1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +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

@ -2219,7 +2219,7 @@ void CGCreature::joinDecision(const CGHeroInstance *h, int cost, ui32 accept) co
}
else
{
cb->showGarrisonDialog(id,h->id,boost::bind(&IGameCallback::removeObject,cb,id)); //show garrison window and remove ourselves from map when player ends
cb->showGarrisonDialog(id,h->id,true,boost::bind(&IGameCallback::removeObject,cb,id)); //show garrison window and remove ourselves from map when player ends
}
}
}
@ -2245,7 +2245,7 @@ void CGMine::onHeroVisit( const CGHeroInstance * h ) const
if(h->tempOwner == tempOwner) //we're visiting our mine
{
cb->showGarrisonDialog(id,h->id,0);
cb->showGarrisonDialog(id,h->id,true,0);
return;
}
@ -3350,7 +3350,7 @@ void CGPandoraBox::giveContents( const CGHeroInstance *h, bool afterBattle ) con
SetGarrisons sg;
sg.garrs[id] = creatures;
cb->sendAndApply(&sg);
cb->showGarrisonDialog(id,h->id,boost::bind(&IGameCallback::removeObject,cb,id));
cb->showGarrisonDialog(id,h->id,true,boost::bind(&IGameCallback::removeObject,cb,id));
}
if(!afterBattle && message.size())
@ -3631,7 +3631,7 @@ void CGGarrison::onHeroVisit (const CGHeroInstance *h) const
if (h->tempOwner != tempOwner)
cb->setOwner(id, h->tempOwner);
//TODO: Garrison visit screen.
cb->showGarrisonDialog(id, h->id, removableUnits, 0);
}
void CGGarrison::fightOver (const CGHeroInstance *h, BattleResult *result) const