mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-21 17:17:06 +02:00
Fixed not working shortcuts on some buttons in main menu
This commit is contained in:
parent
76fd271251
commit
ac1c36b7e2
@ -241,6 +241,11 @@ std::shared_ptr<CButton> CMenuEntry::createButton(CMenuScreen * parent, const Js
|
||||
|
||||
EShortcut shortcut = GH.shortcuts().findShortcut(button["shortcut"].String());
|
||||
|
||||
if (shortcut == EShortcut::NONE && !button["shortcut"].String().empty())
|
||||
{
|
||||
logGlobal->warn("Unknown shortcut '%s' found when loading main menu config!", button["shortcut"].String());
|
||||
}
|
||||
|
||||
auto result = std::make_shared<CButton>(Point(posx, posy), AnimationPath::fromJson(button["name"]), help, command, shortcut);
|
||||
|
||||
if (button["center"].Bool())
|
||||
|
@ -21,9 +21,9 @@
|
||||
"name" : "main",
|
||||
"buttons":
|
||||
[
|
||||
{"x": 644, "y": 70, "center" : true, "name":"MMENUNG", "shortcut" : "mainMenuNew", "help": 3, "command": "to new"},
|
||||
{"x": 645, "y": 192, "center" : true, "name":"MMENULG", "shortcut" : "mainMenuLoad", "help": 4, "command": "to load"},
|
||||
{"x": 643, "y": 296, "center" : true, "name":"MMENUHS", "shortcut" : "mainMenuScores", "help": 5, "command": "highscores"},
|
||||
{"x": 644, "y": 70, "center" : true, "name":"MMENUNG", "shortcut" : "mainMenuNewGame", "help": 3, "command": "to new"},
|
||||
{"x": 645, "y": 192, "center" : true, "name":"MMENULG", "shortcut" : "mainMenuLoadGame", "help": 4, "command": "to load"},
|
||||
{"x": 643, "y": 296, "center" : true, "name":"MMENUHS", "shortcut" : "mainMenuHighScores", "help": 5, "command": "highscores"},
|
||||
{"x": 643, "y": 414, "center" : true, "name":"MMENUCR", "shortcut" : "mainMenuCredits", "help": 6, "command": "to credits"},
|
||||
{"x": 643, "y": 520, "center" : true, "name":"MMENUQT", "shortcut" : "mainMenuQuit", "help": 7, "command": "exit"}
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user