From 6438e784344924eb9ace561ec7fcc2b723dcb0dd Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 18 Oct 2013 12:22:01 +0300 Subject: move virtual member calls from equipmentwindow constuctor into postInit. --- src/game.cpp | 2 ++ src/gui/windows/equipmentwindow.cpp | 3 +++ src/gui/windows/equipmentwindow.h | 2 ++ 3 files changed, 7 insertions(+) (limited to 'src') diff --git a/src/game.cpp b/src/game.cpp index 7b65147e4..3e2b1859d 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -212,7 +212,9 @@ static void createGuiWindows() tradeWindow = new TradeWindow; equipmentWindow = new EquipmentWindow(PlayerInfo::getEquipment(), player_node); + equipmentWindow->postInit(); beingEquipmentWindow = new EquipmentWindow(nullptr, nullptr, true); + beingEquipmentWindow->postInit(); beingEquipmentWindow->setVisible(false); statusWindow = new StatusWindow; miniStatusWindow = new MiniStatusWindow; diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp index 1fe0387e4..43391e611 100644 --- a/src/gui/windows/equipmentwindow.cpp +++ b/src/gui/windows/equipmentwindow.cpp @@ -113,7 +113,10 @@ EquipmentWindow::EquipmentWindow(Equipment *const equipment, recalcSize(); loadWindowState(); +} +void EquipmentWindow::postInit() +{ const gcn::Rectangle &area = getChildrenArea(); mUnequip->setPosition(area.width - mUnequip->getWidth() - mButtonPadding, area.height - mUnequip->getHeight() - mButtonPadding); diff --git a/src/gui/windows/equipmentwindow.h b/src/gui/windows/equipmentwindow.h index 4100206ed..1a2b9467f 100644 --- a/src/gui/windows/equipmentwindow.h +++ b/src/gui/windows/equipmentwindow.h @@ -76,6 +76,8 @@ class EquipmentWindow final : public Window, public gcn::ActionListener */ ~EquipmentWindow(); + void postInit(); + /** * Draws the equipment window. */ -- cgit v1.2.3-70-g09d2