1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

* Garrison dialogs for garrisons. Required a bit restructuring of the code to take removable units into account. All showGarrisonDialog methods and the GarrisonDialog struct now takes it as a parameter. Visiting ally towns would benefit from this other than garrisons.

* Garrison right-click information shown, but not taking detailed info into account.
* Town info dialogs centered around cursor.
This commit is contained in:
OnionKnight
2009-09-09 17:49:03 +00:00
parent 9e7771272d
commit 3d2ab9c753
16 changed files with 115 additions and 73 deletions

View File

@@ -1587,7 +1587,7 @@ void CGameHandler::giveCreatures (int objid, const CGHeroInstance * h, CCreature
SetGarrisons sg;
sg.garrs[objid] = *creatures;
sendAndApply(&sg);
showGarrisonDialog(objid, h->id, 0);
showGarrisonDialog(objid, h->id, true, 0);
return;
}
}
@@ -3191,7 +3191,7 @@ ui32 CGameHandler::getQueryResult( ui8 player, int queryID )
return 0;
}
void CGameHandler::showGarrisonDialog( int upobj, int hid, const boost::function<void()> &cb )
void CGameHandler::showGarrisonDialog( int upobj, int hid, bool removableUnits, const boost::function<void()> &cb )
{
ui8 player = getOwner(hid);
GarrisonDialog gd;
@@ -3205,6 +3205,7 @@ void CGameHandler::showGarrisonDialog( int upobj, int hid, const boost::function
allowedExchanges[QID] = std::pair<si32,si32>(upobj,hid);
states.addQuery(player,QID);
QID++;
gd.removableUnits = removableUnits;
sendAndApply(&gd);
}
}