Katae
By: a guest | Nov 22nd, 2009 | Syntax:
Lua | Size: 0.53 KB | Hits: 91 | Expires: Never
local cf, coordX, coordY, Coords
if modules.Coords.enabled or modules.Location.enabled then
cf, coordX, coordY = CreateFrame'frame', 0, 0
cf:RegisterEvent'ZONE_CHANGED_NEW_AREA'
cf:SetScript("OnUpdate", function() coordX, coordY = GetPlayerMapPosition'player' end)
cf:SetScript("OnEvent", function(self, event, ...) if not WorldMapFrame:IsShown() then SetMapToCurrentZone() end end)
WorldMapFrame:HookScript("OnHide", SetMapToCurrentZone)
function Coords() return format(modules.Coords.fmt or "%d,%d", coordX*100, coordY*100) end
end