Fix strings not wrapping the file browser window.
This commit is contained in:
parent
c0358a44ce
commit
b66921e19e
|
@ -4,6 +4,7 @@
|
|||
- Fix: [#297] Menu click sound not played.
|
||||
- Fix: [#303] Play title music preference is not saved.
|
||||
- Fix: [#340] Cargo rating is calculated incorrectly in some edge cases.
|
||||
- Fix: Strings were not wrapping properly in the file browser window.
|
||||
|
||||
19.03 (2019-03-01)
|
||||
------------------------------------------------------------------------
|
||||
|
|
|
@ -525,15 +525,17 @@ namespace openloco::gfx
|
|||
|
||||
// 0x00495224
|
||||
// al: colour
|
||||
// bp: width
|
||||
// bx: string id
|
||||
// cx: x
|
||||
// dx: y
|
||||
// esi: args
|
||||
// edi: dpi
|
||||
void draw_string_495224(
|
||||
int16_t draw_string_495224(
|
||||
drawpixelinfo_t& dpi,
|
||||
int16_t x,
|
||||
int16_t y,
|
||||
int16_t width,
|
||||
uint8_t colour,
|
||||
string_id stringId,
|
||||
const void* args)
|
||||
|
@ -541,11 +543,14 @@ namespace openloco::gfx
|
|||
registers regs;
|
||||
regs.al = colour;
|
||||
regs.bx = stringId;
|
||||
regs.bp = width;
|
||||
regs.cx = x;
|
||||
regs.dx = y;
|
||||
regs.esi = (int32_t)args;
|
||||
regs.edi = (int32_t)&dpi;
|
||||
call(0x00495224, regs);
|
||||
|
||||
return regs.dx;
|
||||
}
|
||||
|
||||
// 0x00494B3F
|
||||
|
|
|
@ -138,10 +138,11 @@ namespace openloco::gfx
|
|||
|
||||
gfx::point_t draw_string(drawpixelinfo_t* context, int16_t x, int16_t y, uint8_t colour, void* str);
|
||||
|
||||
void draw_string_495224(
|
||||
int16_t draw_string_495224(
|
||||
drawpixelinfo_t& dpi,
|
||||
int16_t x,
|
||||
int16_t y,
|
||||
int16_t width,
|
||||
uint8_t colour,
|
||||
string_id stringId,
|
||||
const void* args = nullptr);
|
||||
|
|
|
@ -390,19 +390,18 @@ namespace openloco::ui::prompt_browse
|
|||
}
|
||||
y += 207;
|
||||
|
||||
uint16_t maxWidth = window.width - window.widgets[7].right;
|
||||
|
||||
// Company
|
||||
set_common_args_stringptr(saveInfo.company);
|
||||
gfx::draw_string_495224(dpi, x, y, 0, string_ids::window_browse_company, _commonFormatArgs);
|
||||
y += 10;
|
||||
y = gfx::draw_string_495224(dpi, x, y, maxWidth, colour::black, string_ids::window_browse_company, _commonFormatArgs);
|
||||
|
||||
// Owner
|
||||
set_common_args_stringptr(saveInfo.owner);
|
||||
gfx::draw_string_495224(dpi, x, y, 0, string_ids::owner_label, _commonFormatArgs);
|
||||
y += 10;
|
||||
y = gfx::draw_string_495224(dpi, x, y, maxWidth, colour::black, string_ids::owner_label, _commonFormatArgs);
|
||||
|
||||
// Date
|
||||
gfx::draw_string_495224(dpi, x, y, 0, string_ids::window_browse_date, &saveInfo.date);
|
||||
y += 10;
|
||||
y = gfx::draw_string_495224(dpi, x, y, maxWidth, colour::black, string_ids::window_browse_date, &saveInfo.date);
|
||||
|
||||
// Challenge progress
|
||||
auto flags = saveInfo.challenge_flags;
|
||||
|
@ -419,7 +418,7 @@ namespace openloco::ui::prompt_browse
|
|||
progress = saveInfo.challenge_progress;
|
||||
}
|
||||
}
|
||||
gfx::draw_string_495224(dpi, x, y, 0, stringId, &progress);
|
||||
gfx::draw_string_495224(dpi, x, y, maxWidth, colour::black, stringId, &progress);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue