summaryrefslogtreecommitdiff
path: root/src/gui/windows/itemamountwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/windows/itemamountwindow.cpp')
-rw-r--r--src/gui/windows/itemamountwindow.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gui/windows/itemamountwindow.cpp b/src/gui/windows/itemamountwindow.cpp
index 7ad559c92..0c0f0bfe2 100644
--- a/src/gui/windows/itemamountwindow.cpp
+++ b/src/gui/windows/itemamountwindow.cpp
@@ -156,10 +156,8 @@ ItemAmountWindow::ItemAmountWindow(const Usage usage, Window *const parent,
mEnabledKeyboard(keyboard.isEnabled())
{
if (!mItem)
- {
- setVisible(false);
return;
- }
+
if (usage == ShopBuyAdd)
mMax = 10000;
else if (!mMax)
@@ -297,11 +295,15 @@ ItemAmountWindow::ItemAmountWindow(const Usage usage, Window *const parent,
}
setLocationRelativeTo(getParentWindow());
- setVisible(true);
mItemIcon->addMouseListener(this);
}
+void ItemAmountWindow::postInit()
+{
+ setVisible(mItem);
+}
+
ItemAmountWindow::~ItemAmountWindow()
{
delete mItemPopup;
@@ -448,5 +450,5 @@ void ItemAmountWindow::showWindow(const Usage usage, Window *const parent,
if (usage != ShopBuyAdd && usage != ShopSellAdd && maxRange <= 1)
finish(item, maxRange, 0, usage);
else
- new ItemAmountWindow(usage, parent, item, maxRange);
+ (new ItemAmountWindow(usage, parent, item, maxRange))->postInit();
}