diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-08-15 20:53:32 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-08-15 20:53:32 +0300 |
commit | f2b5d38744860360b4b592920c4732aea839ab75 (patch) | |
tree | 861f05e56f628d3fc3554ada44bfb98b1803ab01 /src/gui/widgets/itemshortcutcontainer.cpp | |
parent | e5cdd67b71b9d26d5d8a4182a64379fe8a8b4f7a (diff) | |
download | plus-f2b5d38744860360b4b592920c4732aea839ab75.tar.gz plus-f2b5d38744860360b4b592920c4732aea839ab75.tar.bz2 plus-f2b5d38744860360b4b592920c4732aea839ab75.tar.xz plus-f2b5d38744860360b4b592920c4732aea839ab75.zip |
Copy skill cast offset to shortcuts.
Also show offsets in skill popup in shortcuts.
Diffstat (limited to 'src/gui/widgets/itemshortcutcontainer.cpp')
-rw-r--r-- | src/gui/widgets/itemshortcutcontainer.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp index 60519699e..e898c34d4 100644 --- a/src/gui/widgets/itemshortcutcontainer.cpp +++ b/src/gui/widgets/itemshortcutcontainer.cpp @@ -599,16 +599,28 @@ void ItemShortcutContainer::mouseMoved(MouseEvent &event) if (!skill) return; - // +++ for now from data only get cast type const std::string data = selShortcut->getItemData(index); CastTypeT castType = CastType::Default; + int offsetX = 0; + int offsetY = 0; if (!data.empty()) { - castType = static_cast<CastTypeT>(atoi(data.c_str())); + std::vector<int> vect; + splitToIntVector(vect, data, ' '); + const size_t sz = vect.size(); + if (sz > 0) + castType = static_cast<CastTypeT>(vect[0]); + if (sz > 2) + { + offsetX = vect[1]; + offsetY = vect[2]; + } } skillPopup->show(skill, toInt(itemColor, int), - castType); + castType, + offsetX, + offsetY); skillPopup->position(viewport->mMouseX, viewport->mMouseY); } |