-- Coords.lua local _; local CTimerAfter = C_Timer.After; local updating = false; local frame = CreateFrame("Frame", "OmaCoords", UIParent); frame:SetPoint("CENTER", UIParent, "CENTER", 0, 60); frame:SetWidth(1); frame:SetHeight(1); frame.text = frame:CreateFontString(nil, "OVERLAY", "GameFontHighlight"); frame.text:SetPoint("CENTER"); frame:Hide(); local function update() if updating then local vec = C_Map.GetPlayerMapPosition(C_Map.GetBestMapForUnit("player"), "player"); if vec then local x, y = vec:GetXY(); frame.text:SetFormattedText("%.1f, %.1f", x*100, y*100); else frame.text:SetFormattedText("not available"); end CTimerAfter(0.2, update); end end SLASH_OMACOORDS1 = "/coords"; function SlashCmdList.OMACOORDS() if frame:IsShown() then updating = false; frame:Hide(); else updating = true; update(); frame:Show(); end end