1
0
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:
Ivan Savenko 2023-07-04 20:03:10 +03:00
parent 1cbc6457ce
commit 1dff721747
3 changed files with 18 additions and 14 deletions

View File

@ -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);

View File

@ -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;
}

View File

@ -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);