1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-29 00:06:41 +00:00

Do not keep outdated references in the UserData

This commit is contained in:
Andrei Kortunov 2023-11-17 10:59:44 +04:00
parent 1440bcaf2a
commit fa8f92b5ab

View file

@ -421,6 +421,7 @@ namespace MWGui
mSpellBox->setUserString("ToolTipType", "Spell");
mSpellBox->setUserString("Spell", spellId.serialize());
mSpellBox->setUserData(MyGUI::Any::Null);
// use the icon of the first effect
const ESM::MagicEffect* effect = MWBase::Environment::get().getESMStore()->get<ESM::MagicEffect>().find(
@ -491,6 +492,7 @@ namespace MWGui
mSpellStatus->setProgressPosition(0);
mSpellImage->setItem(MWWorld::Ptr());
mSpellBox->clearUserStrings();
mSpellBox->setUserData(MyGUI::Any::Null);
}
void HUD::unsetSelectedWeapon()
@ -520,6 +522,7 @@ namespace MWGui
mWeapBox->setUserString("ToolTipLayout", "HandToHandToolTip");
mWeapBox->setUserString("Caption_HandToHandText", itemName);
mWeapBox->setUserString("ImageTexture_HandToHandImage", icon);
mWeapBox->setUserData(MyGUI::Any::Null);
}
void HUD::setCrosshairVisible(bool visible)
@ -671,7 +674,9 @@ namespace MWGui
mSpellImage->setIcon(std::string());
mWeapBox->clearUserStrings();
mWeapBox->setUserData(MyGUI::Any::Null);
mSpellBox->clearUserStrings();
mSpellBox->setUserData(MyGUI::Any::Null);
}
void HUD::customMarkerCreated(MyGUI::Widget* marker)