mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-22 22:34:33 +01:00
Add scenery picker shortcut
This commit is contained in:
committed by
Michael Steenbeek
parent
262a9f29e8
commit
c537f87fd5
@@ -33,6 +33,7 @@
|
||||
#include <openrct2/util/Util.h>
|
||||
#include <openrct2/windows/Intent.h>
|
||||
#include <openrct2/world/Park.h>
|
||||
#include <openrct2/world/Scenery.h>
|
||||
|
||||
uint8_t gKeyboardShortcutChangeId;
|
||||
|
||||
@@ -767,6 +768,33 @@ static void shortcut_advance_to_next_tick()
|
||||
gDoSingleUpdate = true;
|
||||
}
|
||||
|
||||
static void shortcut_open_scenery_picker()
|
||||
{
|
||||
if ((gScreenFlags & (SCREEN_FLAGS_TITLE_DEMO | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))
|
||||
|| (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR && gS6Info.editor_step != EDITOR_STEP_LANDSCAPE_EDITOR))
|
||||
return;
|
||||
|
||||
rct_window* window_scenery = window_find_by_class(WC_SCENERY);
|
||||
if (window_scenery == nullptr)
|
||||
{
|
||||
rct_window* window_toolbar = window_find_by_class(WC_TOP_TOOLBAR);
|
||||
if (window_toolbar != nullptr)
|
||||
{
|
||||
window_invalidate(window_toolbar);
|
||||
window_event_mouse_up_call(window_toolbar, WC_TOP_TOOLBAR__WIDX_SCENERY);
|
||||
}
|
||||
}
|
||||
|
||||
window_scenery = window_find_by_class(WC_SCENERY);
|
||||
if (window_scenery != nullptr && !widget_is_disabled(window_scenery, WC_SCENERY__WIDX_SCENERY_EYEDROPPER_BUTTON)
|
||||
&& window_scenery->widgets[WC_SCENERY__WIDX_SCENERY_EYEDROPPER_BUTTON].type != WWT_EMPTY
|
||||
&& !gWindowSceneryEyedropperEnabled)
|
||||
{
|
||||
window_event_mouse_up_call(window_scenery, WC_SCENERY__WIDX_SCENERY_EYEDROPPER_BUTTON);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
const shortcut_action shortcut_table[SHORTCUT_COUNT] = {
|
||||
@@ -841,6 +869,7 @@ namespace
|
||||
shortcut_highlight_path_issues_toggle,
|
||||
shortcut_open_tile_inspector,
|
||||
shortcut_advance_to_next_tick,
|
||||
shortcut_open_scenery_picker,
|
||||
};
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
Reference in New Issue
Block a user