From bcde3a79a38aba8ca9e3ab7f4dea13ad8da33a54 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 24 Feb 2013 15:07:58 +0300 Subject: Replace newQuestSfx and completeQuestSfx to newQuestEffectId and completeQuestEffectId. Now in new/complete quest possible play also particle effects. --- src/gui/questswindow.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/gui/questswindow.cpp') 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; -- cgit v1.2.3-60-g2f50