Skip to content

Commit

Permalink
health: Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ls- authored and p3lim committed Jul 23, 2024
1 parent b2ad241 commit 02078dd
Showing 1 changed file with 36 additions and 2 deletions.
38 changes: 36 additions & 2 deletions elements/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Health - A `StatusBar` used to represent the unit's health.
## Sub-Widgets
.bg - A `Texture` used as a background. It will inherit the color of the main StatusBar.
.TempLoss - A `StatusBar` used to represent temporary max health reduction.
.bg - A `Texture` used as a background. It will inherit the color of the main StatusBar.
## Notes
Expand Down Expand Up @@ -58,7 +59,7 @@ The following options are listed by priority. The first check that returns true
-- Add a background
local Background = Health:CreateTexture(nil, 'BACKGROUND')
Background:SetAllPoints(Health)
Background:SetAllPoints()
Background:SetTexture(1, 1, 1, .5)
-- Options
Expand All @@ -74,6 +75,39 @@ The following options are listed by priority. The first check that returns true
-- Register it with oUF
Health.bg = Background
self.Health = Health
-- Alternatively, if .TempLoss is being used
local TempLoss = CreateFrame('StatusBar', nil, self)
TempLoss:SetReverseFill(true)
TempLoss:SetHeight(20)
TempLoss:SetPoint('TOP')
TempLoss:SetPoint('LEFT')
TempLoss:SetPoint('RIGHT')
local Health = CreateFrame('StatusBar', nil, self)
Health:SetPoint('LEFT')
Health:SetPoint('TOPRIGHT', TempLoss:GetStatusBarTexture(), 'TOPLEFT')
Health:SetPoint('BOTTOMRIGHT', TempLoss:GetStatusBarTexture(), 'BOTTOMLEFT')
-- Add a background
local Background = TempLoss:CreateTexture(nil, 'BACKGROUND')
Background:SetAllPoints()
Background:SetTexture(1, 1, 1, .5)
-- Options
Health.colorTapping = true
Health.colorDisconnected = true
Health.colorClass = true
Health.colorReaction = true
Health.colorHealth = true
-- Make the background darker.
Background.multiplier = .5
-- Register it with oUF
Health.TempLoss = TempLoss
Health.bg = Background
self.Health = Health
--]]

local _, ns = ...
Expand Down

0 comments on commit 02078dd

Please sign in to comment.