Skip to content

Commit

Permalink
moved formatMissingHealth function
Browse files Browse the repository at this point in the history
  • Loading branch information
d87 committed Sep 16, 2019
1 parent 51f76a6 commit 77f3c7f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Aptechka.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ local next = next
Aptechka.helpers = helpers
local utf8sub = helpers.utf8sub
local reverse = helpers.Reverse
local AptechkaDB = {}
AptechkaDB = {}
local AptechkaDB = AptechkaDB
local LibSpellLocks
local LibAuraTypes
local LibTargetedCasts
Expand Down
19 changes: 10 additions & 9 deletions frame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ local HealthBarSetColorBG = function(self, r,g,b,a, mul)
self:SetVertexColor(r*mul, g*mul, b*mul, a)
end

local formatMissingHealth = function(text, mh)
if mh < 1000 then
text:SetFormattedText("-%d", mh)
elseif mh < 10000 then
text:SetFormattedText("-%.1fk", mh / 1e3)
else
text:SetFormattedText("-%.0fk", mh / 1e3)
end
end

local SetJob_HealthBar = function(self, job)
local c
Expand Down Expand Up @@ -829,15 +838,6 @@ local SetJob_Text1 = function(self,job)
self:SetColor(multiplyColor(mul, r,g,b,a))
end
end
local formatMissingHealth = function(text, mh)
if mh < 1000 then
text:SetFormattedText("-%d", mh)
elseif mh < 10000 then
text:SetFormattedText("-%.1fk", mh / 1e3)
else
text:SetFormattedText("-%.0fk", mh / 1e3)
end
end
local SetJob_Text2 = function(self,job) -- text2 is always green
if job.healthtext then
formatMissingHealth(self, self.parent.vHealthMax - self.parent.vHealth)
Expand Down Expand Up @@ -1399,6 +1399,7 @@ AptechkaDefaultConfig.GridSkin = function(self)
powerbar:GetStatusBarTexture():SetDrawLayer("ARTWORK",-6)
powerbar:SetMinMaxValues(0,100)
powerbar:SetOrientation("VERTICAL")
-- powerbar:SetStatusBarColor(0.5,0.5,1)
powerbar.SetJob = SetJob_HealthBar
powerbar.OnPowerTypeChange = PowerBar_OnPowerTypeChange
powerbar.SetColor = HealthBarSetColorFG
Expand Down

0 comments on commit 77f3c7f

Please sign in to comment.