Skip to content
This repository was archived by the owner on Jan 21, 2024. It is now read-only.

Commit 09743dc

Browse files
committed
fix drag and drop icon not updating when chain dragging
1 parent 31a01c4 commit 09743dc

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

Objects/ACTIONBUTTON_DragAndDrop.lua

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,10 @@ function ACTIONBUTTON:OnDragStart()
3737

3838
if drag then
3939

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==0 then
42+
self:SetMouseCursor()
43+
end
4544

4645
self:PickUpMacro()
4746

@@ -75,6 +74,10 @@ function ACTIONBUTTON:OnReceiveDrag()
7574
wipe(macroCache)
7675
end
7776

77+
if #macroCache>0 then --if we have a cache, pickup the current icon before replacing it with the new content
78+
self:SetMouseCursor()
79+
end
80+
7881
if #macroDrag>0 then --checks to see if the thing we are placing is a Neuron created macro vs something from the spellbook
7982
self:PlaceMacro()
8083
elseif cursorType == "spell" then
@@ -109,7 +112,7 @@ function ACTIONBUTTON:OnReceiveDrag()
109112
self:UpdateAll()
110113

111114
if #macroCache>0 then
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
113116
self:ACTIONBAR_SHOWGRID() --show the button grid if we have something picked up (i.e if macroDrag contains something)
114117
else
115118
SetCursor(nil)
@@ -472,8 +475,11 @@ function ACTIONBUTTON:PlaceFlyout(action1, action2)
472475
self:UpdateFlyout(true)
473476
end
474477

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
476480
function ACTIONBUTTON:SetMouseCursor()
481+
ClearCursor()
482+
477483
if self.spell and self.spellID then
478484
PickupSpell(self.spellID)
479485
if GetCursorInfo() then

0 commit comments

Comments
 (0)