diff options
Diffstat (limited to 'src/gui/windows/inventorywindow.cpp')
-rw-r--r-- | src/gui/windows/inventorywindow.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp index 01e5e052d..2122fce2f 100644 --- a/src/gui/windows/inventorywindow.cpp +++ b/src/gui/windows/inventorywindow.cpp @@ -73,6 +73,7 @@ InventoryWindow::InventoryWindow(Inventory *const inventory): KeyListener(), SelectionListener(), InventoryListener(), + AttributeListener(), mInventory(inventory), mItems(new ItemContainer(this, mInventory)), mUseButton(nullptr), @@ -131,8 +132,6 @@ InventoryWindow::InventoryWindow(Inventory *const inventory): mSortDropDown->setSelected(0); } - listen(CHANNEL_ATTRIBUTES); - if (setupWindow) setupWindow->registerWindowForReset(this); @@ -690,17 +689,6 @@ void InventoryWindow::close() } } -void InventoryWindow::processEvent(const Channels channel A_UNUSED, - const DepricatedEvent &event) -{ - if (event.getName() == EVENT_UPDATEATTRIBUTE) - { - const int id = event.getInt("id"); - if (id == PlayerInfo::TOTAL_WEIGHT || id == PlayerInfo::MAX_WEIGHT) - updateWeight(); - } -} - void InventoryWindow::updateWeight() { if (!isMainInventory() || !mWeightBar) @@ -821,3 +809,11 @@ void InventoryWindow::unsetInventory() } mInventory = nullptr; } + +void InventoryWindow::attributeChanged(const int id, + const int oldVal A_UNUSED, + const int newVal A_UNUSED) +{ + if (id == PlayerInfo::TOTAL_WEIGHT || id == PlayerInfo::MAX_WEIGHT) + updateWeight(); +} |