summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/skilldialog.cpp14
-rw-r--r--src/gui/skilldialog.h5
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.
*/