1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-29 09:44:52 +01:00

Add keyboard shortcut to Keyboard Shortcuts window

This commit is contained in:
Rik Smeets
2023-04-17 11:15:32 +02:00
committed by GitHub
parent e832159f35
commit 55adb71cd8
5 changed files with 12 additions and 1 deletions

View File

@@ -52,6 +52,7 @@ namespace OpenRCT2::Ui::ShortcutId
constexpr std::string_view InterfaceOpenMessages = "interface.open.messages";
constexpr std::string_view InterfaceOpenMap = "interface.open.map";
constexpr std::string_view InterfaceShowOptions = "interface.open.options";
constexpr std::string_view InterfaceOpenKeyboardShortcuts = "interface.open.keyboard_shortcuts";
constexpr std::string_view InterfaceOpenTransparencyOptions = "interface.open.transparency_options";
constexpr std::string_view InterfaceOpenCheats = "interface.open.cheats";
constexpr std::string_view InterfaceOpenTileInspector = "interface.open.tileinspector";

View File

@@ -392,6 +392,11 @@ static void ShortcutOpenCheatWindow()
ContextOpenWindow(WindowClass::Cheats);
}
static void ShortcutOpenKeyboardShortcutsWindow()
{
WindowShortcutKeysOpen();
}
static void ShortcutOpenTransparencyWindow()
{
if (gScreenFlags != SCREEN_FLAGS_PLAYING)
@@ -816,6 +821,7 @@ void ShortcutManager::RegisterDefaultShortcuts()
RegisterShortcut(ShortcutId::InterfaceOpenMessages, STR_SHORTCUT_SHOW_RECENT_MESSAGES, "M", ShortcutShowRecentMessages);
RegisterShortcut(ShortcutId::InterfaceOpenMap, STR_SHORTCUT_SHOW_MAP, "TAB", ShortcutShowMap);
RegisterShortcut(ShortcutId::InterfaceShowOptions, STR_SHORTCUT_SHOW_OPTIONS, std::bind(ContextOpenWindow, WindowClass::Options));
RegisterShortcut(ShortcutId::InterfaceOpenKeyboardShortcuts, STR_SHORTCUT_OPEN_KEYBOARD_SHORTCUTS_WINDOW, "SHIFT+/", ShortcutOpenKeyboardShortcutsWindow);
RegisterShortcut(ShortcutId::InterfaceOpenTransparencyOptions, STR_SHORTCUT_OPEN_TRANSPARENCY_OPTIONS, "CTRL+T", ShortcutOpenTransparencyWindow);
RegisterShortcut(ShortcutId::InterfaceOpenCheats, STR_SHORTCUT_OPEN_CHEATS_WINDOW, "CTRL+ALT+C", ShortcutOpenCheatWindow);
RegisterShortcut(ShortcutId::InterfaceOpenTileInspector, STR_SHORTCUT_OPEN_TILE_INSPECTOR, []() {

View File

@@ -3982,7 +3982,9 @@ enum : uint16_t
STR_TRACK_DESIGN_BLOCK_BRAKE_SPEED_RESET = 6579,
STR_RESET = 6580,
STR_RESET_SHORTCUT_KEYS_PROMPT = 6581
STR_RESET_SHORTCUT_KEYS_PROMPT = 6581,
STR_SHORTCUT_OPEN_KEYBOARD_SHORTCUTS_WINDOW = 6582,
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
/* MAX_STR_COUNT = 32768 */ // MAX_STR_COUNT - upper limit for number of strings, not the current count strings