mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 22:51:53 -05:00
- added buff timer configuration modes to the custom bar
This commit is contained in:
@ -4,6 +4,7 @@ IceCustomBar = AceOO.Class(IceUnitBar)
|
|||||||
|
|
||||||
local validUnits = {"player", "target", "focus", "pet", "vehicle", "targettarget", "main hand weapon", "off hand weapon"}
|
local validUnits = {"player", "target", "focus", "pet", "vehicle", "targettarget", "main hand weapon", "off hand weapon"}
|
||||||
local buffOrDebuff = {"buff", "debuff"}
|
local buffOrDebuff = {"buff", "debuff"}
|
||||||
|
local validBuffTimers = {"none", "seconds", "minutes:seconds", "minutes"}
|
||||||
|
|
||||||
IceCustomBar.prototype.auraDuration = 0
|
IceCustomBar.prototype.auraDuration = 0
|
||||||
IceCustomBar.prototype.auraEndTime = 0
|
IceCustomBar.prototype.auraEndTime = 0
|
||||||
@ -64,6 +65,7 @@ function IceCustomBar.prototype:GetDefaultSettings()
|
|||||||
settings["trackOnlyMine"] = true
|
settings["trackOnlyMine"] = true
|
||||||
settings["displayWhenEmpty"] = false
|
settings["displayWhenEmpty"] = false
|
||||||
settings["hideAnimationSettings"] = true
|
settings["hideAnimationSettings"] = true
|
||||||
|
settings["buffTimerDisplay"] = "minutes"
|
||||||
|
|
||||||
return settings
|
return settings
|
||||||
end
|
end
|
||||||
@ -225,6 +227,24 @@ function IceCustomBar.prototype:GetOptions()
|
|||||||
order = 20.9
|
order = 20.9
|
||||||
}
|
}
|
||||||
|
|
||||||
|
opts["buffTimerDisplay"] = {
|
||||||
|
type = 'text',
|
||||||
|
name = 'Buff timer display',
|
||||||
|
desc = 'How to display the buff timer next to the name of the buff on the bar',
|
||||||
|
get = function()
|
||||||
|
return self.moduleSettings.buffTimerDisplay
|
||||||
|
end,
|
||||||
|
set = function(v)
|
||||||
|
self.moduleSettings.buffTimerDisplay = v
|
||||||
|
self:UpdateCustomBar()
|
||||||
|
end,
|
||||||
|
disabled = function()
|
||||||
|
return not self.moduleSettings.enabled
|
||||||
|
end,
|
||||||
|
validate = validBuffTimers,
|
||||||
|
order = 21
|
||||||
|
}
|
||||||
|
|
||||||
return opts
|
return opts
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -309,7 +329,24 @@ function IceCustomBar.prototype:UpdateCustomBar(unit, fromUpdate)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if (remaining ~= nil) then
|
if (remaining ~= nil) then
|
||||||
self:SetBottomText1(self.moduleSettings.upperText .. " " .. tostring(ceil(remaining or 0)) .. "s")
|
local buffString = ""
|
||||||
|
if self.moduleSettings.buffTimerDisplay == "seconds" then
|
||||||
|
buffString = tostring(ceil(remaining or 0)) .. "s"
|
||||||
|
else
|
||||||
|
local seconds = ceil(remaining)%60
|
||||||
|
local minutes = ceil(remaining)/60
|
||||||
|
|
||||||
|
if self.moduleSettings.buffTimerDisplay == "minutes:seconds" then
|
||||||
|
buffString = floor(minutes) .. ":" .. string.format("%02d", seconds)
|
||||||
|
elseif self.moduleSettings.buffTimerDisplay == "minutes" then
|
||||||
|
if minutes > 1 then
|
||||||
|
buffString = ceil(minutes) .. "m"
|
||||||
|
else
|
||||||
|
buffString = ceil(remaining) .. "s"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
self:SetBottomText1(self.moduleSettings.upperText .. " " .. buffString)
|
||||||
else
|
else
|
||||||
self.auraBuffCount = 0
|
self.auraBuffCount = 0
|
||||||
self:SetBottomText1(self.moduleSettings.upperText)
|
self:SetBottomText1(self.moduleSettings.upperText)
|
||||||
|
Reference in New Issue
Block a user