mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-30 17:06:47 +00:00
Fix trade windows crashing after a new game
This commit is contained in:
parent
e32c73725c
commit
7eb1dcb682
2 changed files with 8 additions and 3 deletions
|
@ -220,11 +220,13 @@ namespace MWGui
|
|||
|
||||
mDisposeCorpseButton->setVisible(loot);
|
||||
|
||||
setTitle(MWWorld::Class::get(container).getName(container));
|
||||
|
||||
mSortModel = new SortFilterItemModel(mModel);
|
||||
|
||||
mItemView->setModel (mSortModel);
|
||||
|
||||
// Careful here. setTitle may cause size updates, causing itemview redraw, so make sure to do it last
|
||||
// or we end up using a possibly invalid model.
|
||||
setTitle(MWWorld::Class::get(container).getName(container));
|
||||
}
|
||||
|
||||
void ContainerWindow::onCloseButtonClicked(MyGUI::Widget* _sender)
|
||||
|
|
|
@ -82,7 +82,6 @@ namespace MWGui
|
|||
void TradeWindow::startTrade(const MWWorld::Ptr& actor)
|
||||
{
|
||||
mPtr = actor;
|
||||
setTitle(MWWorld::Class::get(actor).getName(actor));
|
||||
|
||||
mCurrentBalance = 0;
|
||||
mCurrentMerchantOffer = 0;
|
||||
|
@ -99,6 +98,10 @@ namespace MWGui
|
|||
mItemView->setModel (mSortModel);
|
||||
|
||||
updateLabels();
|
||||
|
||||
// Careful here. setTitle may cause size updates, causing itemview redraw, so make sure to do it last
|
||||
// or we end up using a possibly invalid model.
|
||||
setTitle(MWWorld::Class::get(actor).getName(actor));
|
||||
}
|
||||
|
||||
void TradeWindow::onFilterChanged(MyGUI::Widget* _sender)
|
||||
|
|
Loading…
Reference in a new issue