From c77f06f7b80a67c842abe837beb2f22e9ecf60cc Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 27 Apr 2014 19:03:49 +0300 Subject: Add ArrowsListener. Also fix arrows amount update on arrows pickup. --- src/gui/windows/ministatuswindow.cpp | 12 +++++++----- src/gui/windows/ministatuswindow.h | 8 +++++--- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'src/gui/windows') diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp index 804d52d5b..95948e776 100644 --- a/src/gui/windows/ministatuswindow.cpp +++ b/src/gui/windows/ministatuswindow.cpp @@ -56,6 +56,8 @@ MiniStatusWindow::MiniStatusWindow() : Window("MiniStatus", false, nullptr, "ministatus.xml"), InventoryListener(), AttributeListener(), + StatListener(), + ArrowsListener(), mBars(), mBarNames(), mIcons(), @@ -532,11 +534,6 @@ void MiniStatusWindow::slotsChanged(Inventory *const inventory) StatusWindow::updateInvSlotsBar(mInvSlotsBar); } -void MiniStatusWindow::updateArrows() -{ - StatusWindow::updateArrowsBar(mArrowsBar); -} - Rect MiniStatusWindow::getChildrenArea() { const int padding = mPadding; @@ -547,6 +544,11 @@ Rect MiniStatusWindow::getChildrenArea() rect.height - padding2); } +void MiniStatusWindow::arrowsChanged() +{ + StatusWindow::updateArrowsBar(mArrowsBar); +} + #ifdef USE_PROFILER void MiniStatusWindow::logicChildren() { diff --git a/src/gui/windows/ministatuswindow.h b/src/gui/windows/ministatuswindow.h index 171e1fe2f..3b7138a23 100644 --- a/src/gui/windows/ministatuswindow.h +++ b/src/gui/windows/ministatuswindow.h @@ -25,6 +25,7 @@ #include "inventory.h" +#include "listeners/arrowslistener.h" #include "listeners/attributelistener.h" #include "listeners/statlistener.h" @@ -46,7 +47,8 @@ class TextPopup; class MiniStatusWindow final : public Window, public InventoryListener, public AttributeListener, - public StatListener + public StatListener, + public ArrowsListener { public: MiniStatusWindow(); @@ -80,8 +82,6 @@ class MiniStatusWindow final : public Window, void updateBars(); - void updateArrows(); - void slotsChanged(Inventory *const inventory) override final; std::vector &getBars() A_WARN_UNUSED @@ -97,6 +97,8 @@ class MiniStatusWindow final : public Window, const int oldVal1, const int oldVal2) override final; + void arrowsChanged(); + #ifdef USE_PROFILER void logicChildren(); #endif -- cgit v1.2.3-70-g09d2