mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
- added bar/bg visibility options to mirrorbar, castbar, targetcastbar
- shuffled bar/bg visibility options to show up after the Enabled option and to be disabled if the bar is disabled - removed OnUpdate registration for mirrorbar since it handles OnUpdate itself - fixed a potential nil access in the DogTag fontstring stuff
This commit is contained in:
@ -42,8 +42,12 @@ function IceBarElement.prototype:Enable()
|
||||
self:RegisterEvent("PLAYER_TARGET_CHANGED", "TargetChanged")
|
||||
|
||||
if DogTag ~= nil then
|
||||
DogTag:AddFontString(self.frame.bottomUpperText, self.frame, self.unit, self.moduleSettings.upperText)
|
||||
DogTag:AddFontString(self.frame.bottomLowerText, self.frame, self.unit, self.moduleSettings.lowerText)
|
||||
if self.frame.bottomUpperText and self.moduleSettings.upperText then
|
||||
DogTag:AddFontString(self.frame.bottomUpperText, self.frame, self.unit, self.moduleSettings.upperText)
|
||||
end
|
||||
if self.frame.bottomLowerText and self.moduleSettings.lowerText then
|
||||
DogTag:AddFontString(self.frame.bottomLowerText, self.frame, self.unit, self.moduleSettings.lowerText)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -159,7 +163,10 @@ function IceBarElement.prototype:GetOptions()
|
||||
self.barFrame:Hide()
|
||||
end
|
||||
end,
|
||||
order = 13.1
|
||||
disabled = function()
|
||||
return not self.moduleSettings.enabled
|
||||
end,
|
||||
order = 28
|
||||
}
|
||||
|
||||
opts["bgVisible"] = {
|
||||
@ -177,7 +184,10 @@ function IceBarElement.prototype:GetOptions()
|
||||
self.frame.bg:Hide()
|
||||
end
|
||||
end,
|
||||
order = 13.2
|
||||
disabled = function()
|
||||
return not self.moduleSettings.enabled
|
||||
end,
|
||||
order = 29
|
||||
}
|
||||
|
||||
opts["shouldAnimate"] =
|
||||
@ -405,7 +415,9 @@ function IceBarElement.prototype:CreateFrame()
|
||||
self:CreateTexts()
|
||||
|
||||
self.frame:SetScale(self.moduleSettings.scale)
|
||||
self.frame:SetScript("OnUpdate", function() self:MyOnUpdate() end)
|
||||
if not string.find(self.elementName, "MirrorBar") then
|
||||
self.frame:SetScript("OnUpdate", function() self:MyOnUpdate() end)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
@ -135,6 +135,48 @@ function CastBar.prototype:GetOptions()
|
||||
end
|
||||
}
|
||||
|
||||
opts["barVisible"] = {
|
||||
type = 'toggle',
|
||||
name = 'Bar visible',
|
||||
desc = 'Toggle bar visibility',
|
||||
get = function()
|
||||
return self.moduleSettings.barVisible['bar']
|
||||
end,
|
||||
set = function(v)
|
||||
self.moduleSettings.barVisible['bar'] = v
|
||||
if v then
|
||||
self.barFrame:Show()
|
||||
else
|
||||
self.barFrame:Hide()
|
||||
end
|
||||
end,
|
||||
disabled = function()
|
||||
return not self.moduleSettings.enabled
|
||||
end,
|
||||
order = 28
|
||||
}
|
||||
|
||||
opts["bgVisible"] = {
|
||||
type = 'toggle',
|
||||
name = 'Bar background visible',
|
||||
desc = 'Toggle bar background visibility',
|
||||
get = function()
|
||||
return self.moduleSettings.barVisible['bg']
|
||||
end,
|
||||
set = function(v)
|
||||
self.moduleSettings.barVisible['bg'] = v
|
||||
if v then
|
||||
self.frame.bg:Show()
|
||||
else
|
||||
self.frame.bg:Hide()
|
||||
end
|
||||
end,
|
||||
disabled = function()
|
||||
return not self.moduleSettings.enabled
|
||||
end,
|
||||
order = 29
|
||||
}
|
||||
|
||||
opts["textSettings"] =
|
||||
{
|
||||
type = 'group',
|
||||
|
@ -25,6 +25,7 @@ function MirrorBar.prototype:init(side, offset, name, db)
|
||||
self.moduleSettings = {}
|
||||
self.moduleSettings.side = side
|
||||
self.moduleSettings.offset = offset
|
||||
self.moduleSettings.barVisible = {bar = true, bg = true}
|
||||
|
||||
-- unregister the event superclass registered, we don't want to register
|
||||
-- this to the core
|
||||
@ -62,7 +63,7 @@ function MirrorBar.prototype:OnUpdate(elapsed)
|
||||
if (self.paused) then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
self:Update()
|
||||
|
||||
self.value = self.value + (self.timerScale * elapsed * 1000)
|
||||
@ -180,6 +181,7 @@ function MirrorBarHandler.prototype:GetDefaultSettings()
|
||||
settings["barFontBold"] = true
|
||||
settings["lockTextAlpha"] = true
|
||||
settings["textVisible"] = {upper = true, lower = true}
|
||||
settings["barVisible"] = {bg = true, bar = true}
|
||||
return settings
|
||||
end
|
||||
|
||||
@ -229,6 +231,40 @@ function MirrorBarHandler.prototype:GetOptions()
|
||||
end,
|
||||
order = 31
|
||||
}
|
||||
|
||||
opts["barVisible"] = {
|
||||
type = 'toggle',
|
||||
name = 'Bar visible',
|
||||
desc = 'Toggle bar visibility',
|
||||
get = function()
|
||||
return self.moduleSettings.barVisible['bar']
|
||||
end,
|
||||
set = function(v)
|
||||
self.moduleSettings.barVisible['bar'] = v
|
||||
self:Redraw()
|
||||
end,
|
||||
disabled = function()
|
||||
return not self.moduleSettings.enabled
|
||||
end,
|
||||
order = 28
|
||||
}
|
||||
|
||||
opts["bgVisible"] = {
|
||||
type = 'toggle',
|
||||
name = 'Bar background visible',
|
||||
desc = 'Toggle bar background visibility',
|
||||
get = function()
|
||||
return self.moduleSettings.barVisible['bg']
|
||||
end,
|
||||
set = function(v)
|
||||
self.moduleSettings.barVisible['bg'] = v
|
||||
self:Redraw()
|
||||
end,
|
||||
disabled = function()
|
||||
return not self.moduleSettings.enabled
|
||||
end,
|
||||
order = 29
|
||||
}
|
||||
|
||||
opts["textSettings"] =
|
||||
{
|
||||
@ -447,6 +483,7 @@ function MirrorBarHandler.prototype:SetSettings(bar)
|
||||
bar.moduleSettings.scale = self.moduleSettings.scale
|
||||
bar.moduleSettings.textVerticalOffset = self.moduleSettings.textVerticalOffset
|
||||
bar.moduleSettings.textHorizontalOffset = self.moduleSettings.textHorizontalOffset
|
||||
bar.moduleSettings.barVisible = self.moduleSettings.barVisible
|
||||
end
|
||||
|
||||
|
||||
|
@ -81,6 +81,48 @@ function TargetCast.prototype:GetOptions()
|
||||
end
|
||||
}
|
||||
|
||||
opts["barVisible"] = {
|
||||
type = 'toggle',
|
||||
name = 'Bar visible',
|
||||
desc = 'Toggle bar visibility',
|
||||
get = function()
|
||||
return self.moduleSettings.barVisible['bar']
|
||||
end,
|
||||
set = function(v)
|
||||
self.moduleSettings.barVisible['bar'] = v
|
||||
if v then
|
||||
self.barFrame:Show()
|
||||
else
|
||||
self.barFrame:Hide()
|
||||
end
|
||||
end,
|
||||
disabled = function()
|
||||
return not self.moduleSettings.enabled
|
||||
end,
|
||||
order = 28
|
||||
}
|
||||
|
||||
opts["bgVisible"] = {
|
||||
type = 'toggle',
|
||||
name = 'Bar background visible',
|
||||
desc = 'Toggle bar background visibility',
|
||||
get = function()
|
||||
return self.moduleSettings.barVisible['bg']
|
||||
end,
|
||||
set = function(v)
|
||||
self.moduleSettings.barVisible['bg'] = v
|
||||
if v then
|
||||
self.frame.bg:Show()
|
||||
else
|
||||
self.frame.bg:Hide()
|
||||
end
|
||||
end,
|
||||
disabled = function()
|
||||
return not self.moduleSettings.enabled
|
||||
end,
|
||||
order = 29
|
||||
}
|
||||
|
||||
return opts
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user