summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/itemshortcutcontainer.cpp18
-rw-r--r--src/gui/widgets/skilllistbox.h11
2 files changed, 22 insertions, 7 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);
}
diff --git a/src/gui/widgets/skilllistbox.h b/src/gui/widgets/skilllistbox.h
index 91023e4dd..720d51005 100644
--- a/src/gui/widgets/skilllistbox.h
+++ b/src/gui/widgets/skilllistbox.h
@@ -202,7 +202,9 @@ class SkillListBox final : public ListBox
return;
skillPopup->show(skill,
skill->customSelectedLevel,
- skill->customCastType);
+ skill->customCastType,
+ skill->customOffsetX,
+ skill->customOffsetY);
skillPopup->position(viewport->mMouseX,
viewport->mMouseY);
}
@@ -221,9 +223,10 @@ class SkillListBox final : public ListBox
return;
dragDrop.dragSkill(skill, DragDropSource::Skills);
dragDrop.setItem(skill->id + SKILL_MIN_ID);
- // +++ using only cast type in data
- dragDrop.setItemData(toString(CAST_S32(
- skill->customCastType)));
+ dragDrop.setItemData(strprintf("%d %d %d",
+ CAST_S32(skill->customCastType),
+ skill->customOffsetX,
+ skill->customOffsetY));
}
ListBox::mouseDragged(event);
}