That is what i have at this time.
lua:
Lua Code:
MyMod_Settings = {
MinimapPos = 45
}
function MyMod_MinimapButton_Reposition()
MyMod_MinimapButton:SetPoint("TOPLEFT","Minimap","TOPLEFT",52-(80*cos(MyMod_Settings.MinimapPos)),(80*sin(MyMod_Settings.MinimapPos))-52)
end
function MyMod_MinimapButton_DraggingFrame_OnUpdate()
local xpos,ypos = GetCursorPosition()
local xmin,ymin = Minimap:GetLeft(), Minimap:GetBottom()
xpos = xmin-xpos/UIParent:GetScale()+70
ypos = ypos/UIParent:GetScale()-ymin-70
MyMod_Settings.MinimapPos = math.deg(math.atan2(ypos,xpos))
MyMod_MinimapButton_Reposition()
end
function MyMod_MinimapButton_OnClick()
DEFAULT_CHAT_FRAME.editBox:SetText("/gt")
ChatEdit_SendText(DEFAULT_CHAT_FRAME.editBox, 0)
end
xml:
Lua Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Script file="GildenSteuerMiniMapButton.lua"/>
<Button name="MyMod_MinimapButton" parent="Minimap" enableMouse="true" movable="true" hidden="false">
<Size>
<AbsDimension x="33" y="33"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="MyMod_MinimapButton_Icon" file="Interface\Icons\inv_misc_notefolded2a">
<Size>
<AbsDimension x="21" y="21"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="7" y="-6"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
<Layer level="OVERLAY">
<Texture file="Interface\Minimap\MiniMap-TrackingBorder">
<Size>
<AbsDimension x="56" y="56"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
</Texture>
</Layer>
</Layers>
<Frames>
<Frame name="MyMod_MinimapButton_DraggingFrame" hidden="true">
<Scripts>
<OnUpdate>
MyMod_MinimapButton_DraggingFrame_OnUpdate()
</OnUpdate>
</Scripts>
</Frame>
</Frames>
<HighlightTexture alphaMode="ADD" file="Interface\Minimap\UI-Minimap-ZoomButton-Highlight"/>
<Scripts>
<OnLoad>
this:RegisterForClicks("LeftButtonUp","RightButtonUp")
this:RegisterForDrag("LeftButton","RightButton")
</OnLoad>
<OnDragStart>
this:LockHighlight()
MyMod_MinimapButton_DraggingFrame:Show()
</OnDragStart>
<OnDragStop>
this:UnlockHighlight()
MyMod_MinimapButton_DraggingFrame:Hide()
</OnDragStop>
<OnClick>
MyMod_MinimapButton_OnClick() -- do your thing in here, arg1 is mouse button clicked
</OnClick>
</Scripts>
</Button>
</Ui>
But i cant move the Button. And I will add a tooltip for it.