Im trying to change cursor shape over each unit on grid.
I have some clue for it but need help to do work with every unit
Code:
local cursorGrid = "ITEM_CURSOR"
local function OnEnter(self)
SetCursor(cursorGrid)
end
GridLayoutFrame:SetScript("OnEnter", OnEnter)
|
Tried this, but does´nt work
Code:
local function OnEnter(self)
SetCursor("ITEM_CURSOR")
end
--GridLayoutFrame:SetScript("OnEnter", OnEnter)
--/run print(GetMouseFocus():GetName())
local GridFrame = Grid:GetModule("GridFrame")
local function WithAllGridFrames(func)
for _, frame in pairs(GridFrame.registeredFrames) do
frame:SetScript("OnEnter", OnEnter)
end
end
local GridUnitCursor = CreateFrame("Frame")
GridUnitCursor:RegisterEvent("PLAYER_ENTERING_WORLD")
GridUnitCursor:SetScript("OnEvent", function(self)
WithAllGridFrames()
WithAllGridFrames = nil
self:UnregisterEvent("PLAYER_ENTERING_WORLD")
self:SetScript("OnEvent", nil)
end)
|