diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-11-15 23:44:01 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-11-15 23:44:01 +0000 |
commit | 0e925e97554aae573e895afa4e3d8450f01df342 (patch) | |
tree | bbc30319410aecb9fec7c005e667cd7fb628bb17 /src/gui/sell.cpp | |
parent | ffa0fae492d954c0aed35a0acbd7b856778d7328 (diff) | |
download | mana-client-0e925e97554aae573e895afa4e3d8450f01df342.tar.gz mana-client-0e925e97554aae573e895afa4e3d8450f01df342.tar.bz2 mana-client-0e925e97554aae573e895afa4e3d8450f01df342.tar.xz mana-client-0e925e97554aae573e895afa4e3d8450f01df342.zip |
Moved item icon from ItemInfo class to the Item class, so that it can be loaded
on demand. Results in faster startup time and reduced memory usage.
Diffstat (limited to 'src/gui/sell.cpp')
-rw-r--r-- | src/gui/sell.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/sell.cpp b/src/gui/sell.cpp index 08565654..bc683c0b 100644 --- a/src/gui/sell.cpp +++ b/src/gui/sell.cpp @@ -38,7 +38,6 @@ #include "../item.h" #include "../npc.h" #include "../net/gameserver/player.h" -#include "../resources/itemdb.h" #include "../resources/iteminfo.h" #include "../utils/gettext.h" #include "../utils/strprintf.h" @@ -158,11 +157,12 @@ void SellDialog::action(const gcn::ActionEvent &event) && mAmountItems <= mMaxItems) { Net::GameServer::Player::tradeWithNPC - (mShopItems->at(selectedItem).id, mAmountItems); + (mShopItems->at(selectedItem)->getId(), mAmountItems); mMaxItems -= mAmountItems; - mShopItems->getShop()->at(selectedItem).quantity = mMaxItems; - mPlayerMoney += (mAmountItems * mShopItems->at(selectedItem).price); + mShopItems->getShop()->at(selectedItem)->setQuantity(mMaxItems); + mPlayerMoney += + mAmountItems * mShopItems->at(selectedItem)->getPrice(); mAmountItems = 1; if (!mMaxItems) @@ -206,20 +206,20 @@ SellDialog::updateButtonsAndLabels() if (selectedItem > -1) { - const ItemInfo &info = ItemDB::get(mShopItems->at(selectedItem).id); + const ItemInfo &info = mShopItems->at(selectedItem)->getInfo(); mItemDescLabel->setCaption (strprintf(_("Description: %s"), info.getDescription().c_str())); mItemEffectLabel->setCaption (strprintf(_("Effect: %s"), info.getEffect().c_str())); - mMaxItems = mShopItems->at(selectedItem).quantity; + mMaxItems = mShopItems->at(selectedItem)->getQuantity(); if (mAmountItems > mMaxItems) { mAmountItems = mMaxItems; } - income = mAmountItems * mShopItems->at(selectedItem).price; + income = mAmountItems * mShopItems->at(selectedItem)->getPrice(); } else { |