mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
Make use of extra horizontal space when shortcut window is resized.
This commit is contained in:
@@ -1977,7 +1977,7 @@ STR_2778 :»{MOVE_X}{10}{STRING}
|
||||
STR_2779 :Viewport #{COMMA16}
|
||||
STR_2780 :Extra viewport
|
||||
# End of new strings
|
||||
STR_2781 :{STRINGID}:{MOVE_X}{255}{STRINGID}
|
||||
STR_2781 :{STRINGID}:
|
||||
STR_2782 :SHIFT +
|
||||
STR_2783 :CTRL +
|
||||
STR_2784 :Change keyboard shortcut
|
||||
|
||||
@@ -362,13 +362,20 @@ static void window_shortcut_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i
|
||||
gfx_filter_rect(dpi, 0, y - 1, scrollWidth, y + (SCROLLABLE_ROW_HEIGHT - 2), PALETTE_DARKEN_1);
|
||||
}
|
||||
|
||||
const int32_t bindingOffset = scrollWidth - 150;
|
||||
set_format_arg(0, rct_string_id, STR_SHORTCUT_ENTRY_FORMAT);
|
||||
set_format_arg(2, rct_string_id, ShortcutList[i].StringId);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, 0, y - 1, bindingOffset);
|
||||
|
||||
char keybinding[128];
|
||||
keyboard_shortcuts_format_string(keybinding, 128, ShortcutList[i].ShortcutId);
|
||||
|
||||
set_format_arg(0, rct_string_id, STR_SHORTCUT_ENTRY_FORMAT);
|
||||
set_format_arg(2, rct_string_id, ShortcutList[i].StringId);
|
||||
set_format_arg(4, rct_string_id, STR_STRING);
|
||||
set_format_arg(6, char*, keybinding);
|
||||
gfx_draw_string_left(dpi, format, gCommonFormatArgs, COLOUR_BLACK, 0, y - 1);
|
||||
if (strlen(keybinding) > 0)
|
||||
{
|
||||
const int32_t maxWidth = 150;
|
||||
set_format_arg(0, rct_string_id, STR_STRING);
|
||||
set_format_arg(2, char*, keybinding);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, bindingOffset, y - 1, maxWidth);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user