From 6e31b1bcabe5988e302e429c09caae11b3a98f44 Mon Sep 17 00:00:00 2001 From: Oleg Derevenetz Date: Thu, 16 Jan 2025 19:05:32 +0300 Subject: [PATCH] Style nits --- src/fheroes2/game/game_hotkeys.cpp | 7 ++++--- src/fheroes2/game/game_hotkeys.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/fheroes2/game/game_hotkeys.cpp b/src/fheroes2/game/game_hotkeys.cpp index 9018fe33b8..b9505480a5 100644 --- a/src/fheroes2/game/game_hotkeys.cpp +++ b/src/fheroes2/game/game_hotkeys.cpp @@ -106,6 +106,7 @@ namespace = { Game::HotKeyCategory::GLOBAL, gettext_noop( "hotkey|toggle fullscreen" ), fheroes2::Key::KEY_F4 }; hotKeyEventInfo[hotKeyEventToInt( Game::HotKeyEvent::GLOBAL_TOGGLE_TEXT_SUPPORT_MODE )] = { Game::HotKeyCategory::GLOBAL, gettext_noop( "hotkey|toggle text support mode" ), fheroes2::Key::KEY_F10 }; + #if defined( WITH_DEBUG ) hotKeyEventInfo[hotKeyEventToInt( Game::HotKeyEvent::DEBUG_TOGGLE_DEVELOPER_MODE )] = { Game::HotKeyCategory::GLOBAL, gettext_noop( "hotkey|toggle developer mode" ), fheroes2::Key::KEY_BACKQUOTE }; @@ -486,6 +487,9 @@ void Game::globalKeyDownEvent( const fheroes2::Key key, const int32_t modifier ) conf.Save( Settings::configFileName ); } #if defined( WITH_DEBUG ) + else if ( key == hotKeyEventInfo[hotKeyEventToInt( HotKeyEvent::DEBUG_TOGGLE_DEVELOPER_MODE )].key ) { + Logging::setDebugLevel( DBG_DEVEL ^ Logging::getDebugLevel() ); + } else if ( key == hotKeyEventInfo[hotKeyEventToInt( HotKeyEvent::WORLD_TRANSFER_CONTROL_TO_AI )].key ) { static bool recursiveCall = false; @@ -537,9 +541,6 @@ void Game::globalKeyDownEvent( const fheroes2::Key key, const int32_t modifier ) } } } - else if ( key == hotKeyEventInfo[hotKeyEventToInt( HotKeyEvent::DEBUG_TOGGLE_DEVELOPER_MODE )].key ) { - Logging::setDebugLevel( DBG_DEVEL ^ Logging::getDebugLevel() ); - } #endif } diff --git a/src/fheroes2/game/game_hotkeys.h b/src/fheroes2/game/game_hotkeys.h index 87ae23152c..a5b794d4cc 100644 --- a/src/fheroes2/game/game_hotkeys.h +++ b/src/fheroes2/game/game_hotkeys.h @@ -45,6 +45,7 @@ namespace Game GLOBAL_TOGGLE_FULLSCREEN, GLOBAL_TOGGLE_TEXT_SUPPORT_MODE, + #if defined( WITH_DEBUG ) // This hotkey is only for debug mode. DEBUG_TOGGLE_DEVELOPER_MODE,