diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-08-22 17:58:31 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-08-25 22:09:32 +0200 |
commit | 221d67c4774bf41e6f2f0f73fb6914030e33bdde (patch) | |
tree | 6fbb4de64d172c196ed617176d5346dd4d774c49 /src/gui/equipmentwindow.h | |
parent | 9e313b385bae45a88338a2dbfb008af7a9e38e7a (diff) | |
download | mana-221d67c4774bf41e6f2f0f73fb6914030e33bdde.tar.gz mana-221d67c4774bf41e6f2f0f73fb6914030e33bdde.tar.bz2 mana-221d67c4774bf41e6f2f0f73fb6914030e33bdde.tar.xz mana-221d67c4774bf41e6f2f0f73fb6914030e33bdde.zip |
Fixed initialization of equipment backend
For new characters (and in general, when logging in with a character
that had nothing equipped), the equipment backend wasn't being
initialized. This resulted in the equipment not being visible in the
Equipment window.
Fixes #83
Diffstat (limited to 'src/gui/equipmentwindow.h')
-rw-r--r-- | src/gui/equipmentwindow.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/equipmentwindow.h b/src/gui/equipmentwindow.h index 19630e0b..1b63c866 100644 --- a/src/gui/equipmentwindow.h +++ b/src/gui/equipmentwindow.h @@ -62,7 +62,7 @@ class EquipmentWindow : public Window, public gcn::ActionListener /** * Returns the current selected slot or -1 if none. */ - int getSelected() + int getSelected() const { return mSelected; } protected: @@ -76,16 +76,16 @@ class EquipmentWindow : public Window, public gcn::ActionListener Image *backgroundImage = nullptr; }; - EquipBox *mEquipBox = nullptr; /**< Equipment Boxes. */ + std::vector<EquipBox> mBoxes; /**< Equipment boxes. */ - int mSelected = -1; /**< Index of selected item. */ + int mSelected = -1; /**< Index of selected item. */ Equipment *mEquipment; - int mBoxesNumber = 0; /**< Number of equipment boxes to display */ private: void mouseExited(gcn::MouseEvent &event) override; void mouseMoved(gcn::MouseEvent &event) override; + int getBoxIndex(int x, int y) const; Item *getItem(int x, int y) const; std::string getSlotName(int x, int y) const; |