From 64fc4f0ccf6cfb25864e67e3f8cf29d4671c64d5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 18 Sep 2014 12:52:40 +0300 Subject: Add skills duration/cooldown. --- src/gui/windows/skilldialog.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/gui/windows/skilldialog.cpp') diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp index 07a60b594..073cf11bd 100644 --- a/src/gui/windows/skilldialog.cpp +++ b/src/gui/windows/skilldialog.cpp @@ -48,6 +48,7 @@ #include "utils/dtor.h" #include "utils/gettext.h" +#include "utils/timer.h" #include "resources/beingcommon.h" #include "resources/skillconsts.h" @@ -424,6 +425,20 @@ SkillInfo* SkillDialog::getSkillByItem(const int itemId) const return nullptr; } +void SkillDialog::setSkillDuration(const int id, const int duration) +{ + SkillMap::const_iterator it = mSkills.find(id); + if (it != mSkills.end()) + { + SkillInfo *const info = (*it).second; + if (info) + { + info->duration = duration / 10; + info->durationTime = tick_time; + } + } +} + void SkillDialog::widgetResized(const Event &event) { Window::widgetResized(event); -- cgit v1.2.3-70-g09d2