Added script to coords
p3lim-52096 [11-09-08 - 13:25]
Added script to coords
git-svn-id: svn://svn.wowinterface.com/pMinimap-54/trunk@57 ae24c21f-2f0c-4c94-9256-0092abe71e0d
diff --git a/pMinimap_Coords/pMinimap_Coords.lua b/pMinimap_Coords/pMinimap_Coords.lua
index 0010b68..0a49766 100644
--- a/pMinimap_Coords/pMinimap_Coords.lua
+++ b/pMinimap_Coords/pMinimap_Coords.lua
@@ -1 +1 @@
-MiniMapCoords = CreateFrame('Frame', 'MiniMapCoord', Minimap)
MiniMapCoords:SetWidth(40)
MiniMapCoords:SetHeight(14)
MiniMapCoords:Show()
if(pMinimapDB2.clock) then
MiniMapCoords:SetPoint('BOTTOMRIGHT', Minimap)
else
MiniMapCoords:SetPoint('BOTTOM', Minimap)
end
MiniMapCoordText = MiniMapCoords:CreateFontString('MiniMapCoordText', 'OVERLAY')
MiniMapCoordText:SetPoint('CENTER', MiniMapCoords)
MiniMapCoordText:SetFont(pMinimapDB2.font, pMinimapDB2.fontsize, pMinimapDB2.fontflag)
MiniMapCoordText:SetTextColor(1, 1, 1)
local total = 0
MiniMapCoord:SetScript('OnUpdate', function(self, elapsed)
total = total + elapsed
if(total > 0.25) then
if(IsInInstance()) then
MiniMapCoordText:SetText()
else
local x, y = GetPlayerMapPosition('player')
MiniMapCoordText:SetFormattedText('%.0f,%.0f', x*100, y*100)
end
total = 0
end
end)
local handler = CreateFrame('Frame')
handler:RegisterEvent('ZONE_CHANGED_NEW_AREA')
handler:SetScript('OnEvent', function()
SetMapToCurrentZone()
end)
\ No newline at end of file
+MiniMapCoordButton = CreateFrame('Button', 'MiniMapCoord', Minimap)
MiniMapCoordButton:SetWidth(40)
MiniMapCoordButton:SetHeight(14)
MiniMapCoordButton:Show()
MiniMapCoordButton:RegisterForClicks('AnyUp')
MiniMapCoordButton:SetScript('OnClick', function() ToggleFrame(WorldMapFrame) end)
if(pMinimapDB2.clock) then
MiniMapCoordButton:SetPoint('BOTTOMRIGHT', Minimap)
else
MiniMapCoordButton:SetPoint('BOTTOM', Minimap)
end
MiniMapCoordText = MiniMapCoordButton:CreateFontString('MiniMapCoordText', 'OVERLAY')
MiniMapCoordText:SetPoint('CENTER', MiniMapCoordButton)
MiniMapCoordText:SetFont(pMinimapDB2.font, pMinimapDB2.fontsize, pMinimapDB2.fontflag)
MiniMapCoordText:SetTextColor(1, 1, 1)
local total = 0
MiniMapCoordButton:SetScript('OnUpdate', function(self, elapsed)
total = total + elapsed
if(total > 0.25) then
if(IsInInstance()) then
MiniMapCoordText:SetText()
else
local x, y = GetPlayerMapPosition('player')
MiniMapCoordText:SetFormattedText('%.0f,%.0f', x*100, y*100)
end
total = 0
end
end)
MiniMapCoordButton:RegisterEvent('ZONE_CHANGED_NEW_AREA')
MiniMapCoordButton:SetScript('OnEvent', function()
SetMapToCurrentZone()
end)
\ No newline at end of file