Skip to content

Commit

Permalink
Retail: Added an option to display health-current raw numbers (GH issue
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelnpsp committed Mar 2, 2024
1 parent 5a90b96 commit 73b3d73
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 8 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 Thousand 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."] = ""
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 Thousand 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
Expand Down
1 change: 1 addition & 0 deletions Options/locales/esES.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1380,6 +1380,7 @@ L["Show only heals that are going to land within the selected time period. Selec
L["Heal Types"] = "Tipo de Curas"
L["Shorten Heal Numbers"] = "Acorta numeros (curas)"
L["Shorten Health Numbers"] = "Acorta numeros (vidas)"
L["Shorten Thousand Numbers"] = "Acorta numeros por encima de mil"
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."
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 Thousand 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."] = ""
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 Thousand 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."] = ""
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 Thousand 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."] = "현재 배율을 받은 치유에 적용"
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 Thousand 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."] = ""
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 Thousand 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."] = ""
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 Thousand 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."] = ""
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 Thousand 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."] = ""
Expand Down
22 changes: 19 additions & 3 deletions Options/modules/statuses/StatusHealth.lua
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,27 @@ Grid2Options:RegisterStatusOptions("health-current", "health", function(self, st
end,
}
else
options.millionShorten = {
options.thousandShorten = {
type = "toggle",
tristate = false,
width = "full",
order = 50,
name = L["Shorten Thousand Numbers"],
desc = L["Shorten Thousand Numbers"],
get = function ()
return not status.dbx.displayRawNumbersRetail or status.dbx.displayMillionShort
end,
set = function (_, v)
status.dbx.displayRawNumbersRetail = not v or nil
status.dbx.displayMillionShort = nil
status:Refresh()
end,
}
options.millionShorten = {
type = "toggle",
tristate = false,
width = "full",
order = 51,
name = L["Shorten Above Million Numbers"],
desc = L["Shorten Above Million Numbers"],
get = function () return status.dbx.displayMillionShort end,
Expand All @@ -130,7 +146,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 percent"],
desc = L["Add shields to health percent"],
get = function () return status.dbx.addPercentShield end,
Expand All @@ -143,7 +159,7 @@ Grid2Options:RegisterStatusOptions("health-current", "health", function(self, st
type = "toggle",
tristate = false,
width = "full",
order = 52,
order = 53,
name = L["Add shields to health amount"],
desc = L["Add shields to health amount"],
get = function () return status.dbx.addAmountShield end,
Expand Down
16 changes: 11 additions & 5 deletions modules/StatusHealth.lua
Original file line number Diff line number Diff line change
Expand Up @@ -254,19 +254,23 @@ local function HealthCurrent_GetPercentDFH(self, unit)
end

-- text health
local function HealthCurrent_GetTextRaw(self, unit)
return tostring(UnitHealth(unit))
end

local function HealthCurrent_GetTextClassic(self, unit)
local h = UnitHealth(unit)
return h<1000 and fmt("%d",h) or fmt("%.1fk",h/1000)
end

local function HealthCurrent_GetTextClassicRaw(self, unit)
return tostring(UnitHealth(unit))
end

local function HealthCurrent_GetTextRetail(self, unit)
return fmt("%.1fk", UnitHealth(unit) / 1000)
end

local function HealthCurrent_GetTextRetailShieldRaw(self, unit)
return tostring(UnitHealth(unit)+UnitGetTotalAbsorbs(unit))
end

local function HealthCurrent_GetTextRetailShield(self, unit)
return fmt("%.1fk", (UnitHealth(unit)+UnitGetTotalAbsorbs(unit)) / 1000)
end
Expand Down Expand Up @@ -318,12 +322,14 @@ function HealthCurrent:UpdateDB()
local dbx = self.dbx
fmtPercent = Grid2.db.profile.formatting.percentFormat
if Grid2.isClassic then
self.GetText = dbx.displayRawNumbers and HealthCurrent_GetTextClassicRaw or HealthCurrent_GetTextClassic
self.GetText = dbx.displayRawNumbers and HealthCurrent_GetTextRaw or HealthCurrent_GetTextClassic
else
self.addShield = (dbx.addPercentShield or dbx.addAmountShield) or nil
self.GetPercentText = dbx.addPercentShield and HealthCurrent_GetPercentTextShield or nil
if dbx.displayMillionShort then
self.GetText = dbx.addAmountShield and HealthCurrent_GetTextRetailShieldM or HealthCurrent_GetTextRetailM
elseif dbx.displayRawNumbersRetail then
self.GetText = dbx.addAmountShield and HealthCurrent_GetTextRetailShieldRaw or HealthCurrent_GetTextRaw
else
self.GetText = dbx.addAmountShield and HealthCurrent_GetTextRetailShield or HealthCurrent_GetTextRetail
end
Expand Down

0 comments on commit 73b3d73

Please sign in to comment.