forked from mirror/openmw-tes3mp
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);
|
mDisposeCorpseButton->setVisible(loot);
|
||||||
|
|
||||||
setTitle(MWWorld::Class::get(container).getName(container));
|
|
||||||
|
|
||||||
mSortModel = new SortFilterItemModel(mModel);
|
mSortModel = new SortFilterItemModel(mModel);
|
||||||
|
|
||||||
mItemView->setModel (mSortModel);
|
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)
|
void ContainerWindow::onCloseButtonClicked(MyGUI::Widget* _sender)
|
||||||
|
|
|
@ -82,7 +82,6 @@ namespace MWGui
|
||||||
void TradeWindow::startTrade(const MWWorld::Ptr& actor)
|
void TradeWindow::startTrade(const MWWorld::Ptr& actor)
|
||||||
{
|
{
|
||||||
mPtr = actor;
|
mPtr = actor;
|
||||||
setTitle(MWWorld::Class::get(actor).getName(actor));
|
|
||||||
|
|
||||||
mCurrentBalance = 0;
|
mCurrentBalance = 0;
|
||||||
mCurrentMerchantOffer = 0;
|
mCurrentMerchantOffer = 0;
|
||||||
|
@ -99,6 +98,10 @@ namespace MWGui
|
||||||
mItemView->setModel (mSortModel);
|
mItemView->setModel (mSortModel);
|
||||||
|
|
||||||
updateLabels();
|
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)
|
void TradeWindow::onFilterChanged(MyGUI::Widget* _sender)
|
||||||
|
|
Loading…
Reference in a new issue