From 76e55447563fae6f8d17f2fd90231c81e0b3f927 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 21 Oct 2014 01:13:46 +0300 Subject: Add to item field identified. --- src/gui/widgets/itemcontainer.cpp | 2 +- src/gui/windows/itemamountwindow.cpp | 2 +- src/gui/windows/npcdialog.cpp | 2 +- src/gui/windows/tradewindow.cpp | 26 +++++++++++++++++++------- src/gui/windows/tradewindow.h | 16 ++++++++++++---- 5 files changed, 34 insertions(+), 14 deletions(-) (limited to 'src/gui') diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index 784fc56db..8f8f886da 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -553,7 +553,7 @@ void ItemContainer::mouseReleased(MouseEvent &event) if (item && !PlayerInfo::isItemProtected(item->getId())) { mInventory->addItem(item->getId(), 1, 1, item->getColor(), - false, false); + item->getIdentified(), false, false); } return; } diff --git a/src/gui/windows/itemamountwindow.cpp b/src/gui/windows/itemamountwindow.cpp index 975cbbd20..31c6c8adc 100644 --- a/src/gui/windows/itemamountwindow.cpp +++ b/src/gui/windows/itemamountwindow.cpp @@ -319,7 +319,7 @@ void ItemAmountWindow::action(const ActionEvent &event) const int id = ItemDB::get(mItemsModal->getElementAt( mItemDropDown->getSelected())).getId(); - mItem = new Item(id, 10000, 0, 1, false, false); + mItem = new Item(id, 10000, 0, 1, true, false, false); if (mUsage == ShopBuyAdd) mMax = 10000; diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp index c0551299b..ff434c07c 100644 --- a/src/gui/windows/npcdialog.cpp +++ b/src/gui/windows/npcdialog.cpp @@ -468,7 +468,7 @@ void NpcDialog::action(const ActionEvent &event) if (item) { mInventory->addItem(item->getId(), 1, 1, item->getColor(), - false, false); + item->getIdentified(), false, false); } } } diff --git a/src/gui/windows/tradewindow.cpp b/src/gui/windows/tradewindow.cpp index 1f4325413..34164758c 100644 --- a/src/gui/windows/tradewindow.cpp +++ b/src/gui/windows/tradewindow.cpp @@ -194,26 +194,38 @@ void TradeWindow::addItem(const int id, const bool own, const int quantity, const uint8_t refine, - const unsigned char color) const + const unsigned char color, + const bool identified) const { if (own) - mMyInventory->addItem(id, quantity, refine, color, false, false); + { + mMyInventory->addItem(id, quantity, refine, color, + identified, false, false); + } else - mPartnerInventory->addItem(id, quantity, refine, color, false, false); + { + mPartnerInventory->addItem(id, quantity, refine, color, + identified, false, false); + } } -void TradeWindow::addItem2(const int id, const bool own, const int quantity, - const uint8_t refine, const unsigned char color, +void TradeWindow::addItem2(const int id, + const bool own, + const int quantity, + const uint8_t refine, + const unsigned char color, + const bool identified, const bool equipment) const { if (own) { - mMyInventory->addItem(id, quantity, refine, color, equipment, false); + mMyInventory->addItem(id, quantity, refine, color, + identified, equipment, false); } else { mPartnerInventory->addItem(id, quantity, refine, color, - equipment, false); + identified, equipment, false); } } diff --git a/src/gui/windows/tradewindow.h b/src/gui/windows/tradewindow.h index 0c01c81cd..ef60b051e 100644 --- a/src/gui/windows/tradewindow.h +++ b/src/gui/windows/tradewindow.h @@ -67,8 +67,12 @@ class TradeWindow final : public Window, /** * Add an item to the trade window. */ - void addItem(const int id, const bool own, const int quantity, - const uint8_t refine, const unsigned char color) const; + void addItem(const int id, + const bool own, + const int quantity, + const uint8_t refine, + const unsigned char color, + const bool identified) const; /** * Reset both item containers @@ -78,8 +82,12 @@ class TradeWindow final : public Window, /** * Add an item to the trade window. */ - void addItem2(const int id, const bool own, const int quantity, - const uint8_t refine, const unsigned char color, + void addItem2(const int id, + const bool own, + const int quantity, + const uint8_t refine, + const unsigned char color, + const bool identified, const bool equipment) const; /** -- cgit v1.2.3-60-g2f50