summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-02-24 15:07:58 +0300
committerAndrei Karas <akaras@inbox.ru>2013-02-24 15:07:58 +0300
commitbcde3a79a38aba8ca9e3ab7f4dea13ad8da33a54 (patch)
tree382d6301e5ec116905aa9a0f3e5e7ed3fe941e4f
parent70894a3935b30c8a001a614d808261059d29c63a (diff)
downloadplus-bcde3a79a38aba8ca9e3ab7f4dea13ad8da33a54.tar.gz
plus-bcde3a79a38aba8ca9e3ab7f4dea13ad8da33a54.tar.bz2
plus-bcde3a79a38aba8ca9e3ab7f4dea13ad8da33a54.tar.xz
plus-bcde3a79a38aba8ca9e3ab7f4dea13ad8da33a54.zip
Replace newQuestSfx and completeQuestSfx to newQuestEffectId and completeQuestEffectId.
Now in new/complete quest possible play also particle effects.
-rw-r--r--src/defaults.cpp2
-rw-r--r--src/gui/questswindow.cpp15
-rw-r--r--src/gui/questswindow.h2
3 files changed, 16 insertions, 3 deletions
diff --git a/src/defaults.cpp b/src/defaults.cpp
index 02a137502..30cb22a63 100644
--- a/src/defaults.cpp
+++ b/src/defaults.cpp
@@ -382,6 +382,8 @@ DefaultsData* getPathsDefaults()
AddDEF("missEffectId", -1);
AddDEF("criticalHitEffectId", 28);
AddDEF("afkEffectId", -1);
+ AddDEF("newQuestEffectId", -1);
+ AddDEF("completeQuestEffectId", -1);
AddDEF("minimaps", "graphics/minimaps/");
AddDEF("maps", "maps/");
diff --git a/src/gui/questswindow.cpp b/src/gui/questswindow.cpp
index a34bb25f6..164f3ce26 100644
--- a/src/gui/questswindow.cpp
+++ b/src/gui/questswindow.cpp
@@ -21,6 +21,8 @@
#include "gui/questswindow.h"
#include "configuration.h"
+#include "effectmanager.h"
+#include "localplayer.h"
#include "soundmanager.h"
#include "gui/gui.h"
@@ -108,7 +110,9 @@ QuestsWindow::QuestsWindow() :
getOptionBool("showtextbackground"), "quests_text_background.xml")),
mCloseButton(new Button(this, _("Close"), "close", this)),
mCompleteIcon(Theme::getImageFromThemeXml("complete_icon.xml", "")),
- mIncompleteIcon(Theme::getImageFromThemeXml("incomplete_icon.xml", ""))
+ mIncompleteIcon(Theme::getImageFromThemeXml("incomplete_icon.xml", "")),
+ mNewQuestEffectId(paths.getIntValue("newQuestEffectId")),
+ mCompleteQuestEffectId(paths.getIntValue("completeQuestEffectId"))
{
setWindowName("Quests");
setResizable(true);
@@ -370,10 +374,15 @@ void QuestsWindow::rebuild(const bool playSound)
switch (newCompleteStatus)
{
case 0:
- sound.playSfx(paths.getValue("newQuestSfx", ""));
+ if (effectManager)
+ effectManager->trigger(mNewQuestEffectId, player_node);
break;
case 1:
- sound.playSfx(paths.getValue("completeQuestSfx", ""));
+ if (effectManager)
+ {
+ effectManager->trigger(mCompleteQuestEffectId,
+ player_node);
+ }
break;
default:
break;
diff --git a/src/gui/questswindow.h b/src/gui/questswindow.h
index b4a46aafc..884b488c4 100644
--- a/src/gui/questswindow.h
+++ b/src/gui/questswindow.h
@@ -83,6 +83,8 @@ class QuestsWindow final : public Window, public gcn::ActionListener
std::vector<QuestItem*> mQuestLinks;
Image *mCompleteIcon;
Image *mIncompleteIcon;
+ int mNewQuestEffectId;
+ int mCompleteQuestEffectId;
};
extern QuestsWindow *questsWindow;