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