summaryrefslogtreecommitdiff
path: root/src/gui/npcdialog.cpp
diff options
context:
space:
mode:
authorChuck Miller <shadowmil@gmail.com>2010-11-13 17:00:46 -0500
committerChuck Miller <shadowmil@gmail.com>2010-11-13 17:39:15 -0500
commitf8d22e47ac3b6392d68f1a8a45383798f5751101 (patch)
treee29b42821ec8f6e579f2cfd4d2a20bc8c248b930 /src/gui/npcdialog.cpp
parent8e7e63a2473eedd36eeef726e45dacc9d17d157a (diff)
downloadmana-client-f8d22e47ac3b6392d68f1a8a45383798f5751101.tar.gz
mana-client-f8d22e47ac3b6392d68f1a8a45383798f5751101.tar.bz2
mana-client-f8d22e47ac3b6392d68f1a8a45383798f5751101.tar.xz
mana-client-f8d22e47ac3b6392d68f1a8a45383798f5751101.zip
Replace config listeners with the event system
Reviewed-by: Jared Adams
Diffstat (limited to 'src/gui/npcdialog.cpp')
-rw-r--r--src/gui/npcdialog.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gui/npcdialog.cpp b/src/gui/npcdialog.cpp
index 5b1939a6..1a5186ff 100644
--- a/src/gui/npcdialog.cpp
+++ b/src/gui/npcdialog.cpp
@@ -143,7 +143,7 @@ NpcDialog::NpcDialog(int npcId)
setVisible(true);
requestFocus();
- config.addListener("logNpcInGui", this);
+ listen(CHANNEL_CONFIG);
PlayerInfo::setNPCInteractionCount(PlayerInfo::getNPCInteractionCount()
+ 1);
}
@@ -161,7 +161,6 @@ NpcDialog::~NpcDialog()
instances.remove(this);
- config.removeListener("logNpcInGui", this);
PlayerInfo::setNPCInteractionCount(PlayerInfo::getNPCInteractionCount()
- 1);
@@ -383,9 +382,13 @@ void NpcDialog::setVisible(bool visible)
}
}
-void NpcDialog::optionChanged(const std::string &name)
+void NpcDialog::event(Channels channel, const Mana::Event &event)
{
- if (name == "logNpcInGui")
+ if (channel != CHANNEL_CONFIG)
+ return;
+
+ if (event.getName() == EVENT_CONFIGOPTIONCHANGED &&
+ event.getString("option") == "logNpcInGui")
{
mLogInteraction = config.getBoolValue("logNpcInGui");
}