1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

add help text

This commit is contained in:
Laserlicht
2024-07-29 00:54:58 +02:00
committed by GitHub
parent 2e2d8f8833
commit 6adc49b814
5 changed files with 33 additions and 2 deletions

View File

@@ -849,6 +849,14 @@ OptionsTab::HandicapWindow::HandicapWindow()
tmp = tmp.substr(0, isIncome || isGrowth ? 3 : 5);
textinputs[player][resource]->setText(tmp.length() == 0 ? "0" : (negative ? "-" : "") + std::to_string(stoi(tmp)));
});
textinputs[player][resource]->setPopupCallback([isIncome, isGrowth](){
if(isIncome)
CRClickPopup::createAndPush(CGI->generaltexth->translate("vcmi.lobby.handicap.income"));
else if(isGrowth)
CRClickPopup::createAndPush(CGI->generaltexth->translate("vcmi.lobby.handicap.growth"));
else
CRClickPopup::createAndPush(CGI->generaltexth->translate("vcmi.lobby.handicap.resource"));
});
if(isIncome || isGrowth)
labels.push_back(std::make_shared<CLabel>(area.topRight().x, area.center().y, FONT_SMALL, ETextAlignment::CENTERRIGHT, Colors::WHITE, "%"));
}