From 18973230c163336944a7a0ecf466daa563cf8355 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 28 Sep 2014 18:30:37 +0300 Subject: Add support for pages in equipment window. --- src/gui/windows/equipmentwindow.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/gui/windows/equipmentwindow.h') diff --git a/src/gui/windows/equipmentwindow.h b/src/gui/windows/equipmentwindow.h index 30fdcc366..628b2fdbe 100644 --- a/src/gui/windows/equipmentwindow.h +++ b/src/gui/windows/equipmentwindow.h @@ -26,6 +26,7 @@ #include "equipment.h" #include "localconsts.h" +#include "gui/widgets/equipmentpage.h" #include "gui/widgets/window.h" #include "utils/xml.h" @@ -40,6 +41,7 @@ class Image; class ImageSet; class Item; class PlayerBox; +class TabStrip; struct EquipmentBox; @@ -102,14 +104,23 @@ class EquipmentWindow final : public Window, void fillDefault(); + void updatePage(); + + int addPage(const std::string &name); + + void addDefaultPage(); + void addBox(const int idx, int x, int y, const int imageIndex); void loadWindow(const XmlNodePtrConst windowNode); - void loadPlayerBox(const XmlNodePtr playerBoxNode); + void loadPage(const XmlNodePtr node); + + void loadPlayerBox(const XmlNodePtr playerBoxNode, const int page); void loadSlot(const XmlNodePtr slotNode, - const ImageSet *const imageset); + const ImageSet *const imageset, + const int page); static int parseSlotName(const std::string &name) A_WARN_UNUSED; @@ -123,7 +134,8 @@ class EquipmentWindow final : public Window, Image *mSlotBackground; Image *mSlotHighlightedBackground; ImageCollection *mVertexes; - std::vector mBoxes; + std::vector mPages; + TabStrip *mTabs; Color mHighlightColor; Color mBorderColor; Color mLabelsColor; @@ -136,7 +148,10 @@ class EquipmentWindow final : public Window, int mMinY; int mMaxX; int mMaxY; + int mYPadding; + int mSelectedTab; bool mForing; + bool mHaveDefaultPage; }; extern EquipmentWindow *equipmentWindow; -- cgit v1.2.3-60-g2f50