1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-23 00:28:08 +02:00

Miscellaneous fixes:

- proper block of "back" button in campaign menu.
- proper block of AI switch in battles
- vertical garrisons can now be attacked from top
- better UI logging, vcmi will print to log file all pressed buttons
- server will not try to build already existing building
This commit is contained in:
Ivan Savenko
2014-01-13 17:44:21 +00:00
parent fb5c9fc972
commit c5b74a2dce
6 changed files with 31 additions and 7 deletions

View File

@ -3139,8 +3139,6 @@ void CBonusSelection::init()
startB = new CAdventureMapButton("", "", boost::bind(&CBonusSelection::startMap, this), 475, 536, "CBBEGIB.DEF", SDLK_RETURN);
restartB = new CAdventureMapButton("", "", boost::bind(&CBonusSelection::restartMap, this), 475, 536, "CBRESTB.DEF", SDLK_RETURN);
backB = new CAdventureMapButton("", "", boost::bind(&CBonusSelection::goBack, this), 624, 536, "CBCANCB.DEF", SDLK_ESCAPE);
// block back button for in-progress campaigns. May not be H3 behaviour but avoids the crash
backB->block(!ourCampaign->mapsConquered.empty());
//campaign name
if (ourCampaign->camp->header.name.length())
@ -3299,12 +3297,17 @@ void CBonusSelection::selectMap(int mapNr, bool initialSelect)
// draw start button
restartB->disable();
startB->enable();
if (!ourCampaign->mapsConquered.empty())
backB->block(true);
else
backB->block(false);
}
else
{
// draw restart button
startB->disable();
restartB->enable();
backB->block(false);
}
startInfo.difficulty = ourCampaign->camp->scenarios[mapNr].difficulty;