diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-08-02 21:32:53 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-08-02 21:32:53 +0300 |
commit | f886c62eee04a89c01d30322db1a9eb85f699ac3 (patch) | |
tree | d1cf48972f652b66986e14b9034493883c57dc22 /src/gui/windows/skilldialog.cpp | |
parent | 7a56bfad4c7297863c717a7ca8c8cf42c712a220 (diff) | |
download | mv-f886c62eee04a89c01d30322db1a9eb85f699ac3.tar.gz mv-f886c62eee04a89c01d30322db1a9eb85f699ac3.tar.bz2 mv-f886c62eee04a89c01d30322db1a9eb85f699ac3.tar.xz mv-f886c62eee04a89c01d30322db1a9eb85f699ac3.zip |
Add item shortcuts tab with automatically filled with skills.
Diffstat (limited to 'src/gui/windows/skilldialog.cpp')
-rw-r--r-- | src/gui/windows/skilldialog.cpp | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp index a0401012d..fdc1b7409 100644 --- a/src/gui/windows/skilldialog.cpp +++ b/src/gui/windows/skilldialog.cpp @@ -241,11 +241,38 @@ void SkillDialog::update() PlayerInfo::getAttribute(Attributes::PLAYER_SKILL_POINTS))); mPointsLabel->adjustSize(); + ItemShortcut *const shortcuts = itemShortcut[SHORTCUT_AUTO_TAB]; + shortcuts->clear(); + size_t idx = 0; + FOR_EACH (SkillMap::const_iterator, it, mSkills) { SkillInfo *const info = (*it).second; - if ((info != nullptr) && info->modifiable == Modifiable_true) + if (info == nullptr) + continue; + if (info->modifiable == Modifiable_true) info->update(); + if (info->visible == Visible_false || + idx >= SHORTCUT_ITEMS) + { + continue; + } + const SkillType::SkillType type = info->type; + if (type == SkillType::Attack || + type == SkillType::Ground || + type == SkillType::Self || + type == SkillType::Support) + { + shortcuts->setItemFast(idx, + info->id + SKILL_MIN_ID, + fromInt(info->customSelectedLevel, ItemColor)); + + shortcuts->setItemData(idx, strprintf("%d %d %d", + CAST_S32(info->customCastType), + info->customOffsetX, + info->customOffsetY)); + idx ++; + } } skillPopup->reset(); |