mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
- added width scaling to individual bars
This commit is contained in:
@ -85,6 +85,7 @@ function IceBarElement.prototype:GetDefaultSettings()
|
|||||||
settings["desiredLerpTime"] = 0.2
|
settings["desiredLerpTime"] = 0.2
|
||||||
settings["barVisible"] = {bg = true, bar = true}
|
settings["barVisible"] = {bg = true, bar = true}
|
||||||
settings["myTagVersion"] = 2
|
settings["myTagVersion"] = 2
|
||||||
|
settings["widthModifier"] = 0
|
||||||
|
|
||||||
return settings
|
return settings
|
||||||
end
|
end
|
||||||
@ -242,6 +243,26 @@ function IceBarElement.prototype:GetOptions()
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
opts["widthModifier"] =
|
||||||
|
{
|
||||||
|
type = 'range',
|
||||||
|
name = '|c' .. self.configColor .. 'Bar width modifier|r',
|
||||||
|
desc = 'Make this bar wider or thinner than others',
|
||||||
|
min = -80,
|
||||||
|
max = 80,
|
||||||
|
step = 1,
|
||||||
|
get = function()
|
||||||
|
return self.moduleSettings.widthModifier
|
||||||
|
end,
|
||||||
|
set = function(v)
|
||||||
|
self.moduleSettings.widthModifier = v
|
||||||
|
self:Redraw()
|
||||||
|
end,
|
||||||
|
disabled = function()
|
||||||
|
return not self.moduleSettings.enabled
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
opts["textSettings"] =
|
opts["textSettings"] =
|
||||||
{
|
{
|
||||||
type = 'group',
|
type = 'group',
|
||||||
@ -460,7 +481,7 @@ function IceBarElement.prototype:CreateBackground()
|
|||||||
end
|
end
|
||||||
|
|
||||||
self.frame:SetFrameStrata("BACKGROUND")
|
self.frame:SetFrameStrata("BACKGROUND")
|
||||||
self.frame:SetWidth(self.settings.barWidth)
|
self.frame:SetWidth(self.settings.barWidth + self.moduleSettings.widthModifier)
|
||||||
self.frame:SetHeight(self.settings.barHeight)
|
self.frame:SetHeight(self.settings.barHeight)
|
||||||
|
|
||||||
if not (self.frame.bg) then
|
if not (self.frame.bg) then
|
||||||
@ -504,7 +525,7 @@ function IceBarElement.prototype:CreateBar()
|
|||||||
end
|
end
|
||||||
|
|
||||||
self.barFrame:SetFrameStrata("LOW")
|
self.barFrame:SetFrameStrata("LOW")
|
||||||
self.barFrame:SetWidth(self.settings.barWidth)
|
self.barFrame:SetWidth(self.settings.barWidth + self.moduleSettings.widthModifier)
|
||||||
self.barFrame:SetHeight(self.settings.barHeight)
|
self.barFrame:SetHeight(self.settings.barHeight)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user