diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-03-27 13:25:04 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-03-27 13:25:24 +0100 |
commit | dd05447445dc1766e532130318af2cb6bb72a994 (patch) | |
tree | c8b2cbac64ccf9545a39c143088b57fe2cb8e678 /src/gui/storagewindow.cpp | |
parent | 05e753294c1a603252d2eed4b1731c3f50543a7e (diff) | |
parent | 2aab736bc5d77ffda789d7de56cef100fac207e1 (diff) | |
download | mana-client-dd05447445dc1766e532130318af2cb6bb72a994.tar.gz mana-client-dd05447445dc1766e532130318af2cb6bb72a994.tar.bz2 mana-client-dd05447445dc1766e532130318af2cb6bb72a994.tar.xz mana-client-dd05447445dc1766e532130318af2cb6bb72a994.zip |
Merge branch 'aethyra/master'
Conflicts:
src/beingmanager.cpp
src/gui/confirm_dialog.cpp
src/gui/inventorywindow.cpp
src/gui/inventorywindow.h
src/gui/label.cpp
src/gui/label.h
src/gui/popup.cpp
src/gui/popup.h
src/gui/scrollarea.cpp
src/gui/skin.cpp
src/gui/skin.h
src/gui/speechbubble.cpp
src/gui/window.cpp
src/gui/window.h
src/localplayer.h
src/main.cpp
src/net/ea/playerhandler.cpp
src/resources/ambientoverlay.h
src/resources/dye.cpp
src/resources/imagewriter.cpp
src/resources/itemdb.cpp
src/shopitem.cpp
Diffstat (limited to 'src/gui/storagewindow.cpp')
-rw-r--r-- | src/gui/storagewindow.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/gui/storagewindow.cpp b/src/gui/storagewindow.cpp index 81212ae8..479348aa 100644 --- a/src/gui/storagewindow.cpp +++ b/src/gui/storagewindow.cpp @@ -50,7 +50,6 @@ #include "../utils/gettext.h" #include "../utils/strprintf.h" -#include "../utils/stringutils.h" StorageWindow::StorageWindow(Network *network, int invSize): Window(_("Storage")), @@ -74,7 +73,7 @@ StorageWindow::StorageWindow(Network *network, int invSize): mInvenScroll = new ScrollArea(mItems); mInvenScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); - mUsedSlots = toString(player_node->getStorage()->getNumberOfSlotsUsed()); + mUsedSlots = player_node->getStorage()->getNumberOfSlotsUsed(); mSlotsLabel = new Label(_("Slots: ")); @@ -107,14 +106,15 @@ void StorageWindow::logic() Window::logic(); - if (mUsedSlots != toString(player_node->getStorage()->getNumberOfSlotsUsed())) + const int usedSlots = player_node->getInventory()->getNumberOfSlotsUsed(); + + if (mUsedSlots != usedSlots) { - mUsedSlots = toString(player_node->getStorage()->getNumberOfSlotsUsed()); + mUsedSlots = usedSlots; - mSlotsBar->setProgress((float) - player_node->getStorage()->getNumberOfSlotsUsed() / mMaxSlots); + mSlotsBar->setProgress((float) mUsedSlots / mMaxSlots); - mSlotsBar->setText(strprintf("%s/%d", mUsedSlots.c_str(), mMaxSlots)); + mSlotsBar->setText(strprintf("%d/%d", mUsedSlots, mMaxSlots)); } } @@ -166,7 +166,8 @@ void StorageWindow::mouseClicked(gcn::MouseEvent &event) { Item *item = mItems->getSelectedItem(); - if (!item) { + if (!item) + { mRetrieveButton->setEnabled(false); return; } |