summaryrefslogtreecommitdiff
path: root/src/gui/inventorywindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/inventorywindow.cpp')
-rw-r--r--src/gui/inventorywindow.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp
index d18490a4..0b554469 100644
--- a/src/gui/inventorywindow.cpp
+++ b/src/gui/inventorywindow.cpp
@@ -24,12 +24,11 @@
#include <guichan/font.hpp>
#include <guichan/mouseinput.hpp>
-#include <guichan/widgets/label.hpp>
-
#include "button.h"
#include "inventorywindow.h"
#include "item_amount.h"
#include "itemcontainer.h"
+#include "label.h"
#include "progressbar.h"
#include "scrollarea.h"
#include "sdlinput.h"
@@ -40,7 +39,6 @@
#include "../inventory.h"
#include "../item.h"
#include "../localplayer.h"
-#include "../log.h"
#include "../units.h"
#include "../resources/iteminfo.h"
@@ -63,7 +61,7 @@ InventoryWindow::InventoryWindow(int invSize):
setMinWidth(375);
setMinHeight(283);
// If you adjust these defaults, don't forget to adjust the trade window's.
- setDefaultSize(115, 30, 375, 283);
+ setDefaultSize(375, 300, ImageRect::CENTER);
addKeyListener(this);
std::string longestUseString = getFont()->getWidth(_("Equip")) >
@@ -96,8 +94,8 @@ InventoryWindow::InventoryWindow(int invSize):
mMaxWeight = -1;
mUsedSlots = toString(player_node->getInventory()->getNumberOfSlotsUsed());
- mSlotsLabel = new gcn::Label(_("Slots: "));
- mWeightLabel = new gcn::Label(_("Weight: "));
+ mSlotsLabel = new Label(_("Slots: "));
+ mWeightLabel = new Label(_("Weight: "));
mSlotsBar = new ProgressBar(1.0f, 100, 20, 225, 200, 25);
mWeightBar = new ProgressBar(1.0f, 100, 20, 0, 0, 255);
@@ -129,6 +127,9 @@ InventoryWindow::~InventoryWindow()
void InventoryWindow::logic()
{
+ if (!isVisible())
+ return;
+
Window::logic();
// It would be nicer if this update could be event based, needs some