From c7d6fb280271feb57022542f72584fbbbcfb2bc8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 25 Mar 2015 17:12:04 +0300 Subject: Allow set for each skill own levelup particle effect. --- src/gui/widgets/skilldata.h | 3 +++ src/gui/windows/skilldialog.cpp | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'src/gui') diff --git a/src/gui/widgets/skilldata.h b/src/gui/widgets/skilldata.h index 943aa929c..5885b1ba9 100644 --- a/src/gui/widgets/skilldata.h +++ b/src/gui/widgets/skilldata.h @@ -39,9 +39,12 @@ struct SkillData final std::string particle; std::string invokeCmd; + SoundInfo soundHit; SoundInfo soundMiss; + int updateEffectId; + SkillData(); A_DELETE_COPY(SkillData) ~SkillData(); diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp index bbefbd5a7..2804b8734 100644 --- a/src/gui/windows/skilldialog.cpp +++ b/src/gui/windows/skilldialog.cpp @@ -366,6 +366,8 @@ void SkillDialog::loadXmlFile(const std::string &fileName) node, "soundMissDelay", 0); data->invokeCmd = XML::getProperty( node, "invokeCmd", ""); + data->updateEffectId = XML::getProperty( + node, "levelUpEffectId", -1); skill->addData(level, data); } @@ -576,14 +578,24 @@ void SkillDialog::updateQuest(const int var, const int val) void SkillDialog::playUpdateEffect(const int id) const { - const int effectId = paths.getIntValue("skillLevelUpEffectId"); - if (!effectManager || effectId == -1) + if (!effectManager) return; const SkillMap::const_iterator it = mSkills.find(id); if (it != mSkills.end()) { - if (it->second) + SkillInfo *const info = it->second; + if (info) + { + const SkillData *const data = info->data; + if (!data) + return; + int effectId = data->updateEffectId; + if (effectId == -1) + effectId = paths.getIntValue("skillLevelUpEffectId"); + if (effectId == -1) + return; effectManager->trigger(effectId, localPlayer); + } } } -- cgit v1.2.3-70-g09d2