Skip to content

Commit 672d07b

Browse files
authored
Merge pull request #225 from Brandon82/attach_absorbs_to_missing_health
Good job, appreciate the PR.
2 parents 7e54463 + 8969cc3 commit 672d07b

2 files changed

Lines changed: 42 additions & 2 deletions

File tree

Core/Config/GUI.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ local function CreateHealPredictionSettings(containerParent, unit, updateCallbac
741741
AbsorbSettings:AddChild(AbsorbHeightSlider)
742742

743743
local AbsorbPositionDropdown = AG:Create("Dropdown")
744-
AbsorbPositionDropdown:SetList({["LEFT"] = "Left", ["RIGHT"] = "Right"})
744+
AbsorbPositionDropdown:SetList({["LEFT"] = "Left", ["RIGHT"] = "Right", ["ATTACH"] = "Attach to missing health"}, {"LEFT", "RIGHT", "ATTACH"})
745745
AbsorbPositionDropdown:SetLabel("Position")
746746
AbsorbPositionDropdown:SetValue(HealPredictionDB.Absorbs.Position)
747747
AbsorbPositionDropdown:SetRelativeWidth(0.33)
@@ -781,7 +781,7 @@ local function CreateHealPredictionSettings(containerParent, unit, updateCallbac
781781
HealAbsorbSettings:AddChild(HealAbsorbHeightSlider)
782782

783783
local HealAbsorbPositionDropdown = AG:Create("Dropdown")
784-
HealAbsorbPositionDropdown:SetList({["LEFT"] = "Left", ["RIGHT"] = "Right"})
784+
HealAbsorbPositionDropdown:SetList({["LEFT"] = "Left", ["RIGHT"] = "Right", ["ATTACH"] = "Attach to missing health"}, {"LEFT", "RIGHT", "ATTACH"})
785785
HealAbsorbPositionDropdown:SetLabel("Position")
786786
HealAbsorbPositionDropdown:SetValue(HealPredictionDB.HealAbsorbs.Position)
787787
HealAbsorbPositionDropdown:SetRelativeWidth(0.33)

Elements/HealPrediction.lua

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ local function CreateUnitAbsorbs(unitFrame, unit)
1212
AbsorbBar:SetPoint("TOPRIGHT", unitFrame.Health, "TOPRIGHT", 0, 0)
1313
AbsorbBar:SetHeight(AbsorbDB.Height)
1414
AbsorbBar:SetReverseFill(true)
15+
elseif AbsorbDB.Position == "ATTACH" then
16+
unitFrame.Health:SetClipsChildren(true)
17+
if unitFrame.Health:GetReverseFill() then
18+
AbsorbBar:SetPoint("TOPRIGHT", unitFrame.Health:GetStatusBarTexture(), "TOPLEFT", 0, 0)
19+
AbsorbBar:SetReverseFill(true)
20+
else
21+
AbsorbBar:SetPoint("TOPLEFT", unitFrame.Health:GetStatusBarTexture(), "TOPRIGHT", 0, 0)
22+
AbsorbBar:SetReverseFill(false)
23+
end
24+
AbsorbBar:SetHeight(AbsorbDB.Height)
1525
else
1626
AbsorbBar:SetPoint("TOPLEFT", unitFrame.Health, "TOPLEFT", 0, 0)
1727
AbsorbBar:SetHeight(AbsorbDB.Height)
@@ -35,6 +45,16 @@ local function CreateUnitHealAbsorbs(unitFrame, unit)
3545
HealAbsorbBar:SetPoint("TOPRIGHT", unitFrame.Health, "TOPRIGHT", 0, 0)
3646
HealAbsorbBar:SetHeight(HealAbsorbDB.Height)
3747
HealAbsorbBar:SetReverseFill(true)
48+
elseif HealAbsorbDB.Position == "ATTACH" then
49+
unitFrame.Health:SetClipsChildren(true)
50+
if unitFrame.Health:GetReverseFill() then
51+
HealAbsorbBar:SetPoint("TOPRIGHT", unitFrame.Health:GetStatusBarTexture(), "TOPLEFT", 0, 0)
52+
HealAbsorbBar:SetReverseFill(true)
53+
else
54+
HealAbsorbBar:SetPoint("TOPLEFT", unitFrame.Health:GetStatusBarTexture(), "TOPRIGHT", 0, 0)
55+
HealAbsorbBar:SetReverseFill(false)
56+
end
57+
HealAbsorbBar:SetHeight(HealAbsorbDB.Height)
3858
else
3959
HealAbsorbBar:SetPoint("TOPLEFT", unitFrame.Health, "TOPLEFT", 0, 0)
4060
HealAbsorbBar:SetHeight(HealAbsorbDB.Height)
@@ -78,6 +98,16 @@ function UUF:UpdateUnitHealPrediction(unitFrame, unit)
7898
unitFrame.HealthPrediction.damageAbsorb:SetPoint("TOPRIGHT", unitFrame.Health, "TOPRIGHT", 0, 0)
7999
unitFrame.HealthPrediction.damageAbsorb:SetHeight(AbsorbDB.Height)
80100
unitFrame.HealthPrediction.damageAbsorb:SetReverseFill(true)
101+
elseif AbsorbDB.Position == "ATTACH" then
102+
unitFrame.Health:SetClipsChildren(true)
103+
if unitFrame.Health:GetReverseFill() then
104+
unitFrame.HealthPrediction.damageAbsorb:SetPoint("TOPRIGHT", unitFrame.Health:GetStatusBarTexture(), "TOPLEFT", 0, 0)
105+
unitFrame.HealthPrediction.damageAbsorb:SetReverseFill(true)
106+
else
107+
unitFrame.HealthPrediction.damageAbsorb:SetPoint("TOPLEFT", unitFrame.Health:GetStatusBarTexture(), "TOPRIGHT", 0, 0)
108+
unitFrame.HealthPrediction.damageAbsorb:SetReverseFill(false)
109+
end
110+
unitFrame.HealthPrediction.damageAbsorb:SetHeight(AbsorbDB.Height)
81111
else
82112
unitFrame.HealthPrediction.damageAbsorb:SetPoint("TOPLEFT", unitFrame.Health, "TOPLEFT", 0, 0)
83113
unitFrame.HealthPrediction.damageAbsorb:SetHeight(AbsorbDB.Height)
@@ -100,6 +130,16 @@ function UUF:UpdateUnitHealPrediction(unitFrame, unit)
100130
unitFrame.HealthPrediction.healAbsorb:SetPoint("TOPRIGHT", unitFrame.Health, "TOPRIGHT", 0, 0)
101131
unitFrame.HealthPrediction.healAbsorb:SetHeight(HealAbsorbDB.Height)
102132
unitFrame.HealthPrediction.healAbsorb:SetReverseFill(true)
133+
elseif HealAbsorbDB.Position == "ATTACH" then
134+
unitFrame.Health:SetClipsChildren(true)
135+
if unitFrame.Health:GetReverseFill() then
136+
unitFrame.HealthPrediction.healAbsorb:SetPoint("TOPRIGHT", unitFrame.Health:GetStatusBarTexture(), "TOPLEFT", 0, 0)
137+
unitFrame.HealthPrediction.healAbsorb:SetReverseFill(true)
138+
else
139+
unitFrame.HealthPrediction.healAbsorb:SetPoint("TOPLEFT", unitFrame.Health:GetStatusBarTexture(), "TOPRIGHT", 0, 0)
140+
unitFrame.HealthPrediction.healAbsorb:SetReverseFill(false)
141+
end
142+
unitFrame.HealthPrediction.healAbsorb:SetHeight(HealAbsorbDB.Height)
103143
else
104144
unitFrame.HealthPrediction.healAbsorb:SetPoint("TOPLEFT", unitFrame.Health, "TOPLEFT", 0, 0)
105145
unitFrame.HealthPrediction.healAbsorb:SetHeight(HealAbsorbDB.Height)

0 commit comments

Comments
 (0)