Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
d87 committed Oct 15, 2020
1 parent 1d59c76 commit ca4e912
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions NugHealth.lua
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ function NugHealth:Enable()
end
end
]]
self:RegisterUnitEvent("UNIT_HEALTH", "player")
-- self:RegisterUnitEvent("UNIT_MAXHEALTH", "player")
if not isClassic then
self:RegisterUnitEvent("UNIT_ABSORB_AMOUNT_CHANGED", "player")
Expand Down
15 changes: 12 additions & 3 deletions frame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ local function pixelperfect(size)
return floor(size/pmult + 0.5)*pmult
end

local FRAMELEVEL = {
BASEFRAME = 0,
HEALTH = 1,
POWER = 1,
BORDER = 2,
BAR = 5,
TEXT = 3,
}

local MakeBorder = function(self, tex, left, right, top, bottom, drawLayer, level)
local t = self:CreateTexture(nil, drawLayer, nil, level)
t:SetTexture(tex)
Expand Down Expand Up @@ -389,7 +398,7 @@ local function CreateStaggerSpikebar(parent)
local trend_width = pixelperfect(NugHealthDB.spike_width)

local trend = CreateFrame("Frame", nil, parent)
trend:SetFrameLevel(3)
trend:SetFrameLevel(FRAMELEVEL.BAR)
trend:SetWidth(trend_width)
trend:SetHeight(height*0.25)

Expand Down Expand Up @@ -748,14 +757,14 @@ function NugHealth.Create(self)
-- local fontsize = Aptechka.db.profile.nameFontSize
-- local manabar_width = config.manabarwidth
local outlineSize = pixelperfect(2)

local height = pixelperfect(NugHealthDB.height)
local width = pixelperfect(NugHealthDB.width)
local absorb_width = pixelperfect(NugHealthDB.absorb_width)
local stagger_width = pixelperfect(NugHealthDB.stagger_width)

self:SetWidth(width)
self:SetHeight(height)
self:SetFrameLevel(FRAMELEVEL.BASEFRAME)

self.state = {}

Expand Down Expand Up @@ -794,7 +803,7 @@ function NugHealth.Create(self)

-- local hp = CreateFrame("StatusBar", nil, self)
local hp = ns.CreateCustomStatusBar(nil, self, "VERTICAL")
--hp:SetAllPoints(self)
hp:SetFrameLevel(FRAMELEVEL.HEALTH)
hp:SetPoint("TOPLEFT",self,"TOPLEFT",0,0)
hp:SetPoint("TOPRIGHT",self,"TOPRIGHT",0,0)
-- hp:SetPoint("TOPRIGHT",stagger,"TOPRIGHT",0,0)
Expand Down

0 comments on commit ca4e912

Please sign in to comment.