diff --git a/AI/VCAI/VCAI.cpp b/AI/VCAI/VCAI.cpp index 7a2661474..3a2778263 100644 --- a/AI/VCAI/VCAI.cpp +++ b/AI/VCAI/VCAI.cpp @@ -606,7 +606,7 @@ void VCAI::heroGotLevel(const CGHeroInstance *hero, PrimarySkill::PrimarySkill p LOG_TRACE_PARAMS(logAi, "queryID '%i'", queryID); NET_EVENT_HANDLER; status.addQuery(queryID, boost::str(boost::format("Hero %s got level %d") % hero->name % hero->level)); - requestActionASAP([=]{ answerQuery(queryID, 0); }); + requestActionASAP([=](){ answerQuery(queryID, 0); }); } void VCAI::commanderGotLevel (const CCommanderInstance * commander, std::vector skills, QueryID queryID) @@ -614,7 +614,7 @@ void VCAI::commanderGotLevel (const CCommanderInstance * commander, std::vector< LOG_TRACE_PARAMS(logAi, "queryID '%i'", queryID); NET_EVENT_HANDLER; status.addQuery(queryID, boost::str(boost::format("Commander %s of %s got level %d") % commander->name % commander->armyObj->nodeName() % (int)commander->level)); - requestActionASAP([=]{ answerQuery(queryID, 0); }); + requestActionASAP([=](){ answerQuery(queryID, 0); }); } void VCAI::showBlockingDialog(const std::string &text, const std::vector &components, QueryID askID, const int soundID, bool selection, bool cancel) @@ -703,7 +703,7 @@ void VCAI::showGarrisonDialog(const CArmedInstance *up, const CGHeroInstance *do void VCAI::showMapObjectSelectDialog(QueryID askID, const Component & icon, const MetaString & title, const MetaString & description, const std::vector & objects) { status.addQuery(askID, "Map object select query"); - requestActionASAP([=]{ answerQuery(askID, 0); }); + requestActionASAP([=](){ answerQuery(askID, 0); }); //TODO: Town portal destination selection goes here } diff --git a/client/CMusicHandler.cpp b/client/CMusicHandler.cpp index 351caf5fa..1b1b3ce01 100644 --- a/client/CMusicHandler.cpp +++ b/client/CMusicHandler.cpp @@ -189,7 +189,7 @@ int CSoundHandler::playSound(std::string sound, int repeats, bool cache) else if (cache) callbacks[channel]; else - callbacks[channel] = [chunk]{ Mix_FreeChunk(chunk);}; + callbacks[channel] = [chunk](){ Mix_FreeChunk(chunk);}; } else channel = -1; diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index 468740962..393ffd640 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -1165,7 +1165,7 @@ void CPlayerInterface::showBlockingDialog( const std::string &text, const std::v for (auto & component : components) intComps.push_back(new CComponent(component)); //will be deleted by close in window - showYesNoDialog(text, [=]{ cb->selectionMade(1, askID); }, [=]{ cb->selectionMade(0, askID); }, true, intComps); + showYesNoDialog(text, [=](){ cb->selectionMade(1, askID); }, [=](){ cb->selectionMade(0, askID); }, true, intComps); } else if (selection) { @@ -1434,7 +1434,7 @@ bool CPlayerInterface::altPressed() const void CPlayerInterface::showGarrisonDialog( const CArmedInstance *up, const CGHeroInstance *down, bool removableUnits, QueryID queryID) { EVENT_HANDLER_CALLED_BY_CLIENT; - auto onEnd = [=]{ cb->selectionMade(0, queryID); }; + auto onEnd = [=](){ cb->selectionMade(0, queryID); }; if (stillMoveHero.get() == DURING_MOVE && adventureInt->terrain.currentPath && adventureInt->terrain.currentPath->nodes.size() > 1) //to ignore calls on passing through garrisons { @@ -1608,7 +1608,7 @@ void CPlayerInterface::showShipyardDialog(const IShipyard *obj) auto state = obj->shipyardStatus(); std::vector cost; obj->getBoatCost(cost); - CShipyardWindow *csw = new CShipyardWindow(cost, state, obj->getBoatType(), [=]{ cb->buildBoat(obj); }); + CShipyardWindow *csw = new CShipyardWindow(cost, state, obj->getBoatType(), [=](){ cb->buildBoat(obj); }); GH.pushInt(csw); } @@ -2705,7 +2705,7 @@ void CPlayerInterface::waitForAllDialogs(bool unlockPim) void CPlayerInterface::proposeLoadingGame() { - showYesNoDialog(CGI->generaltexth->allTexts[68], [this] { sendCustomEvent(RETURN_TO_MENU_LOAD); }, 0, false); + showYesNoDialog(CGI->generaltexth->allTexts[68], [this](){ sendCustomEvent(RETURN_TO_MENU_LOAD); }, 0, false); } CPlayerInterface::SpellbookLastSetting::SpellbookLastSetting() diff --git a/client/CPreGame.cpp b/client/CPreGame.cpp index 7ae38c20a..3c48a5640 100644 --- a/client/CPreGame.cpp +++ b/client/CPreGame.cpp @@ -3157,7 +3157,7 @@ CMultiMode::CMultiMode() btns[0] = new CButton(Point(373, 78), "MUBHOT.DEF", CGI->generaltexth->zelp[266], std::bind(&CMultiMode::openHotseat, this)); btns[1] = new CButton(Point(373, 78 + 57*1), "MUBHOST.DEF", CButton::tooltip("Host TCP/IP game", ""), std::bind(&CMultiMode::hostTCP, this)); btns[2] = new CButton(Point(373, 78 + 57*2), "MUBJOIN.DEF", CButton::tooltip("Join TCP/IP game", ""), std::bind(&CMultiMode::joinTCP, this)); - btns[6] = new CButton(Point(373, 424), "MUBCANC.DEF", CGI->generaltexth->zelp[288], [&] { GH.popIntTotally(this);}, SDLK_ESCAPE); + btns[6] = new CButton(Point(373, 424), "MUBCANC.DEF", CGI->generaltexth->zelp[288], [&](){ GH.popIntTotally(this);}, SDLK_ESCAPE); } void CMultiMode::openHotseat() diff --git a/client/battle/CBattleInterface.cpp b/client/battle/CBattleInterface.cpp index 661bda294..1589932c8 100644 --- a/client/battle/CBattleInterface.cpp +++ b/client/battle/CBattleInterface.cpp @@ -242,8 +242,8 @@ CBattleInterface::CBattleInterface(const CCreatureSet *army1, const CCreatureSet console->pos.h = 38; if (tacticsMode) { - btactNext = new CButton(Point(213, 560), "icm011.def", std::make_pair("", ""), [&]{ bTacticNextStack(nullptr);}, SDLK_SPACE); - btactEnd = new CButton(Point(419, 560), "icm012.def", std::make_pair("", ""), [&]{ bEndTacticPhase();}, SDLK_RETURN); + btactNext = new CButton(Point(213, 560), "icm011.def", std::make_pair("", ""), [&](){ bTacticNextStack(nullptr);}, SDLK_SPACE); + btactEnd = new CButton(Point(419, 560), "icm012.def", std::make_pair("", ""), [&](){ bEndTacticPhase();}, SDLK_RETURN); menu = BitmapHandler::loadBitmap("COPLACBR.BMP"); } else @@ -790,7 +790,7 @@ void CBattleInterface::bSurrenderf() enemyHeroName = "#ENEMY#"; //TODO: should surrendering without enemy hero be enabled? std::string surrenderMessage = boost::str(boost::format(CGI->generaltexth->allTexts[32]) % enemyHeroName % cost); //%s states: "I will accept your surrender and grant you and your troops safe passage for the price of %d gold." - curInt->showYesNoDialog(surrenderMessage, [this]{ reallySurrender(); }, 0, false); + curInt->showYesNoDialog(surrenderMessage, [this](){ reallySurrender(); }, 0, false); } } @@ -2218,7 +2218,7 @@ void CBattleInterface::handleHex(BattleHex myNumber, int eventType) { case CHOOSE_TACTICS_STACK: consoleMsg = (boost::format(CGI->generaltexth->allTexts[481]) % shere->getName()).str(); //Select %s - realizeAction = [=]{ stackActivated(shere); }; + realizeAction = [=](){ stackActivated(shere); }; break; case MOVE_TACTICS: case MOVE_STACK: @@ -2276,7 +2276,7 @@ void CBattleInterface::handleHex(BattleHex myNumber, int eventType) else cursorFrame = ECursor::COMBAT_SHOOT; - realizeAction = [=] {giveCommand(Battle::SHOOT, myNumber, activeStack->ID);}; + realizeAction = [=](){giveCommand(Battle::SHOOT, myNumber, activeStack->ID);}; std::string estDmgText = formatDmgRange(curInt->cb->battleEstimateDamage(CRandomGenerator::getDefault(), sactive, shere)); //calculating estimated dmg //printing - Shoot %s (%d shots left, %s damage) consoleMsg = (boost::format(CGI->generaltexth->allTexts[296]) % shere->getName() % sactive->shots.available() % estDmgText).str(); @@ -2329,7 +2329,7 @@ void CBattleInterface::handleHex(BattleHex myNumber, int eventType) case HEAL: cursorFrame = ECursor::COMBAT_HEAL; consoleMsg = (boost::format(CGI->generaltexth->allTexts[419]) % shere->getName()).str(); //Apply first aid to the %s - realizeAction = [=]{ giveCommand(Battle::STACK_HEAL, myNumber, activeStack->ID); }; //command healing + realizeAction = [=](){ giveCommand(Battle::STACK_HEAL, myNumber, activeStack->ID); }; //command healing break; case RISE_DEMONS: cursorType = ECursor::SPELLBOOK; @@ -2340,13 +2340,13 @@ void CBattleInterface::handleHex(BattleHex myNumber, int eventType) break; case CATAPULT: cursorFrame = ECursor::COMBAT_SHOOT_CATAPULT; - realizeAction = [=]{ giveCommand(Battle::CATAPULT, myNumber, activeStack->ID); }; + realizeAction = [=](){ giveCommand(Battle::CATAPULT, myNumber, activeStack->ID); }; break; case CREATURE_INFO: { cursorFrame = ECursor::COMBAT_QUERY; consoleMsg = (boost::format(CGI->generaltexth->allTexts[297]) % shere->getName()).str(); - realizeAction = [=]{ GH.pushInt(new CStackWindow(shere, false)); }; + realizeAction = [=](){ GH.pushInt(new CStackWindow(shere, false)); }; break; } } diff --git a/client/battle/CBattleInterfaceClasses.cpp b/client/battle/CBattleInterfaceClasses.cpp index a5f86ade1..88291a0eb 100644 --- a/client/battle/CBattleInterfaceClasses.cpp +++ b/client/battle/CBattleInterfaceClasses.cpp @@ -300,9 +300,9 @@ CBattleOptionsWindow::CBattleOptionsWindow(const SDL_Rect & position, CBattleInt animSpeeds->addToggle(100, new CToggleButton(Point(156, 225), "sysob11.def", CGI->generaltexth->zelp[424])); animSpeeds->setSelected(owner->getAnimSpeed()); - setToDefault = new CButton (Point(246, 359), "codefaul.def", CGI->generaltexth->zelp[393], [&]{ bDefaultf(); }); + setToDefault = new CButton (Point(246, 359), "codefaul.def", CGI->generaltexth->zelp[393], [&](){ bDefaultf(); }); setToDefault->setImageOrder(1, 0, 2, 3); - exit = new CButton (Point(357, 359), "soretrn.def", CGI->generaltexth->zelp[392], [&]{ bExitf();}, SDLK_RETURN); + exit = new CButton (Point(357, 359), "soretrn.def", CGI->generaltexth->zelp[392], [&](){ bExitf();}, SDLK_RETURN); exit->setImageOrder(1, 0, 2, 3); //creating labels @@ -349,7 +349,7 @@ CBattleResultWindow::CBattleResultWindow(const BattleResult &br, const SDL_Rect CPicture * bg = new CPicture("CPRESULT"); bg->colorize(owner.playerID); - exit = new CButton (Point(384, 505), "iok6432.def", std::make_pair("", ""), [&]{ bExitf();}, SDLK_RETURN); + exit = new CButton (Point(384, 505), "iok6432.def", std::make_pair("", ""), [&](){ bExitf();}, SDLK_RETURN); exit->borderColor = Colors::METALLIC_GOLD; if(br.winner==0) //attacker won diff --git a/client/widgets/CArtifactHolder.cpp b/client/widgets/CArtifactHolder.cpp index 93ae0ae9f..e114ebc4e 100644 --- a/client/widgets/CArtifactHolder.cpp +++ b/client/widgets/CArtifactHolder.cpp @@ -658,8 +658,8 @@ CArtifactsOfHero::CArtifactsOfHero(const Point& position, bool createCommonPart) backpack.push_back(add); } - leftArtRoll = new CButton(Point(379, 364), "hsbtns3.def", CButton::tooltip(), [&]{ scrollBackpack(-1);}, SDLK_LEFT); - rightArtRoll = new CButton(Point(632, 364), "hsbtns5.def", CButton::tooltip(), [&]{ scrollBackpack(+1);}, SDLK_RIGHT); + leftArtRoll = new CButton(Point(379, 364), "hsbtns3.def", CButton::tooltip(), [&](){ scrollBackpack(-1);}, SDLK_LEFT); + rightArtRoll = new CButton(Point(632, 364), "hsbtns5.def", CButton::tooltip(), [&](){ scrollBackpack(+1);}, SDLK_RIGHT); } CArtifactsOfHero::~CArtifactsOfHero() @@ -972,7 +972,7 @@ CCommanderArtPlace::CCommanderArtPlace(Point position, const CGHeroInstance * co void CCommanderArtPlace::clickLeft(tribool down, bool previousState) { if (ourArt && text.size() && down) - LOCPLINT->showYesNoDialog(CGI->generaltexth->localizedTexts["commanderWindow"]["artifactMessage"].String(), [this] { returnArtToHeroCallback(); }, [] {}); + LOCPLINT->showYesNoDialog(CGI->generaltexth->localizedTexts["commanderWindow"]["artifactMessage"].String(), [this](){ returnArtToHeroCallback(); }, [](){}); } void CCommanderArtPlace::clickRight(tribool down, bool previousState) diff --git a/client/widgets/CGarrisonInt.cpp b/client/widgets/CGarrisonInt.cpp index 43ccd19cd..1929a4b1f 100644 --- a/client/widgets/CGarrisonInt.cpp +++ b/client/widgets/CGarrisonInt.cpp @@ -148,7 +148,7 @@ bool CGarrisonSlot::viewInfo() std::function upgr = nullptr; std::function dism = nullptr; if(canUpgrade) upgr = [=] (CreatureID newID) { LOCPLINT->cb->upgradeCreature(getObj(), ID, newID); }; - if(canDismiss) dism = [=] { LOCPLINT->cb->dismissCreature(getObj(), ID); }; + if(canDismiss) dism = [=](){ LOCPLINT->cb->dismissCreature(getObj(), ID); }; owner->selectSlot(nullptr); owner->setSplittingMode(false); @@ -532,11 +532,11 @@ CGarrisonWindow::CGarrisonWindow( const CArmedInstance *up, const CGHeroInstance garr = new CGarrisonInt(92, 127, 4, Point(0,96), background->bg, Point(93,127), up, down, removableUnits); { - CButton *split = new CButton(Point(88, 314), "IDV6432.DEF", CButton::tooltip(CGI->generaltexth->tcommands[3], ""), [&]{ garr->splitClick(); } ); + CButton *split = new CButton(Point(88, 314), "IDV6432.DEF", CButton::tooltip(CGI->generaltexth->tcommands[3], ""), [&](){ garr->splitClick(); } ); removeChild(split); garr->addSplitBtn(split); } - quit = new CButton(Point(399, 314), "IOK6432.DEF", CButton::tooltip(CGI->generaltexth->tcommands[8], ""), [&]{ close(); }, SDLK_RETURN); + quit = new CButton(Point(399, 314), "IOK6432.DEF", CButton::tooltip(CGI->generaltexth->tcommands[8], ""), [&](){ close(); }, SDLK_RETURN); std::string titleText; if (down->tempOwner == up->tempOwner) diff --git a/client/windows/CCastleInterface.cpp b/client/windows/CCastleInterface.cpp index da12d406d..7e0ca4827 100644 --- a/client/windows/CCastleInterface.cpp +++ b/client/windows/CCastleInterface.cpp @@ -1435,7 +1435,7 @@ CBuildWindow::CBuildWindow(const CGTownInstance *Town, const CBuilding * Buildin buy->borderColor = Colors::METALLIC_GOLD; buy->block(state!=7 || LOCPLINT->playerID != town->tempOwner); - CButton * cancel = new CButton(Point(290, 445), "ICANCEL", CButton::tooltip(tooltipNo), [&] { close();}, SDLK_ESCAPE); + CButton * cancel = new CButton(Point(290, 445), "ICANCEL", CButton::tooltip(tooltipNo), [&](){ close();}, SDLK_ESCAPE); cancel->borderColor = Colors::METALLIC_GOLD; } } diff --git a/client/windows/CCreatureWindow.cpp b/client/windows/CCreatureWindow.cpp index ad799b56c..a66c47419 100644 --- a/client/windows/CCreatureWindow.cpp +++ b/client/windows/CCreatureWindow.cpp @@ -322,7 +322,7 @@ void CStackWindow::CWindowSection::createStackInfo(bool showExp, bool showArt) parent->stackArtifactButton.reset(new CButton( Point(pos.x - 2 , pos.y + 46), "stackWindow/cancelButton", CButton::tooltip(text), - [=]{ parent->removeStackArtifact(ArtifactPosition::CREATURE_SLOT); })); + [=](){ parent->removeStackArtifact(ArtifactPosition::CREATURE_SLOT); })); parent->stackArtifactButton->recActions &= ~DISPOSE; } } @@ -457,7 +457,7 @@ void CStackWindow::CWindowSection::createCommander() Point skillPos = getSkillPos(index); auto icon = new CCommanderSkillIcon(new CPicture(getSkillImage(index), skillPos.x, skillPos.y), - [=] { LOCPLINT->showInfoDialog(getSkillDescription(index)); }); + [=](){ LOCPLINT->showInfoDialog(getSkillDescription(index)); }); icon->text = getSkillDescription(index); //used to handle right click description via LRClickableAreaWText::ClickRight() @@ -495,7 +495,7 @@ CIntObject * CStackWindow::createSkillEntry(int index) { const auto bonus = CGI->creh->skillRequirements[skillID-100].first; const CStackInstance *stack = info->commander; - CCommanderSkillIcon * icon = new CCommanderSkillIcon(new CPicture(stack->bonusToGraphics(bonus)), []{}); + CCommanderSkillIcon * icon = new CCommanderSkillIcon(new CPicture(stack->bonusToGraphics(bonus)), [](){}); icon->callback = [=] { setSelection(skillID, icon); @@ -531,8 +531,8 @@ void CStackWindow::CWindowSection::createCommanderAbilities() }, Point(38, 3+pos.h), Point(63, 0), 6, abilitiesCount); - auto leftBtn = new CButton(Point(10, pos.h + 6), "hsbtns3.def", CButton::tooltip(), [=]{ list->moveToPrev(); }, SDLK_LEFT); - auto rightBtn = new CButton(Point(411, pos.h + 6), "hsbtns5.def", CButton::tooltip(), [=]{ list->moveToNext(); }, SDLK_RIGHT); + auto leftBtn = new CButton(Point(10, pos.h + 6), "hsbtns3.def", CButton::tooltip(), [=](){ list->moveToPrev(); }, SDLK_LEFT); + auto rightBtn = new CButton(Point(411, pos.h + 6), "hsbtns5.def", CButton::tooltip(), [=](){ list->moveToNext(); }, SDLK_RIGHT); if (abilitiesCount <= 6) { @@ -677,7 +677,7 @@ void CStackWindow::CWindowSection::createButtonPanel() parent->switchButtons[parent->activeTab]->disable(); } - auto exitBtn = new CButton(Point(382, 5), "hsbtns.def", CGI->generaltexth->zelp[447], [=]{ parent->close(); }, SDLK_RETURN); + auto exitBtn = new CButton(Point(382, 5), "hsbtns.def", CGI->generaltexth->zelp[447], [=](){ parent->close(); }, SDLK_RETURN); exitBtn->assignedKeys.insert(SDLK_ESCAPE); } diff --git a/client/windows/CHeroWindow.cpp b/client/windows/CHeroWindow.cpp index 23cb2ba77..929541ca2 100644 --- a/client/windows/CHeroWindow.cpp +++ b/client/windows/CHeroWindow.cpp @@ -103,10 +103,10 @@ CHeroWindow::CHeroWindow(const CGHeroInstance *hero): //artifs = new CArtifactsOfHero(pos.topLeft(), true); ourBar = new CGStatusBar(7, 559, "ADROLLVR.bmp", 660); // new CStatusBar(pos.x+72, pos.y+567, "ADROLLVR.bmp", 660); - quitButton = new CButton(Point(609, 516), "hsbtns.def", CButton::tooltip(heroscrn[17]), [&]{ close(); }, SDLK_RETURN); + quitButton = new CButton(Point(609, 516), "hsbtns.def", CButton::tooltip(heroscrn[17]), [&](){ close(); }, SDLK_RETURN); quitButton->assignedKeys.insert(SDLK_ESCAPE); - dismissButton = new CButton(Point(454, 429), "hsbtns2.def", CButton::tooltip(heroscrn[28]), [&]{ dismissCurrent(); }, SDLK_d); - questlogButton = new CButton(Point(314, 429), "hsbtns4.def", CButton::tooltip(heroscrn[0]), [&]{ questlog(); }, SDLK_q); + dismissButton = new CButton(Point(454, 429), "hsbtns2.def", CButton::tooltip(heroscrn[28]), [&](){ dismissCurrent(); }, SDLK_d); + questlogButton = new CButton(Point(314, 429), "hsbtns4.def", CButton::tooltip(heroscrn[0]), [&](){ questlog(); }, SDLK_q); formations = new CToggleGroup(0); formations->addToggle(0, new CToggleButton(Point(481, 483), "hsbtns6.def", std::make_pair(heroscrn[23], heroscrn[29]), 0, SDLK_t)); @@ -115,7 +115,7 @@ CHeroWindow::CHeroWindow(const CGHeroInstance *hero): if (hero->commander) { auto texts = CGI->generaltexth->localizedTexts["heroWindow"]["openCommander"]; - commanderButton = new CButton (Point(317, 18), "buttons/commander", CButton::tooltip(texts), [&]{ commanderWindow(); }, SDLK_c); + commanderButton = new CButton (Point(317, 18), "buttons/commander", CButton::tooltip(texts), [&](){ commanderWindow(); }, SDLK_c); } //right list of heroes @@ -209,7 +209,7 @@ void CHeroWindow::update(const CGHeroInstance * hero, bool redrawNeeded) boost::algorithm::replace_first(helpBox, "%s", CGI->generaltexth->allTexts[43]); garr = new CGarrisonInt(15, 485, 8, Point(), background->bg, Point(15,485), curHero); - auto split = new CButton(Point(539, 519), "hsbtns9.def", CButton::tooltip(CGI->generaltexth->allTexts[256], helpBox), [&]{ garr->splitClick(); }); + auto split = new CButton(Point(539, 519), "hsbtns9.def", CButton::tooltip(CGI->generaltexth->allTexts[256], helpBox), [&](){ garr->splitClick(); }); garr->addSplitBtn(split); } @@ -300,8 +300,8 @@ void CHeroWindow::update(const CGHeroInstance * hero, bool redrawNeeded) void CHeroWindow::dismissCurrent() { - CFunctionList ony = [=] { close(); }; - ony += [=] { LOCPLINT->cb->dismissHero(curHero); }; + CFunctionList ony = [=](){ close(); }; + ony += [=](){ LOCPLINT->cb->dismissHero(curHero); }; LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[22], ony, 0, false); } diff --git a/client/windows/CKingdomInterface.cpp b/client/windows/CKingdomInterface.cpp index 92558e686..067226a2c 100644 --- a/client/windows/CKingdomInterface.cpp +++ b/client/windows/CKingdomInterface.cpp @@ -623,15 +623,15 @@ void CKingdomInterface::generateButtons() btnExit->setImageOrder(3, 4, 5, 6); //Object list control buttons - dwellTop = new CButton (Point(733, 4), "OVBUTN4.DEF", CButton::tooltip(), [&]{ dwellingsList->moveToPos(0);}); + dwellTop = new CButton (Point(733, 4), "OVBUTN4.DEF", CButton::tooltip(), [&](){ dwellingsList->moveToPos(0);}); - dwellBottom = new CButton (Point(733, footerPos+2), "OVBUTN4.DEF", CButton::tooltip(), [&]{ dwellingsList->moveToPos(-1); }); + dwellBottom = new CButton (Point(733, footerPos+2), "OVBUTN4.DEF", CButton::tooltip(), [&](){ dwellingsList->moveToPos(-1); }); dwellBottom->setImageOrder(2, 3, 4, 5); - dwellUp = new CButton (Point(733, 24), "OVBUTN4.DEF", CButton::tooltip(), [&]{ dwellingsList->moveToPrev(); }); + dwellUp = new CButton (Point(733, 24), "OVBUTN4.DEF", CButton::tooltip(), [&](){ dwellingsList->moveToPrev(); }); dwellUp->setImageOrder(4, 5, 6, 7); - dwellDown = new CButton (Point(733, footerPos-18), "OVBUTN4.DEF", CButton::tooltip(), [&]{ dwellingsList->moveToNext(); }); + dwellDown = new CButton (Point(733, footerPos-18), "OVBUTN4.DEF", CButton::tooltip(), [&](){ dwellingsList->moveToNext(); }); dwellDown->setImageOrder(6, 7, 8, 9); } diff --git a/client/windows/CTradeWindow.cpp b/client/windows/CTradeWindow.cpp index ba19135fb..80d4a44bf 100644 --- a/client/windows/CTradeWindow.cpp +++ b/client/windows/CTradeWindow.cpp @@ -715,13 +715,13 @@ CMarketplaceWindow::CMarketplaceWindow(const IMarket *Market, const CGHeroInstan ok = new CButton(Point(516, 520), "IOK6432.DEF", CGI->generaltexth->zelp[600], [&]{ close(); }, SDLK_RETURN); ok->assignedKeys.insert(SDLK_ESCAPE); - deal = new CButton(Point(307, 520), "TPMRKB.DEF", CGI->generaltexth->zelp[595], [&] { makeDeal(); } ); + deal = new CButton(Point(307, 520), "TPMRKB.DEF", CGI->generaltexth->zelp[595], [&](){ makeDeal(); } ); deal->block(true); if(sliderNeeded) { slider = new CSlider(Point(231, 490),137, std::bind(&CMarketplaceWindow::sliderMoved,this,_1),0,0); - max = new CButton(Point(229, 520), "IRCBTNS.DEF", CGI->generaltexth->zelp[596], [&] { setMax(); }); + max = new CButton(Point(229, 520), "IRCBTNS.DEF", CGI->generaltexth->zelp[596], [&](){ setMax(); }); max->block(true); } else @@ -774,15 +774,15 @@ CMarketplaceWindow::CMarketplaceWindow(const IMarket *Market, const CGHeroInstan int specialOffset = mode == EMarketMode::ARTIFACT_RESOURCE ? 35 : 0; //in selling artifacts mode we need to move res-res and art-res buttons down if(printButtonFor(EMarketMode::RESOURCE_PLAYER)) - new CButton(Point(18, 520),"TPMRKBU1.DEF", CGI->generaltexth->zelp[612], [&] { setMode(EMarketMode::RESOURCE_PLAYER);}); + new CButton(Point(18, 520),"TPMRKBU1.DEF", CGI->generaltexth->zelp[612], [&](){ setMode(EMarketMode::RESOURCE_PLAYER);}); if(printButtonFor(EMarketMode::RESOURCE_RESOURCE)) - new CButton(Point(516, 450 + specialOffset),"TPMRKBU5.DEF", CGI->generaltexth->zelp[605], [&] { setMode(EMarketMode::RESOURCE_RESOURCE);}); + new CButton(Point(516, 450 + specialOffset),"TPMRKBU5.DEF", CGI->generaltexth->zelp[605], [&](){ setMode(EMarketMode::RESOURCE_RESOURCE);}); if(printButtonFor(EMarketMode::CREATURE_RESOURCE)) - new CButton(Point(516, 485),"TPMRKBU4.DEF", CGI->generaltexth->zelp[599], [&] { setMode(EMarketMode::CREATURE_RESOURCE);}); + new CButton(Point(516, 485),"TPMRKBU4.DEF", CGI->generaltexth->zelp[599], [&](){ setMode(EMarketMode::CREATURE_RESOURCE);}); if(printButtonFor(EMarketMode::RESOURCE_ARTIFACT)) - new CButton(Point(18, 450 + specialOffset),"TPMRKBU2.DEF", CGI->generaltexth->zelp[598], [&] { setMode(EMarketMode::RESOURCE_ARTIFACT);}); + new CButton(Point(18, 450 + specialOffset),"TPMRKBU2.DEF", CGI->generaltexth->zelp[598], [&](){ setMode(EMarketMode::RESOURCE_ARTIFACT);}); if(printButtonFor(EMarketMode::ARTIFACT_RESOURCE)) - new CButton(Point(18, 485),"TPMRKBU3.DEF", CGI->generaltexth->zelp[613], [&] { setMode(EMarketMode::ARTIFACT_RESOURCE);}); + new CButton(Point(18, 485),"TPMRKBU3.DEF", CGI->generaltexth->zelp[613], [&](){ setMode(EMarketMode::ARTIFACT_RESOURCE);}); updateTraderText(); } diff --git a/client/windows/GUIClasses.cpp b/client/windows/GUIClasses.cpp index 2625ff0bb..45d848068 100644 --- a/client/windows/GUIClasses.cpp +++ b/client/windows/GUIClasses.cpp @@ -530,22 +530,22 @@ CSystemOptionsWindow::CSystemOptionsWindow(): rightGroup->add(282, 217, texts["fullscreenButton"]["label"].String()); //setting up buttons - load = new CButton (Point(246, 298), "SOLOAD.DEF", CGI->generaltexth->zelp[321], [&] { bloadf(); }, SDLK_l); + load = new CButton (Point(246, 298), "SOLOAD.DEF", CGI->generaltexth->zelp[321], [&](){ bloadf(); }, SDLK_l); load->setImageOrder(1, 0, 2, 3); - save = new CButton (Point(357, 298), "SOSAVE.DEF", CGI->generaltexth->zelp[322], [&] { bsavef(); }, SDLK_s); + save = new CButton (Point(357, 298), "SOSAVE.DEF", CGI->generaltexth->zelp[322], [&](){ bsavef(); }, SDLK_s); save->setImageOrder(1, 0, 2, 3); - restart = new CButton (Point(246, 357), "SORSTRT", CGI->generaltexth->zelp[323], [&] { brestartf(); }, SDLK_r); + restart = new CButton (Point(246, 357), "SORSTRT", CGI->generaltexth->zelp[323], [&](){ brestartf(); }, SDLK_r); restart->setImageOrder(1, 0, 2, 3); - mainMenu = new CButton (Point(357, 357), "SOMAIN.DEF", CGI->generaltexth->zelp[320], [&] { bmainmenuf(); }, SDLK_m); + mainMenu = new CButton (Point(357, 357), "SOMAIN.DEF", CGI->generaltexth->zelp[320], [&](){ bmainmenuf(); }, SDLK_m); mainMenu->setImageOrder(1, 0, 2, 3); - quitGame = new CButton (Point(246, 415), "soquit.def", CGI->generaltexth->zelp[324], [&] { bquitf(); }, SDLK_q); + quitGame = new CButton (Point(246, 415), "soquit.def", CGI->generaltexth->zelp[324], [&](){ bquitf(); }, SDLK_q); quitGame->setImageOrder(1, 0, 2, 3); - backToMap = new CButton ( Point(357, 415), "soretrn.def", CGI->generaltexth->zelp[325], [&] { breturnf(); }, SDLK_RETURN); + backToMap = new CButton ( Point(357, 415), "soretrn.def", CGI->generaltexth->zelp[325], [&](){ breturnf(); }, SDLK_RETURN); backToMap->setImageOrder(1, 0, 2, 3); backToMap->assignedKeys.insert(SDLK_ESCAPE); @@ -1195,9 +1195,9 @@ CTransformerWindow::CTransformerWindow(const CGHeroInstance * _hero, const CGTow if ( army->getCreature(SlotID(i)) ) items.push_back(new CItem(this, army->getStackCount(SlotID(i)), i)); - all = new CButton(Point(146, 416), "ALTARMY.DEF", CGI->generaltexth->zelp[590], [&] { addAll(); }, SDLK_a); - convert = new CButton(Point(269, 416), "ALTSACR.DEF", CGI->generaltexth->zelp[591], [&] { makeDeal(); }, SDLK_RETURN); - cancel = new CButton(Point(392, 416), "ICANCEL.DEF", CGI->generaltexth->zelp[592], [&] { close(); },SDLK_ESCAPE); + all = new CButton(Point(146, 416), "ALTARMY.DEF", CGI->generaltexth->zelp[590], [&](){ addAll(); }, SDLK_a); + convert = new CButton(Point(269, 416), "ALTSACR.DEF", CGI->generaltexth->zelp[591], [&](){ makeDeal(); }, SDLK_RETURN); + cancel = new CButton(Point(392, 416), "ICANCEL.DEF", CGI->generaltexth->zelp[592], [&](){ close(); },SDLK_ESCAPE); bar = new CGStatusBar(new CPicture(*background, Rect(8, pos.h - 26, pos.w - 16, 19), 8, pos.h - 26)); new CLabel(153, 29,FONT_SMALL, CENTER, Colors::YELLOW, CGI->generaltexth->allTexts[485]);//holding area