diff --git a/client/gui/ShortcutHandler.cpp b/client/gui/ShortcutHandler.cpp index 257ca5e64..a2137c768 100644 --- a/client/gui/ShortcutHandler.cpp +++ b/client/gui/ShortcutHandler.cpp @@ -140,14 +140,14 @@ EShortcut ShortcutHandler::findShortcut(const std::string & identifier ) const {"lobbyToggleChat", EShortcut::LOBBY_TOGGLE_CHAT }, {"lobbyAdditionalOptions", EShortcut::LOBBY_ADDITIONAL_OPTIONS }, {"lobbySelectScenario", EShortcut::LOBBY_SELECT_SCENARIO }, - {"gameEndTurn", EShortcut::GAME_END_TURN }, - {"gameLoadGame", EShortcut::GAME_LOAD_GAME }, - {"gameSaveGame", EShortcut::GAME_SAVE_GAME }, - {"gameRestartGame", EShortcut::GAME_RESTART_GAME }, - {"gameMainMenu", EShortcut::GAME_TO_MAIN_MENU }, - {"gameQuitGame", EShortcut::GAME_QUIT_GAME }, - {"gameOpenMarketplace", EShortcut::GAME_OPEN_MARKETPLACE }, - {"gameOpenThievesGuild", EShortcut::GAME_OPEN_THIEVES_GUILD }, + {"adventureEndTurn", EShortcut::ADVENTURE_END_TURN }, + {"adventureLoadGame", EShortcut::ADVENTURE_LOAD_GAME }, + {"adventureSaveGame", EShortcut::ADVENTURE_SAVE_GAME }, + {"adventureRestartGame", EShortcut::ADVENTURE_RESTART_GAME }, + {"adventureMainMenu", EShortcut::ADVENTURE_TO_MAIN_MENU }, + {"adventureQuitGame", EShortcut::ADVENTURE_QUIT_GAME }, + {"adventureMarketplace", EShortcut::ADVENTURE_MARKETPLACE }, + {"adventureThievesGuild", EShortcut::ADVENTURE_THIEVES_GUILD }, {"gameActivateConsole", EShortcut::GAME_ACTIVATE_CONSOLE }, {"adventureGameOptions", EShortcut::ADVENTURE_GAME_OPTIONS }, {"adventureToggleGrid", EShortcut::ADVENTURE_TOGGLE_GRID }, @@ -239,9 +239,94 @@ EShortcut ShortcutHandler::findShortcut(const std::string & identifier ) const {"heroCostumeLoad8", EShortcut::HERO_COSTUME_LOAD_8 }, {"heroCostumeLoad9", EShortcut::HERO_COSTUME_LOAD_9 }, {"spellbookTabAdventure", EShortcut::SPELLBOOK_TAB_ADVENTURE }, - {"spellbookTabCombat", EShortcut::SPELLBOOK_TAB_COMBAT } + {"spellbookTabCombat", EShortcut::SPELLBOOK_TAB_COMBAT }, + {"mainMenuHotseat", EShortcut::MAIN_MENU_HOTSEAT }, + {"mainMenuHostGame", EShortcut::MAIN_MENU_HOST_GAME }, + {"mainMenuJoinGame", EShortcut::MAIN_MENU_JOIN_GAME }, + {"highScoresCampaigns", EShortcut::HIGH_SCORES_CAMPAIGNS }, + {"highScoresScenarios", EShortcut::HIGH_SCORES_SCENARIOS }, + {"highScoresReset", EShortcut::HIGH_SCORES_RESET }, + {"lobbyReplayVideo", EShortcut::LOBBY_REPLAY_VIDEO }, + {"lobbyExtraOptions", EShortcut::LOBBY_EXTRA_OPTIONS }, + {"lobbyTurnOptions", EShortcut::LOBBY_TURN_OPTIONS }, + {"lobbyInvitePlayers", EShortcut::LOBBY_INVITE_PLAYERS }, + {"lobbyFlipCoin", EShortcut::LOBBY_FLIP_COIN }, + {"lobbyRandomTown", EShortcut::LOBBY_RANDOM_TOWN }, + {"lobbyRandomTownVs", EShortcut::LOBBY_RANDOM_TOWN_VS }, + {"mapsSizeS", EShortcut::MAPS_SIZE_S }, + {"mapsSizeM", EShortcut::MAPS_SIZE_M }, + {"mapsSizeL", EShortcut::MAPS_SIZE_L }, + {"mapsSizeXl", EShortcut::MAPS_SIZE_XL }, + {"mapsSizeAll", EShortcut::MAPS_SIZE_ALL }, + {"mapsSortPlayers", EShortcut::MAPS_SORT_PLAYERS }, + {"mapsSortSize", EShortcut::MAPS_SORT_SIZE }, + {"mapsSortFormat", EShortcut::MAPS_SORT_FORMAT }, + {"mapsSortName", EShortcut::MAPS_SORT_NAME }, + {"mapsSortVictory", EShortcut::MAPS_SORT_VICTORY }, + {"mapsSortDefeat", EShortcut::MAPS_SORT_DEFEAT }, + {"mapsSortMaps", EShortcut::MAPS_SORT_MAPS }, + {"mapsSortChangedate", EShortcut::MAPS_SORT_CHANGEDATE }, + {"settingsLoadGame", EShortcut::SETTINGS_LOAD_GAME }, + {"settingsSaveGame", EShortcut::SETTINGS_SAVE_GAME }, + {"settingsNewGame", EShortcut::SETTINGS_NEW_GAME }, + {"settingsRestartGame", EShortcut::SETTINGS_RESTART_GAME }, + {"settingsToMainMenu", EShortcut::SETTINGS_TO_MAIN_MENU }, + {"settingsQuitGame", EShortcut::SETTINGS_QUIT_GAME }, + {"adventureReplayTurn", EShortcut::ADVENTURE_REPLAY_TURN }, + {"adventureNewGame", EShortcut::ADVENTURE_NEW_GAME }, + {"battleOpenActiveUnit", EShortcut::BATTLE_OPEN_ACTIVE_UNIT }, + {"battleOpenHoveredUnit", EShortcut::BATTLE_OPEN_HOVERED_UNIT }, + {"marketDeal", EShortcut::MARKET_DEAL }, + {"marketMaxAmount", EShortcut::MARKET_MAX_AMOUNT }, + {"marketSacrificeAll", EShortcut::MARKET_SACRIFICE_ALL }, + {"marketSacrificeBackpack", EShortcut::MARKET_SACRIFICE_BACKPACK }, + {"marketResourcePlayer", EShortcut::MARKET_RESOURCE_PLAYER }, + {"marketArtifactResource", EShortcut::MARKET_ARTIFACT_RESOURCE }, + {"marketResourceArtifact", EShortcut::MARKET_RESOURCE_ARTIFACT }, + {"marketCreatureResource", EShortcut::MARKET_CREATURE_RESOURCE }, + {"marketResourceResource", EShortcut::MARKET_RESOURCE_RESOURCE }, + {"marketCreatureExperience", EShortcut::MARKET_CREATURE_EXPERIENCE }, + {"marketArtifactExperience", EShortcut::MARKET_ARTIFACT_EXPERIENCE }, + {"townOpenHall", EShortcut::TOWN_OPEN_HALL }, + {"townOpenFort", EShortcut::TOWN_OPEN_FORT }, + {"townOpenMarket", EShortcut::TOWN_OPEN_MARKET }, + {"townOpenMageGuild", EShortcut::TOWN_OPEN_MAGE_GUILD }, + {"townOpenThievesGuild", EShortcut::TOWN_OPEN_THIEVES_GUILD }, + {"townOpenRecruitment", EShortcut::TOWN_OPEN_RECRUITMENT }, + {"townOpenHeroExchange", EShortcut::TOWN_OPEN_HERO_EXCHANGE }, + {"townOpenHero", EShortcut::TOWN_OPEN_HERO }, + {"townOpenVisitingHero", EShortcut::TOWN_OPEN_VISITING_HERO }, + {"townOpenGarrisonedHero", EShortcut::TOWN_OPEN_GARRISONED_HERO }, + {"recruitmentSwitchLevel", EShortcut::RECRUITMENT_SWITCH_LEVEL }, + {"heroArmySplit", EShortcut::HERO_ARMY_SPLIT }, + {"heroBackpack", EShortcut::HERO_BACKPACK }, + {"exchangeArmyToLeft", EShortcut::EXCHANGE_ARMY_TO_LEFT }, + {"exchangeArmyToRight", EShortcut::EXCHANGE_ARMY_TO_RIGHT }, + {"exchangeArmySwap", EShortcut::EXCHANGE_ARMY_SWAP }, + {"exchangeArtifactsToLeft", EShortcut::EXCHANGE_ARTIFACTS_TO_LEFT }, + {"exchangeArtifactsToRight", EShortcut::EXCHANGE_ARTIFACTS_TO_RIGHT }, + {"exchangeArtifactsSwap", EShortcut::EXCHANGE_ARTIFACTS_SWAP }, + {"exchangeBackpackLeft", EShortcut::EXCHANGE_BACKPACK_LEFT }, + {"exchangeBackpackRight", EShortcut::EXCHANGE_BACKPACK_RIGHT }, }; +#ifndef ENABLE_GOLDMASTER + std::vector assignedShortcuts; + std::vector missingShortcuts; + for (auto const & entry : shortcutNames) + { + assert(!vstd::contains(assignedShortcuts, entry.second)); + assignedShortcuts.push_back(entry.second); + } + + for (EShortcut id = vstd::next(EShortcut::NONE, 1); id < EShortcut::AFTER_LAST; id = vstd::next(id, 1)) + if (!vstd::contains(assignedShortcuts, id)) + missingShortcuts.push_back(id); + + if (!missingShortcuts.empty()) + logGlobal->error("Found %d shortcuts without assigned string name!", missingShortcuts.size()); +#endif + if (shortcutNames.count(identifier)) return shortcutNames.at(identifier); return EShortcut::NONE;