From cd511bda4e07f5de49ef66eff9d2fe4d649c17b6 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Wed, 4 Feb 2009 18:36:02 -0700 Subject: Simplified equipment window initialization, since only the local player has an inventory or an equipment. Signed-off-by: Ira Rice --- src/gui/equipmentwindow.cpp | 4 ++-- src/gui/equipmentwindow.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/gui') diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp index 8a7b23ae..5ba9501d 100644 --- a/src/gui/equipmentwindow.cpp +++ b/src/gui/equipmentwindow.cpp @@ -58,9 +58,8 @@ static const int boxPosition[][2] = { {129, 78} // EQUIP_AMMO_SLOT }; -EquipmentWindow::EquipmentWindow(Equipment *equipment): +EquipmentWindow::EquipmentWindow(): Window(_("Equipment")), - mEquipment(equipment), mSelected(-1) { mItemPopup = new ItemPopup(); @@ -89,6 +88,7 @@ EquipmentWindow::EquipmentWindow(Equipment *equipment): mEquipBox[i].posY = boxPosition[i][1] + getTitleBarHeight(); } + mEquipment = player_node->mEquipment.get(); mInventory = player_node->getInventory(); } diff --git a/src/gui/equipmentwindow.h b/src/gui/equipmentwindow.h index b64c768b..4ae3300f 100644 --- a/src/gui/equipmentwindow.h +++ b/src/gui/equipmentwindow.h @@ -52,7 +52,7 @@ class EquipmentWindow : public Window, public gcn::ActionListener /** * Constructor. */ - EquipmentWindow(Equipment *equipment); + EquipmentWindow(); /** * Destructor. @@ -68,8 +68,6 @@ class EquipmentWindow : public Window, public gcn::ActionListener void mousePressed(gcn::MouseEvent& mouseEvent); - Item* getItem(const int &x, const int &y); - enum { // Equipment rules: EQUIP_LEGS_SLOT = 0, @@ -91,6 +89,8 @@ class EquipmentWindow : public Window, public gcn::ActionListener void mouseExited(gcn::MouseEvent &event); void mouseMoved(gcn::MouseEvent &event); + Item* getItem(const int &x, const int &y); + Equipment *mEquipment; Inventory *mInventory; gcn::Button *mUnequip; /**< Button for unequipping. */ -- cgit v1.2.3-70-g09d2