From 38581f724db7901741ac72a9b2b11eede6b28b5e Mon Sep 17 00:00:00 2001 From: greenya Date: Wed, 17 May 2017 22:19:03 +0300 Subject: [PATCH] minimap/panel: consistent player coordinates --- modules/minimap.lua | 4 +--- modules/panel.lua | 8 ++++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/minimap.lua b/modules/minimap.lua index ec79bf4c..6ac9117d 100644 --- a/modules/minimap.lua +++ b/modules/minimap.lua @@ -115,9 +115,7 @@ pfUI:RegisterModule("minimap", function () SetMapToCurrentZone() local posX, posY = GetPlayerMapPosition("player") if posX ~= 0 and posY ~= 0 then - local roundedX = ceil(posX * 1000)/10 - local roundedY = ceil(posY * 1000)/10 - pfUI.minimapCoordinates.text:SetText(roundedX..", "..roundedY) + pfUI.minimapCoordinates.text:SetText(round(posX * 100, 1) .. ", " .. round(posY * 100, 1)) else pfUI.minimapCoordinates.text:SetText("|cffffaaaaN/A") end diff --git a/modules/panel.lua b/modules/panel.lua index 6c01d101..9a892d1b 100644 --- a/modules/panel.lua +++ b/modules/panel.lua @@ -352,14 +352,18 @@ pfUI:RegisterModule("panel", function () function pfUI.panel:UpdateZone () local tooltip = function () - local posX, posY = GetPlayerMapPosition("player") local real = GetRealZoneText() local sub = GetSubZoneText() GameTooltip:ClearLines() GameTooltip_SetDefaultAnchor(GameTooltip, this) GameTooltip:AddLine("|cffffffff" .. real) GameTooltip:AddLine(sub) - GameTooltip:AddLine("|cffaaaaaa" .. round(posX*100,1) .. " / " .. round(posY*100,1)) + + local posX, posY = GetPlayerMapPosition("player") + if posX ~= 0 and posY ~= 0 then + GameTooltip:AddLine("|cffaaaaaa" .. round(posX * 100, 1) .. ", " .. round(posY * 100, 1)) + end + GameTooltip:Show() end