--[[ MyMinimapButton v0.4 This is an embedded library intended to be used by other mods. It's not a standalone mod. See MyMinimapButton_API_readme.txt for more info. ]] local version = 0.4 if not MyMinimapButton or MyMinimapButton.Version340) and 1 or found -- leave if we've done full circle end return position end, OnMouseDown = function() getglobal(this:GetName().."Icon"):SetTexCoord(.1,.9,.1,.9) end, OnMouseUp = function() getglobal(this:GetName().."Icon"):SetTexCoord(0,1,0,1) end, OnEnter = function() GameTooltip_SetDefaultAnchor(GameTooltip,UIParent) GameTooltip:AddLine(this.tooltipTitle) GameTooltip:AddLine(this.tooltipText,.8,.8,.8,1) GameTooltip:Show() end, OnLeave = function() GameTooltip:Hide() end, OnDragStart = function() MyMinimapButton:OnMouseDown() this:LockHighlight() this:SetScript("OnUpdate",MyMinimapButton.OnUpdate) end, OnDragStop = function() this:SetScript("OnUpdate",nil) this:UnlockHighlight() MyMinimapButton:OnMouseUp() end, OnUpdate = function() local xpos,ypos = GetCursorPosition() local xmin,ymin = Minimap:GetLeft(), Minimap:GetBottom() xpos = xmin-xpos/Minimap:GetEffectiveScale()+70 ypos = ypos/Minimap:GetEffectiveScale()-ymin-70 this.modSettings.position = math.deg(math.atan2(ypos,xpos)) local modName = string.gsub(this:GetName() or "","MinimapButton$","") MyMinimapButton:Move(modName) end, OnClick = function() if arg1=="LeftButton" and this.leftClick then this.leftClick() elseif arg1=="RightButton" and this.rightClick then this.rightClick() end end } end