diff --git a/src/openrct2-ui/input/KeyboardShortcuts.cpp b/src/openrct2-ui/input/KeyboardShortcuts.cpp index ceec0fa8ae..a1208bb7fc 100644 --- a/src/openrct2-ui/input/KeyboardShortcuts.cpp +++ b/src/openrct2-ui/input/KeyboardShortcuts.cpp @@ -309,4 +309,5 @@ const uint16 KeyboardShortcuts::DefaultKeys[SHORTCUT_COUNT] = SDL_SCANCODE_KP_0, // SHORTCUT_RIDE_CONSTRUCTION_BUILD_CURRENT SDL_SCANCODE_KP_MINUS, // SHORTCUT_RIDE_CONSTRUCTION_DEMOLISH_CURRENT PLATFORM_MODIFIER | SDL_SCANCODE_L, // SHORTCUT_LOAD_GAME + SDL_SCANCODE_B, // SHORTCUT_CLEAR_SCENERY }; diff --git a/src/openrct2-ui/input/KeyboardShortcuts.h b/src/openrct2-ui/input/KeyboardShortcuts.h index bfad5ee8e1..7e3763b408 100644 --- a/src/openrct2-ui/input/KeyboardShortcuts.h +++ b/src/openrct2-ui/input/KeyboardShortcuts.h @@ -95,6 +95,7 @@ enum SHORTCUT_RIDE_CONSTRUCTION_BUILD_CURRENT, SHORTCUT_RIDE_CONSTRUCTION_DEMOLISH_CURRENT, SHORTCUT_LOAD_GAME, + SHORTCUT_CLEAR_SCENERY, SHORTCUT_COUNT, diff --git a/src/openrct2-ui/input/keyboard_shortcut.c b/src/openrct2-ui/input/keyboard_shortcut.c index a16969fbb1..138a01c4b4 100644 --- a/src/openrct2-ui/input/keyboard_shortcut.c +++ b/src/openrct2-ui/input/keyboard_shortcut.c @@ -495,6 +495,23 @@ static void shortcut_open_cheat_window() window_cheats_open(); } +static void shortcut_clear_scenery() +{ + if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) + return; + + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gS6Info.editor_step == EDITOR_STEP_LANDSCAPE_EDITOR) { + if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) { + rct_window *window = window_find_by_class(WC_TOP_TOOLBAR); + if (window != NULL) { + window_invalidate(window); + window_event_mouse_up_call(window, WC_TOP_TOOLBAR__WIDX_CLEAR_SCENERY); + } + } + } +} + + static void shortcut_open_chat_window() { if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) @@ -722,6 +739,7 @@ static const shortcut_action shortcut_table[SHORTCUT_COUNT] = { shortcut_ride_construction_build_current, shortcut_ride_construction_demolish_current, shortcut_load_game, + shortcut_clear_scenery, }; #pragma endregion diff --git a/src/openrct2-ui/windows/shortcut_keys.c b/src/openrct2-ui/windows/shortcut_keys.c index e6477e5896..baa8ced153 100644 --- a/src/openrct2-ui/windows/shortcut_keys.c +++ b/src/openrct2-ui/windows/shortcut_keys.c @@ -150,6 +150,7 @@ const rct_string_id ShortcutStringIds[] = { STR_SHORTCUT_RIDE_CONSTRUCTION_BUILD_CURRENT, STR_SHORTCUT_RIDE_CONSTRUCTION_DEMOLISH_CURRENT, STR_LOAD_GAME, + STR_CLEAR_SCENERY, }; /** diff --git a/src/openrct2/interface/window.h b/src/openrct2/interface/window.h index ace7c20411..97c1c691be 100644 --- a/src/openrct2/interface/window.h +++ b/src/openrct2/interface/window.h @@ -497,6 +497,7 @@ enum { #define WC_TOP_TOOLBAR__WIDX_WATER 9 #define WC_TOP_TOOLBAR__WIDX_SCENERY 10 #define WC_TOP_TOOLBAR__WIDX_PATH 11 +#define WC_TOP_TOOLBAR__WIDX_CLEAR_SCENERY 17 #define WC_RIDE_CONSTRUCTION__WIDX_CONSTRUCT 23 #define WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE 29 #define WC_RIDE_CONSTRUCTION__WIDX_EXIT 30