mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Fix infobox resetting to current hero during enemy turn
This commit is contained in:
parent
1cbc6457ce
commit
1dff721747
@ -83,8 +83,11 @@ void AdventureMapInterface::onAudioPaused()
|
||||
|
||||
void AdventureMapInterface::onHeroMovementStarted(const CGHeroInstance * hero)
|
||||
{
|
||||
widget->getInfoBar()->popAll();
|
||||
widget->getInfoBar()->showSelection();
|
||||
if (shortcuts->optionMapViewActive())
|
||||
{
|
||||
widget->getInfoBar()->popAll();
|
||||
widget->getInfoBar()->showSelection();
|
||||
}
|
||||
}
|
||||
|
||||
void AdventureMapInterface::onHeroChanged(const CGHeroInstance *h)
|
||||
@ -134,15 +137,15 @@ void AdventureMapInterface::activate()
|
||||
}
|
||||
|
||||
void AdventureMapInterface::deactivate()
|
||||
{
|
||||
CIntObject::deactivate();
|
||||
CCS->curh->set(Cursor::Map::POINTER);
|
||||
|
||||
if(LOCPLINT)
|
||||
LOCPLINT->cingconsole->deactivate();
|
||||
}
|
||||
|
||||
void AdventureMapInterface::showAll(Canvas & to)
|
||||
{
|
||||
CIntObject::deactivate();
|
||||
CCS->curh->set(Cursor::Map::POINTER);
|
||||
|
||||
if(LOCPLINT)
|
||||
LOCPLINT->cingconsole->deactivate();
|
||||
}
|
||||
|
||||
void AdventureMapInterface::showAll(Canvas & to)
|
||||
{
|
||||
CIntObject::showAll(to);
|
||||
LOCPLINT->cingconsole->show(to);
|
||||
|
@ -37,8 +37,6 @@ CIntObject::~CIntObject()
|
||||
if(isActive())
|
||||
deactivate();
|
||||
|
||||
GH.events().assertElementInactive(this);
|
||||
|
||||
while(!children.empty())
|
||||
{
|
||||
if((defActions & DISPOSE) && (children.front()->recActions & DISPOSE))
|
||||
@ -104,7 +102,7 @@ void CIntObject::deactivate()
|
||||
|
||||
void CIntObject::addUsedEvents(ui16 newActions)
|
||||
{
|
||||
if (isActive())
|
||||
if (isActive() && inputEnabled)
|
||||
activateEvents(~used & newActions);
|
||||
used |= newActions;
|
||||
}
|
||||
|
@ -138,6 +138,9 @@ void CListBox::reset()
|
||||
|
||||
void CListBox::resize(size_t newSize)
|
||||
{
|
||||
if (totalSize == newSize)
|
||||
return;
|
||||
|
||||
totalSize = newSize;
|
||||
if (slider)
|
||||
slider->setAmount((int)totalSize);
|
||||
|
Loading…
Reference in New Issue
Block a user