Originally Posted by semlar
Alright, try this one, it should actually work this time.
Lua Code:
local oSetAttribute = getmetatable(ActionButton1).__index.SetAttribute hooksecurefunc(getmetatable(ActionButton1).__index, 'SetAttribute', function(self, attribute) if attribute ~= 'showgrid' then return end oSetAttribute(self, 'showgrid', CursorHasSpell() or 0) if not HasAction(self.action) then self:Hide() end end)
Plus I'm pretty sure my last example had an infinite loop in it, I'm surprised it worked at all.
|
EDIT4: I got it working with the stuff I use 99% of the time, but I cannot get it working when moving:
I tried with CursorHasCompanion / EquipmentSet, but it seems they do not exist.
Is there a way to make it work when anything is being dragged?
Edit: I added CursorHasItem() to it, but how do I make it work with macros?
Edit2: HAHA!
I just randomly tried CursorHasMacro, and of course it worked!
Edit3: Edited #1 to contain the working code.
You have been a big help really, thank you so much!