Skip to content

Commit

Permalink
Retail: Added an option to abbreviate millions in health-current stat…
Browse files Browse the repository at this point in the history
…us (gh issue #205)
  • Loading branch information
michaelnpsp committed Feb 20, 2024
1 parent 58df609 commit e03e46c
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 5 deletions.
1 change: 1 addition & 0 deletions Options/locales/deDE.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,7 @@ L["\"%s\" has sent you a profile configuration. Do you want to activate received
-- L["Heal Types"] = ""
-- L["Shorten Heal Numbers"] = ""
-- L["Shorten Health Numbers"] = ""
-- L["Shorten Above Million Numbers"] = ""
-- L["Include heals casted by me, if unchecked only other players heals are displayed."] = ""
-- L["Apply this multiplier value to incoming heals."] = ""
-- L["Incoming overheals below the specified value will not be shown."] = ""
Expand Down
1 change: 1 addition & 0 deletions Options/locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1366,6 +1366,7 @@ L["Show only heals that are going to land within the selected time period. Selec
L["Heal Types"] = true
L["Shorten Heal Numbers"] = true
L["Shorten Health Numbers"] = true
L["Shorten Above Million Numbers"] = true
L["Include heals casted by me, if unchecked only other players heals are displayed."] = true
L["Apply this multiplier value to incoming heals."] = true
L["Incoming overheals below the specified value will not be shown."] = true
Expand Down
5 changes: 3 additions & 2 deletions Options/locales/esES.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1378,8 +1378,9 @@ L["%d seconds"] = "%s segundos"
L["Heals Time Band"] = "Curas Tango Tiempo"
L["Show only heals that are going to land within the selected time period. Select None to display all heals."] = "Muestra solo la curas que se van a aplicar en el periodo de tiempo seleccionado."
L["Heal Types"] = "Tipo de Curas"
L["Shorten Heal Numbers"] = "Acortar numeros (curas)"
L["Shorten Health Numbers"] = "Acortar numeros (vidas)"
L["Shorten Heal Numbers"] = "Acorta numeros (curas)"
L["Shorten Health Numbers"] = "Acorta numeros (vidas)"
L["Shorten Above Million Numbers"] = "Acorta numeros por encima de un millon"
L["Include heals casted by me, if unchecked only other players heals are displayed."] = "Incluir curas casteadas por mi, si se desactiva solo se muestran las curas originadas por otros juegadores."
L["Apply this multiplier value to incoming heals."] = "Aplicar este mulitplicador a las curas entrantes."
L["Incoming overheals below the specified value will not be shown."] = "No se mostrará la sobrecuracion por debajo del valor indicado."
Expand Down
1 change: 1 addition & 0 deletions Options/locales/frFR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1363,6 +1363,7 @@ L["\"%s\" has sent you a profile configuration. Do you want to activate received
-- L["Heal Types"] = ""
-- L["Shorten Heal Numbers"] = ""
-- L["Shorten Health Numbers"] = ""
-- L["Shorten Above Million Numbers"] = ""
-- L["Include heals casted by me, if unchecked only other players heals are displayed."] = ""
-- L["Apply this multiplier value to incoming heals."] = ""
-- L["Incoming overheals below the specified value will not be shown."] = ""
Expand Down
1 change: 1 addition & 0 deletions Options/locales/itIT.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,7 @@ L["You can include a descriptive prefix using separators \"@#>\""] = "Puoi inclu
-- L["Heal Types"] = ""
-- L["Shorten Heal Numbers"] = ""
-- L["Shorten Health Numbers"] = ""
-- L["Shorten Above Million Numbers"] = ""
-- L["Include heals casted by me, if unchecked only other players heals are displayed."] = ""
-- L["Apply this multiplier value to incoming heals."] = ""
-- L["Incoming overheals below the specified value will not be shown."] = ""
Expand Down
1 change: 1 addition & 0 deletions Options/locales/koKR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,7 @@ L["Show only heals that are going to land within the selected time period. Selec
L["Heal Types"] = "치유 유형"
L["Shorten Heal Numbers"] = "치유 숫자 짧게"
L["Shorten Health Numbers"] = "생명력 숫자 짧게"
-- L["Shorten Above Million Numbers"] = ""
L["Include heals casted by me, if unchecked only other players heals are displayed."] = "내가 시전한 치유도 포함, 미체크시 다른 플레이어의 치유만 표시"
L["Apply this multiplier value to incoming heals."] = "현재 배율을 받은 치유에 적용"
L["Incoming overheals below the specified value will not be shown."] = "지정값 아래의 받는 초과 치유는 표시하지 않음"
Expand Down
1 change: 1 addition & 0 deletions Options/locales/ptBR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,7 @@ L["A resurrection spell has been casted on the unit"] = "A magia reviver esta se
-- L["Heal Types"] = ""
-- L["Shorten Heal Numbers"] = ""
-- L["Shorten Health Numbers"] = ""
-- L["Shorten Above Million Numbers"] = ""
-- L["Include heals casted by me, if unchecked only other players heals are displayed."] = ""
-- L["Apply this multiplier value to incoming heals."] = ""
-- L["Incoming overheals below the specified value will not be shown."] = ""
Expand Down
1 change: 1 addition & 0 deletions Options/locales/ruRU.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,7 @@ L["You can include a descriptive prefix using separators \"@#>\""] = "Вы мо
-- L["Heal Types"] = ""
-- L["Shorten Heal Numbers"] = ""
-- L["Shorten Health Numbers"] = ""
-- L["Shorten Above Million Numbers"] = ""
-- L["Include heals casted by me, if unchecked only other players heals are displayed."] = ""
-- L["Apply this multiplier value to incoming heals."] = ""
-- L["Incoming overheals below the specified value will not be shown."] = ""
Expand Down
1 change: 1 addition & 0 deletions Options/locales/zhCN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1363,6 +1363,7 @@ L["You can include a descriptive prefix using separators \"@#>\""] = "你可以
-- L["Heal Types"] = ""
-- L["Shorten Heal Numbers"] = ""
-- L["Shorten Health Numbers"] = ""
-- L["Shorten Above Million Numbers"] = ""
-- L["Include heals casted by me, if unchecked only other players heals are displayed."] = ""
-- L["Apply this multiplier value to incoming heals."] = ""
-- L["Incoming overheals below the specified value will not be shown."] = ""
Expand Down
1 change: 1 addition & 0 deletions Options/locales/zhTW.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1363,6 +1363,7 @@ L["You can include a descriptive prefix using separators \"@#>\""] = "你可以
-- L["Heal Types"] = ""
-- L["Shorten Heal Numbers"] = ""
-- L["Shorten Health Numbers"] = ""
-- L["Shorten Above Million Numbers"] = ""
-- L["Include heals casted by me, if unchecked only other players heals are displayed."] = ""
-- L["Apply this multiplier value to incoming heals."] = ""
-- L["Incoming overheals below the specified value will not be shown."] = ""
Expand Down
17 changes: 15 additions & 2 deletions Options/modules/statuses/StatusHealth.lua
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,24 @@ Grid2Options:RegisterStatusOptions("health-current", "health", function(self, st
end,
}
else
options.healthPercentShield = {
options.millionShorten = {
type = "toggle",
tristate = false,
width = "full",
order = 50,
name = L["Shorten Above Million Numbers"],
desc = L["Shorten Above Million Numbers"],
get = function () return status.dbx.displayMillionShort end,
set = function (_, v)
status.dbx.displayMillionShort = v or nil
status:Refresh()
end,
}
options.healthPercentShield = {
type = "toggle",
tristate = false,
width = "full",
order = 51,
name = L["Add shields to health percent"],
desc = L["Add shields to health percent"],
get = function () return status.dbx.addPercentShield end,
Expand All @@ -130,7 +143,7 @@ Grid2Options:RegisterStatusOptions("health-current", "health", function(self, st
type = "toggle",
tristate = false,
width = "full",
order = 51,
order = 52,
name = L["Add shields to health amount"],
desc = L["Add shields to health amount"],
get = function () return status.dbx.addAmountShield end,
Expand Down
24 changes: 23 additions & 1 deletion modules/StatusHealth.lua
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,24 @@ local function HealthCurrent_GetTextRetailShield(self, unit)
return fmt("%.1fk", (UnitHealth(unit)+UnitGetTotalAbsorbs(unit)) / 1000)
end

local function HealthCurrent_GetTextRetailM(self, unit)
local h = UnitHealth(unit)
if h<1000000 then
return fmt("%.1fk",h/1000)
else
return fmt("%.1fm",h/1000000)
end
end

local function HealthCurrent_GetTextRetailShieldM(self, unit)
local h = UnitHealth(unit)+UnitGetTotalAbsorbs(unit)
if h<1000000 then
return fmt("%.1fk",h/1000)
else
return fmt("%.1fm",h/1000000)
end
end

function HealthCurrent:OnEnable()
Health_Enable(self)
if self.addShield then
Expand Down Expand Up @@ -303,8 +321,12 @@ function HealthCurrent:UpdateDB()
self.GetText = dbx.displayRawNumbers and HealthCurrent_GetTextClassicRaw or HealthCurrent_GetTextClassic
else
self.addShield = (dbx.addPercentShield or dbx.addAmountShield) or nil
self.GetText = dbx.addAmountShield and HealthCurrent_GetTextRetailShield or HealthCurrent_GetTextRetail
self.GetPercentText = dbx.addPercentShield and HealthCurrent_GetPercentTextShield or nil
if dbx.displayMillionShort then
self.GetText = dbx.addAmountShield and HealthCurrent_GetTextRetailShieldM or HealthCurrent_GetTextRetailM
else
self.GetText = dbx.addAmountShield and HealthCurrent_GetTextRetailShield or HealthCurrent_GetTextRetail
end
end
self.GetPercent = dbx.deadAsFullHealth and HealthCurrent_GetPercentDFH or HealthCurrent_GetPercentSTD
self.color1 = Grid2:MakeColor(dbx.color1)
Expand Down

0 comments on commit e03e46c

Please sign in to comment.