mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-09 13:13:34 +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
40c3fa0dc1
commit
f2799ea1d9
@ -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…
x
Reference in New Issue
Block a user