Skip to content

Commit

Permalink
Merge pull request #8 from Cortes-Jeremy/develop
Browse files Browse the repository at this point in the history
Quick fix highlight border showing at the start of arena
  • Loading branch information
Cortes-Jeremy authored Apr 5, 2021
2 parents b2799e0 + 7562a91 commit 6814685
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Gladius/Gladius.lua
Original file line number Diff line number Diff line change
Expand Up @@ -779,9 +779,9 @@ end
function Gladius:PLAYER_TARGET_CHANGED(event)
local target = UnitGUID("target")
for _, button in pairs(self.buttons) do
if( button.GUID == target ) then
if( button.GUID == target and target ~= nil) then
if (db.highlightBrd) then
button.health.highlightBrd:Show()
button.highlightBrd:Show()
end
if (db.highlight) then
button.highlight:Show()
Expand Down
32 changes: 18 additions & 14 deletions Gladius/frame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ function Gladius:CreateButton(i)
button.spellCooldownFrame = spellCooldownFrame
button.drCooldownFrame = drCooldownFrame
button.highlight = healthBar.highlight
button.highlightBrd = healthBar.highlightBrd
button.selected = button.selected
button.focusBorder = focusBorder
button.assistBorder = assistBorder
Expand Down Expand Up @@ -570,6 +571,7 @@ function Gladius:CreatePetButton(id, parent)
healthBar.highlight:SetAllPoints(healthBar)
healthBar.highlight:Hide()

-- HealthBar Border hightlight
healthBar.highlightBrd = CreateFrame("Frame", nil, healthbar)
healthBar.highlightBrd:SetFrameLevel( healthBar:GetFrameLevel() + 1)
healthBar.highlightBrd:Hide()
Expand Down Expand Up @@ -605,6 +607,7 @@ function Gladius:CreatePetButton(id, parent)
button.focusBorder = focusBorder
button.assistBorder = assistBorder
button.highlight = healthBar.highlight
button.highlightBrd = healthBar.highlightBrd
button.health = healthBar
button.nameText = nameText
button.healthText = healthText
Expand Down Expand Up @@ -815,26 +818,27 @@ function Gladius:UpdateFrame()
DisableTexTiling(button.health:GetStatusBarTexture())
DisableTexTiling(button.health.bg)

--health bar highlight location and texture
button.health.highlightBrd:ClearAllPoints()
-- Health bar loss animation (textures, size, position)
button.cutaway.bar:SetTexture(LSM:Fetch(LSM.MediaType.STATUSBAR, db.barTexture)) -- same bar as health bar
button.cutaway.bar:SetVertexColor(255/255, 0/255, 0/255, 1) -- texture color
button.cutaway.bar:SetSize(0, button.health:GetHeight())

-- Health highlight
button.highlightBrd:ClearAllPoints()
if(db.highlightBrdInset) then
button.health.highlightBrd:SetAllPoints(button.health)
button.highlightBrd:SetAllPoints(button.health)
else
button.health.highlightBrd:SetPoint("TOPLEFT", button.health, "TOPLEFT", -db.highlightBrdSize, db.highlightBrdSize)
button.health.highlightBrd:SetPoint("TOPRIGHT", button.health, "TOPRIGHT", db.highlightBrdSize, db.highlightBrdSize)
button.health.highlightBrd:SetPoint("BOTTOMLEFT", button.health, "BOTTOMLEFT", -db.highlightBrdSize, -db.highlightBrdSize)
button.health.highlightBrd:SetPoint("BOTTOMRIGHT", button.health, "BOTTOMRIGHT", db.highlightBrdSize, -db.highlightBrdSize)
button.highlightBrd:SetPoint("TOPLEFT", button.health, "TOPLEFT", -db.highlightBrdSize, db.highlightBrdSize)
button.highlightBrd:SetPoint("TOPRIGHT", button.health, "TOPRIGHT", db.highlightBrdSize, db.highlightBrdSize)
button.highlightBrd:SetPoint("BOTTOMLEFT", button.health, "BOTTOMLEFT", -db.highlightBrdSize, -db.highlightBrdSize)
button.highlightBrd:SetPoint("BOTTOMRIGHT", button.health, "BOTTOMRIGHT", db.highlightBrdSize, -db.highlightBrdSize)
end
button.health.highlightBrd:SetBackdrop({
button.highlightBrd:SetBackdrop({
edgeFile = [[Interface\Buttons\WHITE8x8]],
edgeSize = db.highlightBrdSize,
})
button.health.highlightBrd:SetBackdropBorderColor( db.highlightBrdColor.r, db.highlightBrdColor.g, db.highlightBrdColor.b, db.highlightBrdColor.a);

-- Health bar loss animation (textures, size, position)
button.cutaway.bar:SetTexture(LSM:Fetch(LSM.MediaType.STATUSBAR, db.barTexture)) -- same bar as health bar
button.cutaway.bar:SetVertexColor(255/255, 0/255, 0/255, 1) -- texture color
button.cutaway.bar:SetSize(0, button.health:GetHeight())
button.highlightBrd:SetBackdropBorderColor( db.highlightBrdColor.r, db.highlightBrdColor.g, db.highlightBrdColor.b, db.highlightBrdColor.a);
button.highlightBrd:Hide()

-- absorb bar location and size
-- OverAbsorb
Expand Down

0 comments on commit 6814685

Please sign in to comment.