1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +02:00

Merge pull request #2743 from Laserlicht/fix_difficulty_widget

[fix] difficulty widget
This commit is contained in:
Nordsoft91 2023-09-03 17:57:43 +04:00 committed by GitHub
commit 2eaed0c983
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -218,6 +218,10 @@ void InfoCard::changeSelection()
flagbox->recreate();
labelDifficulty->setText(CGI->generaltexth->arraytxt[142 + mapInfo->mapHeader->difficulty]);
iconDifficulty->setSelected(SEL->getCurrentDifficulty());
if(SEL->screenType == ESelectionScreen::loadGame || SEL->screenType == ESelectionScreen::saveGame)
for(auto & button : iconDifficulty->buttons)
button.second->setEnabled(button.first == SEL->getCurrentDifficulty());
const std::array<std::string, 5> difficultyPercent = {"80%", "100%", "130%", "160%", "200%"};
labelDifficultyPercent->setText(difficultyPercent[SEL->getCurrentDifficulty()]);