summaryrefslogtreecommitdiff
path: root/src/gui/inventorywindow.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2006-01-22 13:31:13 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2006-01-22 13:31:13 +0000
commitbd56bf8afdab16383ed8ad08412a8c807f84af85 (patch)
tree0e963ada63bcbe3c50dd77986aaa15b9ba49816a /src/gui/inventorywindow.cpp
parent5359640b6f271af31f6423df9d661433eff89a3e (diff)
downloadmana-client-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.gz
mana-client-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.bz2
mana-client-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.xz
mana-client-bd56bf8afdab16383ed8ad08412a8c807f84af85.zip
Merged NETWORK branch (includes BEING_OVERHAUL).
Diffstat (limited to 'src/gui/inventorywindow.cpp')
-rw-r--r--src/gui/inventorywindow.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp
index 0b8a37a7..3b786f62 100644
--- a/src/gui/inventorywindow.cpp
+++ b/src/gui/inventorywindow.cpp
@@ -36,14 +36,11 @@
#include "itemcontainer.h"
#include "scrollarea.h"
-#include "../inventory.h"
#include "../item.h"
-#include "../playerinfo.h"
+#include "../localplayer.h"
#include "../resources/iteminfo.h"
-extern Inventory *inventory;
-
InventoryWindow::InventoryWindow():
Window("Inventory")
{
@@ -56,7 +53,7 @@ InventoryWindow::InventoryWindow():
useButton = new Button("Use");
dropButton = new Button("Drop");
- items = new ItemContainer(inventory);
+ items = new ItemContainer(player_node->mInventory);
invenScroll = new ScrollArea(items);
invenScroll->setPosition(8, 8);
invenScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
@@ -98,8 +95,8 @@ void InventoryWindow::logic()
// Update weight information
std::stringstream tempstr;
- tempstr << "Total Weight: " << player_info->totalWeight
- << " - Maximum Weight: " << player_info->maxWeight;
+ tempstr << "Total Weight: " << player_node->totalWeight
+ << " - Maximum Weight: " << player_node->maxWeight;
weightLabel->setCaption(tempstr.str());
weightLabel->adjustSize();
}
@@ -115,14 +112,14 @@ void InventoryWindow::action(const std::string &eventId)
if (eventId == "use") {
if (item->isEquipment()) {
if (item->isEquipped()) {
- inventory->unequipItem(item);
+ player_node->unequipItem(item);
}
else {
- inventory->equipItem(item);
+ player_node->equipItem(item);
}
}
else {
- inventory->useItem(item);
+ player_node->useItem(item);
}
}
else if (eventId == "drop")