mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-03 16:45:33 +00:00
Reset item model when reference is reset (Fixes #1628)
This caused crashes when the window was resized after the reference no longer exists (e.g. when a savegame is loaded)
This commit is contained in:
parent
0489bdcd22
commit
0295673869
6 changed files with 22 additions and 0 deletions
|
@ -153,6 +153,11 @@ void CompanionWindow::onReferenceUnavailable()
|
||||||
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Companion);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Companion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CompanionWindow::resetReference()
|
||||||
|
{
|
||||||
|
ReferenceInterface::resetReference();
|
||||||
|
mItemView->setModel(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,8 @@ namespace MWGui
|
||||||
|
|
||||||
virtual void exit();
|
virtual void exit();
|
||||||
|
|
||||||
|
virtual void resetReference();
|
||||||
|
|
||||||
void open(const MWWorld::Ptr& npc);
|
void open(const MWWorld::Ptr& npc);
|
||||||
void onFrame ();
|
void onFrame ();
|
||||||
|
|
||||||
|
|
|
@ -258,6 +258,12 @@ namespace MWGui
|
||||||
onTakeAllButtonClicked(mTakeButton);
|
onTakeAllButtonClicked(mTakeButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ContainerWindow::resetReference()
|
||||||
|
{
|
||||||
|
ReferenceInterface::resetReference();
|
||||||
|
mItemView->setModel(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
void ContainerWindow::close()
|
void ContainerWindow::close()
|
||||||
{
|
{
|
||||||
WindowBase::close();
|
WindowBase::close();
|
||||||
|
|
|
@ -54,6 +54,8 @@ namespace MWGui
|
||||||
void open(const MWWorld::Ptr& container, bool loot=false);
|
void open(const MWWorld::Ptr& container, bool loot=false);
|
||||||
virtual void close();
|
virtual void close();
|
||||||
|
|
||||||
|
virtual void resetReference();
|
||||||
|
|
||||||
virtual void exit();
|
virtual void exit();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -531,4 +531,10 @@ namespace MWGui
|
||||||
sellerStats.setLastRestockTime(MWBase::Environment::get().getWorld()->getTimeStamp());
|
sellerStats.setLastRestockTime(MWBase::Environment::get().getWorld()->getTimeStamp());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TradeWindow::resetReference()
|
||||||
|
{
|
||||||
|
ReferenceInterface::resetReference();
|
||||||
|
mItemView->setModel(NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,7 @@ namespace MWGui
|
||||||
|
|
||||||
virtual void exit();
|
virtual void exit();
|
||||||
|
|
||||||
|
virtual void resetReference();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ItemView* mItemView;
|
ItemView* mItemView;
|
||||||
|
|
Loading…
Reference in a new issue