You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 21, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: Objects/ACTIONBUTTON_DragAndDrop.lua
+13-7Lines changed: 13 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -37,11 +37,10 @@ function ACTIONBUTTON:OnDragStart()
37
37
38
38
ifdragthen
39
39
40
-
ClearCursor()
41
-
42
-
--This is all just to put an icon on the mousecursor. Sadly we can't use SetCursor, because once you leave the frame the icon goes away. PickupSpell seems to work, but we need a valid spellID
43
-
--This trick here is that we ignore what is 'actually' and are just using it for the icon and the sound effects
44
-
self:SetMouseCursor()
40
+
--don't run if we have a cache, we will call it manually on the OnReceiveDrag on the new button
41
+
if#macroCache==0then
42
+
self:SetMouseCursor()
43
+
end
45
44
46
45
self:PickUpMacro()
47
46
@@ -75,6 +74,10 @@ function ACTIONBUTTON:OnReceiveDrag()
75
74
wipe(macroCache)
76
75
end
77
76
77
+
if#macroCache>0then--if we have a cache, pickup the current icon before replacing it with the new content
78
+
self:SetMouseCursor()
79
+
end
80
+
78
81
if#macroDrag>0then--checks to see if the thing we are placing is a Neuron created macro vs something from the spellbook
79
82
self:PlaceMacro()
80
83
elseifcursorType=="spell" then
@@ -109,7 +112,7 @@ function ACTIONBUTTON:OnReceiveDrag()
109
112
self:UpdateAll()
110
113
111
114
if#macroCache>0then
112
-
self:OnDragStart(macroCache) --If we picked up a new ability after dropping this one we have to manually call OnDragStart
115
+
self:OnDragStart() --If we picked up a new ability after dropping this one we have to manually call OnDragStart
113
116
self:ACTIONBAR_SHOWGRID() --show the button grid if we have something picked up (i.e if macroDrag contains something)
114
117
else
115
118
SetCursor(nil)
@@ -472,8 +475,11 @@ function ACTIONBUTTON:PlaceFlyout(action1, action2)
472
475
self:UpdateFlyout(true)
473
476
end
474
477
475
-
478
+
--This is all just to put an icon on the mouse cursor. Sadly we can't use SetCursor, because once you leave the frame the icon goes away. PickupSpell seems to work, but we need a valid spellID
479
+
--This trick here is that we ignore what is 'actually' and are just using it for the icon and the sound effects
0 commit comments