mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 13:42:47 +00:00
Use the whole length of the progress bar for text
This commit is contained in:
parent
75ce08681d
commit
b51af7ceb4
@ -523,8 +523,8 @@ bool ShowProgress(u64 current, u64 total, const char* opstr)
|
||||
const u32 text_pos_y = bar_pos_y + bar_height + 2;
|
||||
u32 prog_width = ((total > 0) && (current <= total)) ? (current * (bar_width-4)) / total : 0;
|
||||
u32 prog_percent = ((total > 0) && (current <= total)) ? (current * 100) / total : 0;
|
||||
char tempstr[32];
|
||||
char progstr[32];
|
||||
char tempstr[64];
|
||||
char progstr[64];
|
||||
|
||||
if (!current || last_prog_width > prog_width) {
|
||||
ClearScreenF(true, false, COLOR_STD_BG);
|
||||
@ -533,8 +533,8 @@ bool ShowProgress(u64 current, u64 total, const char* opstr)
|
||||
}
|
||||
DrawRectangle(TOP_SCREEN, bar_pos_x + 2, bar_pos_y + 2, prog_width, bar_height - 4, COLOR_STD_FONT);
|
||||
|
||||
TruncateString(tempstr, opstr, 24, 8);
|
||||
snprintf(progstr, 32, "%s (%lu%%)", tempstr, prog_percent);
|
||||
TruncateString(tempstr, opstr, (bar_width / FONT_WIDTH_EXT) - 7, 8);
|
||||
snprintf(progstr, 64, "%s (%lu%%)", tempstr, prog_percent);
|
||||
DrawString(TOP_SCREEN, progstr, bar_pos_x, text_pos_y, COLOR_STD_FONT, COLOR_STD_BG);
|
||||
DrawString(TOP_SCREEN, "(hold B to cancel)", bar_pos_x + 2, text_pos_y + 14, COLOR_STD_FONT, COLOR_STD_BG);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user