summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-03-24 20:51:36 +0300
committerAndrei Karas <akaras@inbox.ru>2016-03-24 20:51:36 +0300
commitca0ca278d0c4aed9a6d50bb9a8982f5261151ab8 (patch)
tree47df9210d64faca244f5244088b11cf19da42acf /src/gui
parentb7bbb09d62b55bed26d432a6a2af9831c6ec9143 (diff)
downloadplus-ca0ca278d0c4aed9a6d50bb9a8982f5261151ab8.tar.gz
plus-ca0ca278d0c4aed9a6d50bb9a8982f5261151ab8.tar.bz2
plus-ca0ca278d0c4aed9a6d50bb9a8982f5261151ab8.tar.xz
plus-ca0ca278d0c4aed9a6d50bb9a8982f5261151ab8.zip
Rename enum ItemType into ItemDbType.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/popups/itempopup.cpp39
-rw-r--r--src/gui/popups/itempopup.h6
-rw-r--r--src/gui/widgets/itemcontainer.cpp4
-rw-r--r--src/gui/windows/buydialog.cpp4
4 files changed, 27 insertions, 26 deletions
diff --git a/src/gui/popups/itempopup.cpp b/src/gui/popups/itempopup.cpp
index 065704cb8..c1d414539 100644
--- a/src/gui/popups/itempopup.cpp
+++ b/src/gui/popups/itempopup.cpp
@@ -57,7 +57,7 @@ ItemPopup::ItemPopup() :
mItemEffect(new TextBox(this)),
mItemWeight(new TextBox(this)),
mItemCards(new TextBox(this)),
- mItemType(ItemType::UNUSABLE),
+ mItemType(ItemDbType::UNUSABLE),
mIcon(new Icon(this, nullptr)),
mLastName(),
mLastId(0),
@@ -325,29 +325,30 @@ std::string ItemPopup::getCardsString(const int *const cards)
return label->setForegroundColorAll(getThemeColor(name2), \
getThemeColor(name2##_OUTLINE)); \
}
-void ItemPopup::setLabelColor(Label *label, const ItemTypeT type) const
+void ItemPopup::setLabelColor(Label *label,
+ const ItemDbTypeT type) const
{
switch (type)
{
- caseSetColor(ItemType::UNUSABLE, ThemeColorId::GENERIC)
- caseSetColor(ItemType::USABLE, ThemeColorId::USABLE)
- caseSetColor(ItemType::EQUIPMENT_ONE_HAND_WEAPON,
+ caseSetColor(ItemDbType::UNUSABLE, ThemeColorId::GENERIC)
+ caseSetColor(ItemDbType::USABLE, ThemeColorId::USABLE)
+ caseSetColor(ItemDbType::EQUIPMENT_ONE_HAND_WEAPON,
ThemeColorId::ONEHAND)
- caseSetColor(ItemType::EQUIPMENT_TWO_HANDS_WEAPON,
+ caseSetColor(ItemDbType::EQUIPMENT_TWO_HANDS_WEAPON,
ThemeColorId::TWOHAND)
- caseSetColor(ItemType::EQUIPMENT_TORSO, ThemeColorId::TORSO)
- caseSetColor(ItemType::EQUIPMENT_ARMS, ThemeColorId::ARMS)
- caseSetColor(ItemType::EQUIPMENT_HEAD, ThemeColorId::HEAD)
- caseSetColor(ItemType::EQUIPMENT_LEGS, ThemeColorId::LEGS)
- caseSetColor(ItemType::EQUIPMENT_SHIELD, ThemeColorId::SHIELD)
- caseSetColor(ItemType::EQUIPMENT_RING, ThemeColorId::RING)
- caseSetColor(ItemType::EQUIPMENT_NECKLACE, ThemeColorId::NECKLACE)
- caseSetColor(ItemType::EQUIPMENT_FEET, ThemeColorId::FEET)
- caseSetColor(ItemType::EQUIPMENT_AMMO, ThemeColorId::AMMO)
- caseSetColor(ItemType::EQUIPMENT_CHARM, ThemeColorId::CHARM)
- caseSetColor(ItemType::SPRITE_RACE, ThemeColorId::UNKNOWN_ITEM)
- caseSetColor(ItemType::SPRITE_HAIR, ThemeColorId::UNKNOWN_ITEM)
- caseSetColor(ItemType::CARD, ThemeColorId::CARD)
+ caseSetColor(ItemDbType::EQUIPMENT_TORSO, ThemeColorId::TORSO)
+ caseSetColor(ItemDbType::EQUIPMENT_ARMS, ThemeColorId::ARMS)
+ caseSetColor(ItemDbType::EQUIPMENT_HEAD, ThemeColorId::HEAD)
+ caseSetColor(ItemDbType::EQUIPMENT_LEGS, ThemeColorId::LEGS)
+ caseSetColor(ItemDbType::EQUIPMENT_SHIELD, ThemeColorId::SHIELD)
+ caseSetColor(ItemDbType::EQUIPMENT_RING, ThemeColorId::RING)
+ caseSetColor(ItemDbType::EQUIPMENT_NECKLACE, ThemeColorId::NECKLACE)
+ caseSetColor(ItemDbType::EQUIPMENT_FEET, ThemeColorId::FEET)
+ caseSetColor(ItemDbType::EQUIPMENT_AMMO, ThemeColorId::AMMO)
+ caseSetColor(ItemDbType::EQUIPMENT_CHARM, ThemeColorId::CHARM)
+ caseSetColor(ItemDbType::SPRITE_RACE, ThemeColorId::UNKNOWN_ITEM)
+ caseSetColor(ItemDbType::SPRITE_HAIR, ThemeColorId::UNKNOWN_ITEM)
+ caseSetColor(ItemDbType::CARD, ThemeColorId::CARD)
default:
{
return label->setForegroundColorAll(getThemeColor(
diff --git a/src/gui/popups/itempopup.h b/src/gui/popups/itempopup.h
index fc0320614..f862d2754 100644
--- a/src/gui/popups/itempopup.h
+++ b/src/gui/popups/itempopup.h
@@ -24,7 +24,7 @@
#ifndef GUI_POPUPS_ITEMPOPUP_H
#define GUI_POPUPS_ITEMPOPUP_H
-#include "enums/resources/itemtype.h"
+#include "enums/resources/itemdbtype.h"
#include "enums/simpletypes/itemcolor.h"
@@ -82,14 +82,14 @@ class ItemPopup final : public Popup
TextBox *mItemEffect A_NONNULLPOINTER;
TextBox *mItemWeight A_NONNULLPOINTER;
TextBox *mItemCards A_NONNULLPOINTER;
- ItemTypeT mItemType;
+ ItemDbTypeT mItemType;
Icon *mIcon A_NONNULLPOINTER;
std::string mLastName;
int mLastId;
ItemColor mLastColor;
void setLabelColor(Label *label,
- const ItemTypeT type) const A_NONNULL(2);
+ const ItemDbTypeT type) const A_NONNULL(2);
};
extern ItemPopup *itemPopup;
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index 96bdb1dcc..f7f7ceb96 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -158,8 +158,8 @@ namespace
const ItemInfo &info1 = pair1->mItem->getInfo();
const ItemInfo &info2 = pair2->mItem->getInfo();
- const ItemTypeT t1 = info1.getType();
- const ItemTypeT t2 = info2.getType();
+ const ItemDbTypeT t1 = info1.getType();
+ const ItemDbTypeT t2 = info2.getType();
if (t1 == t2)
{
return (info1.getName() < info2.getName());
diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp
index c6be959de..b0cf5bc8c 100644
--- a/src/gui/windows/buydialog.cpp
+++ b/src/gui/windows/buydialog.cpp
@@ -160,8 +160,8 @@ namespace
if (!item1 || !item2)
return false;
- const ItemTypeT type1 = item1->getInfo().getType();
- const ItemTypeT type2 = item2->getInfo().getType();
+ const ItemDbTypeT type1 = item1->getInfo().getType();
+ const ItemDbTypeT type2 = item2->getInfo().getType();
if (type1 == type2)
return item1->getPrice() < item2->getPrice();
return type1 < type2;