summaryrefslogtreecommitdiff
path: root/src/gui/shortcut/itemshortcut.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-08-08 00:38:31 +0300
committerAndrei Karas <akaras@inbox.ru>2017-08-08 00:38:31 +0300
commit344efb2009b8c6d329a6d19dd45ed49076252710 (patch)
tree2e5c1a7d9484e1cc3bfedac7b03c7146be442896 /src/gui/shortcut/itemshortcut.cpp
parentfa4c5d79b04a319550996c48448cd799fe7fde56 (diff)
downloadplus-344efb2009b8c6d329a6d19dd45ed49076252710.tar.gz
plus-344efb2009b8c6d329a6d19dd45ed49076252710.tar.bz2
plus-344efb2009b8c6d329a6d19dd45ed49076252710.tar.xz
plus-344efb2009b8c6d329a6d19dd45ed49076252710.zip
Add into skill context menu for add shortcut.
Also add chat command for add skill shortcut by skill id into free slot.
Diffstat (limited to 'src/gui/shortcut/itemshortcut.cpp')
-rw-r--r--src/gui/shortcut/itemshortcut.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/shortcut/itemshortcut.cpp b/src/gui/shortcut/itemshortcut.cpp
index 7b9bab6e6..2f80f6759 100644
--- a/src/gui/shortcut/itemshortcut.cpp
+++ b/src/gui/shortcut/itemshortcut.cpp
@@ -277,3 +277,13 @@ void ItemShortcut::swap(const int index1, const int index2)
mItemData[index2] = tmpData;
save();
}
+
+size_t ItemShortcut::getFreeIndex() const
+{
+ for (size_t i = 0; i < SHORTCUT_ITEMS; i++)
+ {
+ if (mItems[i] < 0)
+ return i;
+ }
+ return -1;
+}