When I drag the minimap button along the edge, it remains the halo of highlight as you can see in the
picture
This is the code:
XML code (I used nopaste service to avoid wall text)
https://nopaste.me/view/2875c949
Lua code
Lua Code:
function MyMod:onMinimapButtonClick(button)
if (button == "LeftButton") then
print("foo")
end
if (button == "RightButton") then
print("bar")
end
end
MyMod.mmdp = 45 -- MyMod minimap button default position
function MyMod_MinimapButton_Reposition()
MyMod_MinimapButton:SetPoint("TOPLEFT","Minimap","TOPLEFT",52-(80*cos(MyMod.mmdp)),(80*sin(MyMod.mmdp))-52)
end
function MyMod:onMinimapButtonUpdate()
local xpos,ypos = GetCursorPosition()
local xmin,ymin = Minimap:GetLeft(), Minimap:GetBottom()
xpos = xmin-xpos/UIParent:GetScale()+70 -- get coordinates as differences from the center of the minimap
ypos = ypos/UIParent:GetScale()-ymin-70
MyMod.mmdp = math.deg(math.atan2(ypos,xpos)) -- save the degrees we are relative to the minimap center
MyMod_MinimapButton_Reposition() -- move the button
end
Can you help me?