Code:
local mapID, position
local formatText = ": %.1f, %.1f"
hooksecurefunc(WorldMapFrame, "OnMapChanged", function(self)
mapID = self:GetMapID()
end)
local function CoordsUpdate(player, cursor)
local cx, cy = CursorCoords()
if cx and cy then
cursor:SetFormattedText(MOUSE_LABEL..formatText, 100 * cx, 100 * cy)
else
cursor:SetText(MOUSE_LABEL..": --, --")
end
position = C_Map.GetPlayerMapPosition(mapID, "player")
if not position or (position.x == 0 and position.y == 0) then
player:SetText(PLAYER..": --, --")
else
player:SetFormattedText(PLAYER..formatText, 100 * position.x, 100 * position.y)
wipe(position)
end
end