diff --git a/.luacheckrc b/.luacheckrc index 9a4402a..c39b90b 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -1,12 +1,11 @@ td = "lua51" max_line_length = false codes = true -exclude_files = { -} ignore = { "212/self" } globals = { + "AbbreviateNumbers", "C_Map", "C_Navigation", "C_SuperTrack", diff --git a/MapPinTimers.lua b/MapPinTimers.lua index 90bbc02..ecdee94 100644 --- a/MapPinTimers.lua +++ b/MapPinTimers.lua @@ -38,6 +38,13 @@ end -- replaces UpdateDistanceText from Blizzard_QuestNavigation/SuperTrackedFrame.lua do + local function GetDistanceString(distance) + if distance < 1000 then + return tostring(distance) + else + return AbbreviateNumbers(distance) + end + end local throttle = 0 local lastDistance = nil local function UpdateDistanceTextWithTimer(self, elapsed) @@ -57,7 +64,7 @@ do end throttle = 0 end - self.DistanceText:SetText(IN_GAME_NAVIGATION_RANGE:format(Round(distance))) + self.DistanceText:SetText(IN_GAME_NAVIGATION_RANGE:format(GetDistanceString(Round(distance)))) else self.TimeText:SetShown(false) lastDistance = nil