1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

- migrated boost::function/ref/bind to std:: variants

This commit is contained in:
beegee1 2014-08-04 20:33:59 +02:00
parent d535a09d8b
commit 5139378319
38 changed files with 319 additions and 319 deletions

View File

@ -165,7 +165,7 @@ BattleAction CBattleAI::activeStack( const CStack * stack )
{ {
ThreatMap threatsToUs(stack); ThreatMap threatsToUs(stack);
auto dists = cbc->battleGetDistances(stack); auto dists = cbc->battleGetDistances(stack);
const EnemyInfo &ei= *range::min_element(targets.unreachableEnemies, boost::bind(isCloser, _1, _2, boost::ref(dists))); const EnemyInfo &ei= *range::min_element(targets.unreachableEnemies, std::bind(isCloser, _1, _2, std::ref(dists)));
if(distToNearestNeighbour(ei.s->position, dists) < GameConstants::BFIELD_SIZE) if(distToNearestNeighbour(ei.s->position, dists) < GameConstants::BFIELD_SIZE)
{ {
return goTowards(stack, ei.s->position); return goTowards(stack, ei.s->position);

View File

@ -166,7 +166,7 @@ BattleAction CStupidAI::activeStack( const CStack * stack )
else if(enemiesUnreachable.size()) //due to #955 - a buggy battle may occur when there are no enemies else if(enemiesUnreachable.size()) //due to #955 - a buggy battle may occur when there are no enemies
{ {
assert(enemiesUnreachable.size()); assert(enemiesUnreachable.size());
const EnemyInfo &ei= *std::min_element(enemiesUnreachable.begin(), enemiesUnreachable.end(), boost::bind(isCloser, _1, _2, boost::ref(dists))); const EnemyInfo &ei= *std::min_element(enemiesUnreachable.begin(), enemiesUnreachable.end(), std::bind(isCloser, _1, _2, std::ref(dists)));
assert(ei.s); assert(ei.s);
if(distToNearestNeighbour(ei.s->position, dists) < GameConstants::BFIELD_SIZE) if(distToNearestNeighbour(ei.s->position, dists) < GameConstants::BFIELD_SIZE)
{ {

View File

@ -89,7 +89,7 @@ static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size.");
#define BOOST_THREAD_VERSION 3 #define BOOST_THREAD_VERSION 3
#endif #endif
#define BOOST_THREAD_DONT_PROVIDE_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE 1 #define BOOST_THREAD_DONT_PROVIDE_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE 1
//#define BOOST_BIND_NO_PLACEHOLDERS #define BOOST_BIND_NO_PLACEHOLDERS
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <boost/assign.hpp> #include <boost/assign.hpp>
@ -127,7 +127,7 @@ static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size.");
using std::shared_ptr; using std::shared_ptr;
using std::unique_ptr; using std::unique_ptr;
using std::make_shared; using std::make_shared;
//using namespace std::placeholders; using namespace std::placeholders;
namespace range = boost::range; namespace range = boost::range;
/* ---------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------- */

View File

@ -97,11 +97,11 @@ CList::CList(int Size, Point position, std::string btnUp, std::string btnDown, s
list = new CListBox(create, destroy, Point(1,scrollUp->pos.h), Point(0, 32), size, listAmount); list = new CListBox(create, destroy, Point(1,scrollUp->pos.h), Point(0, 32), size, listAmount);
//assign callback only after list was created //assign callback only after list was created
scrollUp->callback = boost::bind(&CListBox::moveToPrev, list); scrollUp->callback = std::bind(&CListBox::moveToPrev, list);
scrollDown = new CAdventureMapButton(CGI->generaltexth->zelp[helpDown], boost::bind(&CListBox::moveToNext, list), 0, scrollUp->pos.h + 32*size, btnDown); scrollDown = new CAdventureMapButton(CGI->generaltexth->zelp[helpDown], std::bind(&CListBox::moveToNext, list), 0, scrollUp->pos.h + 32*size, btnDown);
scrollDown->callback += boost::bind(&CList::update, this); scrollDown->callback += std::bind(&CList::update, this);
scrollUp->callback += boost::bind(&CList::update, this); scrollUp->callback += std::bind(&CList::update, this);
update(); update();
} }
@ -236,7 +236,7 @@ CIntObject * CHeroList::createHeroItem(size_t index)
} }
CHeroList::CHeroList(int size, Point position, std::string btnUp, std::string btnDown): CHeroList::CHeroList(int size, Point position, std::string btnUp, std::string btnDown):
CList(size, position, btnUp, btnDown, LOCPLINT->wanderingHeroes.size(), 303, 304, boost::bind(&CHeroList::createHeroItem, this, _1)) CList(size, position, btnUp, btnDown, LOCPLINT->wanderingHeroes.size(), 303, 304, std::bind(&CHeroList::createHeroItem, this, _1))
{ {
} }
@ -321,7 +321,7 @@ std::string CTownList::CTownItem::getHoverText()
} }
CTownList::CTownList(int size, Point position, std::string btnUp, std::string btnDown): CTownList::CTownList(int size, Point position, std::string btnUp, std::string btnDown):
CList(size, position, btnUp, btnDown, LOCPLINT->towns.size(), 306, 307, boost::bind(&CTownList::createTownItem, this, _1)) CList(size, position, btnUp, btnDown, LOCPLINT->towns.size(), 306, 307, std::bind(&CTownList::createTownItem, this, _1))
{ {
} }

View File

@ -364,34 +364,34 @@ CAdvMapInt::CAdvMapInt():
minimap(Rect(ADVOPT.minimapX, ADVOPT.minimapY, ADVOPT.minimapW, ADVOPT.minimapH)), minimap(Rect(ADVOPT.minimapX, ADVOPT.minimapY, ADVOPT.minimapW, ADVOPT.minimapH)),
statusbar(ADVOPT.statusbarX,ADVOPT.statusbarY,ADVOPT.statusbarG), statusbar(ADVOPT.statusbarX,ADVOPT.statusbarY,ADVOPT.statusbarG),
kingOverview(CGI->generaltexth->zelp[293].first,CGI->generaltexth->zelp[293].second, kingOverview(CGI->generaltexth->zelp[293].first,CGI->generaltexth->zelp[293].second,
boost::bind(&CAdvMapInt::fshowOverview,this),&ADVOPT.kingOverview, SDLK_k), std::bind(&CAdvMapInt::fshowOverview,this),&ADVOPT.kingOverview, SDLK_k),
underground(CGI->generaltexth->zelp[294].first,CGI->generaltexth->zelp[294].second, underground(CGI->generaltexth->zelp[294].first,CGI->generaltexth->zelp[294].second,
boost::bind(&CAdvMapInt::fswitchLevel,this),&ADVOPT.underground, SDLK_u), std::bind(&CAdvMapInt::fswitchLevel,this),&ADVOPT.underground, SDLK_u),
questlog(CGI->generaltexth->zelp[295].first,CGI->generaltexth->zelp[295].second, questlog(CGI->generaltexth->zelp[295].first,CGI->generaltexth->zelp[295].second,
boost::bind(&CAdvMapInt::fshowQuestlog,this),&ADVOPT.questlog, SDLK_q), std::bind(&CAdvMapInt::fshowQuestlog,this),&ADVOPT.questlog, SDLK_q),
sleepWake(CGI->generaltexth->zelp[296].first,CGI->generaltexth->zelp[296].second, sleepWake(CGI->generaltexth->zelp[296].first,CGI->generaltexth->zelp[296].second,
boost::bind(&CAdvMapInt::fsleepWake,this), &ADVOPT.sleepWake, SDLK_w), std::bind(&CAdvMapInt::fsleepWake,this), &ADVOPT.sleepWake, SDLK_w),
moveHero(CGI->generaltexth->zelp[297].first,CGI->generaltexth->zelp[297].second, moveHero(CGI->generaltexth->zelp[297].first,CGI->generaltexth->zelp[297].second,
boost::bind(&CAdvMapInt::fmoveHero,this), &ADVOPT.moveHero, SDLK_m), std::bind(&CAdvMapInt::fmoveHero,this), &ADVOPT.moveHero, SDLK_m),
spellbook(CGI->generaltexth->zelp[298].first,CGI->generaltexth->zelp[298].second, spellbook(CGI->generaltexth->zelp[298].first,CGI->generaltexth->zelp[298].second,
boost::bind(&CAdvMapInt::fshowSpellbok,this), &ADVOPT.spellbook, SDLK_c), std::bind(&CAdvMapInt::fshowSpellbok,this), &ADVOPT.spellbook, SDLK_c),
advOptions(CGI->generaltexth->zelp[299].first,CGI->generaltexth->zelp[299].second, advOptions(CGI->generaltexth->zelp[299].first,CGI->generaltexth->zelp[299].second,
boost::bind(&CAdvMapInt::fadventureOPtions,this), &ADVOPT.advOptions, SDLK_a), std::bind(&CAdvMapInt::fadventureOPtions,this), &ADVOPT.advOptions, SDLK_a),
sysOptions(CGI->generaltexth->zelp[300].first,CGI->generaltexth->zelp[300].second, sysOptions(CGI->generaltexth->zelp[300].first,CGI->generaltexth->zelp[300].second,
boost::bind(&CAdvMapInt::fsystemOptions,this), &ADVOPT.sysOptions, SDLK_o), std::bind(&CAdvMapInt::fsystemOptions,this), &ADVOPT.sysOptions, SDLK_o),
nextHero(CGI->generaltexth->zelp[301].first,CGI->generaltexth->zelp[301].second, nextHero(CGI->generaltexth->zelp[301].first,CGI->generaltexth->zelp[301].second,
boost::bind(&CAdvMapInt::fnextHero,this), &ADVOPT.nextHero, SDLK_h), std::bind(&CAdvMapInt::fnextHero,this), &ADVOPT.nextHero, SDLK_h),
endTurn(CGI->generaltexth->zelp[302].first,CGI->generaltexth->zelp[302].second, endTurn(CGI->generaltexth->zelp[302].first,CGI->generaltexth->zelp[302].second,
boost::bind(&CAdvMapInt::fendTurn,this), &ADVOPT.endTurn, SDLK_e), std::bind(&CAdvMapInt::fendTurn,this), &ADVOPT.endTurn, SDLK_e),
heroList(ADVOPT.hlistSize, Point(ADVOPT.hlistX, ADVOPT.hlistY), ADVOPT.hlistAU, ADVOPT.hlistAD), heroList(ADVOPT.hlistSize, Point(ADVOPT.hlistX, ADVOPT.hlistY), ADVOPT.hlistAU, ADVOPT.hlistAD),
townList(ADVOPT.tlistSize, Point(ADVOPT.tlistX, ADVOPT.tlistY), ADVOPT.tlistAU, ADVOPT.tlistAD), townList(ADVOPT.tlistSize, Point(ADVOPT.tlistX, ADVOPT.tlistY), ADVOPT.tlistAU, ADVOPT.tlistAD),
@ -405,7 +405,7 @@ infoBar(Rect(ADVOPT.infoboxX, ADVOPT.infoboxY, 192, 192) )
pos.h = screen->h; pos.h = screen->h;
position = int3(0,0,0); position = int3(0,0,0);
selection = nullptr; selection = nullptr;
townList.onSelect = boost::bind(&CAdvMapInt::selectionChanged,this); townList.onSelect = std::bind(&CAdvMapInt::selectionChanged,this);
adventureInt=this; adventureInt=this;
bg = BitmapHandler::loadBitmap(ADVOPT.mainGraphic); bg = BitmapHandler::loadBitmap(ADVOPT.mainGraphic);
scrollingDir = 0; scrollingDir = 0;
@ -528,7 +528,7 @@ void CAdvMapInt::fendTurn()
for (int i = 0; i < LOCPLINT->wanderingHeroes.size(); i++) for (int i = 0; i < LOCPLINT->wanderingHeroes.size(); i++)
if (!isHeroSleeping(LOCPLINT->wanderingHeroes[i]) && (LOCPLINT->wanderingHeroes[i]->movement > 0)) if (!isHeroSleeping(LOCPLINT->wanderingHeroes[i]) && (LOCPLINT->wanderingHeroes[i]->movement > 0))
{ {
LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[55], boost::bind(&CAdvMapInt::endingTurn, this), 0, false); LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[55], std::bind(&CAdvMapInt::endingTurn, this), 0, false);
return; return;
} }
} }
@ -1529,19 +1529,19 @@ CAdventureOptions::CAdventureOptions():
{ {
OBJ_CONSTRUCTION_CAPTURING_ALL; OBJ_CONSTRUCTION_CAPTURING_ALL;
exit = new CAdventureMapButton("","",boost::bind(&CAdventureOptions::close, this), 204, 313, "IOK6432.DEF",SDLK_RETURN); exit = new CAdventureMapButton("","",std::bind(&CAdventureOptions::close, this), 204, 313, "IOK6432.DEF",SDLK_RETURN);
exit->assignedKeys.insert(SDLK_ESCAPE); exit->assignedKeys.insert(SDLK_ESCAPE);
scenInfo = new CAdventureMapButton("","", boost::bind(&CAdventureOptions::close, this), 24, 198, "ADVINFO.DEF",SDLK_i); scenInfo = new CAdventureMapButton("","", std::bind(&CAdventureOptions::close, this), 24, 198, "ADVINFO.DEF",SDLK_i);
scenInfo->callback += CAdventureOptions::showScenarioInfo; scenInfo->callback += CAdventureOptions::showScenarioInfo;
//viewWorld = new CAdventureMapButton("","",boost::bind(&CGuiHandler::popIntTotally, &GH, this), 204, 313, "IOK6432.DEF",SDLK_RETURN); //viewWorld = new CAdventureMapButton("","",std::bind(&CGuiHandler::popIntTotally, &GH, this), 204, 313, "IOK6432.DEF",SDLK_RETURN);
puzzle = new CAdventureMapButton("","", boost::bind(&CAdventureOptions::close, this), 24, 81, "ADVPUZ.DEF"); puzzle = new CAdventureMapButton("","", std::bind(&CAdventureOptions::close, this), 24, 81, "ADVPUZ.DEF");
puzzle->callback += boost::bind(&CPlayerInterface::showPuzzleMap, LOCPLINT); puzzle->callback += std::bind(&CPlayerInterface::showPuzzleMap, LOCPLINT);
dig = new CAdventureMapButton("","", boost::bind(&CAdventureOptions::close, this), 24, 139, "ADVDIG.DEF"); dig = new CAdventureMapButton("","", std::bind(&CAdventureOptions::close, this), 24, 139, "ADVDIG.DEF");
if(const CGHeroInstance *h = adventureInt->curHero()) if(const CGHeroInstance *h = adventureInt->curHero())
dig->callback += boost::bind(&CPlayerInterface::tryDiggging, LOCPLINT, h); dig->callback += std::bind(&CPlayerInterface::tryDiggging, LOCPLINT, h);
else else
dig->block(true); dig->block(true);
} }

View File

@ -1528,7 +1528,7 @@ void CCreatureAnim::reset()
void CCreatureAnim::startPreview(bool warMachine) void CCreatureAnim::startPreview(bool warMachine)
{ {
callback = boost::bind(&CCreatureAnim::loopPreview, this, warMachine); callback = std::bind(&CCreatureAnim::loopPreview, this, warMachine);
} }
void CCreatureAnim::clearAndSet(EAnimType type) void CCreatureAnim::clearAndSet(EAnimType type)

View File

@ -764,7 +764,7 @@ void CCastleBuildings::enterCastleGate()
} }
auto titlePic = new CPicture (LOCPLINT->castleInt->bicons->ourImages[BuildingID::CASTLE_GATE].bitmap, 0,0, false);//will be deleted by selection window auto titlePic = new CPicture (LOCPLINT->castleInt->bicons->ourImages[BuildingID::CASTLE_GATE].bitmap, 0,0, false);//will be deleted by selection window
GH.pushInt (new CObjectListWindow(availableTowns, titlePic, CGI->generaltexth->jktexts[40], GH.pushInt (new CObjectListWindow(availableTowns, titlePic, CGI->generaltexth->jktexts[40],
CGI->generaltexth->jktexts[41], boost::bind (&CCastleInterface::castleTeleport, LOCPLINT->castleInt, _1))); CGI->generaltexth->jktexts[41], std::bind (&CCastleInterface::castleTeleport, LOCPLINT->castleInt, _1)));
} }
void CCastleBuildings::enterDwelling(int level) void CCastleBuildings::enterDwelling(int level)
@ -836,7 +836,7 @@ void CCastleBuildings::enterTownHall()
else else
{ {
LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[673]); LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[673]);
(dynamic_cast<CInfoWindow*>(GH.topInt()))->buttons[0]->callback += boost::bind(&CCastleBuildings::openTownHall, this); (dynamic_cast<CInfoWindow*>(GH.topInt()))->buttons[0]->callback += std::bind(&CCastleBuildings::openTownHall, this);
} }
} }
else else
@ -881,12 +881,12 @@ CCastleInterface::CCastleInterface(const CGTownInstance * Town, const CGTownInst
income = new CLabel(195, 443, FONT_SMALL, CENTER); income = new CLabel(195, 443, FONT_SMALL, CENTER);
icon = new CAnimImage("ITPT", 0, 0, 15, 387); icon = new CAnimImage("ITPT", 0, 0, 15, 387);
exit = new CAdventureMapButton(CGI->generaltexth->tcommands[8], "", boost::bind(&CCastleInterface::close,this), 744, 544, "TSBTNS", SDLK_RETURN); exit = new CAdventureMapButton(CGI->generaltexth->tcommands[8], "", std::bind(&CCastleInterface::close,this), 744, 544, "TSBTNS", SDLK_RETURN);
exit->assignedKeys.insert(SDLK_ESCAPE); exit->assignedKeys.insert(SDLK_ESCAPE);
exit->setOffset(4); exit->setOffset(4);
split = new CAdventureMapButton(CGI->generaltexth->tcommands[3], "", boost::bind(&CGarrisonInt::splitClick,garr), 744, 382, "TSBTNS.DEF"); split = new CAdventureMapButton(CGI->generaltexth->tcommands[3], "", std::bind(&CGarrisonInt::splitClick,garr), 744, 382, "TSBTNS.DEF");
split->callback += boost::bind(&HeroSlots::splitClicked, heroes); split->callback += std::bind(&HeroSlots::splitClicked, heroes);
garr->addSplitBtn(split); garr->addSplitBtn(split);
Rect barRect(9, 182, 732, 18); Rect barRect(9, 182, 732, 18);
@ -898,7 +898,7 @@ CCastleInterface::CCastleInterface(const CGTownInstance * Town, const CGTownInst
townlist->select(from); townlist->select(from);
townlist->select(town); //this will scroll list to select current town townlist->select(town); //this will scroll list to select current town
townlist->onSelect = boost::bind(&CCastleInterface::townChange, this); townlist->onSelect = std::bind(&CCastleInterface::townChange, this);
recreateIcons(); recreateIcons();
CCS->musich->playMusic(town->town->clientInfo.musicTheme, true); CCS->musich->playMusic(town->town->clientInfo.musicTheme, true);
@ -1305,7 +1305,7 @@ CHallInterface::CHallInterface(const CGTownInstance *Town):
title = new CLabel(399, 12, FONT_MEDIUM, CENTER, Colors::WHITE, town->town->buildings.at(BuildingID(town->hallLevel()+BuildingID::VILLAGE_HALL))->Name()); title = new CLabel(399, 12, FONT_MEDIUM, CENTER, Colors::WHITE, town->town->buildings.at(BuildingID(town->hallLevel()+BuildingID::VILLAGE_HALL))->Name());
exit = new CAdventureMapButton(CGI->generaltexth->hcommands[8], "", exit = new CAdventureMapButton(CGI->generaltexth->hcommands[8], "",
boost::bind(&CHallInterface::close,this), 748, 556, "TPMAGE1.DEF", SDLK_RETURN); std::bind(&CHallInterface::close,this), 748, 556, "TPMAGE1.DEF", SDLK_RETURN);
exit->assignedKeys.insert(SDLK_ESCAPE); exit->assignedKeys.insert(SDLK_ESCAPE);
auto & boxList = town->town->clientInfo.hallSlots; auto & boxList = town->town->clientInfo.hallSlots;
@ -1408,12 +1408,12 @@ CBuildWindow::CBuildWindow(const CGTownInstance *Town, const CBuilding * Buildin
if(!rightClick) if(!rightClick)
{ //normal window { //normal window
buy = new CAdventureMapButton(boost::str(boost::format(CGI->generaltexth->allTexts[595]) % building->Name()), buy = new CAdventureMapButton(boost::str(boost::format(CGI->generaltexth->allTexts[595]) % building->Name()),
"", boost::bind(&CBuildWindow::buyFunc,this), 45, 446,"IBUY30", SDLK_RETURN); "", std::bind(&CBuildWindow::buyFunc,this), 45, 446,"IBUY30", SDLK_RETURN);
buy->borderColor = Colors::METALLIC_GOLD; buy->borderColor = Colors::METALLIC_GOLD;
buy->borderEnabled = true; buy->borderEnabled = true;
cancel = new CAdventureMapButton(boost::str(boost::format(CGI->generaltexth->allTexts[596]) % building->Name()), cancel = new CAdventureMapButton(boost::str(boost::format(CGI->generaltexth->allTexts[596]) % building->Name()),
"", boost::bind(&CBuildWindow::close,this), 290, 445, "ICANCEL", SDLK_ESCAPE); "", std::bind(&CBuildWindow::close,this), 290, 445, "ICANCEL", SDLK_ESCAPE);
cancel->borderColor = Colors::METALLIC_GOLD; cancel->borderColor = Colors::METALLIC_GOLD;
cancel->borderEnabled = true; cancel->borderEnabled = true;
buy->block(state!=7 || LOCPLINT->playerID != town->tempOwner); buy->block(state!=7 || LOCPLINT->playerID != town->tempOwner);
@ -1445,7 +1445,7 @@ CFortScreen::CFortScreen(const CGTownInstance * town):
title = new CLabel(400, 12, FONT_BIG, CENTER, Colors::WHITE, fortBuilding->Name()); title = new CLabel(400, 12, FONT_BIG, CENTER, Colors::WHITE, fortBuilding->Name());
std::string text = boost::str(boost::format(CGI->generaltexth->fcommands[6]) % fortBuilding->Name()); std::string text = boost::str(boost::format(CGI->generaltexth->fcommands[6]) % fortBuilding->Name());
exit = new CAdventureMapButton(text, "", boost::bind(&CFortScreen::close,this) ,748, 556, "TPMAGE1", SDLK_RETURN); exit = new CAdventureMapButton(text, "", std::bind(&CFortScreen::close,this) ,748, 556, "TPMAGE1", SDLK_RETURN);
exit->assignedKeys.insert(SDLK_ESCAPE); exit->assignedKeys.insert(SDLK_ESCAPE);
std::vector<Point> positions; std::vector<Point> positions;
@ -1655,7 +1655,7 @@ CMageGuildScreen::CMageGuildScreen(CCastleInterface * owner,std::string imagem)
Rect barRect(7, 556, 737, 18); Rect barRect(7, 556, 737, 18);
statusBar = new CGStatusBar(new CPicture(*background, barRect, 7, 556, false)); statusBar = new CGStatusBar(new CPicture(*background, barRect, 7, 556, false));
exit = new CAdventureMapButton(CGI->generaltexth->allTexts[593],"",boost::bind(&CMageGuildScreen::close,this), 748, 556,"TPMAGE1.DEF",SDLK_RETURN); exit = new CAdventureMapButton(CGI->generaltexth->allTexts[593],"",std::bind(&CMageGuildScreen::close,this), 748, 556,"TPMAGE1.DEF",SDLK_RETURN);
exit->assignedKeys.insert(SDLK_ESCAPE); exit->assignedKeys.insert(SDLK_ESCAPE);
std::vector<std::vector<Point> > positions; std::vector<std::vector<Point> > positions;
@ -1732,10 +1732,10 @@ CBlacksmithDialog::CBlacksmithDialog(bool possible, CreatureID creMachineID, Art
boost::lexical_cast<std::string>(CGI->arth->artifacts[aid]->price)); boost::lexical_cast<std::string>(CGI->arth->artifacts[aid]->price));
std::string text = boost::str(boost::format(CGI->generaltexth->allTexts[595]) % creature->nameSing); std::string text = boost::str(boost::format(CGI->generaltexth->allTexts[595]) % creature->nameSing);
buy = new CAdventureMapButton(text,"",boost::bind(&CBlacksmithDialog::close, this), 42, 312,"IBUY30.DEF",SDLK_RETURN); buy = new CAdventureMapButton(text,"",std::bind(&CBlacksmithDialog::close, this), 42, 312,"IBUY30.DEF",SDLK_RETURN);
text = boost::str(boost::format(CGI->generaltexth->allTexts[596]) % creature->nameSing); text = boost::str(boost::format(CGI->generaltexth->allTexts[596]) % creature->nameSing);
cancel = new CAdventureMapButton(text,"",boost::bind(&CBlacksmithDialog::close, this), 224, 312,"ICANCEL.DEF",SDLK_ESCAPE); cancel = new CAdventureMapButton(text,"",std::bind(&CBlacksmithDialog::close, this), 224, 312,"ICANCEL.DEF",SDLK_ESCAPE);
if(possible) if(possible)
buy->callback += [=]{ LOCPLINT->cb->buyArtifact(LOCPLINT->cb->getHero(hid),aid); }; buy->callback += [=]{ LOCPLINT->cb->buyArtifact(LOCPLINT->cb->getHero(hid),aid); };

View File

@ -104,9 +104,9 @@ CCreatureWindow::CCreatureWindow(const CStackInstance &st, CreWinType Type, std:
{ {
CFunctionList<void()> fs; CFunctionList<void()> fs;
fs += Upg; fs += Upg;
fs += boost::bind(&CCreatureWindow::close,this); fs += std::bind(&CCreatureWindow::close,this);
CFunctionList<void()> cfl; CFunctionList<void()> cfl;
cfl += boost::bind(&CPlayerInterface::showYesNoDialog, cfl += std::bind(&CPlayerInterface::showYesNoDialog,
LOCPLINT, CGI->generaltexth->allTexts[207], fs, nullptr, false, upgResCost); LOCPLINT, CGI->generaltexth->allTexts[207], fs, nullptr, false, upgResCost);
upgrade = new CAdventureMapButton("",CGI->generaltexth->zelp[446].second,cfl,385, 148,"IVIEWCR.DEF",SDLK_u); upgrade = new CAdventureMapButton("",CGI->generaltexth->zelp[446].second,cfl,385, 148,"IVIEWCR.DEF",SDLK_u);
} }
@ -123,9 +123,9 @@ CCreatureWindow::CCreatureWindow(const CStackInstance &st, CreWinType Type, std:
CFunctionList<void()> fs[2]; CFunctionList<void()> fs[2];
//on dismiss confirmed //on dismiss confirmed
fs[0] += Dsm; //dismiss fs[0] += Dsm; //dismiss
fs[0] += boost::bind(&CCreatureWindow::close,this);//close this window fs[0] += std::bind(&CCreatureWindow::close,this);//close this window
CFunctionList<void()> cfl; CFunctionList<void()> cfl;
cfl = boost::bind(&CPlayerInterface::showYesNoDialog,LOCPLINT,CGI->generaltexth->allTexts[12],fs[0],fs[1],false,std::vector<CComponent*>()); cfl = std::bind(&CPlayerInterface::showYesNoDialog,LOCPLINT,CGI->generaltexth->allTexts[12],fs[0],fs[1],false,std::vector<CComponent*>());
dismiss = new CAdventureMapButton("",CGI->generaltexth->zelp[445].second,cfl,333, 148,"IVIEWCR2.DEF",SDLK_d); dismiss = new CAdventureMapButton("",CGI->generaltexth->zelp[445].second,cfl,333, 148,"IVIEWCR2.DEF",SDLK_d);
} }
} }
@ -151,9 +151,9 @@ CCreatureWindow::CCreatureWindow (const CCommanderInstance * Commander, const CS
CFunctionList<void()> fs[2]; CFunctionList<void()> fs[2];
//on dismiss confirmed //on dismiss confirmed
fs[0] += Dsm; //dismiss fs[0] += Dsm; //dismiss
fs[0] += boost::bind(&CCreatureWindow::close,this);//close this window fs[0] += std::bind(&CCreatureWindow::close,this);//close this window
CFunctionList<void()> cfl; CFunctionList<void()> cfl;
cfl = boost::bind(&CPlayerInterface::showYesNoDialog,LOCPLINT,CGI->generaltexth->allTexts[12],fs[0],fs[1],false,std::vector<CComponent*>()); cfl = std::bind(&CPlayerInterface::showYesNoDialog,LOCPLINT,CGI->generaltexth->allTexts[12],fs[0],fs[1],false,std::vector<CComponent*>());
if (type < COMMANDER_LEVEL_UP) //can dismiss only in regular window if (type < COMMANDER_LEVEL_UP) //can dismiss only in regular window
dismiss = new CAdventureMapButton("",CGI->generaltexth->zelp[445].second, cfl, 333, 148,"IVIEWCR2.DEF", SDLK_d); dismiss = new CAdventureMapButton("",CGI->generaltexth->zelp[445].second, cfl, 333, 148,"IVIEWCR2.DEF", SDLK_d);
} }
@ -174,9 +174,9 @@ CCreatureWindow::CCreatureWindow (std::vector<ui32> &skills, const CCommanderIns
CFunctionList<void()> fs[2]; CFunctionList<void()> fs[2];
//on dismiss confirmed //on dismiss confirmed
fs[0] += Dsm; //dismiss fs[0] += Dsm; //dismiss
fs[0] += boost::bind(&CCreatureWindow::close,this);//close this window fs[0] += std::bind(&CCreatureWindow::close,this);//close this window
CFunctionList<void()> cfl; CFunctionList<void()> cfl;
cfl = boost::bind(&CPlayerInterface::showYesNoDialog,LOCPLINT,CGI->generaltexth->allTexts[12],fs[0],fs[1],false,std::vector<CComponent*>()); cfl = std::bind(&CPlayerInterface::showYesNoDialog,LOCPLINT,CGI->generaltexth->allTexts[12],fs[0],fs[1],false,std::vector<CComponent*>());
if (type < COMMANDER_LEVEL_UP) //can dismiss only in regular window if (type < COMMANDER_LEVEL_UP) //can dismiss only in regular window
dismiss = new CAdventureMapButton("",CGI->generaltexth->zelp[445].second, cfl, 333, 148,"IVIEWCR2.DEF", SDLK_d); dismiss = new CAdventureMapButton("",CGI->generaltexth->zelp[445].second, cfl, 333, 148,"IVIEWCR2.DEF", SDLK_d);
} }
@ -231,7 +231,7 @@ void CCreatureWindow::init(const CStackInstance *Stack, const CBonusSystemNode *
{ {
ui32 index = selectableSkills.size(); ui32 index = selectableSkills.size();
auto selectableSkill = new CSelectableSkill(); auto selectableSkill = new CSelectableSkill();
selectableSkill->callback = boost::bind(&CCreatureWindow::selectSkill, this, index); selectableSkill->callback = std::bind(&CCreatureWindow::selectSkill, this, index);
if (option < 100) if (option < 100)
{ {
@ -327,7 +327,7 @@ void CCreatureWindow::init(const CStackInstance *Stack, const CBonusSystemNode *
setBackground("CreWin" + boost::lexical_cast<std::string>(bonusRows) + ".pcx"); //1 to 4 rows for now setBackground("CreWin" + boost::lexical_cast<std::string>(bonusRows) + ".pcx"); //1 to 4 rows for now
//Buttons //Buttons
ok = new CAdventureMapButton("",CGI->generaltexth->zelp[445].second, boost::bind(&CCreatureWindow::close,this), 489, 148, "hsbtns.def", SDLK_RETURN); ok = new CAdventureMapButton("",CGI->generaltexth->zelp[445].second, std::bind(&CCreatureWindow::close,this), 489, 148, "hsbtns.def", SDLK_RETURN);
ok->assignedKeys.insert(SDLK_ESCAPE); ok->assignedKeys.insert(SDLK_ESCAPE);
if (type <= BATTLE) //in battle or info window if (type <= BATTLE) //in battle or info window
@ -406,10 +406,10 @@ void CCreatureWindow::init(const CStackInstance *Stack, const CBonusSystemNode *
if (type > BATTLE && type < COMMANDER_BATTLE) //artifact buttons inactive in battle if (type > BATTLE && type < COMMANDER_BATTLE) //artifact buttons inactive in battle
{ {
//TODO: disable buttons if no artifact is equipped //TODO: disable buttons if no artifact is equipped
leftArtRoll = new CAdventureMapButton(std::string(), std::string(), boost::bind (&CCreatureWindow::scrollArt, this, -1), 437, 98, "hsbtns3.def", SDLK_LEFT); leftArtRoll = new CAdventureMapButton(std::string(), std::string(), std::bind (&CCreatureWindow::scrollArt, this, -1), 437, 98, "hsbtns3.def", SDLK_LEFT);
rightArtRoll = new CAdventureMapButton(std::string(), std::string(), boost::bind (&CCreatureWindow::scrollArt, this, +1), 516, 98, "hsbtns5.def", SDLK_RIGHT); rightArtRoll = new CAdventureMapButton(std::string(), std::string(), std::bind (&CCreatureWindow::scrollArt, this, +1), 516, 98, "hsbtns5.def", SDLK_RIGHT);
if (heroOwner) if (heroOwner)
passArtToHero = new CAdventureMapButton(std::string(), std::string(), boost::bind (&CCreatureWindow::passArtifactToHero, this), 437, 148, "OVBUTN1.DEF", SDLK_HOME); passArtToHero = new CAdventureMapButton(std::string(), std::string(), std::bind (&CCreatureWindow::passArtifactToHero, this), 437, 148, "OVBUTN1.DEF", SDLK_HOME);
} }
} }
@ -447,7 +447,7 @@ void CCreatureWindow::init(const CStackInstance *Stack, const CBonusSystemNode *
if (bonusItems.size() > (bonusRows << 1)) //only after graphics are created if (bonusItems.size() > (bonusRows << 1)) //only after graphics are created
{ {
slider = new CSlider(528, 231 + commanderOffset, bonusRows*60, boost::bind (&CCreatureWindow::sliderMoved, this, _1), slider = new CSlider(528, 231 + commanderOffset, bonusRows*60, std::bind (&CCreatureWindow::sliderMoved, this, _1),
bonusRows, (bonusItems.size() + 1) >> 1, 0, false, 0); bonusRows, (bonusItems.size() + 1) >> 1, 0, false, 0);
} }
else //slider automatically places bonus Items else //slider automatically places bonus Items
@ -759,7 +759,7 @@ CCreInfoWindow::CCreInfoWindow(const CStackInstance &stack, bool LClicked, std::
//additional buttons if opened with left click //additional buttons if opened with left click
if(LClicked) if(LClicked)
{ {
std::function<void()> closeFunc = boost::bind(&CCreInfoWindow::close,this); std::function<void()> closeFunc = std::bind(&CCreInfoWindow::close,this);
if(upgradeFunc && upgradeInfo) if(upgradeFunc && upgradeInfo)
{ {
@ -774,11 +774,11 @@ CCreInfoWindow::CCreInfoWindow(const CStackInstance &stack, bool LClicked, std::
onUpgrade += upgradeFunc; onUpgrade += upgradeFunc;
onUpgrade += closeFunc; onUpgrade += closeFunc;
std::function<void()> dialog = boost::bind(&CPlayerInterface::showYesNoDialog, std::function<void()> dialog = std::bind(&CPlayerInterface::showYesNoDialog,
LOCPLINT, LOCPLINT,
CGI->generaltexth->allTexts[207], CGI->generaltexth->allTexts[207],
onUpgrade, 0, false, onUpgrade, 0, false,
boost::ref(upgResCost)); std::ref(upgResCost));
upgrade = new CAdventureMapButton("", CGI->generaltexth->zelp[446].second, dialog, 76, 237, "IVIEWCR", SDLK_u); upgrade = new CAdventureMapButton("", CGI->generaltexth->zelp[446].second, dialog, 76, 237, "IVIEWCR", SDLK_u);
upgrade->block(!LOCPLINT->cb->getResourceAmount().canAfford(upgradeCost)); upgrade->block(!LOCPLINT->cb->getResourceAmount().canAfford(upgradeCost));
@ -790,7 +790,7 @@ CCreInfoWindow::CCreInfoWindow(const CStackInstance &stack, bool LClicked, std::
onDismiss += dismissFunc; onDismiss += dismissFunc;
onDismiss += closeFunc; onDismiss += closeFunc;
std::function<void()> dialog = boost::bind(&CPlayerInterface::showYesNoDialog, std::function<void()> dialog = std::bind(&CPlayerInterface::showYesNoDialog,
LOCPLINT, LOCPLINT,
CGI->generaltexth->allTexts[12], CGI->generaltexth->allTexts[12],
onDismiss, 0, true, std::vector<CComponent*>()); onDismiss, 0, true, std::vector<CComponent*>());
@ -884,7 +884,7 @@ void CCreInfoWindow::init(const CCreature *creature, const CBonusSystemNode *sta
{ {
abilityText = nullptr; abilityText = nullptr;
ok = new CAdventureMapButton("", CGI->generaltexth->zelp[445].second, ok = new CAdventureMapButton("", CGI->generaltexth->zelp[445].second,
boost::bind(&CCreInfoWindow::close,this), 216, 237, "IOKAY.DEF", SDLK_RETURN); std::bind(&CCreInfoWindow::close,this), 216, 237, "IOKAY.DEF", SDLK_RETURN);
ok->assignedKeys.insert(SDLK_ESCAPE); ok->assignedKeys.insert(SDLK_ESCAPE);
} }

View File

@ -103,10 +103,10 @@ CHeroWindow::CHeroWindow(const CGHeroInstance *hero):
//artifs = new CArtifactsOfHero(pos.topLeft(), true); //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); ourBar = new CGStatusBar(7, 559, "ADROLLVR.bmp", 660); // new CStatusBar(pos.x+72, pos.y+567, "ADROLLVR.bmp", 660);
quitButton = new CAdventureMapButton(CGI->generaltexth->heroscrn[17], std::string(),boost::bind(&CHeroWindow::close,this), 609, 516, "hsbtns.def", SDLK_RETURN); quitButton = new CAdventureMapButton(CGI->generaltexth->heroscrn[17], std::string(),std::bind(&CHeroWindow::close,this), 609, 516, "hsbtns.def", SDLK_RETURN);
quitButton->assignedKeys.insert(SDLK_ESCAPE); quitButton->assignedKeys.insert(SDLK_ESCAPE);
dismissButton = new CAdventureMapButton(std::string(), CGI->generaltexth->heroscrn[28], boost::bind(&CHeroWindow::dismissCurrent,this), 454, 429, "hsbtns2.def", SDLK_d); dismissButton = new CAdventureMapButton(std::string(), CGI->generaltexth->heroscrn[28], std::bind(&CHeroWindow::dismissCurrent,this), 454, 429, "hsbtns2.def", SDLK_d);
questlogButton = new CAdventureMapButton(CGI->generaltexth->heroscrn[0], std::string(), boost::bind(&CHeroWindow::questlog,this), 314, 429, "hsbtns4.def", SDLK_q); questlogButton = new CAdventureMapButton(CGI->generaltexth->heroscrn[0], std::string(), std::bind(&CHeroWindow::questlog,this), 314, 429, "hsbtns4.def", SDLK_q);
formations = new CHighlightableButtonsGroup(0); formations = new CHighlightableButtonsGroup(0);
formations->addButton(map_list_of(0,CGI->generaltexth->heroscrn[23]),CGI->generaltexth->heroscrn[29], "hsbtns6.def", 481, 483, 0, 0, SDLK_t); formations->addButton(map_list_of(0,CGI->generaltexth->heroscrn[23]),CGI->generaltexth->heroscrn[29], "hsbtns6.def", 481, 483, 0, 0, SDLK_t);
@ -116,7 +116,7 @@ CHeroWindow::CHeroWindow(const CGHeroInstance *hero):
if (hero->commander) if (hero->commander)
{ {
commanderButton = new CAdventureMapButton ("Commander", "Commander info", boost::bind(&CHeroWindow::commanderWindow, this), 317, 18, "chftke.def", SDLK_c, nullptr, false); commanderButton = new CAdventureMapButton ("Commander", "Commander info", std::bind(&CHeroWindow::commanderWindow, this), 317, 18, "chftke.def", SDLK_c, nullptr, false);
} }
@ -206,7 +206,7 @@ void CHeroWindow::update(const CGHeroInstance * hero, bool redrawNeeded /*= fals
{ {
garr = new CGarrisonInt(15, 485, 8, Point(), background->bg, Point(15,485), curHero); garr = new CGarrisonInt(15, 485, 8, Point(), background->bg, Point(15,485), curHero);
auto split = new CAdventureMapButton(CGI->generaltexth->allTexts[256], CGI->generaltexth->heroscrn[32], auto split = new CAdventureMapButton(CGI->generaltexth->allTexts[256], CGI->generaltexth->heroscrn[32],
boost::bind(&CGarrisonInt::splitClick,garr), 539, 519, "hsbtns9.def", false, nullptr, false); //deleted by garrison destructor std::bind(&CGarrisonInt::splitClick,garr), 539, 519, "hsbtns9.def", false, nullptr, false); //deleted by garrison destructor
boost::algorithm::replace_first(split->hoverTexts[0],"%s",CGI->generaltexth->allTexts[43]); boost::algorithm::replace_first(split->hoverTexts[0],"%s",CGI->generaltexth->allTexts[43]);
garr->addSplitBtn(split); garr->addSplitBtn(split);
@ -281,7 +281,7 @@ void CHeroWindow::update(const CGHeroInstance * hero, bool redrawNeeded /*= fals
//setting formations //setting formations
formations->onChange = 0; formations->onChange = 0;
formations->select(curHero->formation,true); formations->select(curHero->formation,true);
formations->onChange = boost::bind(&CCallback::setFormation, LOCPLINT->cb.get(), curHero, _1); formations->onChange = std::bind(&CCallback::setFormation, LOCPLINT->cb.get(), curHero, _1);
morale->set(&heroWArt); morale->set(&heroWArt);
luck->set(&heroWArt); luck->set(&heroWArt);
@ -292,8 +292,8 @@ void CHeroWindow::update(const CGHeroInstance * hero, bool redrawNeeded /*= fals
void CHeroWindow::dismissCurrent() void CHeroWindow::dismissCurrent()
{ {
CFunctionList<void()> ony = boost::bind(&CHeroWindow::close,this); CFunctionList<void()> ony = std::bind(&CHeroWindow::close,this);
ony += boost::bind(&CCallback::dismissHero, LOCPLINT->cb.get(), curHero); ony += std::bind(&CCallback::dismissHero, LOCPLINT->cb.get(), curHero);
LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[22], ony, 0, false); LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[22], ony, 0, false);
} }

View File

@ -463,7 +463,7 @@ CKingdomInterface::CKingdomInterface():
OBJ_CONSTRUCTION_CAPTURING_ALL; OBJ_CONSTRUCTION_CAPTURING_ALL;
ui32 footerPos = conf.go()->ac.overviewSize * 116; ui32 footerPos = conf.go()->ac.overviewSize * 116;
tabArea = new CTabbedInt(boost::bind(&CKingdomInterface::createMainTab, this, _1), CTabbedInt::DestroyFunc(), Point(4,4)); tabArea = new CTabbedInt(std::bind(&CKingdomInterface::createMainTab, this, _1), CTabbedInt::DestroyFunc(), Point(4,4));
std::vector<const CGObjectInstance * > ownedObjects = LOCPLINT->cb->getMyObjects(); std::vector<const CGObjectInstance * > ownedObjects = LOCPLINT->cb->getMyObjects();
generateObjectsList(ownedObjects); generateObjectsList(ownedObjects);
@ -522,7 +522,7 @@ void CKingdomInterface::generateObjectsList(const std::vector<const CGObjectInst
{ {
objects.push_back(element.second); objects.push_back(element.second);
} }
dwellingsList = new CListBox(boost::bind(&CKingdomInterface::createOwnedObject, this, _1), CListBox::DestroyFunc(), dwellingsList = new CListBox(std::bind(&CKingdomInterface::createOwnedObject, this, _1), CListBox::DestroyFunc(),
Point(740,44), Point(0,57), dwellSize, visibleObjects.size()); Point(740,44), Point(0,57), dwellSize, visibleObjects.size());
} }
@ -603,30 +603,30 @@ void CKingdomInterface::generateButtons()
//Main control buttons //Main control buttons
btnHeroes = new CAdventureMapButton (CGI->generaltexth->overview[11], CGI->generaltexth->overview[6], btnHeroes = new CAdventureMapButton (CGI->generaltexth->overview[11], CGI->generaltexth->overview[6],
boost::bind(&CKingdomInterface::activateTab, this, 0),748,28+footerPos,"OVBUTN1.DEF", SDLK_h); std::bind(&CKingdomInterface::activateTab, this, 0),748,28+footerPos,"OVBUTN1.DEF", SDLK_h);
btnHeroes->block(true); btnHeroes->block(true);
btnTowns = new CAdventureMapButton (CGI->generaltexth->overview[12], CGI->generaltexth->overview[7], btnTowns = new CAdventureMapButton (CGI->generaltexth->overview[12], CGI->generaltexth->overview[7],
boost::bind(&CKingdomInterface::activateTab, this, 1),748,64+footerPos,"OVBUTN6.DEF", SDLK_t); std::bind(&CKingdomInterface::activateTab, this, 1),748,64+footerPos,"OVBUTN6.DEF", SDLK_t);
btnExit = new CAdventureMapButton (CGI->generaltexth->allTexts[600],"", btnExit = new CAdventureMapButton (CGI->generaltexth->allTexts[600],"",
boost::bind(&CKingdomInterface::close, this),748,99+footerPos,"OVBUTN1.DEF", SDLK_RETURN); std::bind(&CKingdomInterface::close, this),748,99+footerPos,"OVBUTN1.DEF", SDLK_RETURN);
btnExit->assignedKeys.insert(SDLK_ESCAPE); btnExit->assignedKeys.insert(SDLK_ESCAPE);
btnExit->setOffset(3); btnExit->setOffset(3);
//Object list control buttons //Object list control buttons
dwellTop = new CAdventureMapButton ("", "", boost::bind(&CListBox::moveToPos, dwellingsList, 0), dwellTop = new CAdventureMapButton ("", "", std::bind(&CListBox::moveToPos, dwellingsList, 0),
733, 4, "OVBUTN4.DEF"); 733, 4, "OVBUTN4.DEF");
dwellBottom = new CAdventureMapButton ("", "", boost::bind(&CListBox::moveToPos, dwellingsList, -1), dwellBottom = new CAdventureMapButton ("", "", std::bind(&CListBox::moveToPos, dwellingsList, -1),
733, footerPos+2, "OVBUTN4.DEF"); 733, footerPos+2, "OVBUTN4.DEF");
dwellBottom->setOffset(2); dwellBottom->setOffset(2);
dwellUp = new CAdventureMapButton ("", "", boost::bind(&CListBox::moveToPrev, dwellingsList), dwellUp = new CAdventureMapButton ("", "", std::bind(&CListBox::moveToPrev, dwellingsList),
733, 24, "OVBUTN4.DEF"); 733, 24, "OVBUTN4.DEF");
dwellUp->setOffset(4); dwellUp->setOffset(4);
dwellDown = new CAdventureMapButton ("", "", boost::bind(&CListBox::moveToNext, dwellingsList), dwellDown = new CAdventureMapButton ("", "", std::bind(&CListBox::moveToNext, dwellingsList),
733, footerPos-18, "OVBUTN4.DEF"); 733, footerPos-18, "OVBUTN4.DEF");
dwellDown->setOffset(6); dwellDown->setOffset(6);
} }
@ -684,7 +684,7 @@ CKingdHeroList::CKingdHeroList(size_t maxSize)
ui32 townCount = LOCPLINT->cb->howManyHeroes(false); ui32 townCount = LOCPLINT->cb->howManyHeroes(false);
ui32 size = conf.go()->ac.overviewSize*116 + 19; ui32 size = conf.go()->ac.overviewSize*116 + 19;
heroes = new CListBox(boost::bind(&CKingdHeroList::createHeroItem, this, _1), boost::bind(&CKingdHeroList::destroyHeroItem, this, _1), heroes = new CListBox(std::bind(&CKingdHeroList::createHeroItem, this, _1), std::bind(&CKingdHeroList::destroyHeroItem, this, _1),
Point(19,21), Point(0,116), maxSize, townCount, 0, 1, Rect(-19, -21, size, size) ); Point(19,21), Point(0,116), maxSize, townCount, 0, 1, Rect(-19, -21, size, size) );
} }
@ -737,7 +737,7 @@ CKingdTownList::CKingdTownList(size_t maxSize)
ui32 townCount = LOCPLINT->cb->howManyTowns(); ui32 townCount = LOCPLINT->cb->howManyTowns();
ui32 size = conf.go()->ac.overviewSize*116 + 19; ui32 size = conf.go()->ac.overviewSize*116 + 19;
towns = new CListBox(boost::bind(&CKingdTownList::createTownItem, this, _1), CListBox::DestroyFunc(), towns = new CListBox(std::bind(&CKingdTownList::createTownItem, this, _1), CListBox::DestroyFunc(),
Point(19,21), Point(0,116), maxSize, townCount, 0, 1, Rect(-19, -21, size, size) ); Point(19,21), Point(0,116), maxSize, townCount, 0, 1, Rect(-19, -21, size, size) );
} }
@ -886,7 +886,7 @@ CHeroItem::CHeroItem(const CGHeroInstance* Hero, CArtifactsOfHero::SCommonPart *
heroArts->commonInfo = artsCommonPart; heroArts->commonInfo = artsCommonPart;
heroArts->setHero(hero); heroArts->setHero(hero);
artsTabs = new CTabbedInt(boost::bind(&CHeroItem::onTabSelected, this, _1), boost::bind(&CHeroItem::onTabDeselected, this, _1)); artsTabs = new CTabbedInt(std::bind(&CHeroItem::onTabSelected, this, _1), std::bind(&CHeroItem::onTabDeselected, this, _1));
artButtons = new CHighlightableButtonsGroup(0); artButtons = new CHighlightableButtonsGroup(0);
for (size_t it = 0; it<3; it++) for (size_t it = 0; it<3; it++)
@ -900,8 +900,8 @@ CHeroItem::CHeroItem(const CGHeroInstance* Hero, CArtifactsOfHero::SCommonPart *
artButtons->addButton(tooltip, overlay, "OVBUTN3",364+it*112, 46, it); artButtons->addButton(tooltip, overlay, "OVBUTN3",364+it*112, 46, it);
artButtons->buttons[it]->addTextOverlay(CGI->generaltexth->allTexts[stringID[it]], FONT_SMALL, Colors::YELLOW); artButtons->buttons[it]->addTextOverlay(CGI->generaltexth->allTexts[stringID[it]], FONT_SMALL, Colors::YELLOW);
} }
artButtons->onChange += boost::bind(&CTabbedInt::setActive, artsTabs, _1); artButtons->onChange += std::bind(&CTabbedInt::setActive, artsTabs, _1);
artButtons->onChange += boost::bind(&CHeroItem::onArtChange, this, _1); artButtons->onChange += std::bind(&CHeroItem::onArtChange, this, _1);
artButtons->select(0,0); artButtons->select(0,0);
garr = new CGarrisonInt(6, 78, 4, Point(), nullptr, Point(), hero, nullptr, true, true); garr = new CGarrisonInt(6, 78, 4, Point(), nullptr, Point(), hero, nullptr, true, true);

View File

@ -271,7 +271,7 @@ int main(int argc, char** argv)
CStopWatch total, pomtime; CStopWatch total, pomtime;
std::cout.flags(std::ios::unitbuf); std::cout.flags(std::ios::unitbuf);
console = new CConsoleHandler; console = new CConsoleHandler;
*console->cb = boost::bind(&processCommand, _1); *console->cb = std::bind(&processCommand, _1);
console->start(); console->start();
atexit(dispose); atexit(dispose);

View File

@ -2,7 +2,7 @@
#include <SDL_mixer.h> #include <SDL_mixer.h>
#include "CMusicHandler.h" #include "CMusicHandler.h"
#include "CGameInfo.h" #include "CGameInfo.h"
#include "../lib/CCreatureHandler.h" #include "../lib/CCreatureHandler.h"
#include "../lib/CSpellHandler.h" #include "../lib/CSpellHandler.h"
#include "../lib/JsonNode.h" #include "../lib/JsonNode.h"
@ -85,7 +85,7 @@ void CSoundHandler::onVolumeChange(const JsonNode &volumeNode)
CSoundHandler::CSoundHandler(): CSoundHandler::CSoundHandler():
listener(settings.listen["general"]["sound"]) listener(settings.listen["general"]["sound"])
{ {
listener(boost::bind(&CSoundHandler::onVolumeChange, this, _1)); listener(std::bind(&CSoundHandler::onVolumeChange, this, _1));
// Vectors for helper(s) // Vectors for helper(s)
pickupSounds += soundBase::pickup01, soundBase::pickup02, soundBase::pickup03, pickupSounds += soundBase::pickup01, soundBase::pickup02, soundBase::pickup03,
@ -282,7 +282,7 @@ void CMusicHandler::onVolumeChange(const JsonNode &volumeNode)
CMusicHandler::CMusicHandler(): CMusicHandler::CMusicHandler():
listener(settings.listen["general"]["music"]) listener(settings.listen["general"]["music"])
{ {
listener(boost::bind(&CMusicHandler::onVolumeChange, this, _1)); listener(std::bind(&CMusicHandler::onVolumeChange, this, _1));
// Map music IDs // Map music IDs
// Vectors for helper // Vectors for helper
const std::string setEnemy[] = {"AITheme0", "AITheme1", "AITheme2"}; const std::string setEnemy[] = {"AITheme0", "AITheme1", "AITheme2"};

View File

@ -1054,7 +1054,7 @@ void CPlayerInterface::showYesNoDialog(const std::string &text, CFunctionList<vo
CInfoWindow::showYesNoDialog(text, &components, onYes, onNo, DelComps, playerID); CInfoWindow::showYesNoDialog(text, &components, onYes, onNo, DelComps, playerID);
} }
void CPlayerInterface::showOkDialog(std::vector<Component> & components, const MetaString & text, const boost::function<void()> & onOk) void CPlayerInterface::showOkDialog(std::vector<Component> & components, const MetaString & text, const std::function<void()> & onOk)
{ {
boost::unique_lock<boost::recursive_mutex> un(*pim); boost::unique_lock<boost::recursive_mutex> un(*pim);
@ -1292,7 +1292,7 @@ void CPlayerInterface::moveHero( const CGHeroInstance *h, CGPath path )
//but no authentic button click/sound ;-) //but no authentic button click/sound ;-)
} }
boost::thread moveHeroTask(boost::bind(&CPlayerInterface::doMoveHero,this,h,path)); boost::thread moveHeroTask(std::bind(&CPlayerInterface::doMoveHero,this,h,path));
} }

View File

@ -236,7 +236,7 @@ public:
void showInfoDialog(const std::string &text, CComponent * component); void showInfoDialog(const std::string &text, CComponent * component);
void showInfoDialog(const std::string &text, const std::vector<CComponent*> & components = std::vector<CComponent*>(), int soundID = 0, bool delComps = false); void showInfoDialog(const std::string &text, const std::vector<CComponent*> & components = std::vector<CComponent*>(), int soundID = 0, bool delComps = false);
void showInfoDialogAndWait(std::vector<Component> & components, const MetaString & text); void showInfoDialogAndWait(std::vector<Component> & components, const MetaString & text);
void showOkDialog(std::vector<Component> & components, const MetaString & text, const boost::function<void()> & onOk); void showOkDialog(std::vector<Component> & components, const MetaString & text, const std::function<void()> & onOk);
void showYesNoDialog(const std::string &text, CFunctionList<void()> onYes, CFunctionList<void()> onNo, bool DelComps = false, const std::vector<CComponent*> & components = std::vector<CComponent*>()); //deactivateCur - whether current main interface should be deactivated; delComps - if components will be deleted on window close void showYesNoDialog(const std::string &text, CFunctionList<void()> onYes, CFunctionList<void()> onNo, bool DelComps = false, const std::vector<CComponent*> & components = std::vector<CComponent*>()); //deactivateCur - whether current main interface should be deactivated; delComps - if components will be deleted on window close
void stopMovement(); void stopMovement();

View File

@ -249,7 +249,7 @@ CMenuScreen::CMenuScreen(const JsonNode& configNode):
//Hardcoded entry //Hardcoded entry
menuNameToEntry.push_back("credits"); menuNameToEntry.push_back("credits");
tabs = new CTabbedInt(boost::bind(&CMenuScreen::createTab, this, _1), CTabbedInt::DestroyFunc()); tabs = new CTabbedInt(std::bind(&CMenuScreen::createTab, this, _1), CTabbedInt::DestroyFunc());
tabs->type |= REDRAW_PARENT; tabs->type |= REDRAW_PARENT;
} }
@ -322,43 +322,43 @@ static std::function<void()> genCommand(CMenuScreen* menu, std::vector<std::stri
{ {
size_t index2 = std::find(menuType.begin(), menuType.end(), commands.front()) - menuType.begin(); size_t index2 = std::find(menuType.begin(), menuType.end(), commands.front()) - menuType.begin();
if ( index2 != menuType.size()) if ( index2 != menuType.size())
return boost::bind(&CMenuScreen::switchToTab, menu, index2); return std::bind(&CMenuScreen::switchToTab, menu, index2);
} }
break; case 1://open campaign selection window break; case 1://open campaign selection window
{ {
return boost::bind(&CGPreGame::openCampaignScreen, CGP, commands.front()); return std::bind(&CGPreGame::openCampaignScreen, CGP, commands.front());
} }
break; case 2://start break; case 2://start
{ {
switch (std::find(gameType.begin(), gameType.end(), commands.front()) - gameType.begin()) switch (std::find(gameType.begin(), gameType.end(), commands.front()) - gameType.begin())
{ {
case 0: return boost::bind(&CGPreGame::openSel, CGP, CMenuScreen::newGame, CMenuScreen::SINGLE_PLAYER); case 0: return std::bind(&CGPreGame::openSel, CGP, CMenuScreen::newGame, CMenuScreen::SINGLE_PLAYER);
case 1: return &pushIntT<CMultiMode>; case 1: return &pushIntT<CMultiMode>;
case 2: return boost::bind(&CGPreGame::openSel, CGP, CMenuScreen::campaignList, CMenuScreen::SINGLE_PLAYER); case 2: return std::bind(&CGPreGame::openSel, CGP, CMenuScreen::campaignList, CMenuScreen::SINGLE_PLAYER);
//TODO: start tutorial //TODO: start tutorial
case 3: return boost::bind(CInfoWindow::showInfoDialog, "Sorry, tutorial is not implemented yet\n", (const std::vector<CComponent*>*)nullptr, false, PlayerColor(1)); case 3: return std::bind(CInfoWindow::showInfoDialog, "Sorry, tutorial is not implemented yet\n", (const std::vector<CComponent*>*)nullptr, false, PlayerColor(1));
} }
} }
break; case 3://load break; case 3://load
{ {
switch (std::find(gameType.begin(), gameType.end(), commands.front()) - gameType.begin()) switch (std::find(gameType.begin(), gameType.end(), commands.front()) - gameType.begin())
{ {
case 0: return boost::bind(&CGPreGame::openSel, CGP, CMenuScreen::loadGame, CMenuScreen::SINGLE_PLAYER); case 0: return std::bind(&CGPreGame::openSel, CGP, CMenuScreen::loadGame, CMenuScreen::SINGLE_PLAYER);
case 1: return boost::bind(&CGPreGame::openSel, CGP, CMenuScreen::loadGame, CMenuScreen::MULTI_HOT_SEAT); case 1: return std::bind(&CGPreGame::openSel, CGP, CMenuScreen::loadGame, CMenuScreen::MULTI_HOT_SEAT);
//TODO: load campaign //TODO: load campaign
case 2: return boost::bind(CInfoWindow::showInfoDialog, "This function is not implemented yet. Campaign saves can be loaded from \"Single Player\" menu", (const std::vector<CComponent*>*)nullptr, false, PlayerColor(1)); case 2: return std::bind(CInfoWindow::showInfoDialog, "This function is not implemented yet. Campaign saves can be loaded from \"Single Player\" menu", (const std::vector<CComponent*>*)nullptr, false, PlayerColor(1));
//TODO: load tutorial //TODO: load tutorial
case 3: return boost::bind(CInfoWindow::showInfoDialog, "Sorry, tutorial is not implemented yet\n", (const std::vector<CComponent*>*)nullptr, false, PlayerColor(1)); case 3: return std::bind(CInfoWindow::showInfoDialog, "Sorry, tutorial is not implemented yet\n", (const std::vector<CComponent*>*)nullptr, false, PlayerColor(1));
} }
} }
break; case 4://exit break; case 4://exit
{ {
return boost::bind(CInfoWindow::showYesNoDialog, boost::ref(CGI->generaltexth->allTexts[69]), (const std::vector<CComponent*>*)nullptr, do_quit, 0, false, PlayerColor(1)); return std::bind(CInfoWindow::showYesNoDialog, std::ref(CGI->generaltexth->allTexts[69]), (const std::vector<CComponent*>*)nullptr, do_quit, 0, false, PlayerColor(1));
} }
break; case 5://highscores break; case 5://highscores
{ {
//TODO: high scores //TODO: high scores
return boost::bind(CInfoWindow::showInfoDialog, "Sorry, high scores menu is not implemented yet\n", (const std::vector<CComponent*>*)nullptr, false, PlayerColor(1)); return std::bind(CInfoWindow::showInfoDialog, "Sorry, high scores menu is not implemented yet\n", (const std::vector<CComponent*>*)nullptr, false, PlayerColor(1));
} }
} }
} }
@ -629,17 +629,17 @@ CSelectionScreen::CSelectionScreen(CMenuScreen::EState Type, CMenuScreen::EMulti
opt->recActions = DISPOSE; opt->recActions = DISPOSE;
randMapTab = new CRandomMapTab(); randMapTab = new CRandomMapTab();
randMapTab->getMapInfoChanged() += boost::bind(&CSelectionScreen::changeSelection, this, _1); randMapTab->getMapInfoChanged() += std::bind(&CSelectionScreen::changeSelection, this, _1);
randMapTab->recActions = DISPOSE; randMapTab->recActions = DISPOSE;
} }
sel = new SelectionTab(screenType, boost::bind(&CSelectionScreen::changeSelection, this, _1), multiPlayer); //scenario selection tab sel = new SelectionTab(screenType, std::bind(&CSelectionScreen::changeSelection, this, _1), multiPlayer); //scenario selection tab
sel->recActions = DISPOSE; sel->recActions = DISPOSE;
switch(screenType) switch(screenType)
{ {
case CMenuScreen::newGame: case CMenuScreen::newGame:
{ {
card->difficulty->onChange = boost::bind(&CSelectionScreen::difficultyChange, this, _1); card->difficulty->onChange = std::bind(&CSelectionScreen::difficultyChange, this, _1);
card->difficulty->select(1, 0); card->difficulty->select(1, 0);
CAdventureMapButton * select = new CAdventureMapButton(CGI->generaltexth->zelp[45], 0, 411, 80, "GSPBUTT.DEF", SDLK_s); CAdventureMapButton * select = new CAdventureMapButton(CGI->generaltexth->zelp[45], 0, 411, 80, "GSPBUTT.DEF", SDLK_s);
select->callback = [&]() select->callback = [&]()
@ -649,7 +649,7 @@ CSelectionScreen::CSelectionScreen(CMenuScreen::EState Type, CMenuScreen::EMulti
}; };
select->addTextOverlay(CGI->generaltexth->allTexts[500], FONT_SMALL); select->addTextOverlay(CGI->generaltexth->allTexts[500], FONT_SMALL);
CAdventureMapButton *opts = new CAdventureMapButton(CGI->generaltexth->zelp[46], boost::bind(&CSelectionScreen::toggleTab, this, opt), 411, 510, "GSPBUTT.DEF", SDLK_a); CAdventureMapButton *opts = new CAdventureMapButton(CGI->generaltexth->zelp[46], std::bind(&CSelectionScreen::toggleTab, this, opt), 411, 510, "GSPBUTT.DEF", SDLK_a);
opts->addTextOverlay(CGI->generaltexth->allTexts[501], FONT_SMALL); opts->addTextOverlay(CGI->generaltexth->allTexts[501], FONT_SMALL);
CAdventureMapButton * randomBtn = new CAdventureMapButton(CGI->generaltexth->zelp[47], 0, 411, 105, "GSPBUTT.DEF", SDLK_r); CAdventureMapButton * randomBtn = new CAdventureMapButton(CGI->generaltexth->zelp[47], 0, 411, 105, "GSPBUTT.DEF", SDLK_r);
@ -660,11 +660,11 @@ CSelectionScreen::CSelectionScreen(CMenuScreen::EState Type, CMenuScreen::EMulti
changeSelection(randMapTab->getMapInfo()); changeSelection(randMapTab->getMapInfo());
}; };
start = new CAdventureMapButton(CGI->generaltexth->zelp[103], boost::bind(&CSelectionScreen::startScenario, this), 411, 535, "SCNRBEG.DEF", SDLK_b); start = new CAdventureMapButton(CGI->generaltexth->zelp[103], std::bind(&CSelectionScreen::startScenario, this), 411, 535, "SCNRBEG.DEF", SDLK_b);
if(network) if(network)
{ {
CAdventureMapButton *hideChat = new CAdventureMapButton(CGI->generaltexth->zelp[48], boost::bind(&InfoCard::toggleChat, card), 619, 83, "GSPBUT2.DEF", SDLK_h); CAdventureMapButton *hideChat = new CAdventureMapButton(CGI->generaltexth->zelp[48], std::bind(&InfoCard::toggleChat, card), 619, 83, "GSPBUT2.DEF", SDLK_h);
hideChat->addTextOverlay(CGI->generaltexth->allTexts[531], FONT_SMALL); hideChat->addTextOverlay(CGI->generaltexth->allTexts[531], FONT_SMALL);
if(multiPlayer == CMenuScreen::MULTI_NETWORK_GUEST) if(multiPlayer == CMenuScreen::MULTI_NETWORK_GUEST)
@ -681,21 +681,21 @@ CSelectionScreen::CSelectionScreen(CMenuScreen::EState Type, CMenuScreen::EMulti
break; break;
case CMenuScreen::loadGame: case CMenuScreen::loadGame:
sel->recActions = 255; sel->recActions = 255;
start = new CAdventureMapButton(CGI->generaltexth->zelp[103], boost::bind(&CSelectionScreen::startScenario, this), 411, 535, "SCNRLOD.DEF", SDLK_l); start = new CAdventureMapButton(CGI->generaltexth->zelp[103], std::bind(&CSelectionScreen::startScenario, this), 411, 535, "SCNRLOD.DEF", SDLK_l);
break; break;
case CMenuScreen::saveGame: case CMenuScreen::saveGame:
sel->recActions = 255; sel->recActions = 255;
start = new CAdventureMapButton("", CGI->generaltexth->zelp[103].second, boost::bind(&CSelectionScreen::startScenario, this), 411, 535, "SCNRSAV.DEF"); start = new CAdventureMapButton("", CGI->generaltexth->zelp[103].second, std::bind(&CSelectionScreen::startScenario, this), 411, 535, "SCNRSAV.DEF");
break; break;
case CMenuScreen::campaignList: case CMenuScreen::campaignList:
sel->recActions = 255; sel->recActions = 255;
start = new CAdventureMapButton(std::pair<std::string, std::string>(), boost::bind(&CSelectionScreen::startCampaign, this), 411, 535, "SCNRLOD.DEF", SDLK_b); start = new CAdventureMapButton(std::pair<std::string, std::string>(), std::bind(&CSelectionScreen::startCampaign, this), 411, 535, "SCNRLOD.DEF", SDLK_b);
break; break;
} }
start->assignedKeys.insert(SDLK_RETURN); start->assignedKeys.insert(SDLK_RETURN);
back = new CAdventureMapButton("", CGI->generaltexth->zelp[105].second, boost::bind(&CGuiHandler::popIntTotally, &GH, this), 581, 535, "SCNRBACK.DEF", SDLK_ESCAPE); back = new CAdventureMapButton("", CGI->generaltexth->zelp[105].second, std::bind(&CGuiHandler::popIntTotally, &GH, this), 581, 535, "SCNRBACK.DEF", SDLK_ESCAPE);
if(network) if(network)
{ {
@ -910,7 +910,7 @@ void CSelectionScreen::startScenario()
auto si = new StartInfo(sInfo); auto si = new StartInfo(sInfo);
CGP->removeFromGui(); CGP->removeFromGui();
CGP->showLoadingScreen(boost::bind(&startGame, si, (CConnection *)nullptr)); CGP->showLoadingScreen(std::bind(&startGame, si, (CConnection *)nullptr));
} }
else else
{ {
@ -920,8 +920,8 @@ void CSelectionScreen::startScenario()
saveGameName = "Saves/" + sel->txt->text; saveGameName = "Saves/" + sel->txt->text;
CFunctionList<void()> overWrite; CFunctionList<void()> overWrite;
overWrite += boost::bind(&CCallback::save, LOCPLINT->cb.get(), saveGameName); overWrite += std::bind(&CCallback::save, LOCPLINT->cb.get(), saveGameName);
overWrite += boost::bind(&CGuiHandler::popIntTotally, &GH, this); overWrite += std::bind(&CGuiHandler::popIntTotally, &GH, this);
if(CResourceHandler::get("local")->existsResource(ResourceID(saveGameName, EResType::CLIENT_SAVEGAME))) if(CResourceHandler::get("local")->existsResource(ResourceID(saveGameName, EResType::CLIENT_SAVEGAME)))
{ {
@ -1258,7 +1258,7 @@ SelectionTab::SelectionTab(CMenuScreen::EState Type, const std::function<void(CM
int sizes[] = {36, 72, 108, 144, 0}; int sizes[] = {36, 72, 108, 144, 0};
const char * names[] = {"SCSMBUT.DEF", "SCMDBUT.DEF", "SCLGBUT.DEF", "SCXLBUT.DEF", "SCALBUT.DEF"}; const char * names[] = {"SCSMBUT.DEF", "SCMDBUT.DEF", "SCLGBUT.DEF", "SCXLBUT.DEF", "SCALBUT.DEF"};
for(int i = 0; i < 5; i++) for(int i = 0; i < 5; i++)
new CAdventureMapButton("", CGI->generaltexth->zelp[54+i].second, boost::bind(&SelectionTab::filter, this, sizes[i], true), 158 + 47*i, 46, names[i]); new CAdventureMapButton("", CGI->generaltexth->zelp[54+i].second, std::bind(&SelectionTab::filter, this, sizes[i], true), 158 + 47*i, 46, names[i]);
} }
//sort buttons buttons //sort buttons buttons
@ -1272,18 +1272,18 @@ SelectionTab::SelectionTab(CMenuScreen::EState Type, const std::function<void(CM
if(criteria == _name) if(criteria == _name)
criteria = generalSortingBy; criteria = generalSortingBy;
new CAdventureMapButton("", CGI->generaltexth->zelp[107+i].second, boost::bind(&SelectionTab::sortBy, this, criteria), xpos[i], 86, names[i]); new CAdventureMapButton("", CGI->generaltexth->zelp[107+i].second, std::bind(&SelectionTab::sortBy, this, criteria), xpos[i], 86, names[i]);
} }
} }
} }
else else
{ {
//sort by buttons //sort by buttons
new CAdventureMapButton("", "", boost::bind(&SelectionTab::sortBy, this, _numOfMaps), 23, 86, "CamCusM.DEF"); //by num of maps new CAdventureMapButton("", "", std::bind(&SelectionTab::sortBy, this, _numOfMaps), 23, 86, "CamCusM.DEF"); //by num of maps
new CAdventureMapButton("", "", boost::bind(&SelectionTab::sortBy, this, _name), 55, 86, "CamCusL.DEF"); //by name new CAdventureMapButton("", "", std::bind(&SelectionTab::sortBy, this, _name), 55, 86, "CamCusL.DEF"); //by name
} }
slider = new CSlider(372, 86, tabType != CMenuScreen::saveGame ? 480 : 430, boost::bind(&SelectionTab::sliderMove, this, _1), positions, curItems.size(), 0, false, 1); slider = new CSlider(372, 86, tabType != CMenuScreen::saveGame ? 480 : 430, std::bind(&SelectionTab::sliderMove, this, _1), positions, curItems.size(), 0, false, 1);
slider->addUsedEvents(WHEEL); slider->addUsedEvents(WHEEL);
slider->slider->keepFrame = true; slider->slider->keepFrame = true;
format = CDefHandler::giveDef("SCSELC.DEF"); format = CDefHandler::giveDef("SCSELC.DEF");
@ -2242,7 +2242,7 @@ OptionsTab::OptionsTab():
pos = bg->pos; pos = bg->pos;
if(SEL->screenType == CMenuScreen::newGame) if(SEL->screenType == CMenuScreen::newGame)
turnDuration = new CSlider(55, 551, 194, boost::bind(&OptionsTab::setTurnLength, this, _1), 1, 11, 11, true, 1); turnDuration = new CSlider(55, 551, 194, std::bind(&OptionsTab::setTurnLength, this, _1), 1, 11, 11, true, 1);
} }
OptionsTab::~OptionsTab() OptionsTab::~OptionsTab()
@ -2546,12 +2546,12 @@ OptionsTab::PlayerOptionsEntry::PlayerOptionsEntry( OptionsTab *owner, PlayerSet
bg = new CPicture(BitmapHandler::loadBitmap(bgs[s.color.getNum()]), 0, 0, true); bg = new CPicture(BitmapHandler::loadBitmap(bgs[s.color.getNum()]), 0, 0, true);
if(SEL->screenType == CMenuScreen::newGame) if(SEL->screenType == CMenuScreen::newGame)
{ {
btns[0] = new CAdventureMapButton(CGI->generaltexth->zelp[132], boost::bind(&OptionsTab::nextCastle, owner, s.color, -1), 107, 5, "ADOPLFA.DEF"); btns[0] = new CAdventureMapButton(CGI->generaltexth->zelp[132], std::bind(&OptionsTab::nextCastle, owner, s.color, -1), 107, 5, "ADOPLFA.DEF");
btns[1] = new CAdventureMapButton(CGI->generaltexth->zelp[133], boost::bind(&OptionsTab::nextCastle, owner, s.color, +1), 168, 5, "ADOPRTA.DEF"); btns[1] = new CAdventureMapButton(CGI->generaltexth->zelp[133], std::bind(&OptionsTab::nextCastle, owner, s.color, +1), 168, 5, "ADOPRTA.DEF");
btns[2] = new CAdventureMapButton(CGI->generaltexth->zelp[148], boost::bind(&OptionsTab::nextHero, owner, s.color, -1), 183, 5, "ADOPLFA.DEF"); btns[2] = new CAdventureMapButton(CGI->generaltexth->zelp[148], std::bind(&OptionsTab::nextHero, owner, s.color, -1), 183, 5, "ADOPLFA.DEF");
btns[3] = new CAdventureMapButton(CGI->generaltexth->zelp[149], boost::bind(&OptionsTab::nextHero, owner, s.color, +1), 244, 5, "ADOPRTA.DEF"); btns[3] = new CAdventureMapButton(CGI->generaltexth->zelp[149], std::bind(&OptionsTab::nextHero, owner, s.color, +1), 244, 5, "ADOPRTA.DEF");
btns[4] = new CAdventureMapButton(CGI->generaltexth->zelp[164], boost::bind(&OptionsTab::nextBonus, owner, s.color, -1), 259, 5, "ADOPLFA.DEF"); btns[4] = new CAdventureMapButton(CGI->generaltexth->zelp[164], std::bind(&OptionsTab::nextBonus, owner, s.color, -1), 259, 5, "ADOPLFA.DEF");
btns[5] = new CAdventureMapButton(CGI->generaltexth->zelp[165], boost::bind(&OptionsTab::nextBonus, owner, s.color, +1), 320, 5, "ADOPRTA.DEF"); btns[5] = new CAdventureMapButton(CGI->generaltexth->zelp[165], std::bind(&OptionsTab::nextBonus, owner, s.color, +1), 320, 5, "ADOPRTA.DEF");
} }
else else
for(auto & elem : btns) for(auto & elem : btns)
@ -2573,7 +2573,7 @@ OptionsTab::PlayerOptionsEntry::PlayerOptionsEntry( OptionsTab *owner, PlayerSet
&& SEL->current->mapHeader->players[s.color.getNum()].canHumanPlay && SEL->current->mapHeader->players[s.color.getNum()].canHumanPlay
&& SEL->multiPlayer != CMenuScreen::MULTI_NETWORK_GUEST) && SEL->multiPlayer != CMenuScreen::MULTI_NETWORK_GUEST)
{ {
flag = new CAdventureMapButton(CGI->generaltexth->zelp[180], boost::bind(&OptionsTab::flagPressed, owner, s.color), -43, 2, flags[s.color.getNum()]); flag = new CAdventureMapButton(CGI->generaltexth->zelp[180], std::bind(&OptionsTab::flagPressed, owner, s.color), -43, 2, flags[s.color.getNum()]);
flag->hoverable = true; flag->hoverable = true;
} }
else else
@ -2980,7 +2980,7 @@ CScenarioInfo::CScenarioInfo(const CMapHeader *mapHeader, const StartInfo *start
card->changeSelection(current); card->changeSelection(current);
card->difficulty->select(startInfo->difficulty, 0); card->difficulty->select(startInfo->difficulty, 0);
back = new CAdventureMapButton("", CGI->generaltexth->zelp[105].second, boost::bind(&CGuiHandler::popIntTotally, &GH, this), 584, 535, "SCNRBACK.DEF", SDLK_ESCAPE); back = new CAdventureMapButton("", CGI->generaltexth->zelp[105].second, std::bind(&CGuiHandler::popIntTotally, &GH, this), 584, 535, "SCNRBACK.DEF", SDLK_ESCAPE);
} }
CScenarioInfo::~CScenarioInfo() CScenarioInfo::~CScenarioInfo()
@ -3059,10 +3059,10 @@ CMultiMode::CMultiMode()
txt = new CTextInput(Rect(19, 436, 334, 16), *bg); txt = new CTextInput(Rect(19, 436, 334, 16), *bg);
txt->setText(settings["general"]["playerName"].String()); //Player txt->setText(settings["general"]["playerName"].String()); //Player
btns[0] = new CAdventureMapButton(CGI->generaltexth->zelp[266], boost::bind(&CMultiMode::openHotseat, this), 373, 78, "MUBHOT.DEF"); btns[0] = new CAdventureMapButton(CGI->generaltexth->zelp[266], std::bind(&CMultiMode::openHotseat, this), 373, 78, "MUBHOT.DEF");
btns[1] = new CAdventureMapButton("Host TCP/IP game", "", boost::bind(&CMultiMode::hostTCP, this), 373, 78 + 57*1, "MUBHOST.DEF"); btns[1] = new CAdventureMapButton("Host TCP/IP game", "", std::bind(&CMultiMode::hostTCP, this), 373, 78 + 57*1, "MUBHOST.DEF");
btns[2] = new CAdventureMapButton("Join TCP/IP game", "", boost::bind(&CMultiMode::joinTCP, this), 373, 78 + 57*2, "MUBJOIN.DEF"); btns[2] = new CAdventureMapButton("Join TCP/IP game", "", std::bind(&CMultiMode::joinTCP, this), 373, 78 + 57*2, "MUBJOIN.DEF");
btns[6] = new CAdventureMapButton(CGI->generaltexth->zelp[288], boost::bind(&CGuiHandler::popIntTotally, boost::ref(GH), this), 373, 424, "MUBCANC.DEF", SDLK_ESCAPE); btns[6] = new CAdventureMapButton(CGI->generaltexth->zelp[288], std::bind(&CGuiHandler::popIntTotally, std::ref(GH), this), 373, 424, "MUBCANC.DEF", SDLK_ESCAPE);
} }
void CMultiMode::openHotseat() void CMultiMode::openHotseat()
@ -3099,11 +3099,11 @@ CHotSeatPlayers::CHotSeatPlayers(const std::string &firstPlayer)
for(int i = 0; i < ARRAY_COUNT(txt); i++) for(int i = 0; i < ARRAY_COUNT(txt); i++)
{ {
txt[i] = new CTextInput(Rect(60, 85 + i*30, 280, 16), *bg); txt[i] = new CTextInput(Rect(60, 85 + i*30, 280, 16), *bg);
txt[i]->cb += boost::bind(&CHotSeatPlayers::onChange, this, _1); txt[i]->cb += std::bind(&CHotSeatPlayers::onChange, this, _1);
} }
ok = new CAdventureMapButton(CGI->generaltexth->zelp[560], boost::bind(&CHotSeatPlayers::enterSelectionScreen, this), 95, 338, "MUBCHCK.DEF", SDLK_RETURN); ok = new CAdventureMapButton(CGI->generaltexth->zelp[560], std::bind(&CHotSeatPlayers::enterSelectionScreen, this), 95, 338, "MUBCHCK.DEF", SDLK_RETURN);
cancel = new CAdventureMapButton(CGI->generaltexth->zelp[561], boost::bind(&CGuiHandler::popIntTotally, boost::ref(GH), this), 205, 338, "MUBCANC.DEF", SDLK_ESCAPE); cancel = new CAdventureMapButton(CGI->generaltexth->zelp[561], std::bind(&CGuiHandler::popIntTotally, std::ref(GH), this), 205, 338, "MUBCANC.DEF", SDLK_ESCAPE);
bar = new CGStatusBar(new CPicture(Rect(7, 381, 348, 18), 0));//226, 472 bar = new CGStatusBar(new CPicture(Rect(7, 381, 348, 18), 0));//226, 472
txt[0]->setText(firstPlayer, true); txt[0]->setText(firstPlayer, true);
@ -3166,9 +3166,9 @@ void CBonusSelection::init()
blitAt(panel, 456, 6, background); blitAt(panel, 456, 6, background);
startB = new CAdventureMapButton("", "", boost::bind(&CBonusSelection::startMap, this), 475, 536, "CBBEGIB.DEF", SDLK_RETURN); startB = new CAdventureMapButton("", "", std::bind(&CBonusSelection::startMap, this), 475, 536, "CBBEGIB.DEF", SDLK_RETURN);
restartB = new CAdventureMapButton("", "", boost::bind(&CBonusSelection::restartMap, this), 475, 536, "CBRESTB.DEF", SDLK_RETURN); restartB = new CAdventureMapButton("", "", std::bind(&CBonusSelection::restartMap, this), 475, 536, "CBRESTB.DEF", SDLK_RETURN);
backB = new CAdventureMapButton("", "", boost::bind(&CBonusSelection::goBack, this), 624, 536, "CBCANCB.DEF", SDLK_ESCAPE); backB = new CAdventureMapButton("", "", std::bind(&CBonusSelection::goBack, this), 624, 536, "CBCANCB.DEF", SDLK_ESCAPE);
//campaign name //campaign name
if (ourCampaign->camp->header.name.length()) if (ourCampaign->camp->header.name.length())
@ -3241,8 +3241,8 @@ void CBonusSelection::init()
//difficulty selection buttons //difficulty selection buttons
if (ourCampaign->camp->header.difficultyChoosenByPlayer) if (ourCampaign->camp->header.difficultyChoosenByPlayer)
{ {
diffLb = new CAdventureMapButton("", "", boost::bind(&CBonusSelection::decreaseDifficulty, this), 694, 508, "SCNRBLF.DEF"); diffLb = new CAdventureMapButton("", "", std::bind(&CBonusSelection::decreaseDifficulty, this), 694, 508, "SCNRBLF.DEF");
diffRb = new CAdventureMapButton("", "", boost::bind(&CBonusSelection::increaseDifficulty, this), 738, 508, "SCNRBRT.DEF"); diffRb = new CAdventureMapButton("", "", std::bind(&CBonusSelection::increaseDifficulty, this), 738, 508, "SCNRBRT.DEF");
} }
//load miniflags //load miniflags
@ -3637,7 +3637,7 @@ void CBonusSelection::startMap()
auto exitCb = [=]() auto exitCb = [=]()
{ {
logGlobal->infoStream() << "Starting scenario " << selectedMap; logGlobal->infoStream() << "Starting scenario " << selectedMap;
CGP->showLoadingScreen(boost::bind(&startGame, si, (CConnection *)nullptr)); CGP->showLoadingScreen(std::bind(&startGame, si, (CConnection *)nullptr));
}; };
const CCampaignScenario & scenario = ourCampaign->camp->scenarios[selectedMap]; const CCampaignScenario & scenario = ourCampaign->camp->scenarios[selectedMap];
@ -4017,7 +4017,7 @@ void StartWithCurrentSettings::apply(CSelectionScreen *selScreen)
vstd::clear_pointer(selScreen->serverHandlingThread); //detach us vstd::clear_pointer(selScreen->serverHandlingThread); //detach us
saveGameName.clear(); saveGameName.clear();
CGP->showLoadingScreen(boost::bind(&startGame, startingInfo.sInfo, startingInfo.serv)); CGP->showLoadingScreen(std::bind(&startGame, startingInfo.sInfo, startingInfo.serv));
throw 666; //EVIL, EVIL, EVIL workaround to kill thread (does "goto catch" outside listening loop) throw 666; //EVIL, EVIL, EVIL workaround to kill thread (does "goto catch" outside listening loop)
} }
@ -4097,7 +4097,7 @@ CAdventureMapButton* CCampaignScreen::createExitButton(const JsonNode& button)
if (!button["help"].isNull() && button["help"].Float() > 0) if (!button["help"].isNull() && button["help"].Float() > 0)
help = CGI->generaltexth->zelp[button["help"].Float()]; help = CGI->generaltexth->zelp[button["help"].Float()];
std::function<void()> close = boost::bind(&CGuiHandler::popIntTotally, &GH, this); std::function<void()> close = std::bind(&CGuiHandler::popIntTotally, &GH, this);
return new CAdventureMapButton(help, close, button["x"].Float(), button["y"].Float(), button["name"].String(), button["hotkey"].Float()); return new CAdventureMapButton(help, close, button["x"].Float(), button["y"].Float(), button["name"].String(), button["hotkey"].Float());
} }
@ -4233,14 +4233,14 @@ CSimpleJoinScreen::CSimpleJoinScreen()
title = new CTextBox("Enter address:", boxRect, 0, FONT_BIG, CENTER, Colors::WHITE); title = new CTextBox("Enter address:", boxRect, 0, FONT_BIG, CENTER, Colors::WHITE);
address = new CTextInput(Rect(25, 68, 175, 16), *bg); address = new CTextInput(Rect(25, 68, 175, 16), *bg);
address->cb += boost::bind(&CSimpleJoinScreen::onChange, this, _1); address->cb += std::bind(&CSimpleJoinScreen::onChange, this, _1);
port = new CTextInput(Rect(25, 115, 175, 16), *bg); port = new CTextInput(Rect(25, 115, 175, 16), *bg);
port->cb += boost::bind(&CSimpleJoinScreen::onChange, this, _1); port->cb += std::bind(&CSimpleJoinScreen::onChange, this, _1);
port->filters.add(boost::bind(&CTextInput::numberFilter, _1, _2, 0, 65535)); port->filters.add(std::bind(&CTextInput::numberFilter, _1, _2, 0, 65535));
ok = new CAdventureMapButton(CGI->generaltexth->zelp[560], boost::bind(&CSimpleJoinScreen::enterSelectionScreen, this), 26, 142, "MUBCHCK.DEF", SDLK_RETURN); ok = new CAdventureMapButton(CGI->generaltexth->zelp[560], std::bind(&CSimpleJoinScreen::enterSelectionScreen, this), 26, 142, "MUBCHCK.DEF", SDLK_RETURN);
cancel = new CAdventureMapButton(CGI->generaltexth->zelp[561], boost::bind(&CGuiHandler::popIntTotally, boost::ref(GH), this), 142, 142, "MUBCANC.DEF", SDLK_ESCAPE); cancel = new CAdventureMapButton(CGI->generaltexth->zelp[561], std::bind(&CGuiHandler::popIntTotally, std::ref(GH), this), 142, 142, "MUBCANC.DEF", SDLK_ESCAPE);
bar = new CGStatusBar(new CPicture(Rect(7, 186, 218, 18), 0)); bar = new CGStatusBar(new CPicture(Rect(7, 186, 218, 18), 0));
port->setText(boost::lexical_cast<std::string>(settings["server"]["port"].Float()), true); port->setText(boost::lexical_cast<std::string>(settings["server"]["port"].Float()), true);

View File

@ -89,7 +89,7 @@ void CQuestMinimap::addQuestMarks (const QuestInfo * q)
CQuestIcon * pic = new CQuestIcon ("VwSymbol.def", 3, x, y); CQuestIcon * pic = new CQuestIcon ("VwSymbol.def", 3, x, y);
pic->moveBy (Point ( -pic->pos.w/2, -pic->pos.h/2)); pic->moveBy (Point ( -pic->pos.w/2, -pic->pos.h/2));
pic->callback = boost::bind (&CQuestMinimap::iconClicked, this); pic->callback = std::bind (&CQuestMinimap::iconClicked, this);
icons.push_back(pic); icons.push_back(pic);
} }
@ -130,10 +130,10 @@ void CQuestLog::init()
{ {
minimap = new CQuestMinimap (Rect (47, 33, 144, 144)); minimap = new CQuestMinimap (Rect (47, 33, 144, 144));
description = new CTextBox ("", Rect(245, 33, 350, 355), 1, FONT_MEDIUM, TOPLEFT, Colors::WHITE); description = new CTextBox ("", Rect(245, 33, 350, 355), 1, FONT_MEDIUM, TOPLEFT, Colors::WHITE);
ok = new CAdventureMapButton("",CGI->generaltexth->zelp[445].second, boost::bind(&CQuestLog::close,this), 547, 401, "IOKAY.DEF", SDLK_RETURN); ok = new CAdventureMapButton("",CGI->generaltexth->zelp[445].second, std::bind(&CQuestLog::close,this), 547, 401, "IOKAY.DEF", SDLK_RETURN);
if (quests.size() > QUEST_COUNT) if (quests.size() > QUEST_COUNT)
slider = new CSlider(203, 199, 230, boost::bind (&CQuestLog::sliderMoved, this, _1), QUEST_COUNT, quests.size(), false, 0); slider = new CSlider(203, 199, 230, std::bind (&CQuestLog::sliderMoved, this, _1), QUEST_COUNT, quests.size(), false, 0);
for (int i = 0; i < quests.size(); ++i) for (int i = 0; i < quests.size(); ++i)
{ {
@ -142,7 +142,7 @@ void CQuestLog::init()
if (quests[i].obj) if (quests[i].obj)
text.addReplacement (quests[i].obj->getObjectName()); //get name of the object text.addReplacement (quests[i].obj->getObjectName()); //get name of the object
CQuestLabel * label = new CQuestLabel (Rect(28, 199 + i * 24, 172,30), FONT_SMALL, TOPLEFT, Colors::WHITE, text.toString()); CQuestLabel * label = new CQuestLabel (Rect(28, 199 + i * 24, 172,30), FONT_SMALL, TOPLEFT, Colors::WHITE, text.toString());
label->callback = boost::bind(&CQuestLog::selectQuest, this, i); label->callback = std::bind(&CQuestLog::selectQuest, this, i);
labels.push_back(label); labels.push_back(label);
} }

View File

@ -160,29 +160,29 @@ CSpellWindow::CSpellWindow(const SDL_Rect &, const CGHeroInstance * _myHero, CPl
statusBar = new CGStatusBar(7 + pos.x, 569 + pos.y, "Spelroll.bmp"); statusBar = new CGStatusBar(7 + pos.x, 569 + pos.y, "Spelroll.bmp");
SDL_Rect temp_rect = genRect(45, 35, 479 + pos.x, 405 + pos.y); SDL_Rect temp_rect = genRect(45, 35, 479 + pos.x, 405 + pos.y);
exitBtn = new SpellbookInteractiveArea(temp_rect, boost::bind(&CSpellWindow::fexitb, this), CGI->generaltexth->zelp[460].second, boost::bind(&CGStatusBar::setText, statusBar, (CGI->generaltexth->zelp[460].first)), boost::bind(&CGStatusBar::clear, statusBar), myInt); exitBtn = new SpellbookInteractiveArea(temp_rect, std::bind(&CSpellWindow::fexitb, this), CGI->generaltexth->zelp[460].second, std::bind(&CGStatusBar::setText, statusBar, (CGI->generaltexth->zelp[460].first)), std::bind(&CGStatusBar::clear, statusBar), myInt);
temp_rect = genRect(45, 35, 221 + pos.x, 405 + pos.y); temp_rect = genRect(45, 35, 221 + pos.x, 405 + pos.y);
battleSpells = new SpellbookInteractiveArea(temp_rect, boost::bind(&CSpellWindow::fbattleSpellsb, this), CGI->generaltexth->zelp[453].second, boost::bind(&CGStatusBar::setText, statusBar, (CGI->generaltexth->zelp[453].first)), boost::bind(&CGStatusBar::clear, statusBar), myInt); battleSpells = new SpellbookInteractiveArea(temp_rect, std::bind(&CSpellWindow::fbattleSpellsb, this), CGI->generaltexth->zelp[453].second, std::bind(&CGStatusBar::setText, statusBar, (CGI->generaltexth->zelp[453].first)), std::bind(&CGStatusBar::clear, statusBar), myInt);
temp_rect = genRect(45, 35, 355 + pos.x, 405 + pos.y); temp_rect = genRect(45, 35, 355 + pos.x, 405 + pos.y);
adventureSpells = new SpellbookInteractiveArea(temp_rect, boost::bind(&CSpellWindow::fadvSpellsb, this), CGI->generaltexth->zelp[452].second, boost::bind(&CGStatusBar::setText, statusBar, (CGI->generaltexth->zelp[452].first)), boost::bind(&CGStatusBar::clear, statusBar), myInt); adventureSpells = new SpellbookInteractiveArea(temp_rect, std::bind(&CSpellWindow::fadvSpellsb, this), CGI->generaltexth->zelp[452].second, std::bind(&CGStatusBar::setText, statusBar, (CGI->generaltexth->zelp[452].first)), std::bind(&CGStatusBar::clear, statusBar), myInt);
temp_rect = genRect(45, 35, 418 + pos.x, 405 + pos.y); temp_rect = genRect(45, 35, 418 + pos.x, 405 + pos.y);
manaPoints = new SpellbookInteractiveArea(temp_rect, boost::bind(&CSpellWindow::fmanaPtsb, this), CGI->generaltexth->zelp[459].second, boost::bind(&CGStatusBar::setText, statusBar, (CGI->generaltexth->zelp[459].first)), boost::bind(&CGStatusBar::clear, statusBar), myInt); manaPoints = new SpellbookInteractiveArea(temp_rect, std::bind(&CSpellWindow::fmanaPtsb, this), CGI->generaltexth->zelp[459].second, std::bind(&CGStatusBar::setText, statusBar, (CGI->generaltexth->zelp[459].first)), std::bind(&CGStatusBar::clear, statusBar), myInt);
temp_rect = genRect(36, 56, 549 + pos.x, 94 + pos.y); temp_rect = genRect(36, 56, 549 + pos.x, 94 + pos.y);
selectSpellsA = new SpellbookInteractiveArea(temp_rect, boost::bind(&CSpellWindow::selectSchool, this, 0), CGI->generaltexth->zelp[454].second, boost::bind(&CGStatusBar::setText, statusBar, (CGI->generaltexth->zelp[454].first)), boost::bind(&CGStatusBar::clear, statusBar), myInt); selectSpellsA = new SpellbookInteractiveArea(temp_rect, std::bind(&CSpellWindow::selectSchool, this, 0), CGI->generaltexth->zelp[454].second, std::bind(&CGStatusBar::setText, statusBar, (CGI->generaltexth->zelp[454].first)), std::bind(&CGStatusBar::clear, statusBar), myInt);
temp_rect = genRect(36, 56, 549 + pos.x, 151 + pos.y); temp_rect = genRect(36, 56, 549 + pos.x, 151 + pos.y);
selectSpellsE = new SpellbookInteractiveArea(temp_rect, boost::bind(&CSpellWindow::selectSchool, this, 3), CGI->generaltexth->zelp[457].second, boost::bind(&CGStatusBar::setText, statusBar, (CGI->generaltexth->zelp[457].first)), boost::bind(&CGStatusBar::clear, statusBar), myInt); selectSpellsE = new SpellbookInteractiveArea(temp_rect, std::bind(&CSpellWindow::selectSchool, this, 3), CGI->generaltexth->zelp[457].second, std::bind(&CGStatusBar::setText, statusBar, (CGI->generaltexth->zelp[457].first)), std::bind(&CGStatusBar::clear, statusBar), myInt);
temp_rect = genRect(36, 56, 549 + pos.x, 210 + pos.y); temp_rect = genRect(36, 56, 549 + pos.x, 210 + pos.y);
selectSpellsF = new SpellbookInteractiveArea(temp_rect, boost::bind(&CSpellWindow::selectSchool, this, 1), CGI->generaltexth->zelp[455].second, boost::bind(&CGStatusBar::setText, statusBar, (CGI->generaltexth->zelp[455].first)), boost::bind(&CGStatusBar::clear, statusBar), myInt); selectSpellsF = new SpellbookInteractiveArea(temp_rect, std::bind(&CSpellWindow::selectSchool, this, 1), CGI->generaltexth->zelp[455].second, std::bind(&CGStatusBar::setText, statusBar, (CGI->generaltexth->zelp[455].first)), std::bind(&CGStatusBar::clear, statusBar), myInt);
temp_rect = genRect(36, 56, 549 + pos.x, 270 + pos.y); temp_rect = genRect(36, 56, 549 + pos.x, 270 + pos.y);
selectSpellsW = new SpellbookInteractiveArea(temp_rect, boost::bind(&CSpellWindow::selectSchool, this, 2), CGI->generaltexth->zelp[456].second, boost::bind(&CGStatusBar::setText, statusBar, (CGI->generaltexth->zelp[456].first)), boost::bind(&CGStatusBar::clear, statusBar), myInt); selectSpellsW = new SpellbookInteractiveArea(temp_rect, std::bind(&CSpellWindow::selectSchool, this, 2), CGI->generaltexth->zelp[456].second, std::bind(&CGStatusBar::setText, statusBar, (CGI->generaltexth->zelp[456].first)), std::bind(&CGStatusBar::clear, statusBar), myInt);
temp_rect = genRect(36, 56, 549 + pos.x, 330 + pos.y); temp_rect = genRect(36, 56, 549 + pos.x, 330 + pos.y);
selectSpellsAll = new SpellbookInteractiveArea(temp_rect, boost::bind(&CSpellWindow::selectSchool, this, 4), CGI->generaltexth->zelp[458].second, boost::bind(&CGStatusBar::setText, statusBar, (CGI->generaltexth->zelp[458].first)), boost::bind(&CGStatusBar::clear, statusBar), myInt); selectSpellsAll = new SpellbookInteractiveArea(temp_rect, std::bind(&CSpellWindow::selectSchool, this, 4), CGI->generaltexth->zelp[458].second, std::bind(&CGStatusBar::setText, statusBar, (CGI->generaltexth->zelp[458].first)), std::bind(&CGStatusBar::clear, statusBar), myInt);
temp_rect = genRect(leftCorner->h, leftCorner->w, 97 + pos.x, 77 + pos.y); temp_rect = genRect(leftCorner->h, leftCorner->w, 97 + pos.x, 77 + pos.y);
lCorner = new SpellbookInteractiveArea(temp_rect, boost::bind(&CSpellWindow::fLcornerb, this), CGI->generaltexth->zelp[450].second, boost::bind(&CGStatusBar::setText, statusBar, (CGI->generaltexth->zelp[450].first)), boost::bind(&CGStatusBar::clear, statusBar), myInt); lCorner = new SpellbookInteractiveArea(temp_rect, std::bind(&CSpellWindow::fLcornerb, this), CGI->generaltexth->zelp[450].second, std::bind(&CGStatusBar::setText, statusBar, (CGI->generaltexth->zelp[450].first)), std::bind(&CGStatusBar::clear, statusBar), myInt);
temp_rect = genRect(rightCorner->h, rightCorner->w, 487 + pos.x, 72 + pos.y); temp_rect = genRect(rightCorner->h, rightCorner->w, 487 + pos.x, 72 + pos.y);
rCorner = new SpellbookInteractiveArea(temp_rect, boost::bind(&CSpellWindow::fRcornerb, this), CGI->generaltexth->zelp[451].second, boost::bind(&CGStatusBar::setText, statusBar, (CGI->generaltexth->zelp[451].first)), boost::bind(&CGStatusBar::clear, statusBar), myInt); rCorner = new SpellbookInteractiveArea(temp_rect, std::bind(&CSpellWindow::fRcornerb, this), CGI->generaltexth->zelp[451].second, std::bind(&CGStatusBar::setText, statusBar, (CGI->generaltexth->zelp[451].first)), std::bind(&CGStatusBar::clear, statusBar), myInt);
//areas for spells //areas for spells
int xpos = 117 + pos.x, ypos = 90 + pos.y; int xpos = 117 + pos.x, ypos = 90 + pos.y;
@ -782,7 +782,7 @@ void CSpellWindow::SpellArea::clickLeft(tribool down, bool previousState)
GH.pushInt (new CObjectListWindow(availableTowns, GH.pushInt (new CObjectListWindow(availableTowns,
new CAnimImage("SPELLSCR",spell), new CAnimImage("SPELLSCR",spell),
CGI->generaltexth->jktexts[40], CGI->generaltexth->jktexts[41], CGI->generaltexth->jktexts[40], CGI->generaltexth->jktexts[41],
boost::bind (&CSpellWindow::teleportTo, owner, _1, h))); std::bind (&CSpellWindow::teleportTo, owner, _1, h)));
} }
return; return;
} }

View File

@ -374,7 +374,7 @@ void CGarrisonSlot::clickLeft(tribool down, bool previousState)
int countLeft = owner->getSelection()->myStack ? owner->getSelection()->myStack->count : 0; int countLeft = owner->getSelection()->myStack ? owner->getSelection()->myStack->count : 0;
int countRight = myStack ? myStack->count : 0; int countRight = myStack ? myStack->count : 0;
GH.pushInt(new CSplitWindow(owner->getSelection()->creature, boost::bind(&CGarrisonInt::splitStacks, owner, _1, _2), GH.pushInt(new CSplitWindow(owner->getSelection()->creature, std::bind(&CGarrisonInt::splitStacks, owner, _1, _2),
minLeft, minRight, countLeft, countRight)); minLeft, minRight, countLeft, countRight));
refr = true; refr = true;
} }
@ -656,7 +656,7 @@ CInfoWindow::CInfoWindow(std::string Text, PlayerColor player, const TCompsInfo
ID = QueryID(-1); ID = QueryID(-1);
for(auto & Button : Buttons) for(auto & Button : Buttons)
{ {
CAdventureMapButton *button = new CAdventureMapButton("","",boost::bind(&CInfoWindow::close,this),0,0,Button.first); CAdventureMapButton *button = new CAdventureMapButton("","",std::bind(&CInfoWindow::close,this),0,0,Button.first);
button->borderColor = Colors::METALLIC_GOLD; button->borderColor = Colors::METALLIC_GOLD;
button->borderEnabled = true; button->borderEnabled = true;
button->callback.add(Button.second); //each button will close the window apart from call-defined actions button->callback.add(Button.second); //each button will close the window apart from call-defined actions
@ -741,7 +741,7 @@ void CInfoWindow::showYesNoDialog(const std::string & text, const std::vector<CC
GH.pushInt(temp); GH.pushInt(temp);
} }
void CInfoWindow::showOkDialog(const std::string & text, const std::vector<CComponent*> *components, const boost::function<void()> & onOk, bool delComps, PlayerColor player) void CInfoWindow::showOkDialog(const std::string & text, const std::vector<CComponent*> *components, const std::function<void()> & onOk, bool delComps, PlayerColor player)
{ {
std::vector<std::pair<std::string,CFunctionList<void()> > > pom; std::vector<std::pair<std::string,CFunctionList<void()> > > pom;
pom.push_back(std::pair<std::string,CFunctionList<void()> >("IOKAY.DEF",0)); pom.push_back(std::pair<std::string,CFunctionList<void()> >("IOKAY.DEF",0));
@ -1269,7 +1269,7 @@ CComponentBox::CComponentBox(std::vector<CSelectableComponent *> _components, Re
int key = SDLK_1; int key = SDLK_1;
for(auto & comp : _components) for(auto & comp : _components)
{ {
comp->onSelect = boost::bind(&CComponentBox::selectionChanged, this, comp); comp->onSelect = std::bind(&CComponentBox::selectionChanged, this, comp);
comp->assignedKeys.insert(key++); comp->assignedKeys.insert(key++);
} }
selectionChanged(_components.front()); selectionChanged(_components.front());
@ -1295,8 +1295,8 @@ CSelWindow::CSelWindow(const std::string &Text, PlayerColor player, int charperl
{ {
buttons.push_back(new CAdventureMapButton("","",Buttons[i].second,0,0,Buttons[i].first)); buttons.push_back(new CAdventureMapButton("","",Buttons[i].second,0,0,Buttons[i].first));
if(!i && askID.getNum() >= 0) if(!i && askID.getNum() >= 0)
buttons.back()->callback += boost::bind(&CSelWindow::madeChoice,this); buttons.back()->callback += std::bind(&CSelWindow::madeChoice,this);
buttons[i]->callback += boost::bind(&CInfoWindow::close,this); //each button will close the window apart from call-defined actions buttons[i]->callback += std::bind(&CInfoWindow::close,this); //each button will close the window apart from call-defined actions
} }
text = new CTextBox(Text, Rect(0, 0, 250, 100), 0, FONT_MEDIUM, CENTER, Colors::WHITE); text = new CTextBox(Text, Rect(0, 0, 250, 100), 0, FONT_MEDIUM, CENTER, Colors::WHITE);
@ -1305,14 +1305,14 @@ CSelWindow::CSelWindow(const std::string &Text, PlayerColor player, int charperl
buttons.back()->assignedKeys.insert(SDLK_ESCAPE); //last button - reacts on escape buttons.back()->assignedKeys.insert(SDLK_ESCAPE); //last button - reacts on escape
if(buttons.size() > 1 && askID.getNum() >= 0) //cancel button functionality if(buttons.size() > 1 && askID.getNum() >= 0) //cancel button functionality
buttons.back()->callback += boost::bind(&CCallback::selectionMade,LOCPLINT->cb.get(),0,askID); buttons.back()->callback += std::bind(&CCallback::selectionMade,LOCPLINT->cb.get(),0,askID);
for(int i=0;i<comps.size();i++) for(int i=0;i<comps.size();i++)
{ {
comps[i]->recActions = 255; comps[i]->recActions = 255;
addChild(comps[i]); addChild(comps[i]);
components.push_back(comps[i]); components.push_back(comps[i]);
comps[i]->onSelect = boost::bind(&CSelWindow::selectionChange,this,i); comps[i]->onSelect = std::bind(&CSelWindow::selectionChange,this,i);
if(i<9) if(i<9)
comps[i]->assignedKeys.insert(SDLK_1+i); comps[i]->assignedKeys.insert(SDLK_1+i);
} }
@ -1549,11 +1549,11 @@ CRecruitmentWindow::CRecruitmentWindow(const CGDwelling *Dwelling, int Level, co
new CGStatusBar(new CPicture(*background, Rect(8, pos.h - 26, pos.w - 16, 19), 8, pos.h - 26)); new CGStatusBar(new CPicture(*background, Rect(8, pos.h - 26, pos.w - 16, 19), 8, pos.h - 26));
slider = new CSlider(176,279,135,nullptr,0,0,0,true); slider = new CSlider(176,279,135,nullptr,0,0,0,true);
slider->moved = boost::bind(&CRecruitmentWindow::sliderMoved,this, _1); slider->moved = std::bind(&CRecruitmentWindow::sliderMoved,this, _1);
maxButton = new CAdventureMapButton(CGI->generaltexth->zelp[553],boost::bind(&CSlider::moveToMax,slider),134,313,"IRCBTNS.DEF",SDLK_m); maxButton = new CAdventureMapButton(CGI->generaltexth->zelp[553],std::bind(&CSlider::moveToMax,slider),134,313,"IRCBTNS.DEF",SDLK_m);
buyButton = new CAdventureMapButton(CGI->generaltexth->zelp[554],boost::bind(&CRecruitmentWindow::buy,this),212,313,"IBY6432.DEF",SDLK_RETURN); buyButton = new CAdventureMapButton(CGI->generaltexth->zelp[554],std::bind(&CRecruitmentWindow::buy,this),212,313,"IBY6432.DEF",SDLK_RETURN);
cancelButton = new CAdventureMapButton(CGI->generaltexth->zelp[555],boost::bind(&CRecruitmentWindow::close,this),290,313,"ICN6432.DEF",SDLK_ESCAPE); cancelButton = new CAdventureMapButton(CGI->generaltexth->zelp[555],std::bind(&CRecruitmentWindow::close,this),290,313,"ICN6432.DEF",SDLK_ESCAPE);
title = new CLabel(243, 32, FONT_BIG, CENTER, Colors::YELLOW); title = new CLabel(243, 32, FONT_BIG, CENTER, Colors::YELLOW);
availableValue = new CLabel(205, 253, FONT_SMALL, CENTER, Colors::WHITE); availableValue = new CLabel(205, 253, FONT_SMALL, CENTER, Colors::WHITE);
@ -1662,17 +1662,17 @@ CSplitWindow::CSplitWindow(const CCreature * creature, std::function<void(int, i
int leftMax = total - rightMin; int leftMax = total - rightMin;
int rightMax = total - leftMin; int rightMax = total - leftMin;
ok = new CAdventureMapButton("", "", boost::bind(&CSplitWindow::apply, this), 20, 263, "IOK6432", SDLK_RETURN); ok = new CAdventureMapButton("", "", std::bind(&CSplitWindow::apply, this), 20, 263, "IOK6432", SDLK_RETURN);
cancel = new CAdventureMapButton("", "", boost::bind(&CSplitWindow::close, this), 214, 263, "ICN6432", SDLK_ESCAPE); cancel = new CAdventureMapButton("", "", std::bind(&CSplitWindow::close, this), 214, 263, "ICN6432", SDLK_ESCAPE);
int sliderPositions = total - leftMin - rightMin; int sliderPositions = total - leftMin - rightMin;
leftInput = new CTextInput(Rect(20, 218, 100, 36), FONT_BIG, boost::bind(&CSplitWindow::setAmountText, this, _1, true)); leftInput = new CTextInput(Rect(20, 218, 100, 36), FONT_BIG, std::bind(&CSplitWindow::setAmountText, this, _1, true));
rightInput = new CTextInput(Rect(176, 218, 100, 36), FONT_BIG, boost::bind(&CSplitWindow::setAmountText, this, _1, false)); rightInput = new CTextInput(Rect(176, 218, 100, 36), FONT_BIG, std::bind(&CSplitWindow::setAmountText, this, _1, false));
//add filters to allow only number input //add filters to allow only number input
leftInput->filters.add(boost::bind(&CTextInput::numberFilter, _1, _2, leftMin, leftMax)); leftInput->filters.add(std::bind(&CTextInput::numberFilter, _1, _2, leftMin, leftMax));
rightInput->filters.add(boost::bind(&CTextInput::numberFilter, _1, _2, rightMin, rightMax)); rightInput->filters.add(std::bind(&CTextInput::numberFilter, _1, _2, rightMin, rightMax));
leftInput->setText(boost::lexical_cast<std::string>(leftAmount), false); leftInput->setText(boost::lexical_cast<std::string>(leftAmount), false);
rightInput->setText(boost::lexical_cast<std::string>(rightAmount), false); rightInput->setText(boost::lexical_cast<std::string>(rightAmount), false);
@ -1680,7 +1680,7 @@ CSplitWindow::CSplitWindow(const CCreature * creature, std::function<void(int, i
animLeft = new CCreaturePic(20, 54, creature, true, false); animLeft = new CCreaturePic(20, 54, creature, true, false);
animRight = new CCreaturePic(177, 54,creature, true, false); animRight = new CCreaturePic(177, 54,creature, true, false);
slider = new CSlider(21, 194, 257, boost::bind(&CSplitWindow::sliderMoved, this, _1), 0, sliderPositions, rightAmount - rightMin, true); slider = new CSlider(21, 194, 257, std::bind(&CSplitWindow::sliderMoved, this, _1), 0, sliderPositions, rightAmount - rightMin, true);
std::string title = CGI->generaltexth->allTexts[256]; std::string title = CGI->generaltexth->allTexts[256];
boost::algorithm::replace_first(title,"%s", creature->namePl); boost::algorithm::replace_first(title,"%s", creature->namePl);
@ -1729,7 +1729,7 @@ CLevelWindow::CLevelWindow(const CGHeroInstance *hero, PrimarySkill::PrimarySkil
LOCPLINT->showingDialog->setn(true); LOCPLINT->showingDialog->setn(true);
new CAnimImage("PortraitsLarge", hero->portrait, 0, 170, 66); new CAnimImage("PortraitsLarge", hero->portrait, 0, 170, 66);
new CAdventureMapButton("", "", boost::bind(&CLevelWindow::close, this), 297, 413, "IOKAY", SDLK_RETURN); new CAdventureMapButton("", "", std::bind(&CLevelWindow::close, this), 297, 413, "IOKAY", SDLK_RETURN);
//%s has gained a level. //%s has gained a level.
new CLabel(192, 33, FONT_MEDIUM, CENTER, Colors::WHITE, new CLabel(192, 33, FONT_MEDIUM, CENTER, Colors::WHITE,
@ -1874,9 +1874,9 @@ void CObjectListWindow::init(CIntObject * titlePic, std::string _title, std::str
title = new CLabel(152, 27, FONT_BIG, CENTER, Colors::YELLOW, _title); title = new CLabel(152, 27, FONT_BIG, CENTER, Colors::YELLOW, _title);
descr = new CLabel(145, 133, FONT_SMALL, CENTER, Colors::WHITE, _descr); descr = new CLabel(145, 133, FONT_SMALL, CENTER, Colors::WHITE, _descr);
ok = new CAdventureMapButton("","",boost::bind(&CObjectListWindow::elementSelected, this),15,402,"IOKAY.DEF", SDLK_RETURN); ok = new CAdventureMapButton("","",std::bind(&CObjectListWindow::elementSelected, this),15,402,"IOKAY.DEF", SDLK_RETURN);
ok->block(true); ok->block(true);
exit = new CAdventureMapButton("","",boost::bind(&CGuiHandler::popIntTotally,&GH, this),228,402,"ICANCEL.DEF",SDLK_ESCAPE); exit = new CAdventureMapButton("","",std::bind(&CGuiHandler::popIntTotally,&GH, this),228,402,"ICANCEL.DEF",SDLK_ESCAPE);
if (titlePic) if (titlePic)
{ {
@ -1886,7 +1886,7 @@ void CObjectListWindow::init(CIntObject * titlePic, std::string _title, std::str
titleImage->pos.x = pos.w/2 + pos.x - titleImage->pos.w/2; titleImage->pos.x = pos.w/2 + pos.x - titleImage->pos.w/2;
titleImage->pos.y =75 + pos.y - titleImage->pos.h/2; titleImage->pos.y =75 + pos.y - titleImage->pos.h/2;
} }
list = new CListBox(boost::bind(&CObjectListWindow::genItem, this, _1), CListBox::DestroyFunc(), list = new CListBox(std::bind(&CObjectListWindow::genItem, this, _1), CListBox::DestroyFunc(),
Point(14, 151), Point(0, 25), 9, items.size(), 0, 1, Rect(262, -32, 256, 256) ); Point(14, 151), Point(0, 25), 9, items.size(), 0, 1, Rect(262, -32, 256, 256) );
list->type |= REDRAW_PARENT; list->type |= REDRAW_PARENT;
} }
@ -2324,7 +2324,7 @@ void CTradeWindow::initItems(bool Left)
artSets.push_back(arts); artSets.push_back(arts);
if(mode == EMarketMode::ARTIFACT_RESOURCE) if(mode == EMarketMode::ARTIFACT_RESOURCE)
arts->highlightModeCallback = boost::bind(&CTradeWindow::artifactSelected, this, _1); arts->highlightModeCallback = std::bind(&CTradeWindow::artifactSelected, this, _1);
return; return;
} }
@ -2623,16 +2623,16 @@ CMarketplaceWindow::CMarketplaceWindow(const IMarket *Market, const CGHeroInstan
initItems(false); initItems(false);
initItems(true); initItems(true);
ok = new CAdventureMapButton(CGI->generaltexth->zelp[600],boost::bind(&CGuiHandler::popIntTotally,&GH,this),516,520,"IOK6432.DEF",SDLK_RETURN); ok = new CAdventureMapButton(CGI->generaltexth->zelp[600],std::bind(&CGuiHandler::popIntTotally,&GH,this),516,520,"IOK6432.DEF",SDLK_RETURN);
ok->assignedKeys.insert(SDLK_ESCAPE); ok->assignedKeys.insert(SDLK_ESCAPE);
deal = new CAdventureMapButton(CGI->generaltexth->zelp[595],boost::bind(&CMarketplaceWindow::makeDeal,this),307,520,"TPMRKB.DEF"); deal = new CAdventureMapButton(CGI->generaltexth->zelp[595],std::bind(&CMarketplaceWindow::makeDeal,this),307,520,"TPMRKB.DEF");
deal->block(true); deal->block(true);
if(sliderNeeded) if(sliderNeeded)
{ {
slider = new CSlider(231,490,137,nullptr,0,0); slider = new CSlider(231,490,137,nullptr,0,0);
slider->moved = boost::bind(&CMarketplaceWindow::sliderMoved,this,_1); slider->moved = std::bind(&CMarketplaceWindow::sliderMoved,this,_1);
max = new CAdventureMapButton(CGI->generaltexth->zelp[596],boost::bind(&CMarketplaceWindow::setMax,this),229,520,"IRCBTNS.DEF"); max = new CAdventureMapButton(CGI->generaltexth->zelp[596],std::bind(&CMarketplaceWindow::setMax,this),229,520,"IRCBTNS.DEF");
max->block(true); max->block(true);
} }
else else
@ -2685,15 +2685,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 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)) if(printButtonFor(EMarketMode::RESOURCE_PLAYER))
new CAdventureMapButton(CGI->generaltexth->zelp[612],boost::bind(&CMarketplaceWindow::setMode,this, EMarketMode::RESOURCE_PLAYER), 18, 520,"TPMRKBU1.DEF"); new CAdventureMapButton(CGI->generaltexth->zelp[612],std::bind(&CMarketplaceWindow::setMode,this, EMarketMode::RESOURCE_PLAYER), 18, 520,"TPMRKBU1.DEF");
if(printButtonFor(EMarketMode::RESOURCE_RESOURCE)) if(printButtonFor(EMarketMode::RESOURCE_RESOURCE))
new CAdventureMapButton(CGI->generaltexth->zelp[605],boost::bind(&CMarketplaceWindow::setMode,this, EMarketMode::RESOURCE_RESOURCE), 516, 450 + specialOffset,"TPMRKBU5.DEF"); new CAdventureMapButton(CGI->generaltexth->zelp[605],std::bind(&CMarketplaceWindow::setMode,this, EMarketMode::RESOURCE_RESOURCE), 516, 450 + specialOffset,"TPMRKBU5.DEF");
if(printButtonFor(EMarketMode::CREATURE_RESOURCE)) if(printButtonFor(EMarketMode::CREATURE_RESOURCE))
new CAdventureMapButton(CGI->generaltexth->zelp[599],boost::bind(&CMarketplaceWindow::setMode,this, EMarketMode::CREATURE_RESOURCE), 516, 485,"TPMRKBU4.DEF"); //was y=450, changed to not overlap res-res in some conditions new CAdventureMapButton(CGI->generaltexth->zelp[599],std::bind(&CMarketplaceWindow::setMode,this, EMarketMode::CREATURE_RESOURCE), 516, 485,"TPMRKBU4.DEF"); //was y=450, changed to not overlap res-res in some conditions
if(printButtonFor(EMarketMode::RESOURCE_ARTIFACT)) if(printButtonFor(EMarketMode::RESOURCE_ARTIFACT))
new CAdventureMapButton(CGI->generaltexth->zelp[598],boost::bind(&CMarketplaceWindow::setMode,this, EMarketMode::RESOURCE_ARTIFACT), 18, 450 + specialOffset,"TPMRKBU2.DEF"); new CAdventureMapButton(CGI->generaltexth->zelp[598],std::bind(&CMarketplaceWindow::setMode,this, EMarketMode::RESOURCE_ARTIFACT), 18, 450 + specialOffset,"TPMRKBU2.DEF");
if(printButtonFor(EMarketMode::ARTIFACT_RESOURCE)) if(printButtonFor(EMarketMode::ARTIFACT_RESOURCE))
new CAdventureMapButton(CGI->generaltexth->zelp[613],boost::bind(&CMarketplaceWindow::setMode,this, EMarketMode::ARTIFACT_RESOURCE), 18, 485,"TPMRKBU3.DEF"); //was y=450, changed to not overlap res-art in some conditions new CAdventureMapButton(CGI->generaltexth->zelp[613],std::bind(&CMarketplaceWindow::setMode,this, EMarketMode::ARTIFACT_RESOURCE), 18, 485,"TPMRKBU3.DEF"); //was y=450, changed to not overlap res-art in some conditions
updateTraderText(); updateTraderText();
} }
@ -3038,11 +3038,11 @@ CAltarWindow::CAltarWindow(const IMarket *Market, const CGHeroInstance *Hero /*=
new CTextBox(CGI->generaltexth->allTexts[480], Rect(320, 56, 256, 40), 0, FONT_SMALL, CENTER, Colors::YELLOW); new CTextBox(CGI->generaltexth->allTexts[480], Rect(320, 56, 256, 40), 0, FONT_SMALL, CENTER, Colors::YELLOW);
slider = new CSlider(231,481,137,nullptr,0,0); slider = new CSlider(231,481,137,nullptr,0,0);
slider->moved = boost::bind(&CAltarWindow::sliderMoved,this,_1); slider->moved = std::bind(&CAltarWindow::sliderMoved,this,_1);
max = new CAdventureMapButton(CGI->generaltexth->zelp[578],boost::bind(&CSlider::moveToMax, slider),147,520,"IRCBTNS.DEF"); max = new CAdventureMapButton(CGI->generaltexth->zelp[578],std::bind(&CSlider::moveToMax, slider),147,520,"IRCBTNS.DEF");
sacrificedUnits.resize(GameConstants::ARMY_SIZE, 0); sacrificedUnits.resize(GameConstants::ARMY_SIZE, 0);
sacrificeAll = new CAdventureMapButton(CGI->generaltexth->zelp[579],boost::bind(&CAltarWindow::SacrificeAll,this),393,520,"ALTARMY.DEF"); sacrificeAll = new CAdventureMapButton(CGI->generaltexth->zelp[579],std::bind(&CAltarWindow::SacrificeAll,this),393,520,"ALTARMY.DEF");
sacrificeBackpack = nullptr; sacrificeBackpack = nullptr;
initItems(true); initItems(true);
@ -3056,9 +3056,9 @@ CAltarWindow::CAltarWindow(const IMarket *Market, const CGHeroInstance *Hero /*=
//%s's Creatures //%s's Creatures
new CLabel(302, 423, FONT_SMALL, CENTER, Colors::YELLOW, CGI->generaltexth->allTexts[478]); new CLabel(302, 423, FONT_SMALL, CENTER, Colors::YELLOW, CGI->generaltexth->allTexts[478]);
sacrificeAll = new CAdventureMapButton(CGI->generaltexth->zelp[571], boost::bind(&CAltarWindow::SacrificeAll,this),393,520,"ALTFILL.DEF"); sacrificeAll = new CAdventureMapButton(CGI->generaltexth->zelp[571], std::bind(&CAltarWindow::SacrificeAll,this),393,520,"ALTFILL.DEF");
sacrificeAll->block(hero->artifactsInBackpack.empty() && hero->artifactsWorn.empty()); sacrificeAll->block(hero->artifactsInBackpack.empty() && hero->artifactsWorn.empty());
sacrificeBackpack = new CAdventureMapButton(CGI->generaltexth->zelp[570],boost::bind(&CAltarWindow::SacrificeBackpack,this),147,520,"ALTEMBK.DEF"); sacrificeBackpack = new CAdventureMapButton(CGI->generaltexth->zelp[570],std::bind(&CAltarWindow::SacrificeBackpack,this),147,520,"ALTEMBK.DEF");
sacrificeBackpack->block(hero->artifactsInBackpack.empty()); sacrificeBackpack->block(hero->artifactsInBackpack.empty());
slider = nullptr; slider = nullptr;
@ -3077,15 +3077,15 @@ CAltarWindow::CAltarWindow(const IMarket *Market, const CGHeroInstance *Hero /*=
new CGStatusBar(new CPicture(*background, Rect(8, pos.h - 26, pos.w - 16, 19), 8, pos.h - 26)); new CGStatusBar(new CPicture(*background, Rect(8, pos.h - 26, pos.w - 16, 19), 8, pos.h - 26));
ok = new CAdventureMapButton(CGI->generaltexth->zelp[568],boost::bind(&CGuiHandler::popIntTotally,&GH,this),516,520,"IOK6432.DEF",SDLK_RETURN); ok = new CAdventureMapButton(CGI->generaltexth->zelp[568],std::bind(&CGuiHandler::popIntTotally,&GH,this),516,520,"IOK6432.DEF",SDLK_RETURN);
ok->assignedKeys.insert(SDLK_ESCAPE); ok->assignedKeys.insert(SDLK_ESCAPE);
deal = new CAdventureMapButton(CGI->generaltexth->zelp[585],boost::bind(&CAltarWindow::makeDeal,this),269,520,"ALTSACR.DEF"); deal = new CAdventureMapButton(CGI->generaltexth->zelp[585],std::bind(&CAltarWindow::makeDeal,this),269,520,"ALTSACR.DEF");
if(Hero->getAlignment() != ::EAlignment::EVIL && Mode == EMarketMode::CREATURE_EXP) if(Hero->getAlignment() != ::EAlignment::EVIL && Mode == EMarketMode::CREATURE_EXP)
new CAdventureMapButton(CGI->generaltexth->zelp[580], boost::bind(&CTradeWindow::setMode,this, EMarketMode::ARTIFACT_EXP), 516, 421, "ALTART.DEF"); new CAdventureMapButton(CGI->generaltexth->zelp[580], std::bind(&CTradeWindow::setMode,this, EMarketMode::ARTIFACT_EXP), 516, 421, "ALTART.DEF");
if(Hero->getAlignment() != ::EAlignment::GOOD && Mode == EMarketMode::ARTIFACT_EXP) if(Hero->getAlignment() != ::EAlignment::GOOD && Mode == EMarketMode::ARTIFACT_EXP)
new CAdventureMapButton(CGI->generaltexth->zelp[572], boost::bind(&CTradeWindow::setMode,this, EMarketMode::CREATURE_EXP), 516, 421, "ALTSACC.DEF"); new CAdventureMapButton(CGI->generaltexth->zelp[572], std::bind(&CTradeWindow::setMode,this, EMarketMode::CREATURE_EXP), 516, 421, "ALTSACC.DEF");
expPerUnit.resize(GameConstants::ARMY_SIZE, 0); expPerUnit.resize(GameConstants::ARMY_SIZE, 0);
getExpValues(); getExpValues();
@ -3491,31 +3491,31 @@ CSystemOptionsWindow::CSystemOptionsWindow():
//setting up buttons //setting up buttons
load = new CAdventureMapButton (CGI->generaltexth->zelp[321].first, CGI->generaltexth->zelp[321].second, load = new CAdventureMapButton (CGI->generaltexth->zelp[321].first, CGI->generaltexth->zelp[321].second,
boost::bind(&CSystemOptionsWindow::bloadf, this), 246, 298, "SOLOAD.DEF", SDLK_l); std::bind(&CSystemOptionsWindow::bloadf, this), 246, 298, "SOLOAD.DEF", SDLK_l);
load->swappedImages = true; load->swappedImages = true;
load->update(); load->update();
save = new CAdventureMapButton (CGI->generaltexth->zelp[322].first, CGI->generaltexth->zelp[322].second, save = new CAdventureMapButton (CGI->generaltexth->zelp[322].first, CGI->generaltexth->zelp[322].second,
boost::bind(&CSystemOptionsWindow::bsavef, this), 357, 298, "SOSAVE.DEF", SDLK_s); std::bind(&CSystemOptionsWindow::bsavef, this), 357, 298, "SOSAVE.DEF", SDLK_s);
save->swappedImages = true; save->swappedImages = true;
save->update(); save->update();
restart = new CAdventureMapButton (CGI->generaltexth->zelp[323].first, CGI->generaltexth->zelp[323].second, restart = new CAdventureMapButton (CGI->generaltexth->zelp[323].first, CGI->generaltexth->zelp[323].second,
boost::bind(&CSystemOptionsWindow::brestartf, this), 246, 357, "SORSTRT", SDLK_r); std::bind(&CSystemOptionsWindow::brestartf, this), 246, 357, "SORSTRT", SDLK_r);
restart->swappedImages = true; restart->swappedImages = true;
restart->update(); restart->update();
mainMenu = new CAdventureMapButton (CGI->generaltexth->zelp[320].first, CGI->generaltexth->zelp[320].second, mainMenu = new CAdventureMapButton (CGI->generaltexth->zelp[320].first, CGI->generaltexth->zelp[320].second,
boost::bind(&CSystemOptionsWindow::bmainmenuf, this), 357, 357, "SOMAIN.DEF", SDLK_m); std::bind(&CSystemOptionsWindow::bmainmenuf, this), 357, 357, "SOMAIN.DEF", SDLK_m);
mainMenu->swappedImages = true; mainMenu->swappedImages = true;
mainMenu->update(); mainMenu->update();
quitGame = new CAdventureMapButton (CGI->generaltexth->zelp[324].first, CGI->generaltexth->zelp[324].second, quitGame = new CAdventureMapButton (CGI->generaltexth->zelp[324].first, CGI->generaltexth->zelp[324].second,
boost::bind(&CSystemOptionsWindow::bquitf, this), 246, 415, "soquit.def", SDLK_q); std::bind(&CSystemOptionsWindow::bquitf, this), 246, 415, "soquit.def", SDLK_q);
quitGame->swappedImages = true; quitGame->swappedImages = true;
quitGame->update(); quitGame->update();
backToMap = new CAdventureMapButton (CGI->generaltexth->zelp[325].first, CGI->generaltexth->zelp[325].second, backToMap = new CAdventureMapButton (CGI->generaltexth->zelp[325].first, CGI->generaltexth->zelp[325].second,
boost::bind(&CSystemOptionsWindow::breturnf, this), 357, 415, "soretrn.def", SDLK_RETURN); std::bind(&CSystemOptionsWindow::breturnf, this), 357, 415, "soretrn.def", SDLK_RETURN);
backToMap->swappedImages = true; backToMap->swappedImages = true;
backToMap->update(); backToMap->update();
backToMap->assignedKeys.insert(SDLK_ESCAPE); backToMap->assignedKeys.insert(SDLK_ESCAPE);
@ -3526,47 +3526,47 @@ CSystemOptionsWindow::CSystemOptionsWindow():
heroMoveSpeed->addButton(boost::assign::map_list_of(0,CGI->generaltexth->zelp[351].second),CGI->generaltexth->zelp[351].second, "sysopb3.def", 124, 77, 4); heroMoveSpeed->addButton(boost::assign::map_list_of(0,CGI->generaltexth->zelp[351].second),CGI->generaltexth->zelp[351].second, "sysopb3.def", 124, 77, 4);
heroMoveSpeed->addButton(boost::assign::map_list_of(0,CGI->generaltexth->zelp[352].second),CGI->generaltexth->zelp[352].second, "sysopb4.def", 172, 77, 8); heroMoveSpeed->addButton(boost::assign::map_list_of(0,CGI->generaltexth->zelp[352].second),CGI->generaltexth->zelp[352].second, "sysopb4.def", 172, 77, 8);
heroMoveSpeed->select(settings["adventure"]["heroSpeed"].Float(), 1); heroMoveSpeed->select(settings["adventure"]["heroSpeed"].Float(), 1);
heroMoveSpeed->onChange = boost::bind(&CSystemOptionsWindow::setHeroMoveSpeed, this, _1); heroMoveSpeed->onChange = std::bind(&CSystemOptionsWindow::setHeroMoveSpeed, this, _1);
mapScrollSpeed = new CHighlightableButtonsGroup(0); mapScrollSpeed = new CHighlightableButtonsGroup(0);
mapScrollSpeed->addButton(boost::assign::map_list_of(0,CGI->generaltexth->zelp[357].second),CGI->generaltexth->zelp[357].second, "sysopb9.def", 28, 210, 1); mapScrollSpeed->addButton(boost::assign::map_list_of(0,CGI->generaltexth->zelp[357].second),CGI->generaltexth->zelp[357].second, "sysopb9.def", 28, 210, 1);
mapScrollSpeed->addButton(boost::assign::map_list_of(0,CGI->generaltexth->zelp[358].second),CGI->generaltexth->zelp[358].second, "sysob10.def", 92, 210, 2); mapScrollSpeed->addButton(boost::assign::map_list_of(0,CGI->generaltexth->zelp[358].second),CGI->generaltexth->zelp[358].second, "sysob10.def", 92, 210, 2);
mapScrollSpeed->addButton(boost::assign::map_list_of(0,CGI->generaltexth->zelp[359].second),CGI->generaltexth->zelp[359].second, "sysob11.def", 156, 210, 4); mapScrollSpeed->addButton(boost::assign::map_list_of(0,CGI->generaltexth->zelp[359].second),CGI->generaltexth->zelp[359].second, "sysob11.def", 156, 210, 4);
mapScrollSpeed->select(settings["adventure"]["scrollSpeed"].Float(), 1); mapScrollSpeed->select(settings["adventure"]["scrollSpeed"].Float(), 1);
mapScrollSpeed->onChange = boost::bind(&CSystemOptionsWindow::setMapScrollingSpeed, this, _1); mapScrollSpeed->onChange = std::bind(&CSystemOptionsWindow::setMapScrollingSpeed, this, _1);
musicVolume = new CHighlightableButtonsGroup(0, true); musicVolume = new CHighlightableButtonsGroup(0, true);
for(int i=0; i<10; ++i) for(int i=0; i<10; ++i)
musicVolume->addButton(boost::assign::map_list_of(0,CGI->generaltexth->zelp[326+i].second),CGI->generaltexth->zelp[326+i].second, "syslb.def", 29 + 19*i, 359, i*11); musicVolume->addButton(boost::assign::map_list_of(0,CGI->generaltexth->zelp[326+i].second),CGI->generaltexth->zelp[326+i].second, "syslb.def", 29 + 19*i, 359, i*11);
musicVolume->select(CCS->musich->getVolume(), 1); musicVolume->select(CCS->musich->getVolume(), 1);
musicVolume->onChange = boost::bind(&CSystemOptionsWindow::setMusicVolume, this, _1); musicVolume->onChange = std::bind(&CSystemOptionsWindow::setMusicVolume, this, _1);
effectsVolume = new CHighlightableButtonsGroup(0, true); effectsVolume = new CHighlightableButtonsGroup(0, true);
for(int i=0; i<10; ++i) for(int i=0; i<10; ++i)
effectsVolume->addButton(boost::assign::map_list_of(0,CGI->generaltexth->zelp[336+i].second),CGI->generaltexth->zelp[336+i].second, "syslb.def", 29 + 19*i, 425, i*11); effectsVolume->addButton(boost::assign::map_list_of(0,CGI->generaltexth->zelp[336+i].second),CGI->generaltexth->zelp[336+i].second, "syslb.def", 29 + 19*i, 425, i*11);
effectsVolume->select(CCS->soundh->getVolume(), 1); effectsVolume->select(CCS->soundh->getVolume(), 1);
effectsVolume->onChange = boost::bind(&CSystemOptionsWindow::setSoundVolume, this, _1); effectsVolume->onChange = std::bind(&CSystemOptionsWindow::setSoundVolume, this, _1);
showReminder = new CHighlightableButton( showReminder = new CHighlightableButton(
boost::bind(&CSystemOptionsWindow::toggleReminder, this, true), boost::bind(&CSystemOptionsWindow::toggleReminder, this, false), std::bind(&CSystemOptionsWindow::toggleReminder, this, true), std::bind(&CSystemOptionsWindow::toggleReminder, this, false),
std::map<int,std::string>(), CGI->generaltexth->zelp[361].second, false, "sysopchk.def", nullptr, 246, 87, false); std::map<int,std::string>(), CGI->generaltexth->zelp[361].second, false, "sysopchk.def", nullptr, 246, 87, false);
quickCombat = new CHighlightableButton( quickCombat = new CHighlightableButton(
boost::bind(&CSystemOptionsWindow::toggleQuickCombat, this, true), boost::bind(&CSystemOptionsWindow::toggleQuickCombat, this, false), std::bind(&CSystemOptionsWindow::toggleQuickCombat, this, true), std::bind(&CSystemOptionsWindow::toggleQuickCombat, this, false),
std::map<int,std::string>(), CGI->generaltexth->zelp[362].second, false, "sysopchk.def", nullptr, 246, 87+32, false); std::map<int,std::string>(), CGI->generaltexth->zelp[362].second, false, "sysopchk.def", nullptr, 246, 87+32, false);
spellbookAnim = new CHighlightableButton( spellbookAnim = new CHighlightableButton(
boost::bind(&CSystemOptionsWindow::toggleSpellbookAnim, this, true), boost::bind(&CSystemOptionsWindow::toggleSpellbookAnim, this, false), std::bind(&CSystemOptionsWindow::toggleSpellbookAnim, this, true), std::bind(&CSystemOptionsWindow::toggleSpellbookAnim, this, false),
std::map<int,std::string>(), CGI->generaltexth->zelp[364].second, false, "sysopchk.def", nullptr, 246, 87+64, false); std::map<int,std::string>(), CGI->generaltexth->zelp[364].second, false, "sysopchk.def", nullptr, 246, 87+64, false);
newCreatureWin = new CHighlightableButton( newCreatureWin = new CHighlightableButton(
boost::bind(&CSystemOptionsWindow::toggleCreatureWin, this, true), boost::bind(&CSystemOptionsWindow::toggleCreatureWin, this, false), std::bind(&CSystemOptionsWindow::toggleCreatureWin, this, true), std::bind(&CSystemOptionsWindow::toggleCreatureWin, this, false),
std::map<int,std::string>(), texts["creatureWindowButton"]["help"].String(), false, "sysopchk.def", nullptr, 246, 183, false); std::map<int,std::string>(), texts["creatureWindowButton"]["help"].String(), false, "sysopchk.def", nullptr, 246, 183, false);
fullscreen = new CHighlightableButton( fullscreen = new CHighlightableButton(
boost::bind(&CSystemOptionsWindow::toggleFullscreen, this, true), boost::bind(&CSystemOptionsWindow::toggleFullscreen, this, false), std::bind(&CSystemOptionsWindow::toggleFullscreen, this, true), std::bind(&CSystemOptionsWindow::toggleFullscreen, this, false),
std::map<int,std::string>(), texts["fullscreenButton"]["help"].String(), false, "sysopchk.def", nullptr, 246, 215, false); std::map<int,std::string>(), texts["fullscreenButton"]["help"].String(), false, "sysopchk.def", nullptr, 246, 215, false);
showReminder->select(settings["adventure"]["heroReminder"].Bool()); showReminder->select(settings["adventure"]["heroReminder"].Bool());
@ -3578,7 +3578,7 @@ CSystemOptionsWindow::CSystemOptionsWindow():
onFullscreenChanged([&](const JsonNode &newState){ fullscreen->select(newState.Bool());}); onFullscreenChanged([&](const JsonNode &newState){ fullscreen->select(newState.Bool());});
gameResButton = new CAdventureMapButton("", texts["resolutionButton"]["help"].String(), gameResButton = new CAdventureMapButton("", texts["resolutionButton"]["help"].String(),
boost::bind(&CSystemOptionsWindow::selectGameRes, this), std::bind(&CSystemOptionsWindow::selectGameRes, this),
28, 275,"SYSOB12", SDLK_g); 28, 275,"SYSOB12", SDLK_g);
std::string resText; std::string resText;
@ -3602,7 +3602,7 @@ void CSystemOptionsWindow::selectGameRes()
} }
GH.pushInt(new CObjectListWindow(items, nullptr, texts["label"].String(), texts["help"].String(), GH.pushInt(new CObjectListWindow(items, nullptr, texts["label"].String(), texts["help"].String(),
boost::bind(&CSystemOptionsWindow::setGameRes, this, _1))); std::bind(&CSystemOptionsWindow::setGameRes, this, _1)));
} }
void CSystemOptionsWindow::setGameRes(int index) void CSystemOptionsWindow::setGameRes(int index)
@ -3716,9 +3716,9 @@ CTavernWindow::CTavernWindow(const CGObjectInstance *TavernObj):
new CTextBox(LOCPLINT->cb->getTavernGossip(tavernObj), Rect(32, 190, 330, 68), 0, FONT_SMALL, CENTER, Colors::WHITE); new CTextBox(LOCPLINT->cb->getTavernGossip(tavernObj), Rect(32, 190, 330, 68), 0, FONT_SMALL, CENTER, Colors::WHITE);
new CGStatusBar(new CPicture(*background, Rect(8, pos.h - 26, pos.w - 16, 19), 8, pos.h - 26)); new CGStatusBar(new CPicture(*background, Rect(8, pos.h - 26, pos.w - 16, 19), 8, pos.h - 26));
cancel = new CAdventureMapButton(CGI->generaltexth->tavernInfo[7],"", boost::bind(&CTavernWindow::close, this), 310, 428, "ICANCEL.DEF", SDLK_ESCAPE); cancel = new CAdventureMapButton(CGI->generaltexth->tavernInfo[7],"", std::bind(&CTavernWindow::close, this), 310, 428, "ICANCEL.DEF", SDLK_ESCAPE);
recruit = new CAdventureMapButton("", "", boost::bind(&CTavernWindow::recruitb, this), 272, 355, "TPTAV01.DEF", SDLK_RETURN); recruit = new CAdventureMapButton("", "", std::bind(&CTavernWindow::recruitb, this), 272, 355, "TPTAV01.DEF", SDLK_RETURN);
thiefGuild = new CAdventureMapButton(CGI->generaltexth->tavernInfo[5],"", boost::bind(&CTavernWindow::thievesguildb, this), 22, 428, "TPTAV02.DEF", SDLK_t); thiefGuild = new CAdventureMapButton(CGI->generaltexth->tavernInfo[5],"", std::bind(&CTavernWindow::thievesguildb, this), 22, 428, "TPTAV02.DEF", SDLK_t);
if(LOCPLINT->cb->getResourceAmount(Res::GOLD) < 2500) //not enough gold if(LOCPLINT->cb->getResourceAmount(Res::GOLD) < 2500) //not enough gold
{ {
@ -4101,11 +4101,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); garr = new CGarrisonInt(92, 127, 4, Point(0,96), background->bg, Point(93,127), up, down, removableUnits);
{ {
CAdventureMapButton *split = new CAdventureMapButton(CGI->generaltexth->tcommands[3],"",boost::bind(&CGarrisonInt::splitClick,garr),88,314,"IDV6432.DEF"); CAdventureMapButton *split = new CAdventureMapButton(CGI->generaltexth->tcommands[3],"",std::bind(&CGarrisonInt::splitClick,garr),88,314,"IDV6432.DEF");
removeChild(split); removeChild(split);
garr->addSplitBtn(split); garr->addSplitBtn(split);
} }
quit = new CAdventureMapButton(CGI->generaltexth->tcommands[8],"",boost::bind(&CGarrisonWindow::close,this),399,314,"IOK6432.DEF",SDLK_RETURN); quit = new CAdventureMapButton(CGI->generaltexth->tcommands[8],"",std::bind(&CGarrisonWindow::close,this),399,314,"IOK6432.DEF",SDLK_RETURN);
std::string titleText; std::string titleText;
if (garr->armedObjs[1]->tempOwner == garr->armedObjs[0]->tempOwner) if (garr->armedObjs[1]->tempOwner == garr->armedObjs[0]->tempOwner)
@ -4336,7 +4336,7 @@ void CArtPlace::clickRight(tribool down, bool previousState)
ourArt->artType->id, ourArt->artType->id,
combination->id, combination->id,
true, true,
boost::bind(&CCallback::assembleArtifacts, LOCPLINT->cb.get(), ourOwner->curHero, slotID, true, combination->id), std::bind(&CCallback::assembleArtifacts, LOCPLINT->cb.get(), ourOwner->curHero, slotID, true, combination->id),
0); 0);
if(assemblyPossibilities.size() > 2) if(assemblyPossibilities.size() > 2)
@ -4354,7 +4354,7 @@ void CArtPlace::clickRight(tribool down, bool previousState)
ourArt->artType->id, ourArt->artType->id,
0, 0,
false, false,
boost::bind(&CCallback::assembleArtifacts, LOCPLINT->cb.get(), ourOwner->curHero, slotID, false, ArtifactID()), std::bind(&CCallback::assembleArtifacts, LOCPLINT->cb.get(), ourOwner->curHero, slotID, false, ArtifactID()),
0); 0);
return; return;
} }
@ -4881,8 +4881,8 @@ CArtifactsOfHero::CArtifactsOfHero(std::vector<CArtPlace *> ArtWorn, std::vector
eraseSlotData(backpack[s], ArtifactPosition(GameConstants::BACKPACK_START + s)); eraseSlotData(backpack[s], ArtifactPosition(GameConstants::BACKPACK_START + s));
} }
leftArtRoll->callback += boost::bind(&CArtifactsOfHero::scrollBackpack,this,-1); leftArtRoll->callback += std::bind(&CArtifactsOfHero::scrollBackpack,this,-1);
rightArtRoll->callback += boost::bind(&CArtifactsOfHero::scrollBackpack,this,+1); rightArtRoll->callback += std::bind(&CArtifactsOfHero::scrollBackpack,this,+1);
} }
CArtifactsOfHero::CArtifactsOfHero(const Point& position, bool createCommonPart /*= false*/) CArtifactsOfHero::CArtifactsOfHero(const Point& position, bool createCommonPart /*= false*/)
@ -4926,8 +4926,8 @@ CArtifactsOfHero::CArtifactsOfHero(const Point& position, bool createCommonPart
backpack.push_back(add); backpack.push_back(add);
} }
leftArtRoll = new CAdventureMapButton(std::string(), std::string(), boost::bind(&CArtifactsOfHero::scrollBackpack,this,-1), 379, 364, "hsbtns3.def", SDLK_LEFT); leftArtRoll = new CAdventureMapButton(std::string(), std::string(), std::bind(&CArtifactsOfHero::scrollBackpack,this,-1), 379, 364, "hsbtns3.def", SDLK_LEFT);
rightArtRoll = new CAdventureMapButton(std::string(), std::string(), boost::bind(&CArtifactsOfHero::scrollBackpack,this,+1), 632, 364, "hsbtns5.def", SDLK_RIGHT); rightArtRoll = new CAdventureMapButton(std::string(), std::string(), std::bind(&CArtifactsOfHero::scrollBackpack,this,+1), 632, 364, "hsbtns5.def", SDLK_RIGHT);
} }
CArtifactsOfHero::~CArtifactsOfHero() CArtifactsOfHero::~CArtifactsOfHero()
@ -5274,20 +5274,20 @@ CExchangeWindow::CExchangeWindow(ObjectInstanceID hero1, ObjectInstanceID hero2,
} }
//buttons //buttons
quit = new CAdventureMapButton(CGI->generaltexth->zelp[600], boost::bind(&CExchangeWindow::close, this), 732, 567, "IOKAY.DEF", SDLK_RETURN); quit = new CAdventureMapButton(CGI->generaltexth->zelp[600], std::bind(&CExchangeWindow::close, this), 732, 567, "IOKAY.DEF", SDLK_RETURN);
if(queryID.getNum() > 0) if(queryID.getNum() > 0)
quit->callback += [=]{ LOCPLINT->cb->selectionMade(0, queryID); }; quit->callback += [=]{ LOCPLINT->cb->selectionMade(0, queryID); };
questlogButton[0] = new CAdventureMapButton(CGI->generaltexth->heroscrn[0], "", boost::bind(&CExchangeWindow::questlog,this, 0), 10, 44, "hsbtns4.def"); questlogButton[0] = new CAdventureMapButton(CGI->generaltexth->heroscrn[0], "", std::bind(&CExchangeWindow::questlog,this, 0), 10, 44, "hsbtns4.def");
questlogButton[1] = new CAdventureMapButton(CGI->generaltexth->heroscrn[0], "", boost::bind(&CExchangeWindow::questlog,this, 1), 740, 44, "hsbtns4.def"); questlogButton[1] = new CAdventureMapButton(CGI->generaltexth->heroscrn[0], "", std::bind(&CExchangeWindow::questlog,this, 1), 740, 44, "hsbtns4.def");
Rect barRect(5, 578, 725, 18); Rect barRect(5, 578, 725, 18);
ourBar = new CGStatusBar(new CPicture(*background, barRect, 5, 578, false)); ourBar = new CGStatusBar(new CPicture(*background, barRect, 5, 578, false));
//garrison interface //garrison interface
garr = new CGarrisonInt(69, 131, 4, Point(418,0), *background, Point(69,131), heroInst[0],heroInst[1], true, true); garr = new CGarrisonInt(69, 131, 4, Point(418,0), *background, Point(69,131), heroInst[0],heroInst[1], true, true);
garr->addSplitBtn(new CAdventureMapButton(CGI->generaltexth->tcommands[3], "", boost::bind(&CGarrisonInt::splitClick, garr), 10, 132, "TSBTNS.DEF")); garr->addSplitBtn(new CAdventureMapButton(CGI->generaltexth->tcommands[3], "", std::bind(&CGarrisonInt::splitClick, garr), 10, 132, "TSBTNS.DEF"));
garr->addSplitBtn(new CAdventureMapButton(CGI->generaltexth->tcommands[3], "", boost::bind(&CGarrisonInt::splitClick, garr), 740, 132, "TSBTNS.DEF")); garr->addSplitBtn(new CAdventureMapButton(CGI->generaltexth->tcommands[3], "", std::bind(&CGarrisonInt::splitClick, garr), 740, 132, "TSBTNS.DEF"));
} }
CExchangeWindow::~CExchangeWindow() //d-tor CExchangeWindow::~CExchangeWindow() //d-tor
@ -5320,8 +5320,8 @@ CShipyardWindow::CShipyardWindow(const std::vector<si32> &cost, int state, int b
goldPic = new CAnimImage("RESOURCE", Res::GOLD, 0, 100, 244); goldPic = new CAnimImage("RESOURCE", Res::GOLD, 0, 100, 244);
woodPic = new CAnimImage("RESOURCE", Res::WOOD, 0, 196, 244); woodPic = new CAnimImage("RESOURCE", Res::WOOD, 0, 196, 244);
quit = new CAdventureMapButton(CGI->generaltexth->allTexts[599], "", boost::bind(&CShipyardWindow::close, this), 224, 312, "ICANCEL", SDLK_RETURN); quit = new CAdventureMapButton(CGI->generaltexth->allTexts[599], "", std::bind(&CShipyardWindow::close, this), 224, 312, "ICANCEL", SDLK_RETURN);
build = new CAdventureMapButton(CGI->generaltexth->allTexts[598], "", boost::bind(&CShipyardWindow::close, this), 42, 312, "IBUY30", SDLK_RETURN); build = new CAdventureMapButton(CGI->generaltexth->allTexts[598], "", std::bind(&CShipyardWindow::close, this), 42, 312, "IBUY30", SDLK_RETURN);
build->callback += onBuy; build->callback += onBuy;
for(Res::ERes i = Res::WOOD; i <= Res::GOLD; vstd::advance(i, 1)) for(Res::ERes i = Res::WOOD; i <= Res::GOLD; vstd::advance(i, 1))
@ -5347,7 +5347,7 @@ CPuzzleWindow::CPuzzleWindow(const int3 &GrailPos, double discoveredRatio):
OBJ_CONSTRUCTION_CAPTURING_ALL; OBJ_CONSTRUCTION_CAPTURING_ALL;
CCS->soundh->playSound(soundBase::OBELISK); CCS->soundh->playSound(soundBase::OBELISK);
quitb = new CAdventureMapButton(CGI->generaltexth->allTexts[599], "", boost::bind(&CPuzzleWindow::close, this), 670, 538, "IOK6432.DEF", SDLK_RETURN); quitb = new CAdventureMapButton(CGI->generaltexth->allTexts[599], "", std::bind(&CPuzzleWindow::close, this), 670, 538, "IOK6432.DEF", SDLK_RETURN);
quitb->assignedKeys.insert(SDLK_ESCAPE); quitb->assignedKeys.insert(SDLK_ESCAPE);
quitb->borderColor = Colors::METALLIC_GOLD; quitb->borderColor = Colors::METALLIC_GOLD;
quitb->borderEnabled = true; quitb->borderEnabled = true;
@ -5489,9 +5489,9 @@ CTransformerWindow::CTransformerWindow(const CGHeroInstance * _hero, const CGTow
if ( army->getCreature(SlotID(i)) ) if ( army->getCreature(SlotID(i)) )
items.push_back(new CItem(this, army->getStackCount(SlotID(i)), i)); items.push_back(new CItem(this, army->getStackCount(SlotID(i)), i));
all = new CAdventureMapButton(CGI->generaltexth->zelp[590],boost::bind(&CTransformerWindow::addAll,this), 146,416,"ALTARMY.DEF",SDLK_a); all = new CAdventureMapButton(CGI->generaltexth->zelp[590],std::bind(&CTransformerWindow::addAll,this), 146,416,"ALTARMY.DEF",SDLK_a);
convert= new CAdventureMapButton(CGI->generaltexth->zelp[591],boost::bind(&CTransformerWindow::makeDeal,this), 269,416,"ALTSACR.DEF",SDLK_RETURN); convert= new CAdventureMapButton(CGI->generaltexth->zelp[591],std::bind(&CTransformerWindow::makeDeal,this), 269,416,"ALTSACR.DEF",SDLK_RETURN);
cancel = new CAdventureMapButton(CGI->generaltexth->zelp[592],boost::bind(&CTransformerWindow::close, this),392,416,"ICANCEL.DEF",SDLK_ESCAPE); cancel = new CAdventureMapButton(CGI->generaltexth->zelp[592],std::bind(&CTransformerWindow::close, this),392,416,"ICANCEL.DEF",SDLK_ESCAPE);
bar = new CGStatusBar(new CPicture(*background, Rect(8, pos.h - 26, pos.w - 16, 19), 8, pos.h - 26)); 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 new CLabel(153, 29,FONT_SMALL, CENTER, Colors::YELLOW, CGI->generaltexth->allTexts[485]);//holding area
@ -5610,7 +5610,7 @@ CUniversityWindow::CUniversityWindow(const CGHeroInstance * _hero, const IMarket
items.push_back(new CItem(this, list[i], 54+i*104, 234)); items.push_back(new CItem(this, list[i], 54+i*104, 234));
cancel = new CAdventureMapButton(CGI->generaltexth->zelp[632], cancel = new CAdventureMapButton(CGI->generaltexth->zelp[632],
boost::bind(&CUniversityWindow::close, this),200,313,"IOKAY.DEF",SDLK_RETURN); std::bind(&CUniversityWindow::close, this),200,313,"IOKAY.DEF",SDLK_RETURN);
bar = new CGStatusBar(new CPicture(*background, Rect(8, pos.h - 26, pos.w - 16, 19), 8, pos.h - 26)); bar = new CGStatusBar(new CPicture(*background, Rect(8, pos.h - 26, pos.w - 16, 19), 8, pos.h - 26));
} }
@ -5643,11 +5643,11 @@ CUnivConfirmWindow::CUnivConfirmWindow(CUniversityWindow * PARENT, int SKILL, bo
boost::replace_first(text, "%s", CGI->generaltexth->skillName[SKILL]); boost::replace_first(text, "%s", CGI->generaltexth->skillName[SKILL]);
boost::replace_first(text, "%d", "2000"); boost::replace_first(text, "%d", "2000");
confirm= new CAdventureMapButton(hoverText, text, boost::bind(&CUnivConfirmWindow::makeDeal, this, SKILL), confirm= new CAdventureMapButton(hoverText, text, std::bind(&CUnivConfirmWindow::makeDeal, this, SKILL),
148,299,"IBY6432.DEF",SDLK_RETURN); 148,299,"IBY6432.DEF",SDLK_RETURN);
confirm->block(!available); confirm->block(!available);
cancel = new CAdventureMapButton(CGI->generaltexth->zelp[631],boost::bind(&CUnivConfirmWindow::close, this), cancel = new CAdventureMapButton(CGI->generaltexth->zelp[631],std::bind(&CUnivConfirmWindow::close, this),
252,299,"ICANCEL.DEF",SDLK_ESCAPE); 252,299,"ICANCEL.DEF",SDLK_ESCAPE);
bar = new CGStatusBar(new CPicture(*background, Rect(8, pos.h - 26, pos.w - 16, 19), 8, pos.h - 26)); bar = new CGStatusBar(new CPicture(*background, Rect(8, pos.h - 26, pos.w - 16, 19), 8, pos.h - 26));
} }
@ -5680,16 +5680,16 @@ CHillFortWindow::CHillFortWindow(const CGHeroInstance *visitor, const CGObjectIn
for (int i=0; i<slotsCount; i++) for (int i=0; i<slotsCount; i++)
{ {
currState[i] = getState(SlotID(i)); currState[i] = getState(SlotID(i));
upgrade[i] = new CAdventureMapButton(getTextForSlot(SlotID(i)),"",boost::bind(&CHillFortWindow::makeDeal, this, SlotID(i)), upgrade[i] = new CAdventureMapButton(getTextForSlot(SlotID(i)),"",std::bind(&CHillFortWindow::makeDeal, this, SlotID(i)),
107+i*76, 171, "", SDLK_1+i, &files); 107+i*76, 171, "", SDLK_1+i, &files);
upgrade[i]->block(currState[i] == -1); upgrade[i]->block(currState[i] == -1);
} }
files.clear(); files.clear();
files += "APHLF4R.DEF", "APHLF4Y.DEF", "APHLF4G.DEF"; files += "APHLF4R.DEF", "APHLF4Y.DEF", "APHLF4G.DEF";
currState[slotsCount] = getState(SlotID(slotsCount)); currState[slotsCount] = getState(SlotID(slotsCount));
upgradeAll = new CAdventureMapButton(CGI->generaltexth->allTexts[432],"",boost::bind(&CHillFortWindow::makeDeal, this, SlotID(slotsCount)), upgradeAll = new CAdventureMapButton(CGI->generaltexth->allTexts[432],"",std::bind(&CHillFortWindow::makeDeal, this, SlotID(slotsCount)),
30, 231, "", SDLK_0, &files); 30, 231, "", SDLK_0, &files);
quit = new CAdventureMapButton("","",boost::bind(&CHillFortWindow::close, this), 294, 275, "IOKAY.DEF", SDLK_RETURN); quit = new CAdventureMapButton("","",std::bind(&CHillFortWindow::close, this), 294, 275, "IOKAY.DEF", SDLK_RETURN);
bar = new CGStatusBar(new CPicture(*background, Rect(8, pos.h - 26, pos.w - 16, 19), 8, pos.h - 26)); bar = new CGStatusBar(new CPicture(*background, Rect(8, pos.h - 26, pos.w - 16, 19), 8, pos.h - 26));
garr = new CGarrisonInt(108, 60, 18, Point(),background->bg,Point(108,60),hero,nullptr); garr = new CGarrisonInt(108, 60, 18, Point(),background->bg,Point(108,60),hero,nullptr);
@ -5850,7 +5850,7 @@ CThievesGuildWindow::CThievesGuildWindow(const CGObjectInstance * _owner):
SThievesGuildInfo tgi; //info to be displayed SThievesGuildInfo tgi; //info to be displayed
LOCPLINT->cb->getThievesGuildInfo(tgi, owner); LOCPLINT->cb->getThievesGuildInfo(tgi, owner);
exitb = new CAdventureMapButton (CGI->generaltexth->allTexts[600], "", boost::bind(&CThievesGuildWindow::close,this), 748, 556, "TPMAGE1", SDLK_RETURN); exitb = new CAdventureMapButton (CGI->generaltexth->allTexts[600], "", std::bind(&CThievesGuildWindow::close,this), 748, 556, "TPMAGE1", SDLK_RETURN);
exitb->assignedKeys.insert(SDLK_ESCAPE); exitb->assignedKeys.insert(SDLK_ESCAPE);
statusBar = new CGStatusBar(3, 555, "TStatBar.bmp", 742); statusBar = new CGStatusBar(3, 555, "TStatBar.bmp", 742);

View File

@ -106,7 +106,7 @@ public:
//use only before the game starts! (showYesNoDialog in LOCPLINT must be used then) //use only before the game starts! (showYesNoDialog in LOCPLINT must be used then)
static void showInfoDialog( const std::string & text, const std::vector<CComponent*> *components, bool DelComps = true, PlayerColor player = PlayerColor(1)); static void showInfoDialog( const std::string & text, const std::vector<CComponent*> *components, bool DelComps = true, PlayerColor player = PlayerColor(1));
static void showOkDialog(const std::string & text, const std::vector<CComponent*> *components, const boost::function<void()> & onOk, bool delComps = true, PlayerColor player = PlayerColor(1)); static void showOkDialog(const std::string & text, const std::vector<CComponent*> *components, const std::function<void()> & onOk, bool delComps = true, PlayerColor player = PlayerColor(1));
static void showYesNoDialog( const std::string & text, const std::vector<CComponent*> *components, const CFunctionList<void( ) > &onYes, const CFunctionList<void()> &onNo, bool DelComps = true, PlayerColor player = PlayerColor(1)); static void showYesNoDialog( const std::string & text, const std::vector<CComponent*> *components, const CFunctionList<void( ) > &onYes, const CFunctionList<void()> &onNo, bool DelComps = true, PlayerColor player = PlayerColor(1));
static CInfoWindow *create(const std::string &text, PlayerColor playerID = PlayerColor(1), const std::vector<CComponent*> *components = nullptr, bool DelComps = false); static CInfoWindow *create(const std::string &text, PlayerColor playerID = PlayerColor(1), const std::vector<CComponent*> *components = nullptr, bool DelComps = false);

View File

@ -127,12 +127,12 @@ Graphics::Graphics()
{ {
#if 0 #if 0
std::vector<Task> tasks; //preparing list of graphics to load std::vector<Task> tasks; //preparing list of graphics to load
tasks += boost::bind(&Graphics::loadFonts,this); tasks += std::bind(&Graphics::loadFonts,this);
tasks += boost::bind(&Graphics::loadPaletteAndColors,this); tasks += std::bind(&Graphics::loadPaletteAndColors,this);
tasks += boost::bind(&Graphics::loadHeroFlags,this); tasks += std::bind(&Graphics::loadHeroFlags,this);
tasks += boost::bind(&Graphics::initializeBattleGraphics,this); tasks += std::bind(&Graphics::initializeBattleGraphics,this);
tasks += boost::bind(&Graphics::loadErmuToPicture,this); tasks += std::bind(&Graphics::loadErmuToPicture,this);
tasks += boost::bind(&Graphics::initializeImageLists,this); tasks += std::bind(&Graphics::initializeImageLists,this);
tasks += GET_DEF_ESS(resources32,"RESOURCE.DEF"); tasks += GET_DEF_ESS(resources32,"RESOURCE.DEF");
tasks += GET_DEF_ESS(heroMoveArrows,"ADAG.DEF"); tasks += GET_DEF_ESS(heroMoveArrows,"ADAG.DEF");
@ -288,7 +288,7 @@ void Graphics::loadHeroFlags()
boost::thread_group grupa; boost::thread_group grupa;
for(int g=3; g>=0; --g) for(int g=3; g>=0; --g)
{ {
grupa.create_thread(boost::bind(&Graphics::loadHeroFlagsDetail, this, boost::ref(pr[g]), true)); grupa.create_thread(std::bind(&Graphics::loadHeroFlagsDetail, this, std::ref(pr[g]), true));
} }
grupa.join_all(); grupa.join_all();
#else #else

View File

@ -637,7 +637,7 @@ void BattleSetActiveStack::applyCl( CClient *cl )
playerToCall = activated->owner; playerToCall = activated->owner;
} }
if( vstd::contains(cl->battleints, playerToCall) ) if( vstd::contains(cl->battleints, playerToCall) )
boost::thread( boost::bind(&CClient::waitForMoveAndSend, cl, playerToCall) ); boost::thread( std::bind(&CClient::waitForMoveAndSend, cl, playerToCall) );
} }
void BattleTriggerEffect::applyCl(CClient * cl) void BattleTriggerEffect::applyCl(CClient * cl)

View File

@ -224,16 +224,16 @@ CBattleInterface::CBattleInterface(const CCreatureSet * army1, const CCreatureSe
// blitAt(menu, pos.x, 556 + pos.y); // blitAt(menu, pos.x, 556 + pos.y);
//preparing buttons and console //preparing buttons and console
bOptions = new CAdventureMapButton (CGI->generaltexth->zelp[381].first, CGI->generaltexth->zelp[381].second, boost::bind(&CBattleInterface::bOptionsf,this), 3, 561, "icm003.def", SDLK_o); bOptions = new CAdventureMapButton (CGI->generaltexth->zelp[381].first, CGI->generaltexth->zelp[381].second, std::bind(&CBattleInterface::bOptionsf,this), 3, 561, "icm003.def", SDLK_o);
bSurrender = new CAdventureMapButton (CGI->generaltexth->zelp[379].first, CGI->generaltexth->zelp[379].second, boost::bind(&CBattleInterface::bSurrenderf,this), 54, 561, "icm001.def", SDLK_s); bSurrender = new CAdventureMapButton (CGI->generaltexth->zelp[379].first, CGI->generaltexth->zelp[379].second, std::bind(&CBattleInterface::bSurrenderf,this), 54, 561, "icm001.def", SDLK_s);
bFlee = new CAdventureMapButton (CGI->generaltexth->zelp[380].first, CGI->generaltexth->zelp[380].second, boost::bind(&CBattleInterface::bFleef,this), 105, 561, "icm002.def", SDLK_r); bFlee = new CAdventureMapButton (CGI->generaltexth->zelp[380].first, CGI->generaltexth->zelp[380].second, std::bind(&CBattleInterface::bFleef,this), 105, 561, "icm002.def", SDLK_r);
bAutofight = new CAdventureMapButton (CGI->generaltexth->zelp[382].first, CGI->generaltexth->zelp[382].second, boost::bind(&CBattleInterface::bAutofightf,this), 157, 561, "icm004.def", SDLK_a); bAutofight = new CAdventureMapButton (CGI->generaltexth->zelp[382].first, CGI->generaltexth->zelp[382].second, std::bind(&CBattleInterface::bAutofightf,this), 157, 561, "icm004.def", SDLK_a);
bSpell = new CAdventureMapButton (CGI->generaltexth->zelp[385].first, CGI->generaltexth->zelp[385].second, boost::bind(&CBattleInterface::bSpellf,this), 645, 561, "icm005.def", SDLK_c); bSpell = new CAdventureMapButton (CGI->generaltexth->zelp[385].first, CGI->generaltexth->zelp[385].second, std::bind(&CBattleInterface::bSpellf,this), 645, 561, "icm005.def", SDLK_c);
bWait = new CAdventureMapButton (CGI->generaltexth->zelp[386].first, CGI->generaltexth->zelp[386].second, boost::bind(&CBattleInterface::bWaitf,this), 696, 561, "icm006.def", SDLK_w); bWait = new CAdventureMapButton (CGI->generaltexth->zelp[386].first, CGI->generaltexth->zelp[386].second, std::bind(&CBattleInterface::bWaitf,this), 696, 561, "icm006.def", SDLK_w);
bDefence = new CAdventureMapButton (CGI->generaltexth->zelp[387].first, CGI->generaltexth->zelp[387].second, boost::bind(&CBattleInterface::bDefencef,this), 747, 561, "icm007.def", SDLK_d); bDefence = new CAdventureMapButton (CGI->generaltexth->zelp[387].first, CGI->generaltexth->zelp[387].second, std::bind(&CBattleInterface::bDefencef,this), 747, 561, "icm007.def", SDLK_d);
bDefence->assignedKeys.insert(SDLK_SPACE); bDefence->assignedKeys.insert(SDLK_SPACE);
bConsoleUp = new CAdventureMapButton (std::string(), std::string(), boost::bind(&CBattleInterface::bConsoleUpf,this), 624, 561, "ComSlide.def", SDLK_UP); bConsoleUp = new CAdventureMapButton (std::string(), std::string(), std::bind(&CBattleInterface::bConsoleUpf,this), 624, 561, "ComSlide.def", SDLK_UP);
bConsoleDown = new CAdventureMapButton (std::string(), std::string(), boost::bind(&CBattleInterface::bConsoleDownf,this), 624, 580, "ComSlide.def", SDLK_DOWN); bConsoleDown = new CAdventureMapButton (std::string(), std::string(), std::bind(&CBattleInterface::bConsoleDownf,this), 624, 580, "ComSlide.def", SDLK_DOWN);
bConsoleDown->setOffset(2); bConsoleDown->setOffset(2);
console = new CBattleConsole(); console = new CBattleConsole();
console->pos.x += 211; console->pos.x += 211;
@ -242,8 +242,8 @@ CBattleInterface::CBattleInterface(const CCreatureSet * army1, const CCreatureSe
console->pos.h = 38; console->pos.h = 38;
if(tacticsMode) if(tacticsMode)
{ {
btactNext = new CAdventureMapButton(std::string(), std::string(), boost::bind(&CBattleInterface::bTacticNextStack,this, (CStack*)nullptr), 213, 560, "icm011.def", SDLK_SPACE); btactNext = new CAdventureMapButton(std::string(), std::string(), std::bind(&CBattleInterface::bTacticNextStack,this, (CStack*)nullptr), 213, 560, "icm011.def", SDLK_SPACE);
btactEnd = new CAdventureMapButton(std::string(), std::string(), boost::bind(&CBattleInterface::bEndTacticPhase,this), 419, 560, "icm012.def", SDLK_RETURN); btactEnd = new CAdventureMapButton(std::string(), std::string(), std::bind(&CBattleInterface::bEndTacticPhase,this), 419, 560, "icm012.def", SDLK_RETURN);
menu = BitmapHandler::loadBitmap("COPLACBR.BMP"); menu = BitmapHandler::loadBitmap("COPLACBR.BMP");
} }
else else
@ -819,7 +819,7 @@ void CBattleInterface::bFleef()
if( curInt->cb->battleCanFlee() ) if( curInt->cb->battleCanFlee() )
{ {
CFunctionList<void()> ony = boost::bind(&CBattleInterface::reallyFlee,this); CFunctionList<void()> ony = std::bind(&CBattleInterface::reallyFlee,this);
curInt->showYesNoDialog(CGI->generaltexth->allTexts[28], ony, 0, false); //Are you sure you want to retreat? curInt->showYesNoDialog(CGI->generaltexth->allTexts[28], ony, 0, false); //Are you sure you want to retreat?
} }
else else

View File

@ -258,11 +258,11 @@ CBattleOptionsWindow::CBattleOptionsWindow(const SDL_Rect & position, CBattleInt
background = new CPicture("comopbck.bmp"); background = new CPicture("comopbck.bmp");
background->colorize(owner->getCurrentPlayerInterface()->playerID); background->colorize(owner->getCurrentPlayerInterface()->playerID);
viewGrid = new CHighlightableButton(boost::bind(&CBattleInterface::setPrintCellBorders, owner, true), boost::bind(&CBattleInterface::setPrintCellBorders, owner, false), boost::assign::map_list_of(0,CGI->generaltexth->zelp[427].first)(3,CGI->generaltexth->zelp[427].first), CGI->generaltexth->zelp[427].second, false, "sysopchk.def", nullptr, 25, 56, false); viewGrid = new CHighlightableButton(std::bind(&CBattleInterface::setPrintCellBorders, owner, true), std::bind(&CBattleInterface::setPrintCellBorders, owner, false), boost::assign::map_list_of(0,CGI->generaltexth->zelp[427].first)(3,CGI->generaltexth->zelp[427].first), CGI->generaltexth->zelp[427].second, false, "sysopchk.def", nullptr, 25, 56, false);
viewGrid->select(settings["battle"]["cellBorders"].Bool()); viewGrid->select(settings["battle"]["cellBorders"].Bool());
movementShadow = new CHighlightableButton(boost::bind(&CBattleInterface::setPrintStackRange, owner, true), boost::bind(&CBattleInterface::setPrintStackRange, owner, false), boost::assign::map_list_of(0,CGI->generaltexth->zelp[428].first)(3,CGI->generaltexth->zelp[428].first), CGI->generaltexth->zelp[428].second, false, "sysopchk.def", nullptr, 25, 89, false); movementShadow = new CHighlightableButton(std::bind(&CBattleInterface::setPrintStackRange, owner, true), std::bind(&CBattleInterface::setPrintStackRange, owner, false), boost::assign::map_list_of(0,CGI->generaltexth->zelp[428].first)(3,CGI->generaltexth->zelp[428].first), CGI->generaltexth->zelp[428].second, false, "sysopchk.def", nullptr, 25, 89, false);
movementShadow->select(settings["battle"]["stackRange"].Bool()); movementShadow->select(settings["battle"]["stackRange"].Bool());
mouseShadow = new CHighlightableButton(boost::bind(&CBattleInterface::setPrintMouseShadow, owner, true), boost::bind(&CBattleInterface::setPrintMouseShadow, owner, false), boost::assign::map_list_of(0,CGI->generaltexth->zelp[429].first)(3,CGI->generaltexth->zelp[429].first), CGI->generaltexth->zelp[429].second, false, "sysopchk.def", nullptr, 25, 122, false); mouseShadow = new CHighlightableButton(std::bind(&CBattleInterface::setPrintMouseShadow, owner, true), std::bind(&CBattleInterface::setPrintMouseShadow, owner, false), boost::assign::map_list_of(0,CGI->generaltexth->zelp[429].first)(3,CGI->generaltexth->zelp[429].first), CGI->generaltexth->zelp[429].second, false, "sysopchk.def", nullptr, 25, 122, false);
mouseShadow->select(settings["battle"]["mouseShadow"].Bool()); mouseShadow->select(settings["battle"]["mouseShadow"].Bool());
animSpeeds = new CHighlightableButtonsGroup(0); animSpeeds = new CHighlightableButtonsGroup(0);
@ -270,12 +270,12 @@ CBattleOptionsWindow::CBattleOptionsWindow(const SDL_Rect & position, CBattleInt
animSpeeds->addButton(boost::assign::map_list_of(0,CGI->generaltexth->zelp[423].first),CGI->generaltexth->zelp[423].second, "sysob10.def", 92, 225, 63); animSpeeds->addButton(boost::assign::map_list_of(0,CGI->generaltexth->zelp[423].first),CGI->generaltexth->zelp[423].second, "sysob10.def", 92, 225, 63);
animSpeeds->addButton(boost::assign::map_list_of(0,CGI->generaltexth->zelp[424].first),CGI->generaltexth->zelp[424].second, "sysob11.def",156, 225, 100); animSpeeds->addButton(boost::assign::map_list_of(0,CGI->generaltexth->zelp[424].first),CGI->generaltexth->zelp[424].second, "sysob11.def",156, 225, 100);
animSpeeds->select(owner->getAnimSpeed(), 1); animSpeeds->select(owner->getAnimSpeed(), 1);
animSpeeds->onChange = boost::bind(&CBattleInterface::setAnimSpeed, owner, _1); animSpeeds->onChange = std::bind(&CBattleInterface::setAnimSpeed, owner, _1);
setToDefault = new CAdventureMapButton (CGI->generaltexth->zelp[393], boost::bind(&CBattleOptionsWindow::bDefaultf,this), 246, 359, "codefaul.def"); setToDefault = new CAdventureMapButton (CGI->generaltexth->zelp[393], std::bind(&CBattleOptionsWindow::bDefaultf,this), 246, 359, "codefaul.def");
setToDefault->swappedImages = true; setToDefault->swappedImages = true;
setToDefault->update(); setToDefault->update();
exit = new CAdventureMapButton (CGI->generaltexth->zelp[392], boost::bind(&CBattleOptionsWindow::bExitf,this), 357, 359, "soretrn.def",SDLK_RETURN); exit = new CAdventureMapButton (CGI->generaltexth->zelp[392], std::bind(&CBattleOptionsWindow::bExitf,this), 357, 359, "soretrn.def",SDLK_RETURN);
exit->swappedImages = true; exit->swappedImages = true;
exit->update(); exit->update();
@ -322,7 +322,7 @@ CBattleResultWindow::CBattleResultWindow(const BattleResult &br, const SDL_Rect
CPicture * bg = new CPicture("CPRESULT"); CPicture * bg = new CPicture("CPRESULT");
bg->colorize(owner.playerID); bg->colorize(owner.playerID);
exit = new CAdventureMapButton ("", "", boost::bind(&CBattleResultWindow::bExitf,this), 384, 505, "iok6432.def", SDLK_RETURN); exit = new CAdventureMapButton ("", "", std::bind(&CBattleResultWindow::bExitf,this), 384, 505, "iok6432.def", SDLK_RETURN);
exit->borderColor = Colors::METALLIC_GOLD; exit->borderColor = Colors::METALLIC_GOLD;
exit->borderEnabled = true; exit->borderEnabled = true;

View File

@ -42,7 +42,7 @@ SDL_Color AnimationControls::getNoBorder()
CCreatureAnimation * AnimationControls::getAnimation(const CCreature * creature) CCreatureAnimation * AnimationControls::getAnimation(const CCreature * creature)
{ {
auto func = boost::bind(&AnimationControls::getCreatureAnimationSpeed, creature, _1, _2); auto func = std::bind(&AnimationControls::getCreatureAnimationSpeed, creature, _1, _2);
return new CCreatureAnimation(creature->animDefName, func); return new CCreatureAnimation(creature->animDefName, func);
} }

View File

@ -49,7 +49,7 @@ namespace AnimationControls
class CCreatureAnimation : public CIntObject class CCreatureAnimation : public CIntObject
{ {
public: public:
typedef boost::function<float(CCreatureAnimation *, size_t)> TSpeedController; typedef std::function<float(CCreatureAnimation *, size_t)> TSpeedController;
private: private:
std::string defName; std::string defName;

View File

@ -541,7 +541,7 @@ void CHighlightableButtonsGroup::addButton(CHighlightableButton* bt)
addChild(bt); addChild(bt);
bt->recActions = defActions;//FIXME: not needed? bt->recActions = defActions;//FIXME: not needed?
bt->callback += boost::bind(&CHighlightableButtonsGroup::selectionChanged,this,bt->ID); bt->callback += std::bind(&CHighlightableButtonsGroup::selectionChanged,this,bt->ID);
bt->onlyOn = true; bt->onlyOn = true;
buttons.push_back(bt); buttons.push_back(bt);
} }
@ -555,7 +555,7 @@ void CHighlightableButtonsGroup::addButton(const std::map<int,std::string> &tool
bt->setOffset(buttons.size()-3); bt->setOffset(buttons.size()-3);
} }
bt->ID = uid; bt->ID = uid;
bt->callback += boost::bind(&CHighlightableButtonsGroup::selectionChanged,this,bt->ID); bt->callback += std::bind(&CHighlightableButtonsGroup::selectionChanged,this,bt->ID);
bt->onlyOn = true; bt->onlyOn = true;
buttons.push_back(bt); buttons.push_back(bt);
} }
@ -784,9 +784,9 @@ CSlider::CSlider(int x, int y, int totalw, std::function<void(int)> Moved, int C
right->pos.y = pos.y + totalw - 16; right->pos.y = pos.y + totalw - 16;
} }
left->callback = boost::bind(&CSlider::moveLeft,this); left->callback = std::bind(&CSlider::moveLeft,this);
right->callback = boost::bind(&CSlider::moveRight,this); right->callback = std::bind(&CSlider::moveRight,this);
slider->callback = boost::bind(&CSlider::sliderClicked,this); slider->callback = std::bind(&CSlider::sliderClicked,this);
left->pos.w = left->pos.h = right->pos.w = right->pos.h = slider->pos.w = slider->pos.h = 16; left->pos.w = left->pos.h = right->pos.w = right->pos.h = slider->pos.w = slider->pos.h = 16;
if(horizontal) if(horizontal)
{ {
@ -979,7 +979,7 @@ CListBox::CListBox(CreateFunc create, DestroyFunc destroy, Point Pos, Point Item
if (Slider & 1) if (Slider & 1)
{ {
OBJ_CONSTRUCTION_CAPTURING_ALL; OBJ_CONSTRUCTION_CAPTURING_ALL;
slider = new CSlider(SliderPos.x, SliderPos.y, SliderPos.w, boost::bind(&CListBox::moveToPos, this, _1), slider = new CSlider(SliderPos.x, SliderPos.y, SliderPos.w, std::bind(&CListBox::moveToPos, this, _1),
VisibleSize, TotalSize, InitialPos, Slider & 2, Slider & 4); VisibleSize, TotalSize, InitialPos, Slider & 2, Slider & 4);
} }
reset(); reset();
@ -1457,7 +1457,7 @@ void CTextBox::setText(const std::string &text)
label->setText(text); label->setText(text);
OBJ_CONSTRUCTION_CAPTURING_ALL; OBJ_CONSTRUCTION_CAPTURING_ALL;
slider = new CSlider(pos.w - 32, 0, pos.h, boost::bind(&CTextBox::sliderMoved, this, _1), slider = new CSlider(pos.w - 32, 0, pos.h, std::bind(&CTextBox::sliderMoved, this, _1),
label->pos.h, label->textSize.y, 0, false, sliderStyle); label->pos.h, label->textSize.y, 0, false, sliderStyle);
slider->scrollStep = graphics->fonts[label->font]->getLineHeight(); slider->scrollStep = graphics->fonts[label->font]->getLineHeight();
} }

View File

@ -483,7 +483,7 @@ public:
//Filter that will block all characters not allowed in filenames //Filter that will block all characters not allowed in filenames
static void filenameFilter(std::string &text, const std::string & oldText); static void filenameFilter(std::string &text, const std::string & oldText);
//Filter that will allow only input of numbers in range min-max (min-max are allowed) //Filter that will allow only input of numbers in range min-max (min-max are allowed)
//min-max should be set via something like boost::bind //min-max should be set via something like std::bind
static void numberFilter(std::string &text, const std::string & oldText, int minValue, int maxValue); static void numberFilter(std::string &text, const std::string & oldText, int minValue, int maxValue);
}; };

View File

@ -254,5 +254,5 @@ void CConsoleHandler::end()
void CConsoleHandler::start() void CConsoleHandler::start()
{ {
thread = new boost::thread(boost::bind(&CConsoleHandler::run,console)); thread = new boost::thread(std::bind(&CConsoleHandler::run,console));
} }

View File

@ -33,7 +33,7 @@ void CRandomGenerator::resetSeed()
TRandI CRandomGenerator::getIntRange(int lower, int upper) TRandI CRandomGenerator::getIntRange(int lower, int upper)
{ {
return boost::bind(TIntDist(lower, upper), boost::ref(rand)); return std::bind(TIntDist(lower, upper), std::ref(rand));
} }
int CRandomGenerator::nextInt(int upper) int CRandomGenerator::nextInt(int upper)
@ -53,7 +53,7 @@ int CRandomGenerator::nextInt()
TRand CRandomGenerator::getDoubleRange(double lower, double upper) TRand CRandomGenerator::getDoubleRange(double lower, double upper)
{ {
return boost::bind(TRealDist(lower, upper), boost::ref(rand)); return std::bind(TRealDist(lower, upper), std::ref(rand));
} }
double CRandomGenerator::nextDouble(double upper) double CRandomGenerator::nextDouble(double upper)

View File

@ -26,7 +26,7 @@ void CThreadHelper::run()
{ {
boost::thread_group grupa; boost::thread_group grupa;
for(int i=0;i<threads;i++) for(int i=0;i<threads;i++)
grupa.create_thread(boost::bind(&CThreadHelper::processTasks,this)); grupa.create_thread(std::bind(&CThreadHelper::processTasks,this));
grupa.join_all(); grupa.join_all();
} }
void CThreadHelper::processTasks() void CThreadHelper::processTasks()

View File

@ -37,16 +37,16 @@ template <typename T> inline void setData(T * data, std::function<T()> func)
void DLL_LINKAGE setThreadName(const std::string &name); void DLL_LINKAGE setThreadName(const std::string &name);
#define GET_DATA(TYPE,DESTINATION,FUNCTION_TO_GET) \ #define GET_DATA(TYPE,DESTINATION,FUNCTION_TO_GET) \
(boost::bind(&setData<TYPE>,&DESTINATION,FUNCTION_TO_GET)) (std::bind(&setData<TYPE>,&DESTINATION,FUNCTION_TO_GET))
#define GET_SURFACE(SUR_DESTINATION, SUR_NAME) \ #define GET_SURFACE(SUR_DESTINATION, SUR_NAME) \
(GET_DATA \ (GET_DATA \
(SDL_Surface*,SUR_DESTINATION,\ (SDL_Surface*,SUR_DESTINATION,\
std::function<SDL_Surface*()>(boost::bind(&BitmapHandler::loadBitmap,SUR_NAME,true)))) std::function<SDL_Surface*()>(std::bind(&BitmapHandler::loadBitmap,SUR_NAME,true))))
#define GET_DEF(DESTINATION, DEF_NAME) \ #define GET_DEF(DESTINATION, DEF_NAME) \
(GET_DATA \ (GET_DATA \
(CDefHandler*,DESTINATION,\ (CDefHandler*,DESTINATION,\
std::function<CDefHandler*()>(boost::bind(CDefHandler::giveDef,DEF_NAME)))) std::function<CDefHandler*()>(std::bind(CDefHandler::giveDef,DEF_NAME))))
#define GET_DEF_ESS(DESTINATION, DEF_NAME) \ #define GET_DEF_ESS(DESTINATION, DEF_NAME) \
(GET_DATA \ (GET_DATA \
(CDefEssential*,DESTINATION,\ (CDefEssential*,DESTINATION,\
std::function<CDefEssential*()>(boost::bind(CDefHandler::giveDefEss,DEF_NAME)))) std::function<CDefEssential*()>(std::bind(CDefHandler::giveDefEss,DEF_NAME))))

View File

@ -16,23 +16,23 @@ template<typename Signature>
class CFunctionList class CFunctionList
{ {
public: public:
std::vector<boost::function<Signature> > funcs; std::vector<std::function<Signature> > funcs;
CFunctionList(int){}; CFunctionList(int){};
CFunctionList(){}; CFunctionList(){};
template <typename Functor> template <typename Functor>
CFunctionList(const Functor &f) CFunctionList(const Functor &f)
{ {
funcs.push_back(boost::function<Signature>(f)); funcs.push_back(std::function<Signature>(f));
} }
CFunctionList(const boost::function<Signature> &first) CFunctionList(const std::function<Signature> &first)
{ {
if (first) if (first)
funcs.push_back(first); funcs.push_back(first);
} }
CFunctionList(std::nullptr_t) CFunctionList(std::nullptr_t)
{} {}
CFunctionList & operator+=(const boost::function<Signature> &first) CFunctionList & operator+=(const std::function<Signature> &first)
{ {
funcs.push_back(first); funcs.push_back(first);
return *this; return *this;
@ -54,7 +54,7 @@ public:
} }
void operator()() const void operator()() const
{ {
std::vector<boost::function<Signature> > funcs2 = funcs; //backup std::vector<std::function<Signature> > funcs2 = funcs; //backup
for(size_t i=0;i<funcs2.size(); ++i) for(size_t i=0;i<funcs2.size(); ++i)
{ {
if (funcs2[i]) if (funcs2[i])
@ -64,7 +64,7 @@ public:
template <typename Arg> template <typename Arg>
void operator()(const Arg & a) const void operator()(const Arg & a) const
{ {
std::vector<boost::function<Signature> > funcs2 = funcs; //backup std::vector<std::function<Signature> > funcs2 = funcs; //backup
for(int i=0;i<funcs2.size(); i++) for(int i=0;i<funcs2.size(); i++)
{ {
if (funcs2[i]) if (funcs2[i])
@ -75,7 +75,7 @@ public:
template <typename Arg1, typename Arg2> template <typename Arg1, typename Arg2>
void operator()(Arg1 & a, Arg2 & b) const void operator()(Arg1 & a, Arg2 & b) const
{ {
std::vector<boost::function<Signature> > funcs2 = funcs; //backup std::vector<std::function<Signature> > funcs2 = funcs; //backup
for(int i=0;i<funcs2.size(); i++) for(int i=0;i<funcs2.size(); i++)
{ {
if (funcs2[i]) if (funcs2[i])

View File

@ -250,7 +250,7 @@ int BonusList::valOfBonuses(const CSelector &select) const
// void BonusList::limit(const CBonusSystemNode &node) // void BonusList::limit(const CBonusSystemNode &node)
// { // {
// remove_if(boost::bind(&CBonusSystemNode::isLimitedOnUs, boost::ref(node), _1)); // remove_if(std::bind(&CBonusSystemNode::isLimitedOnUs, std::ref(node), _1));
// } // }

View File

@ -25,12 +25,12 @@ CFilesystemGenerator::CFilesystemGenerator(std::string prefix):
CFilesystemGenerator::TLoadFunctorMap CFilesystemGenerator::genFunctorMap() CFilesystemGenerator::TLoadFunctorMap CFilesystemGenerator::genFunctorMap()
{ {
TLoadFunctorMap map; TLoadFunctorMap map;
map["map"] = boost::bind(&CFilesystemGenerator::loadJsonMap, this, _1, _2); map["map"] = std::bind(&CFilesystemGenerator::loadJsonMap, this, _1, _2);
map["dir"] = boost::bind(&CFilesystemGenerator::loadDirectory, this, _1, _2); map["dir"] = std::bind(&CFilesystemGenerator::loadDirectory, this, _1, _2);
map["lod"] = boost::bind(&CFilesystemGenerator::loadArchive<EResType::ARCHIVE_LOD>, this, _1, _2); map["lod"] = std::bind(&CFilesystemGenerator::loadArchive<EResType::ARCHIVE_LOD>, this, _1, _2);
map["snd"] = boost::bind(&CFilesystemGenerator::loadArchive<EResType::ARCHIVE_SND>, this, _1, _2); map["snd"] = std::bind(&CFilesystemGenerator::loadArchive<EResType::ARCHIVE_SND>, this, _1, _2);
map["vid"] = boost::bind(&CFilesystemGenerator::loadArchive<EResType::ARCHIVE_VID>, this, _1, _2); map["vid"] = std::bind(&CFilesystemGenerator::loadArchive<EResType::ARCHIVE_VID>, this, _1, _2);
map["zip"] = boost::bind(&CFilesystemGenerator::loadZipArchive, this, _1, _2); map["zip"] = std::bind(&CFilesystemGenerator::loadZipArchive, this, _1, _2);
return map; return map;
} }

View File

@ -20,7 +20,7 @@ class JsonNode;
/// Helper class that allows generation of a ISimpleResourceLoader entry out of Json config(s) /// Helper class that allows generation of a ISimpleResourceLoader entry out of Json config(s)
class DLL_LINKAGE CFilesystemGenerator class DLL_LINKAGE CFilesystemGenerator
{ {
typedef boost::function<void(const std::string &, const JsonNode &)> TLoadFunctor; typedef std::function<void(const std::string &, const JsonNode &)> TLoadFunctor;
typedef std::map<std::string, TLoadFunctor> TLoadFunctorMap; typedef std::map<std::string, TLoadFunctor> TLoadFunctorMap;
CFilesystemList * filesystem; CFilesystemList * filesystem;

View File

@ -25,7 +25,7 @@ void CMapGenerator::foreach_neighbour(const int3 &pos, std::function<void(int3&
CMapGenerator::CMapGenerator() : CMapGenerator::CMapGenerator() :
monolithIndex(0), zonesTotal(0) zonesTotal(0), monolithIndex(0)
{ {
} }

View File

@ -1474,7 +1474,7 @@ void CGameHandler::run(bool resume)
if(j->second == elem) if(j->second == elem)
pom.insert(j->first); pom.insert(j->first);
boost::thread(boost::bind(&CGameHandler::handleConnection,this,pom,boost::ref(*elem))); boost::thread(std::bind(&CGameHandler::handleConnection,this,pom,std::ref(*elem)));
} }
if(gs->scenarioOps->mode == StartInfo::DUEL) if(gs->scenarioOps->mode == StartInfo::DUEL)

View File

@ -230,7 +230,7 @@ void CPregameServer::start_async_accept()
assert(acceptor); assert(acceptor);
upcomingConnection = new TSocket(acceptor->get_io_service()); upcomingConnection = new TSocket(acceptor->get_io_service());
acceptor->async_accept(*upcomingConnection, boost::bind(&CPregameServer::connectionAccepted, this, _1)); acceptor->async_accept(*upcomingConnection, std::bind(&CPregameServer::connectionAccepted, this, _1));
} }
void CPregameServer::announceTxt(const std::string &txt, const std::string &playerName /*= "system"*/) void CPregameServer::announceTxt(const std::string &txt, const std::string &playerName /*= "system"*/)
@ -415,7 +415,7 @@ void CVCMIServer::start()
boost::system::error_code error; boost::system::error_code error;
logNetwork->infoStream()<<"Listening for connections at port " << acceptor->local_endpoint().port(); logNetwork->infoStream()<<"Listening for connections at port " << acceptor->local_endpoint().port();
auto s = new tcp::socket(acceptor->get_io_service()); auto s = new tcp::socket(acceptor->get_io_service());
boost::thread acc(boost::bind(vaccept,acceptor,s,&error)); boost::thread acc(std::bind(vaccept,acceptor,s,&error));
#ifndef __ANDROID__ #ifndef __ANDROID__
sr->setToTrueAndNotify(); sr->setToTrueAndNotify();
delete mr; delete mr;