summaryrefslogtreecommitdiff
path: root/src/gui/popups/popupmenu.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-08-15 13:58:32 +0300
committerAndrei Karas <akaras@inbox.ru>2015-08-16 01:52:14 +0300
commit41cc92f73e39cec5dfea6b1164176610cccc7df4 (patch)
tree22fd3d388084d2c61fe80f0441c3c30ab8ffd33c /src/gui/popups/popupmenu.cpp
parent7aa637abc8b0bca35aacdb9492e65f557ed32038 (diff)
downloadmanaverse-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.gz
manaverse-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.bz2
manaverse-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.xz
manaverse-41cc92f73e39cec5dfea6b1164176610cccc7df4.zip
Add strong typed int for item color.
Diffstat (limited to 'src/gui/popups/popupmenu.cpp')
-rw-r--r--src/gui/popups/popupmenu.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index 9adcc7b58..71a6d81d5 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -105,7 +105,7 @@ PopupMenu::PopupMenu() :
mFloorItemId(BeingId_zero),
mItem(nullptr),
mItemId(0),
- mItemColor(1),
+ mItemColor(ItemColor_one),
mMapItem(nullptr),
mTab(nullptr),
mSpell(nullptr),
@@ -1558,7 +1558,7 @@ void PopupMenu::handleLink(const std::string &link,
replaceAll(cmd, "'BEINGID'", toString(toInt(mBeingId, int)));
replaceAll(cmd, "'FLOORID'", toString(toInt(mFloorItemId, int)));
replaceAll(cmd, "'ITEMID'", toString(mItemId));
- replaceAll(cmd, "'ITEMCOLOR'", toString(mItemColor));
+ replaceAll(cmd, "'ITEMCOLOR'", toString(toInt(mItemColor, int)));
replaceAll(cmd, "'BEINGTYPEID'", toString(static_cast<int>(mType)));
replaceAll(cmd, "'PLAYER'", localPlayer->getName());
if (mItem)
@@ -1594,7 +1594,7 @@ void PopupMenu::handleLink(const std::string &link,
mFloorItemId = BeingId_zero;
mItem = nullptr;
mItemId = 0;
- mItemColor = 1;
+ mItemColor = ItemColor_one;
mMapItem = nullptr;
mTab = nullptr;
mSpell = nullptr;
@@ -1751,8 +1751,9 @@ void PopupMenu::showPopup(Window *const parent,
showPopup(x, y);
}
-void PopupMenu::showItemPopup(const int x, const int y, const int itemId,
- const unsigned char color)
+void PopupMenu::showItemPopup(const int x, const int y,
+ const int itemId,
+ const ItemColor color)
{
const Inventory *const inv = PlayerInfo::getInventory();
if (!inv)
@@ -1788,7 +1789,8 @@ void PopupMenu::showItemPopup(const int x, const int y, const int itemId,
}
}
-void PopupMenu::showItemPopup(const int x, const int y, Item *const item)
+void PopupMenu::showItemPopup(const int x, const int y,
+ Item *const item)
{
mItem = item;
mX = x;
@@ -1801,7 +1803,7 @@ void PopupMenu::showItemPopup(const int x, const int y, Item *const item)
else
{
mItemId = 0;
- mItemColor = 1;
+ mItemColor = ItemColor_one;
}
mNick.clear();
mBrowserBox->clearRows();
@@ -2103,7 +2105,8 @@ void PopupMenu::showPickupItemPopup(const int x, const int y,
}
void PopupMenu::showUndressPopup(const int x, const int y,
- const Being *const being, Item *const item)
+ const Being *const being,
+ Item *const item)
{
if (!being || !item)
return;