summaryrefslogtreecommitdiff
path: root/src/listeners
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-04-19 22:02:33 +0300
committerAndrei Karas <akaras@inbox.ru>2015-04-20 00:26:53 +0300
commite3009cfe9cc0a824450d3e71a0ce8d6b5cd9ff91 (patch)
tree2959d64c52fb2d9df7ca30fb5a400e17570c4861 /src/listeners
parentac9d9925b52789abc07795d5ed52dd0de620c757 (diff)
downloadmv-e3009cfe9cc0a824450d3e71a0ce8d6b5cd9ff91.tar.gz
mv-e3009cfe9cc0a824450d3e71a0ce8d6b5cd9ff91.tar.bz2
mv-e3009cfe9cc0a824450d3e71a0ce8d6b5cd9ff91.tar.xz
mv-e3009cfe9cc0a824450d3e71a0ce8d6b5cd9ff91.zip
Add quick settings page for yellow bar options.
Diffstat (limited to 'src/listeners')
-rw-r--r--src/listeners/awaylistener.cpp2
-rw-r--r--src/listeners/gamemodifierlistener.cpp36
-rw-r--r--src/listeners/gamemodifierlistener.h38
3 files changed, 75 insertions, 1 deletions
diff --git a/src/listeners/awaylistener.cpp b/src/listeners/awaylistener.cpp
index 6a8057888..b8b89402f 100644
--- a/src/listeners/awaylistener.cpp
+++ b/src/listeners/awaylistener.cpp
@@ -37,7 +37,7 @@ void AwayListener::action(const ActionEvent &event)
{
if (event.getId() == "ok" && localPlayer && settings.awayMode)
{
- GameModifiers::changeAwayMode();
+ GameModifiers::changeAwayMode(true);
localPlayer->updateStatus();
if (outfitWindow)
outfitWindow->unwearAwayOutfit();
diff --git a/src/listeners/gamemodifierlistener.cpp b/src/listeners/gamemodifierlistener.cpp
new file mode 100644
index 000000000..a8f28a2f6
--- /dev/null
+++ b/src/listeners/gamemodifierlistener.cpp
@@ -0,0 +1,36 @@
+/*
+ * The ManaPlus Client
+ * Copyright (C) 2014-2015 The ManaPlus Developers
+ *
+ * This file is part of The ManaPlus Client.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "listeners/gamemodifierlistener.h"
+
+#include "debug.h"
+
+defineListener(GameModifierListener)
+
+void GameModifierListener::distributeEvent()
+{
+ FOR_EACH (std::vector<GameModifierListener*>::iterator,
+ it, mListeners)
+ {
+ GameModifierListener *const listener = *it;
+ if (listener)
+ listener->gameModifiersChanged();
+ }
+}
diff --git a/src/listeners/gamemodifierlistener.h b/src/listeners/gamemodifierlistener.h
new file mode 100644
index 000000000..0d3966130
--- /dev/null
+++ b/src/listeners/gamemodifierlistener.h
@@ -0,0 +1,38 @@
+/*
+ * The ManaPlus Client
+ * Copyright (C) 2014-2015 The ManaPlus Developers
+ *
+ * This file is part of The ManaPlus Client.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef LISTENERS_GAMEMODIFIERLISTENER_H
+#define LISTENERS_GAMEMODIFIERLISTENER_H
+
+#include "listeners/baselistener.hpp"
+
+#include "localconsts.h"
+
+class GameModifierListener notfinal
+{
+ public:
+ virtual void gameModifiersChanged() = 0;
+
+ static void distributeEvent();
+
+ defineListenerHeader(GameModifierListener)
+};
+
+#endif // LISTENERS_GAMEMODIFIERLISTENER_H