1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-13 01:20:34 +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)
help = LIBRARY->generaltexth->zelp[(size_t)button["help"].Float()];
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)