mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 22:51:53 -05:00
Add support for Anima-charged combo points
Requested by Curseforge ticket 291
This commit is contained in:
@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
vNext:
|
||||||
|
|
||||||
|
- Added support for Anima-charged combo points for Kyrian covenant (ticket #291).
|
||||||
|
|
||||||
v1.13.0:
|
v1.13.0:
|
||||||
|
|
||||||
- Made compatible with 9.0
|
- Made compatible with 9.0
|
||||||
|
@ -12,12 +12,20 @@ if IceHUD.WowVer >= 80000 or IceHUD.WowClassic then
|
|||||||
SPELL_POWER_COMBO_POINTS = Enum.PowerType.ComboPoints
|
SPELL_POWER_COMBO_POINTS = Enum.PowerType.ComboPoints
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local GetUnitChargedPowerPoints = GetUnitChargedPowerPoints
|
||||||
|
if not GetUnitChargedPowerPoints then
|
||||||
|
GetUnitChargedPowerPoints = function()
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Constructor --
|
-- Constructor --
|
||||||
function ComboPoints.prototype:init()
|
function ComboPoints.prototype:init()
|
||||||
ComboPoints.super.prototype.init(self, "ComboPoints")
|
ComboPoints.super.prototype.init(self, "ComboPoints")
|
||||||
|
|
||||||
self:SetDefaultColor("ComboPoints", 1, 1, 0)
|
self:SetDefaultColor("ComboPoints", 1, 1, 0)
|
||||||
self:SetDefaultColor("AnticipationPoints", 1, 0, 1)
|
self:SetDefaultColor("AnticipationPoints", 1, 0, 1)
|
||||||
|
self:SetDefaultColor("KyrianAnimaComboPoint", 0.3137254901960784, 0.3725490196078432, 1)
|
||||||
self.scalingEnabled = true
|
self.scalingEnabled = true
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -274,11 +282,16 @@ function ComboPoints.prototype:Enable(core)
|
|||||||
self:RegisterEvent("PLAYER_COMBO_POINTS", "UpdateComboPoints")
|
self:RegisterEvent("PLAYER_COMBO_POINTS", "UpdateComboPoints")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if IceHUD.WowVer >= 90000 then
|
||||||
|
self:RegisterEvent("UNIT_POWER_POINT_CHARGE", "UpdateChargedComboPoints")
|
||||||
|
end
|
||||||
|
|
||||||
if self.moduleSettings.comboMode == "Graphical" then
|
if self.moduleSettings.comboMode == "Graphical" then
|
||||||
self.moduleSettings.comboMode = "Graphical Bar"
|
self.moduleSettings.comboMode = "Graphical Bar"
|
||||||
end
|
end
|
||||||
|
|
||||||
self:CreateComboFrame(true)
|
self:CreateComboFrame(true)
|
||||||
|
self:UpdateChargedComboPoints()
|
||||||
end
|
end
|
||||||
|
|
||||||
function ComboPoints.prototype:UpdateMaxComboPoints(event, unit, powerType)
|
function ComboPoints.prototype:UpdateMaxComboPoints(event, unit, powerType)
|
||||||
@ -291,6 +304,13 @@ function ComboPoints.prototype:UpdateMaxComboPoints(event, unit, powerType)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function ComboPoints.prototype:UpdateChargedComboPoints()
|
||||||
|
local chargedPowerPoints = GetUnitChargedPowerPoints("player")
|
||||||
|
self.chargedPowerPointIndex = chargedPowerPoints and chargedPowerPoints[1]
|
||||||
|
self:CreateComboFrame()
|
||||||
|
self:UpdateComboPoints()
|
||||||
|
end
|
||||||
|
|
||||||
-- 'Protected' methods --------------------------------------------------------
|
-- 'Protected' methods --------------------------------------------------------
|
||||||
|
|
||||||
-- OVERRIDE
|
-- OVERRIDE
|
||||||
@ -399,7 +419,12 @@ function ComboPoints.prototype:CreateComboFrame(forceTextureUpdate)
|
|||||||
if (self.moduleSettings.gradient) then
|
if (self.moduleSettings.gradient) then
|
||||||
g = g - ((1 / maxComboPoints)*i)
|
g = g - ((1 / maxComboPoints)*i)
|
||||||
end
|
end
|
||||||
self.frame.graphical[i].texture:SetVertexColor(r, g, b)
|
|
||||||
|
if i == self.chargedPowerPointIndex then
|
||||||
|
self.frame.graphical[i].texture:SetVertexColor(self:GetColor("KyrianAnimaComboPoint"))
|
||||||
|
else
|
||||||
|
self.frame.graphical[i].texture:SetVertexColor(r, g, b)
|
||||||
|
end
|
||||||
|
|
||||||
self.frame.graphical[i]:Hide()
|
self.frame.graphical[i]:Hide()
|
||||||
end
|
end
|
||||||
|
@ -6,6 +6,13 @@ if IceHUD.WowVer >= 80000 or IceHUD.WowClassic then
|
|||||||
SPELL_POWER_COMBO_POINTS = Enum.PowerType.ComboPoints
|
SPELL_POWER_COMBO_POINTS = Enum.PowerType.ComboPoints
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local GetUnitChargedPowerPoints = GetUnitChargedPowerPoints
|
||||||
|
if not GetUnitChargedPowerPoints then
|
||||||
|
GetUnitChargedPowerPoints = function()
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function ComboPointsBar.prototype:init()
|
function ComboPointsBar.prototype:init()
|
||||||
ComboPointsBar.super.prototype.init(self, "ComboPointsBar")
|
ComboPointsBar.super.prototype.init(self, "ComboPointsBar")
|
||||||
|
|
||||||
@ -57,7 +64,6 @@ end
|
|||||||
|
|
||||||
function ComboPointsBar.prototype:GetDefaultSettings()
|
function ComboPointsBar.prototype:GetDefaultSettings()
|
||||||
local defaults = ComboPointsBar.super.prototype.GetDefaultSettings(self)
|
local defaults = ComboPointsBar.super.prototype.GetDefaultSettings(self)
|
||||||
defaults.textVisible['lower'] = false
|
|
||||||
defaults.offset = 8
|
defaults.offset = 8
|
||||||
defaults.enabled = false
|
defaults.enabled = false
|
||||||
defaults.alwaysDisplay = false
|
defaults.alwaysDisplay = false
|
||||||
@ -83,6 +89,18 @@ function ComboPointsBar.prototype:Enable(core)
|
|||||||
else
|
else
|
||||||
self:RegisterEvent("PLAYER_COMBO_POINTS", "UpdateComboPoints")
|
self:RegisterEvent("PLAYER_COMBO_POINTS", "UpdateComboPoints")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if IceHUD.WowVer >= 90000 then
|
||||||
|
self:RegisterEvent("UNIT_POWER_POINT_CHARGE", "UpdateChargedComboPoints")
|
||||||
|
end
|
||||||
|
|
||||||
|
self:UpdateChargedComboPoints()
|
||||||
|
end
|
||||||
|
|
||||||
|
function ComboPointsBar.prototype:UpdateChargedComboPoints()
|
||||||
|
local chargedPowerPoints = GetUnitChargedPowerPoints("player")
|
||||||
|
self.chargedPowerPointIndex = chargedPowerPoints and chargedPowerPoints[1]
|
||||||
|
self:UpdateComboPoints()
|
||||||
end
|
end
|
||||||
|
|
||||||
function ComboPointsBar.prototype:CreateFrame()
|
function ComboPointsBar.prototype:CreateFrame()
|
||||||
@ -129,6 +147,7 @@ function ComboPointsBar.prototype:UpdateComboPoints(...)
|
|||||||
end
|
end
|
||||||
|
|
||||||
self:SetBottomText1(points or "0")
|
self:SetBottomText1(points or "0")
|
||||||
|
self:SetBottomText2(self.chargedPowerPointIndex)
|
||||||
end
|
end
|
||||||
|
|
||||||
function ComboPointsBar.prototype:Update()
|
function ComboPointsBar.prototype:Update()
|
||||||
|
Reference in New Issue
Block a user