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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user