diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/skin.cpp | 2 | ||||
-rw-r--r-- | src/gui/skin.h | 6 | ||||
-rw-r--r-- | src/gui/theme.cpp | 3 | ||||
-rw-r--r-- | src/gui/windows/equipmentwindow.cpp | 4 | ||||
-rw-r--r-- | src/gui/windows/equipmentwindow.h | 3 |
5 files changed, 10 insertions, 8 deletions
diff --git a/src/gui/skin.cpp b/src/gui/skin.cpp index 42c93b80e..5ffd3c7c9 100644 --- a/src/gui/skin.cpp +++ b/src/gui/skin.cpp @@ -37,7 +37,7 @@ Skin::Skin(ImageRect *const restrict skin, const ImageRect *const restrict images, const std::string &filePath, const std::string &name, const int padding, const int titlePadding, - std::map<std::string, int> *restrict const options) : + StringIntMap *restrict const options) : instances(1), mFilePath(filePath), mName(name), diff --git a/src/gui/skin.h b/src/gui/skin.h index 6350fd878..150c04eeb 100644 --- a/src/gui/skin.h +++ b/src/gui/skin.h @@ -25,6 +25,8 @@ #ifndef GUI_SKIN_H #define GUI_SKIN_H +#include "utils/stringmap.h" + #include <map> #include <string> @@ -42,7 +44,7 @@ class Skin final const std::string &name = "", const int padding = 3, const int titlePadding = 4, - std::map<std::string, int> *restrict const options = nullptr); + StringIntMap *restrict const options = nullptr); A_DELETE_COPY(Skin) @@ -130,7 +132,7 @@ class Skin final Image *mStickyImageDown; /**< Sticky Button Image */ int mPadding; int mTitlePadding; - std::map<std::string, int> *mOptions; + StringIntMap *mOptions; }; #endif // GUI_SKIN_H diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp index be1433e87..9898aebfc 100644 --- a/src/gui/theme.cpp +++ b/src/gui/theme.cpp @@ -400,8 +400,7 @@ Skin *Theme::readSkin(const std::string &filename, const bool full) int stickySpacing = 3; int stickyPadding = 3; int resizePadding = 2; - std::map<std::string, int> *const mOptions - = new std::map<std::string, int>(); + StringIntMap *const mOptions = new StringIntMap; // iterate <widget>'s for_each_xml_child_node(widgetNode, rootNode) diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp index 17cb77621..e50b0c488 100644 --- a/src/gui/windows/equipmentwindow.cpp +++ b/src/gui/windows/equipmentwindow.cpp @@ -59,7 +59,7 @@ EquipmentWindow *equipmentWindow = nullptr; EquipmentWindow *beingEquipmentWindow = nullptr; static const int BOX_COUNT = 27; -std::map<std::string, int> EquipmentWindow::mSlotNames; +StringIntMap EquipmentWindow::mSlotNames; EquipmentWindow::EquipmentWindow(Equipment *const equipment, Being *const being, @@ -689,7 +689,7 @@ void EquipmentWindow::prepareSlotNames() int EquipmentWindow::parseSlotName(const std::string &name) { - std::map<std::string, int>::const_iterator it = mSlotNames.find(name); + StringIntMapCIter it = mSlotNames.find(name); if (it != mSlotNames.end()) return (*it).second; return -1; diff --git a/src/gui/windows/equipmentwindow.h b/src/gui/windows/equipmentwindow.h index 0b6439f31..27526486a 100644 --- a/src/gui/windows/equipmentwindow.h +++ b/src/gui/windows/equipmentwindow.h @@ -28,6 +28,7 @@ #include "gui/widgets/window.h" +#include "utils/stringmap.h" #include "utils/xml.h" #include "listeners/actionlistener.h" @@ -125,7 +126,7 @@ class EquipmentWindow final : public Window, static int parseSlotName(const std::string &name) A_WARN_UNUSED; - static std::map<std::string, int> mSlotNames; + static StringIntMap mSlotNames; Equipment *mEquipment; |