Skip to content

Commit

Permalink
Customizable Health Text
Browse files Browse the repository at this point in the history
  • Loading branch information
d87 committed Oct 8, 2020
1 parent c5ecf95 commit b63f076
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Aptechka.lua
Original file line number Diff line number Diff line change
Expand Up @@ -969,15 +969,15 @@ function Aptechka.FrameUpdateHealth(self, unit, event)
if gradientHealthColor then
FrameSetJob(self, config.HealthBarColor, true, "HealthBar", h)
end
FrameSetJob(self, config.HealthDeficitStatus, ((hm-h) > hm*0.05), nil, h, hm )
FrameSetJob(self, config.HealthTextStatus, ((hm-h) > hm*0.05), nil, h, hm )

local isDead = UnitIsDeadOrGhost(unit)
if isDead then
FrameSetJob(self, config.AggroStatus, false)
local isGhost = UnitIsGhost(unit)
local deadorghost = isGhost and config.GhostStatus or config.DeadStatus
FrameSetJob(self, deadorghost, true)
FrameSetJob(self,config.HealthDeficitStatus, false )
FrameSetJob(self,config.HealthTextStatus, false )
state.isDead = true
state.isGhost = isGhost
Aptechka.FrameUpdateDisplayPower(self, unit, true)
Expand Down
6 changes: 6 additions & 0 deletions Options/StatusConfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ local addonName, ns = ...

local L = Aptechka.L

local isClassic = WOW_PROJECT_ID == WOW_PROJECT_CLASSIC

function ns.MakeStatusConfig()
local opt = {
type = 'group',
Expand All @@ -18,13 +20,17 @@ function ns.MakeStatusConfig()
"MouseoverStatus",
"MainTankStatus",
"DispelStatus",
"HealthTextStatus",
"RunicPowerStatus",
"AltPowerStatus",
"DebuffAlert1",
"DebuffAlert2",
"DebuffAlert3",
"DebuffAlert4",
}
if isClassic then
table.insert(configurableWidgets, "IncomingHealStatus")
end

for i, status in ipairs(configurableWidgets) do
opt.args[status] = {
Expand Down
4 changes: 2 additions & 2 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ config.DeadStatus = { name = "Dead", assignto = set("text2","health"), color = {
config.GhostStatus = { name = "Ghost", assignto = set("text2","health"), color = {.05,.05,.05}, textcolor = {0,1,0}, text = "GHOST", priority = 62}
config.OfflineStatus = { name = "Offline", assignto = set("text2","text3","health"), color = {.15,.15,.15}, textcolor = {0,1,0}, text = "OFFLINE", priority = 70}
config.AwayStatus = { name = "AFK", assignto = set("text2","text3"), color = {.15,.15,.15}, textcolor = {1,0.8,0}, text = "AFK", priority = 15}
-- config.IncomingHealStatus = { name = "IncomingHeal", assignto = set("text2"), color = { 0, 1, 0}, priority = 15 }
config.HealthDeficitStatus = { name = "HealthDeficit", assignto = set("text2"), color = { 54/255, 201/255, 99/256 }, priority = 10 }
config.IncomingHealStatus = { name = "IncHealText", assignto = set("text2"), color = { 0, 1, 0}, priority = 15 }
config.HealthTextStatus = { name = "HealthText", assignto = set("text2"), color = { 54/255, 201/255, 99/256 }, priority = 10 }
config.UnitNameStatus = { name = "UnitName", assignto = set("text1"), classcolor = true, priority = 20 }
config.HealthBarColor = { name = "HealthBar", assignto = set("health"), color = {1, .3, .3}, classcolor = true, priority = 10 }
config.PowerBarColor = { name = "PowerBar", assignto = set("power"), color = {.5,.5,1}, priority = 20 }
Expand Down
2 changes: 1 addition & 1 deletion frame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ local function formatMissingHealth(mh)
end

local contentNormalizers = {}
function contentNormalizers.HealthDeficit(job, state, contentType, ...)
function contentNormalizers.HealthText(job, state, contentType, ...)
local timerType, cur, max, count, icon, text, r,g,b, texture, texCoords
cur, max = ...
text = string.format(formatMissingHealth(max - cur))
Expand Down

0 comments on commit b63f076

Please sign in to comment.