1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 23:34:37 +01:00

Allow assigning a keyboard shortcut for opening the tile inspector (#7994)

* Allow assigning a keyboard shortcut for opening the tile inspector.

* Only open when debug tools are enabled.

* Add changelog entry
This commit is contained in:
Aaron van Geffen
2018-09-15 08:57:50 +02:00
committed by Michał Janiszewski
parent 3e97b20025
commit 47eea292b5
7 changed files with 16 additions and 0 deletions

View File

@@ -749,6 +749,14 @@ static void shortcut_highlight_path_issues_toggle()
toggle_view_flag(VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES);
}
static void shortcut_open_tile_inspector()
{
if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO || !gConfigGeneral.debugging_tools)
return;
context_open_window(WC_TILE_INSPECTOR);
}
namespace
{
const shortcut_action shortcut_table[SHORTCUT_COUNT] = {
@@ -821,6 +829,7 @@ namespace
shortcut_gridlines_toggle,
shortcut_view_clipping,
shortcut_highlight_path_issues_toggle,
shortcut_open_tile_inspector,
};
} // anonymous namespace

View File

@@ -316,4 +316,5 @@ const uint16_t KeyboardShortcuts::DefaultKeys[SHORTCUT_COUNT] = {
SDL_SCANCODE_7, // SHORTCUT_GRIDLINES_DISPLAY_TOGGLE
SHORTCUT_UNDEFINED, // SHORTCUT_VIEW_CLIPPING
SDL_SCANCODE_I, // SHORTCUT_HIGHLIGHT_PATH_ISSUES_TOGGLE
SHORTCUT_UNDEFINED, // SHORTCUT_TILE_INSPECTOR
};

View File

@@ -93,6 +93,7 @@ enum
SHORTCUT_GRIDLINES_DISPLAY_TOGGLE,
SHORTCUT_VIEW_CLIPPING,
SHORTCUT_HIGHLIGHT_PATH_ISSUES_TOGGLE,
SHORTCUT_TILE_INSPECTOR,
SHORTCUT_COUNT,

View File

@@ -148,6 +148,7 @@ const rct_string_id ShortcutStringIds[SHORTCUT_COUNT] = {
STR_SHORTCUT_GRIDLINES_DISPLAY_TOGGLE,
STR_SHORTCUT_VIEW_CLIPPING,
STR_SHORTCUT_HIGHLIGHT_PATH_ISSUES_TOGGLE,
STR_SHORTCUT_OPEN_TILE_INSPECTOR,
};
// clang-format on

View File

@@ -3893,6 +3893,8 @@ enum
STR_OPEN_USER_CONTENT_FOLDER = 6266,
STR_SHORTCUT_OPEN_TILE_INSPECTOR = 6267,
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
STR_COUNT = 32768
};