diff options
Diffstat (limited to 'src/gui/shortcut/itemshortcut.cpp')
-rw-r--r-- | src/gui/shortcut/itemshortcut.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/gui/shortcut/itemshortcut.cpp b/src/gui/shortcut/itemshortcut.cpp index 5828ae4e7..d4e96a3e2 100644 --- a/src/gui/shortcut/itemshortcut.cpp +++ b/src/gui/shortcut/itemshortcut.cpp @@ -62,8 +62,10 @@ void ItemShortcut::load() std::string name; std::string color; std::string data; - const Configuration *cfg = &serverConfig; + if (mNumber == SHORTCUT_AUTO_TAB) + return; + const Configuration *cfg = &serverConfig; if (mNumber != 0) { name = std::string("shortcut").append(toString(mNumber)).append("_"); @@ -96,6 +98,8 @@ void ItemShortcut::save() const std::string name; std::string color; std::string data; + if (mNumber == SHORTCUT_AUTO_TAB) + return; if (mNumber != 0) { name = std::string("shortcut").append(toString(mNumber)).append("_"); @@ -131,6 +135,16 @@ void ItemShortcut::save() const } } +void ItemShortcut::clear() +{ + for (size_t i = 0; i < SHORTCUT_ITEMS; i++) + { + mItems[i] = 0; + mItemColors[i] = ItemColor_zero; + mItemData[i].clear(); + } +} + void ItemShortcut::useItem(const int index) const { const Inventory *const inv = PlayerInfo::getInventory(); @@ -232,6 +246,14 @@ void ItemShortcut::setItem(const int index, save(); } +void ItemShortcut::setItemFast(const int index, + const int item, + const ItemColor color) +{ + mItems[index] = item; + mItemColors[index] = color; +} + void ItemShortcut::swap(const int index1, const int index2) { if (index1 < 0 || index2 < 0 |