1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +02:00

add missing help

This commit is contained in:
Laserlicht
2025-07-05 12:34:01 +02:00
parent c15f628761
commit 152119c951
2 changed files with 12 additions and 7 deletions

View File

@ -221,8 +221,13 @@ std::shared_ptr<CButton> CMenuEntry::createButton(CMenuScreen * parent, const Js
std::function<void()> command = genCommand(parent, parent->menuNameToEntry, button["command"].String());
std::pair<std::string, std::string> help;
if(!button["help"].isNull() && button["help"].Float() > 0)
if(!button["help"].isNull())
{
if(button["help"].isNumber() && button["help"].Float() > 0)
help = LIBRARY->generaltexth->zelp[(size_t)button["help"].Float()];
if(button["help"].isString() && !button["help"].String().empty())
help = {"", LIBRARY->generaltexth->translate(button["help"].String())};
}
int posx = static_cast<int>(button["x"].Float());
if(posx < 0)

View File

@ -95,11 +95,11 @@
"name" : "campaign",
"buttons":
[
{"x": 634, "y": 67, "center" : true, "name":"CSSSOD", "shortcut" : "mainMenuCampaignSod", "command": "campaigns sod"},
{"x": 637, "y": 181, "center" : true, "name":"CSSROE", "shortcut" : "mainMenuCampaignRoe", "command": "campaigns roe"},
{"x": 638, "y": 301, "center" : true, "name":"CSSARM", "shortcut" : "mainMenuCampaignAb", "command": "campaigns ab"},
{"x": 638, "y": 413, "center" : true, "name":"CSSCUS", "shortcut" : "mainMenuCampaign", "command": "start campaign"},
{"x": 639, "y": 518, "center" : true, "name":"CSSEXIT", "shortcut" : "mainMenuBack", "command": "to new"}
{"x": 634, "y": 67, "center" : true, "name":"CSSSOD", "shortcut" : "mainMenuCampaignSod", "help": "core.genrltxt.734", "command": "campaigns sod"},
{"x": 637, "y": 181, "center" : true, "name":"CSSROE", "shortcut" : "mainMenuCampaignRoe", "help": "core.genrltxt.725", "command": "campaigns roe"},
{"x": 638, "y": 301, "center" : true, "name":"CSSARM", "shortcut" : "mainMenuCampaignAb", "help": "core.genrltxt.724", "command": "campaigns ab"},
{"x": 638, "y": 413, "center" : true, "name":"CSSCUS", "shortcut" : "mainMenuCampaign", "help": "core.genrltxt.726", "command": "start campaign"},
{"x": 639, "y": 518, "center" : true, "name":"CSSEXIT", "shortcut" : "mainMenuBack", "help": "core.genrltxt.727", "command": "to new"}
],
}
]