diff --git a/Localization/enUS.lua b/Localization/enUS.lua index 8b4c90b..abcac12 100644 --- a/Localization/enUS.lua +++ b/Localization/enUS.lua @@ -44,6 +44,14 @@ L["Show Omen when you are in a battleground or arena"] = true L["You are in a dungeon"] = true L["Show Omen when you are in a dungeon (5 man and raid)"] = true +-- Config strings, bar settings section +L["Bar Settings"] = true +L["Configure bar settings."] = true +L["Animate Bars"] = true +L["Smoothly animate bar changes"] = true +L["Short Numbers"] = true +L["Display large numbers in Ks"] = true + -- Config strings, slash command section L["OMEN_SLASH_DESC"] = "These buttons execute the same functions as the ones in the slash command /omen" L["Toggle Omen"] = true diff --git a/Omen.lua b/Omen.lua index cea893e..9f07c13 100644 --- a/Omen.lua +++ b/Omen.lua @@ -36,6 +36,7 @@ local defaults = { Locked = false, BarHeight = 16, AnimateBars = true, + ShortNumbers = true, ShowWith = { Pet = true, Alone = false, @@ -679,18 +680,19 @@ function Omen:UpdateBars() local class = guidClassLookup[guid] if class == nil or db.Classes[class] then -- class == nil implies its not in your raid local bar = bars[j] + local threat = threatTable[guid] bar.Text1:SetText(guidNameLookup[guid] or L["Unknown"]) - if tankThreat == 0 then - bar.Text2:SetFormattedText("%d [100%%]", threatTable[guid] / 100) + if db.ShortNumbers and threat > 100000 then + bar.Text2:SetFormattedText("%2.1fk [%d%%]", threat / 100000, tankThreat == 0 and 0 or threat / tankThreat * 100) else - bar.Text2:SetFormattedText("%d [%d%%]", threatTable[guid] / 100, threatTable[guid] / tankThreat * 100) + bar.Text2:SetFormattedText("%d [%d%%]", threat / 100, tankThreat == 0 and 0 or threat / tankThreat * 100) end local c = (class == "PET" and pet_color) or RAID_CLASS_COLORS[class] or default_color bar.texture:SetVertexColor(c.r, c.g, c.b) if db.AnimateBars then - bar:AnimateTo(w * threatTable[guid] / topthreat) + bar:AnimateTo(w * threat / topthreat) else - bar.texture:SetWidth(w * threatTable[guid] / topthreat) + bar.texture:SetWidth(w * threat / topthreat) end bar:Show() i = i + 1 @@ -879,8 +881,8 @@ local options = { }, Bars = { type = "group", - name = "Bar Settings", - desc = "Bar Settings", + name = L["Bar Settings"], + desc = L["Bar Settings"], set = function(info, value) Omen.db.profile[ info[#info] ] = value Omen:UpdateBars() @@ -889,12 +891,17 @@ local options = { intro = { order = 1, type = "description", - name = "Configure bar settings.", + name = L["Configure bar settings."], }, AnimateBars = { type = "toggle", - name = "Animate Bars", - desc = "Smoothly animate bar changes", + name = L["Animate Bars"], + desc = L["Smoothly animate bar changes"], + }, + ShortNumbers = { + type = "toggle", + name = L["Short Numbers"], + desc = L["Display large numbers in Ks"], }, }, }, @@ -994,7 +1001,7 @@ function Omen:SetupOptions() self:RegisterModuleOptions("OmenSlashCommand", optionsSlash, L["Slash Command"]) self.optionsFrames["Help"] = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("Omen", L["Help File"], "Omen", "Help") self.optionsFrames["ShowWhen"] = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("Omen", L["Show When..."], "Omen", "ShowWhen") - self.optionsFrames["Bars"] = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("Omen", "Bar Settings", "Omen", "Bars") + self.optionsFrames["Bars"] = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("Omen", L["Bar Settings"], "Omen", "Bars") end function Omen:RegisterModuleOptions(name, optionTbl, displayName)