From 4caf571c2251199f146c3db6262c9f42f3adb2df Mon Sep 17 00:00:00 2001 From: Tulio Leao Date: Fri, 21 Aug 2020 12:07:38 -0300 Subject: [PATCH] Followup on #12475 post-mortem comments (#12745) * Remove using namespace OpenRCT2 from header * Fix using wronf undefined enum for shortcut key map --- src/openrct2-ui/input/KeyboardShortcuts.cpp | 2 +- src/openrct2-ui/windows/ShortcutKeyChange.cpp | 2 +- src/openrct2-ui/windows/Window.h | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/openrct2-ui/input/KeyboardShortcuts.cpp b/src/openrct2-ui/input/KeyboardShortcuts.cpp index 6a58961081..dedc53f589 100644 --- a/src/openrct2-ui/input/KeyboardShortcuts.cpp +++ b/src/openrct2-ui/input/KeyboardShortcuts.cpp @@ -149,7 +149,7 @@ void KeyboardShortcuts::Set(int32_t key) auto shortcut = GetFromKey(key); if (shortcut != Input::Shortcut::Undefined) { - _keys[static_cast(shortcut)] = static_cast(Input::Shortcut::Undefined); + _keys[static_cast(shortcut)] = static_cast(Input::ScanCodeUndefined); } // Map shortcut to this key diff --git a/src/openrct2-ui/windows/ShortcutKeyChange.cpp b/src/openrct2-ui/windows/ShortcutKeyChange.cpp index 5d94323e49..8a80078b13 100644 --- a/src/openrct2-ui/windows/ShortcutKeyChange.cpp +++ b/src/openrct2-ui/windows/ShortcutKeyChange.cpp @@ -70,7 +70,7 @@ static rct_window_event_list window_shortcut_change_events = { static rct_string_id CurrentShortcutKeyStringId{}; -rct_window* window_shortcut_change_open(Input::Shortcut shortcut, rct_string_id key_string_id) +rct_window* window_shortcut_change_open(OpenRCT2::Input::Shortcut shortcut, rct_string_id key_string_id) { // Move this to window_shortcut_change_open window_close_by_class(WC_CHANGE_KEYBOARD_SHORTCUT); diff --git a/src/openrct2-ui/windows/Window.h b/src/openrct2-ui/windows/Window.h index aabcd3521e..473a0e2aca 100644 --- a/src/openrct2-ui/windows/Window.h +++ b/src/openrct2-ui/windows/Window.h @@ -16,7 +16,6 @@ #include #include -using namespace OpenRCT2; using loadsave_callback = void (*)(int32_t result, const utf8* path); using scenarioselect_callback = void (*)(const utf8* path); struct Peep; @@ -64,7 +63,7 @@ rct_window* window_save_prompt_open(); rct_window* window_server_list_open(); rct_window* window_server_start_open(); #endif -rct_window* window_shortcut_change_open(Input::Shortcut shortcut, rct_string_id key_string_id); +rct_window* window_shortcut_change_open(OpenRCT2::Input::Shortcut shortcut, rct_string_id key_string_id); rct_window* window_shortcut_keys_open(); rct_window* window_staff_list_open(); rct_window* window_staff_open(Peep* peep);