summaryrefslogtreecommitdiff
path: root/src/gui/windows/skilldialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-08-02 21:32:53 +0300
committerAndrei Karas <akaras@inbox.ru>2017-08-02 21:32:53 +0300
commitf886c62eee04a89c01d30322db1a9eb85f699ac3 (patch)
treed1cf48972f652b66986e14b9034493883c57dc22 /src/gui/windows/skilldialog.cpp
parent7a56bfad4c7297863c717a7ca8c8cf42c712a220 (diff)
downloadmv-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.cpp29
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();