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

added custom icons for buttons made by Ivan

This commit is contained in:
Laserlicht 2024-10-07 13:26:43 +02:00
parent a826b88641
commit b885fd9d3b
4 changed files with 5 additions and 3 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 931 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -2063,20 +2063,22 @@ void CMageGuildScreen::Scroll::clickPressed(const Point & cursorPosition)
auto showSpellResearchDialog = [this, resComps, town, cost, newSpell](){
std::vector<std::pair<AnimationPath, CFunctionList<void()>>> pom;
pom.emplace_back(AnimationPath::builtin("ibuy30.DEF"), nullptr);
pom.emplace_back(AnimationPath::builtin("hsbtns4.DEF"), nullptr);
pom.emplace_back(AnimationPath::builtin("ICANCEL.DEF"), nullptr);
for(int i = 0; i < 3; i++)
pom.emplace_back(AnimationPath::builtin("settingsWindow/button80"), nullptr);
auto text = CGI->generaltexth->translate(LOCPLINT->cb->getResourceAmount().canAfford(cost) ? "vcmi.spellResearch.pay" : "vcmi.spellResearch.canNotAfford");
boost::replace_first(text, "%SPELL1", spell->id.toSpell()->getNameTranslated());
boost::replace_first(text, "%SPELL2", newSpell.toSpell()->getNameTranslated());
auto temp = std::make_shared<CInfoWindow>(text, LOCPLINT->playerID, resComps, pom);
temp->buttons[0]->setOverlay(std::make_shared<CPicture>(ImagePath::builtin("spellResearch/accept")));
temp->buttons[0]->addCallback([this, town](){ LOCPLINT->cb->spellResearch(town, spell->id, true); });
temp->buttons[0]->addPopupCallback([](){ CRClickPopup::createAndPush(CGI->generaltexth->translate("vcmi.spellResearch.research")); });
temp->buttons[0]->setEnabled(LOCPLINT->cb->getResourceAmount().canAfford(cost));
temp->buttons[1]->setOverlay(std::make_shared<CPicture>(ImagePath::builtin("spellResearch/reroll")));
temp->buttons[1]->addCallback([this, town](){ LOCPLINT->cb->spellResearch(town, spell->id, false); });
temp->buttons[1]->addPopupCallback([](){ CRClickPopup::createAndPush(CGI->generaltexth->translate("vcmi.spellResearch.skip")); });
temp->buttons[2]->setOverlay(std::make_shared<CPicture>(ImagePath::builtin("spellResearch/close")));
temp->buttons[2]->addPopupCallback([](){ CRClickPopup::createAndPush(CGI->generaltexth->translate("vcmi.spellResearch.abort")); });
GH.windows().pushWindow(temp);