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