diff options
author | Blue Sans Douze <bluesansdouze@gmail.com> | 2011-03-27 20:18:02 +0200 |
---|---|---|
committer | Blue Sans Douze <bluesansdouze@gmail.com> | 2011-04-02 20:37:42 +0200 |
commit | df7771d05d782789026f01bcbdbcba44028f99aa (patch) | |
tree | bc0b99f81dfebceeb1ddb0420c175839186c2c89 /src/gui | |
parent | 717ebd24d5419ad79ec215c2d28256268a3fa315 (diff) | |
download | mana-df7771d05d782789026f01bcbdbcba44028f99aa.tar.gz mana-df7771d05d782789026f01bcbdbcba44028f99aa.tar.bz2 mana-df7771d05d782789026f01bcbdbcba44028f99aa.tar.xz mana-df7771d05d782789026f01bcbdbcba44028f99aa.zip |
Fix a bug with SkillDialog which doesn't listen to attributes changed
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/skilldialog.cpp | 14 | ||||
-rw-r--r-- | src/gui/skilldialog.h | 5 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp index be46132e..5b3314d1 100644 --- a/src/gui/skilldialog.cpp +++ b/src/gui/skilldialog.cpp @@ -24,6 +24,7 @@ #include "log.h" #include "playerinfo.h" #include "configuration.h" +#include "listener.h" #include "gui/setup.h" @@ -211,6 +212,8 @@ private: SkillDialog::SkillDialog(): Window(_("Skills")) { + listen(CHANNEL_ATTRIBUTES); + setWindowName("Skills"); setCloseButton(true); setResizable(true); @@ -277,6 +280,17 @@ void SkillDialog::update() } } +void SkillDialog::event(Channels channel, const Mana::Event &event) +{ + if (event.getName() == EVENT_UPDATEATTRIBUTE) + { + if (event.getInt("id") == SKILL_POINTS) + { + update(); + } + } +} + void SkillDialog::loadSkills(const std::string &file) { // Fixes issues with removing tabs diff --git a/src/gui/skilldialog.h b/src/gui/skilldialog.h index 3b1b1832..874b4437 100644 --- a/src/gui/skilldialog.h +++ b/src/gui/skilldialog.h @@ -23,6 +23,7 @@ #define SKILLDIALOG_H #include "gui/widgets/window.h" +#include "listener.h" #include <guichan/actionlistener.hpp> @@ -41,13 +42,15 @@ struct SkillInfo; * * \ingroup Interface */ -class SkillDialog : public Window, public gcn::ActionListener +class SkillDialog : public Window, public gcn::ActionListener, public Mana::Listener { public: SkillDialog(); ~SkillDialog(); + void event(Channels channel, const Mana::Event &event); + /** * Called when receiving actions from widget. */ |