diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index 344a1162d4..66b8d7597b 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -3652,6 +3652,8 @@ STR_6329 :{STRING}{STRINGID} STR_6330 :Downloading [{STRING}] from {STRING} ({COMMA16} / {COMMA16}) STR_6331 :Create Ducks STR_6332 :Remove Ducks +STR_6333 :Increase scale factor +STR_6334 :Decrease scale factor ############# # Scenarios # diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 31d33ef7e8..ae857bb4c7 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,5 +1,6 @@ 0.2.4+ (in development) ------------------------------------------------------------------------ +- Feature: [#10305] Add two shortcuts for increasing and decreasing the scaling factor. - Change: [#1164] Use available translations for shortcut key bindings. - Fix: [#10228] Can't import RCT1 Deluxe from Steam. - Fix: [#10325] Crash when banners have no text. diff --git a/src/openrct2-ui/input/KeyboardShortcut.cpp b/src/openrct2-ui/input/KeyboardShortcut.cpp index 8872f00f07..7b5c3b2436 100644 --- a/src/openrct2-ui/input/KeyboardShortcut.cpp +++ b/src/openrct2-ui/input/KeyboardShortcut.cpp @@ -795,6 +795,25 @@ static void shortcut_open_scenery_picker() } } +static void shortcut_scale_up() +{ + gConfigGeneral.window_scale += 0.25f; + config_save_default(); + gfx_invalidate_screen(); + context_trigger_resize(); + context_update_cursor_scale(); +} + +static void shortcut_scale_down() +{ + gConfigGeneral.window_scale -= 0.25f; + gConfigGeneral.window_scale = std::max(0.5f, gConfigGeneral.window_scale); + config_save_default(); + gfx_invalidate_screen(); + context_trigger_resize(); + context_update_cursor_scale(); +} + namespace { const shortcut_action shortcut_table[SHORTCUT_COUNT] = { @@ -870,6 +889,8 @@ namespace shortcut_open_tile_inspector, shortcut_advance_to_next_tick, shortcut_open_scenery_picker, + shortcut_scale_up, + shortcut_scale_down, }; } // anonymous namespace diff --git a/src/openrct2-ui/input/KeyboardShortcuts.cpp b/src/openrct2-ui/input/KeyboardShortcuts.cpp index 116825c829..8455d240e8 100644 --- a/src/openrct2-ui/input/KeyboardShortcuts.cpp +++ b/src/openrct2-ui/input/KeyboardShortcuts.cpp @@ -369,4 +369,6 @@ const uint16_t KeyboardShortcuts::DefaultKeys[SHORTCUT_COUNT] = { SHORTCUT_UNDEFINED, // SHORTCUT_TILE_INSPECTOR SHORTCUT_UNDEFINED, // SHORTCUT_ADVANCE_TO_NEXT_TICK SHORTCUT_UNDEFINED, // SHORTCUT_SCENERY_PICKER + SHORTCUT_UNDEFINED, // SHORTCUT_SCALE_UP + SHORTCUT_UNDEFINED, // SHORTCUT_SCALE_DOWN }; diff --git a/src/openrct2-ui/input/KeyboardShortcuts.h b/src/openrct2-ui/input/KeyboardShortcuts.h index 48090154c2..935ff2040f 100644 --- a/src/openrct2-ui/input/KeyboardShortcuts.h +++ b/src/openrct2-ui/input/KeyboardShortcuts.h @@ -97,6 +97,8 @@ enum SHORTCUT_TILE_INSPECTOR, SHORTCUT_ADVANCE_TO_NEXT_TICK, SHORTCUT_SCENERY_PICKER, + SHORTCUT_SCALE_UP, + SHORTCUT_SCALE_DOWN, SHORTCUT_COUNT, diff --git a/src/openrct2-ui/windows/ShortcutKeys.cpp b/src/openrct2-ui/windows/ShortcutKeys.cpp index 866ed34ccf..e306282f43 100644 --- a/src/openrct2-ui/windows/ShortcutKeys.cpp +++ b/src/openrct2-ui/windows/ShortcutKeys.cpp @@ -151,6 +151,8 @@ const rct_string_id ShortcutStringIds[SHORTCUT_COUNT] = { STR_SHORTCUT_OPEN_TILE_INSPECTOR, STR_ADVANCE_TO_NEXT_TICK, STR_SHORTCUT_OPEN_SCENERY_PICKER, + STR_SHORTCUT_SCALE_UP, + STR_SHORTCUT_SCALE_DOWN, }; // clang-format on diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index 4626458fc5..2d8895187a 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -3876,7 +3876,8 @@ enum STR_CREATE_DUCKS = 6331, STR_REMOVE_DUCKS = 6332, - + STR_SHORTCUT_SCALE_UP = 6333, + STR_SHORTCUT_SCALE_DOWN = 6334, // Have to include resource strings (from scenarios and objects) for the time being now that language is partially working STR_COUNT = 32768 };