|
@@ -48,8 +48,8 @@ CHeroWindow::CHeroWindow(int playerColor):
|
|
|
dismissButton = new AdventureMapButton(std::string(), CGI->generaltexth->heroscrn[28], boost::bind(&CHeroWindow::dismissCurrent,this), 519, 437, "hsbtns2.def", false, NULL, false);
|
|
|
questlogButton = new AdventureMapButton(CGI->generaltexth->heroscrn[0], std::string(), boost::bind(&CHeroWindow::questlog,this), 379, 437, "hsbtns4.def", false, NULL, false);
|
|
|
|
|
|
- gar1button = new AdventureMapButton(CGI->generaltexth->heroscrn[23], CGI->generaltexth->heroscrn[29], boost::bind(&CHeroWindow::gar1,this), 546, 491, "hsbtns6.def", false, NULL, false);
|
|
|
- gar3button = new AdventureMapButton(CGI->generaltexth->heroscrn[24], CGI->generaltexth->heroscrn[30], boost::bind(&CHeroWindow::gar3,this), 546, 527, "hsbtns7.def", false, NULL, false);
|
|
|
+ gar1button = new CHighlightableButton(0,0,map_list_of(0,CGI->generaltexth->heroscrn[23]), CGI->generaltexth->heroscrn[29], false, "hsbtns6.def" , NULL,546, 491, false);
|
|
|
+ gar3button = new CHighlightableButton(0,0,map_list_of(0,CGI->generaltexth->heroscrn[24]), CGI->generaltexth->heroscrn[30], false, "hsbtns7.def", NULL, 546, 527, false);
|
|
|
gar2button = new CHighlightableButton(0, 0, map_list_of(0,CGI->generaltexth->heroscrn[26])(3,CGI->generaltexth->heroscrn[25]), CGI->generaltexth->heroscrn[31], false, "hsbtns8.def", NULL, 604, 491, false);
|
|
|
gar4button = new AdventureMapButton(CGI->generaltexth->allTexts[256], CGI->generaltexth->heroscrn[32], boost::function<void()>(), 604, 527, "hsbtns9.def", false, NULL, false);
|
|
|
boost::algorithm::replace_first(gar4button->hoverTexts[0],"%s",CGI->generaltexth->allTexts[43]);
|
|
@@ -307,9 +307,21 @@ void CHeroWindow::setHero(const CGHeroInstance *Hero)
|
|
|
else
|
|
|
{
|
|
|
gar2button->block(false);
|
|
|
- gar2button->callback = boost::bind(vstd::assign<bool,bool>,boost::ref(hero->tacticFormationEnabled), true);
|
|
|
- gar2button->callback2 = boost::bind(vstd::assign<bool,bool>,boost::ref(hero->tacticFormationEnabled), true);
|
|
|
- }
|
|
|
+ gar2button->callback = vstd::assigno(hero->tacticFormationEnabled,true);
|
|
|
+ gar2button->callback2 = vstd::assigno(hero->tacticFormationEnabled,false);
|
|
|
+ }
|
|
|
+ gar1button->callback.clear();
|
|
|
+ gar1button->callback = vstd::assigno(hero->looseFormation,true);
|
|
|
+ gar1button->callback += boost::bind(&CHighlightableButton::select, gar3button, false);
|
|
|
+ gar1button->callback += boost::bind(&CCallback::setFormation, LOCPLINT->cb, Hero, true);
|
|
|
+ gar3button->callback.clear();
|
|
|
+ gar3button->callback = vstd::assigno(hero->looseFormation,false);
|
|
|
+ gar3button->callback += boost::bind(&CHighlightableButton::select, gar1button, false);
|
|
|
+ gar3button->callback += boost::bind(&CCallback::setFormation, LOCPLINT->cb, Hero, false);
|
|
|
+ if(hero->looseFormation)
|
|
|
+ gar1button->select(true);
|
|
|
+ else
|
|
|
+ gar3button->select(true);
|
|
|
redrawCurBack();
|
|
|
}
|
|
|
|