浏览代码

Merge pull request #4037 from IvanSavenko/end_turn_shortcut_fix

Fix end turn button not assigned to shortcut
Ivan Savenko 1 年之前
父节点
当前提交
ecd117c542
共有 3 个文件被更改,包括 3 次插入5 次删除
  1. 1 3
      client/gui/ShortcutHandler.cpp
  2. 1 1
      config/shortcutsConfig.json
  3. 1 1
      config/widgets/adventureMap.json

+ 1 - 3
client/gui/ShortcutHandler.cpp

@@ -159,6 +159,7 @@ 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::ADVENTURE_END_TURN        }, // compatibility ID - extra's use this string
 		{"adventureEndTurn",         EShortcut::ADVENTURE_END_TURN        },
 		{"adventureLoadGame",        EShortcut::ADVENTURE_LOAD_GAME       },
 		{"adventureSaveGame",        EShortcut::ADVENTURE_SAVE_GAME       },
@@ -339,10 +340,7 @@ EShortcut ShortcutHandler::findShortcut(const std::string & identifier ) const
 	std::vector<EShortcut> assignedShortcuts;
 	std::vector<EShortcut> 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))

+ 1 - 1
config/shortcutsConfig.json

@@ -16,7 +16,7 @@
 		"adventureGameOptions":     "O",
 		"adventureKingdomOverview": "K",
 		"adventureLoadGame":        "L",
-		"adventureMainMenu":        "M",
+		"adventureMainMenu":        "Ctrl+M",
 		"adventureMarketplace":     "B",
 		"adventureMoveHero":        "M",
 		"adventureMoveHeroEE":      [ "Keypad 6", "Right" ],

+ 1 - 1
config/widgets/adventureMap.json

@@ -234,7 +234,7 @@
 					"type": "adventureMapButton",
 					"name": "buttonEndTurn",
 					"image" : "IAM001.DEF",
-					"hotkey": "gameEndTurn",
+					"hotkey": "adventureEndTurn",
 					"help" : "core.help.302",
 					"playerColored" : true,
 					"area": { "top" : 160, "left": 0, "width" : 64, "height" : 32 }