1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Large refactoring of button classes:

- renamed CAdventureMapButton to more expectable CButton
- merged CButtonBase into CButton
- created more generic class for clickable elements
- created more generic class for selectable elements
- renamed CHighlightableButton to CToggleButton
- renamed CHighlightableButtonsGrous to CToggleGroup
- minimized differences between API of all these classes
- removed all but one contructors in buttons, with same parameters across all classes
This commit is contained in:
Ivan Savenko
2014-08-03 14:16:19 +03:00
parent 731aedf3a1
commit 10fc1892a8
37 changed files with 937 additions and 929 deletions

View File

@ -1292,8 +1292,8 @@ void CPlayerInterface::moveHero( const CGHeroInstance *h, CGPath path )
if (adventureInt && adventureInt->isHeroSleeping(h))
{
adventureInt->sleepWake.clickLeft(true, false);
adventureInt->sleepWake.clickLeft(false, true);
adventureInt->sleepWake->clickLeft(true, false);
adventureInt->sleepWake->clickLeft(false, true);
//could've just called
//adventureInt->fsleepWake();
//but no authentic button click/sound ;-)
@ -1328,7 +1328,7 @@ void CPlayerInterface::showGarrisonDialog( const CArmedInstance *up, const CGHer
waitForAllDialogs();
auto cgw = new CGarrisonWindow(up,down,removableUnits);
cgw->quit->callback += onEnd;
cgw->quit->addCallback(onEnd);
GH.pushInt(cgw);
}
@ -2246,7 +2246,7 @@ void CPlayerInterface::acceptTurn()
if(CInfoWindow *iw = dynamic_cast<CInfoWindow *>(GH.topInt()))
iw->close();
adventureInt->endTurn.callback();
adventureInt->fendTurn();
}
// warn player if he has no town