mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
- added pulsing to the shard counter and holy power modules whenever they are maxed out. if this feature goes well then it should probably be ported over to the existing counter modules as well
This commit is contained in:
@ -252,6 +252,27 @@ function IceClassPowerCounter.prototype:GetOptions()
|
|||||||
order = 40,
|
order = 40,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
opts["pulseWhenFull"] = {
|
||||||
|
type = "toggle",
|
||||||
|
name = L["Pulse when full"],
|
||||||
|
desc = L["If this is checked, then whenever the counter is maxed out it will gently pulsate to let you know it's ready to be used."],
|
||||||
|
get = function()
|
||||||
|
return self.moduleSettings.pulseWhenFull
|
||||||
|
end,
|
||||||
|
set = function(info, v)
|
||||||
|
self.moduleSettings.pulseWhenFull = v
|
||||||
|
if v and self.lastNumReady == self.numRunes then
|
||||||
|
self:StartRunesFullAnimation()
|
||||||
|
else
|
||||||
|
self:StopRunesFullAnimation()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
disabled = function()
|
||||||
|
return not self.moduleSettings.enabled
|
||||||
|
end,
|
||||||
|
order = 41,
|
||||||
|
}
|
||||||
|
|
||||||
opts["hideFriendly"] = {
|
opts["hideFriendly"] = {
|
||||||
type = "toggle",
|
type = "toggle",
|
||||||
name = L["Friendly OOC alpha"],
|
name = L["Friendly OOC alpha"],
|
||||||
@ -266,7 +287,7 @@ function IceClassPowerCounter.prototype:GetOptions()
|
|||||||
disabled = function()
|
disabled = function()
|
||||||
return not self.moduleSettings.enabled
|
return not self.moduleSettings.enabled
|
||||||
end,
|
end,
|
||||||
order = 41,
|
order = 42,
|
||||||
}
|
}
|
||||||
|
|
||||||
return opts
|
return opts
|
||||||
@ -292,6 +313,7 @@ function IceClassPowerCounter.prototype:GetDefaultSettings()
|
|||||||
defaults["customMinColor"] = {r=1, g=1, b=0, a=1}
|
defaults["customMinColor"] = {r=1, g=1, b=0, a=1}
|
||||||
defaults["customColor"] = {r=1, g=0, b=0, a=1}
|
defaults["customColor"] = {r=1, g=0, b=0, a=1}
|
||||||
defaults["hideFriendly"] = false
|
defaults["hideFriendly"] = false
|
||||||
|
defaults["pulseWhenFull"] = true
|
||||||
|
|
||||||
return defaults
|
return defaults
|
||||||
end
|
end
|
||||||
@ -373,6 +395,14 @@ function IceClassPowerCounter.prototype:UpdateRunePower()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if self.moduleSettings.pulseWhenFull then
|
||||||
|
if numReady > self.lastNumReady and numReady == self.numRunes then
|
||||||
|
self:StartRunesFullAnimation()
|
||||||
|
elseif numReady < self.numRunes then
|
||||||
|
self:StopRunesFullAnimation()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
self.lastNumReady = numReady
|
self.lastNumReady = numReady
|
||||||
|
|
||||||
if (self.moduleSettings.hideBlizz) then
|
if (self.moduleSettings.hideBlizz) then
|
||||||
@ -380,6 +410,31 @@ function IceClassPowerCounter.prototype:UpdateRunePower()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function IceClassPowerCounter.prototype:StartRunesFullAnimation()
|
||||||
|
if not self.frame.anim then
|
||||||
|
local grp = self.frame:CreateAnimationGroup()
|
||||||
|
grp:SetLooping("BOUNCE")
|
||||||
|
|
||||||
|
-- lots of magic numbers here. i wonder if it's worth making them configurable or not...probably not.
|
||||||
|
local scale = grp:CreateAnimation("Scale")
|
||||||
|
scale:SetStartDelay(0.5)
|
||||||
|
scale:SetEndDelay(0)
|
||||||
|
scale:SetDuration(0.75)
|
||||||
|
scale:SetOrigin("CENTER", 0, 0)
|
||||||
|
scale:SetScale(1.5, 1.5)
|
||||||
|
|
||||||
|
self.frame.anim = grp
|
||||||
|
end
|
||||||
|
|
||||||
|
self.frame.anim:Play()
|
||||||
|
end
|
||||||
|
|
||||||
|
function IceClassPowerCounter.prototype:StopRunesFullAnimation()
|
||||||
|
if self.frame.anim and self.frame.anim:IsPlaying() then
|
||||||
|
self.frame.anim:Stop()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function IceClassPowerCounter.prototype:ShineFinished(rune)
|
function IceClassPowerCounter.prototype:ShineFinished(rune)
|
||||||
UIFrameFadeOut(self.frame.graphical[rune].shine, self.runeShineFadeSpeed);
|
UIFrameFadeOut(self.frame.graphical[rune].shine, self.runeShineFadeSpeed);
|
||||||
end
|
end
|
||||||
@ -420,13 +475,13 @@ end
|
|||||||
function IceClassPowerCounter.prototype:CreateRuneFrame()
|
function IceClassPowerCounter.prototype:CreateRuneFrame()
|
||||||
-- create numeric runes
|
-- create numeric runes
|
||||||
if not self.frame.numeric then
|
if not self.frame.numeric then
|
||||||
self.frame.numeric = self:FontFactory(self.moduleSettings.runeFontSize, nil, self.frame.numeric)
|
self.frame.numeric = self:FontFactory(self.moduleSettings.runeFontSize, self.frame, self.frame.numeric)
|
||||||
end
|
end
|
||||||
|
|
||||||
self.frame.numeric:SetWidth(50)
|
self.frame.numeric:SetWidth(50)
|
||||||
self.frame.numeric:SetJustifyH("CENTER")
|
self.frame.numeric:SetJustifyH("CENTER")
|
||||||
|
|
||||||
self.frame.numeric:SetPoint("TOP", self.frame, "TOP", 0, 0)
|
self.frame.numeric:SetAllPoints(self.frame)
|
||||||
self.frame.numeric:Hide()
|
self.frame.numeric:Hide()
|
||||||
|
|
||||||
if (not self.frame.graphical) then
|
if (not self.frame.graphical) then
|
||||||
|
@ -29,6 +29,14 @@ function ShardCounter.prototype:GetOptions()
|
|||||||
return opts
|
return opts
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function ShardCounter.prototype:GetDefaultSettings()
|
||||||
|
local defaults = ShardCounter.super.prototype.GetDefaultSettings(self)
|
||||||
|
|
||||||
|
defaults["pulseWhenFull"] = false
|
||||||
|
|
||||||
|
return defaults
|
||||||
|
end
|
||||||
|
|
||||||
function ShardCounter.prototype:GetRuneTexture(rune)
|
function ShardCounter.prototype:GetRuneTexture(rune)
|
||||||
if not rune or rune ~= tonumber(rune) then
|
if not rune or rune ~= tonumber(rune) then
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user