mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
- exposed upper text on snd bar since the string specified there is actually used by the module
- disabled the potential duration text when the user has duration alpha set to 0
This commit is contained in:
@ -93,6 +93,7 @@ function SliceAndDice.prototype:GetOptions()
|
|||||||
local opts = SliceAndDice.super.prototype.GetOptions(self)
|
local opts = SliceAndDice.super.prototype.GetOptions(self)
|
||||||
|
|
||||||
opts["textSettings"].args["upperTextString"]["desc"] = "The text to display under this bar. # will be replaced with the number of Slice and Dice seconds remaining."
|
opts["textSettings"].args["upperTextString"]["desc"] = "The text to display under this bar. # will be replaced with the number of Slice and Dice seconds remaining."
|
||||||
|
opts["textSettings"].args["upperTextString"].hidden = false
|
||||||
|
|
||||||
opts["showAsPercentOfMax"] =
|
opts["showAsPercentOfMax"] =
|
||||||
{
|
{
|
||||||
@ -257,7 +258,8 @@ function SliceAndDice.prototype:UpdateSliceAndDice(event, unit, fromUpdate)
|
|||||||
|
|
||||||
-- somewhat redundant, but we also need to check potential remaining time
|
-- somewhat redundant, but we also need to check potential remaining time
|
||||||
if (remaining ~= nil) or PotentialSnDDuration > 0 then
|
if (remaining ~= nil) or PotentialSnDDuration > 0 then
|
||||||
self:SetBottomText1(self.moduleSettings.upperText .. tostring(floor(remaining or 0)) .. " (" .. PotentialSnDDuration .. ")")
|
local potText = " (" .. PotentialSnDDuration .. ")"
|
||||||
|
self:SetBottomText1(self.moduleSettings.upperText .. tostring(floor(remaining or 0)) .. (self.moduleSettings.durationAlpha ~= 0 and potText or ""))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -293,21 +295,24 @@ function SliceAndDice.prototype:UpdateDurationBar(event, unit)
|
|||||||
self:Show(true)
|
self:Show(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
PotentialSnDDuration = self:GetMaxBuffTime(points)
|
if self.moduleSettings.durationAlpha > 0 then
|
||||||
|
PotentialSnDDuration = self:GetMaxBuffTime(points)
|
||||||
|
|
||||||
-- compute the scale from the current number of combo points
|
-- compute the scale from the current number of combo points
|
||||||
scale = IceHUD:Clamp(PotentialSnDDuration / CurrMaxSnDDuration, 0, 1)
|
scale = IceHUD:Clamp(PotentialSnDDuration / CurrMaxSnDDuration, 0, 1)
|
||||||
|
|
||||||
-- sadly, animation uses bar-local variables so we can't use the animation for 2 bar textures on the same bar element
|
-- sadly, animation uses bar-local variables so we can't use the animation for 2 bar textures on the same bar element
|
||||||
if (self.moduleSettings.reverse) then
|
if (self.moduleSettings.reverse) then
|
||||||
scale = 1 - scale
|
scale = 1 - scale
|
||||||
|
end
|
||||||
|
|
||||||
|
self.durationFrame.bar:SetVertexColor(self:GetColor("SliceAndDicePotential", self.moduleSettings.durationAlpha))
|
||||||
|
self:SetBarCoord(self.durationFrame, scale)
|
||||||
end
|
end
|
||||||
|
|
||||||
self.durationFrame.bar:SetVertexColor(self:GetColor("SliceAndDicePotential", self.moduleSettings.durationAlpha))
|
|
||||||
self:SetBarCoord(self.durationFrame, scale)
|
|
||||||
|
|
||||||
if sndEndTime < GetTime() then
|
if sndEndTime < GetTime() then
|
||||||
self:SetBottomText1(self.moduleSettings.upperText .. "0 (" .. PotentialSnDDuration .. ")")
|
local potText = " (" .. PotentialSnDDuration .. ")"
|
||||||
|
self:SetBottomText1(self.moduleSettings.upperText .. "0" .. (self.moduleSettings.durationAlpha > 0 and potText or ""))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user