/branches
local coordframe = CreateFrame("Frame", nil, Minimap) |
coordframe:SetHeight(28) --height of clock button |
coordframe:SetWidth(60) --width of clock button |
coordframe:EnableMouse(true) |
local coords = coordframe:CreateFontString(nil, "OVERLAY") |
coords:SetParent(coordframe) |
local frames = { "Minimap", |
--LFG ICON |
MiniMapMeetingStoneBorder:Hide() |
MiniMapMeetingStoneFrame:SetPoint("BOTTOMLEFT", Minimap, "BOTTOMLEFT", 55, 30) |
MiniMapMeetingStoneFrame:ClearAllPoints() |
MiniMapMeetingStoneFrame:SetPoint("BOTTOMLEFT", Minimap, "BOTTOMLEFT", 27, -3) |
--MISC. THINGS TO HIDE |
MiniMapWorldMapButton:Hide() --default keybinding for world map is M |
local function CoordPosition() |
local clockshown = TimeManagerClockButton:IsShown() |
local coordshown = coordframe:IsShown() |
clockTime:ClearAllPoints() |
TimeManagerClockButton:ClearAllPoints() |
coords:ClearAllPoints() |
coordframe:ClearAllPoints() |
if not PocketPlotDB.top then |
if clockshown and not coordshown then |
clockTime:SetPoint("CENTER") |
TimeManagerClockButton:SetPoint("TOP", Minimap, "BOTTOM", 0, 0) |
end |
if coordshown and not clockshown then |
coordframe:SetPoint("TOP", Minimap, "BOTTOM", 0, 0) |
end |
if clockshown and coordshown then |
clockTime:SetPoint("LEFT") |
TimeManagerClockButton:SetPoint("TOPLEFT", Minimap, "BOTTOMLEFT", 0, 0) |
TimeManagerClockButton:SetPoint("TOPLEFT", Minimap, "BOTTOMLEFT", -10, 0) |
coords:SetPoint("RIGHT") |
coordframe:SetPoint("TOPRIGHT", Minimap, "BOTTOMRIGHT", 0, 0) |
end |
else |
if clockshown and not coordshown then |
clockTime:SetPoint("CENTER") |
TimeManagerClockButton:SetPoint("BOTTOM", Minimap, "TOP", 0, 0) |
end |
if coordshown and not clockshown then |
coordframe:SetPoint("BOTTOM", Minimap, "TOP", 0, 0) |
end |
if clockshown and coordshown then |
clockTime:SetPoint("LEFT") |
TimeManagerClockButton:SetPoint("BOTTOMLEFT", Minimap, "TOPLEFT", 0, 0) |
TimeManagerClockButton:SetPoint("BOTTOMLEFT", Minimap, "TOPLEFT", -10, 0) |
coords:SetPoint("RIGHT") |
coordframe:SetPoint("BOTTOMRIGHT", Minimap, "TOPRIGHT", 0, 0) |
end |
end |
_G[frame]:ClearAllPoints() |
_G[frame]:SetPoint(PocketPlotDB[frame].r, UIParent, PocketPlotDB[frame].a, PocketPlotDB[frame].x, PocketPlotDB[frame].y) |
_G["PP_old"..frame] = _G[frame].SetPoint |
_G[frame].SetPoint = function(self, a,b,c,d,e, ...) |
local a,b,c,d,e = PocketPlotDB[frame].r, UIParent, PocketPlotDB[frame].a, PocketPlotDB[frame].x, PocketPlotDB[frame].y |
return _G["PP_old"..frame](self, a,b,c,d,e, ...) |
end |
if not _G["PP_old"..frame] then |
_G["PP_old"..frame] = _G[frame].SetPoint |
_G[frame].SetPoint = function(self, a,b,c,d,e, ...) |
local a,b,c,d,e = PocketPlotDB[frame].r, UIParent, PocketPlotDB[frame].a, PocketPlotDB[frame].x, PocketPlotDB[frame].y |
return _G["PP_old"..frame](self, a,b,c,d,e, ...) |
end |
end |
end |
local options = { |
mover:SetScript("OnMouseDown", function() mover:StartMoving() end) |
mover:SetScript("OnMouseUp", function() mover:StopMovingOrSizing() SetPosition(movershown) end) |
coordframe:SetScript("OnEnter", function(self) GameTooltip:SetOwner(self, "ANCHOR_LEFT") GameTooltip:AddLine("Click to display the world map.") GameTooltip:Show() end) |
coordframe:SetScript("OnLeave", function() GameTooltip:Hide() end) |
coordframe:SetScript("OnMouseUp", function() WorldMapFrame:Show() end) |
coordframe:SetScript("OnUpdate", function() |
local coordx,coordy = GetPlayerMapPosition("player") |
coords:SetFormattedText("%.1f/%.1f", coordx*100, coordy*100) |