summaryrefslogtreecommitdiff
path: root/src/gui/popupmenu.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-06-04 22:08:04 +0300
committerAndrei Karas <akaras@inbox.ru>2011-06-04 22:08:04 +0300
commita865b10749df829ef46a14e244bc88ac52bc10b4 (patch)
tree244f283ab8ba6cfcc9683eafe51be7a9d7bbabbe /src/gui/popupmenu.cpp
parent9b3e13d4246930f0aa4dfb86e735466032d283dd (diff)
downloadmv-a865b10749df829ef46a14e244bc88ac52bc10b4.tar.gz
mv-a865b10749df829ef46a14e244bc88ac52bc10b4.tar.bz2
mv-a865b10749df829ef46a14e244bc88ac52bc10b4.tar.xz
mv-a865b10749df829ef46a14e244bc88ac52bc10b4.zip
Add colors support for drops panel.
Delete search item function without colors support.
Diffstat (limited to 'src/gui/popupmenu.cpp')
-rw-r--r--src/gui/popupmenu.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index d6004bb27..c3f28744c 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -88,6 +88,7 @@ PopupMenu::PopupMenu():
mFloorItem(0),
mItem(0),
mItemId(0),
+ mItemColor(1),
mMapItem(0),
mTab(0),
mSpell(0),
@@ -889,7 +890,7 @@ void PopupMenu::handleLink(const std::string &link,
Inventory *inv = PlayerInfo::getInventory();
if (inv)
{
- Item *item = inv->findItem(mItemId);
+ Item *item = inv->findItem(mItemId, mItemColor);
if (item)
{
if (item->isEquipment())
@@ -1473,6 +1474,7 @@ void PopupMenu::handleLink(const std::string &link,
mFloorItem = 0;
mItem = 0;
mItemId = 0;
+ mItemColor = 1;
mMapItem = 0;
mNick = "";
}
@@ -1586,6 +1588,7 @@ void PopupMenu::showItemPopup(int x, int y, int itemId, unsigned char color)
{
mItem = 0;
mItemId = itemId;
+ mItemColor = color;
mBrowserBox->clearRows();
mBrowserBox->addRow(strprintf("@@use|%s@@", _("Use")));
@@ -1603,9 +1606,15 @@ void PopupMenu::showItemPopup(int x, int y, Item *item)
{
mItem = item;
if (item)
+ {
mItemId = item->getId();
+ mItemColor = item->getColor();
+ }
else
+ {
mItemId = 0;
+ mItemColor = 1;
+ }
mBrowserBox->clearRows();
if (item)
@@ -1827,6 +1836,7 @@ void PopupMenu::showUndressPopup(int x, int y, Being *being, Item *item)
mBeingId = being->getId();
mItem = item;
mItemId = item->getId();
+ mItemColor = item->getColor();
mBrowserBox->clearRows();