From 8364d8d3d86b0d5bf8ef4708248fcc17e0b7bbb0 Mon Sep 17 00:00:00 2001 From: wolfreak99 Date: Sun, 18 Jun 2017 13:32:12 -0400 Subject: [PATCH] Implement load game shortcut --- src/openrct2-ui/input/KeyboardShortcuts.h | 1 + src/openrct2-ui/input/keyboard_shortcut.c | 8 ++++++++ src/openrct2-ui/windows/shortcut_keys.c | 1 + 3 files changed, 10 insertions(+) diff --git a/src/openrct2-ui/input/KeyboardShortcuts.h b/src/openrct2-ui/input/KeyboardShortcuts.h index 7e0f58e5f4..bfad5ee8e1 100644 --- a/src/openrct2-ui/input/KeyboardShortcuts.h +++ b/src/openrct2-ui/input/KeyboardShortcuts.h @@ -94,6 +94,7 @@ enum SHORTCUT_RIDE_CONSTRUCTION_NEXT_TRACK, SHORTCUT_RIDE_CONSTRUCTION_BUILD_CURRENT, SHORTCUT_RIDE_CONSTRUCTION_DEMOLISH_CURRENT, + SHORTCUT_LOAD_GAME, SHORTCUT_COUNT, diff --git a/src/openrct2-ui/input/keyboard_shortcut.c b/src/openrct2-ui/input/keyboard_shortcut.c index 6f7adae9d6..5e7c6d7338 100644 --- a/src/openrct2-ui/input/keyboard_shortcut.c +++ b/src/openrct2-ui/input/keyboard_shortcut.c @@ -649,6 +649,13 @@ static void shortcut_ride_construction_demolish_current() window_ride_construction_keyboard_shortcut_demolish_current(); } +static void shortcut_load_game() +{ + if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) { + game_do_command(0, 1, 0, 0, GAME_COMMAND_LOAD_OR_QUIT, 0, 0); + } +} + static const shortcut_action shortcut_table[SHORTCUT_COUNT] = { shortcut_close_top_most_window, shortcut_close_all_floating_windows, @@ -714,6 +721,7 @@ static const shortcut_action shortcut_table[SHORTCUT_COUNT] = { shortcut_ride_construction_next_track, shortcut_ride_construction_build_current, shortcut_ride_construction_demolish_current, + shortcut_load_game, }; #pragma endregion diff --git a/src/openrct2-ui/windows/shortcut_keys.c b/src/openrct2-ui/windows/shortcut_keys.c index 08609264e7..e6477e5896 100644 --- a/src/openrct2-ui/windows/shortcut_keys.c +++ b/src/openrct2-ui/windows/shortcut_keys.c @@ -149,6 +149,7 @@ const rct_string_id ShortcutStringIds[] = { STR_SHORTCUT_RIDE_CONSTRUCTION_NEXT_TRACK, STR_SHORTCUT_RIDE_CONSTRUCTION_BUILD_CURRENT, STR_SHORTCUT_RIDE_CONSTRUCTION_DEMOLISH_CURRENT, + STR_LOAD_GAME, }; /**