From a865b10749df829ef46a14e244bc88ac52bc10b4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 4 Jun 2011 22:08:04 +0300 Subject: Add colors support for drops panel. Delete search item function without colors support. --- src/gui/popupmenu.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/gui/popupmenu.cpp') 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(); -- cgit v1.2.3-60-g2f50