diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-03-25 17:12:04 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-03-25 17:18:41 +0300 |
commit | c7d6fb280271feb57022542f72584fbbbcfb2bc8 (patch) | |
tree | d7038817963a70467a56b5fdb429f3061088f28e | |
parent | 44db10623278632b890b0e2cea4fe7add7d4cc74 (diff) | |
download | plus-c7d6fb280271feb57022542f72584fbbbcfb2bc8.tar.gz plus-c7d6fb280271feb57022542f72584fbbbcfb2bc8.tar.bz2 plus-c7d6fb280271feb57022542f72584fbbbcfb2bc8.tar.xz plus-c7d6fb280271feb57022542f72584fbbbcfb2bc8.zip |
Allow set for each skill own levelup particle effect.
-rw-r--r-- | src/gui/widgets/skilldata.h | 3 | ||||
-rw-r--r-- | src/gui/windows/skilldialog.cpp | 18 |
2 files changed, 18 insertions, 3 deletions
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); + } } } |