mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 22:51:53 -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,9 +42,13 @@ function IceBarElement.prototype:Enable()
|
|||||||
self:RegisterEvent("PLAYER_TARGET_CHANGED", "TargetChanged")
|
self:RegisterEvent("PLAYER_TARGET_CHANGED", "TargetChanged")
|
||||||
|
|
||||||
if DogTag ~= nil then
|
if DogTag ~= nil then
|
||||||
|
if self.frame.bottomUpperText and self.moduleSettings.upperText then
|
||||||
DogTag:AddFontString(self.frame.bottomUpperText, self.frame, self.unit, self.moduleSettings.upperText)
|
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)
|
DogTag:AddFontString(self.frame.bottomLowerText, self.frame, self.unit, self.moduleSettings.lowerText)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -159,7 +163,10 @@ function IceBarElement.prototype:GetOptions()
|
|||||||
self.barFrame:Hide()
|
self.barFrame:Hide()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
order = 13.1
|
disabled = function()
|
||||||
|
return not self.moduleSettings.enabled
|
||||||
|
end,
|
||||||
|
order = 28
|
||||||
}
|
}
|
||||||
|
|
||||||
opts["bgVisible"] = {
|
opts["bgVisible"] = {
|
||||||
@ -177,7 +184,10 @@ function IceBarElement.prototype:GetOptions()
|
|||||||
self.frame.bg:Hide()
|
self.frame.bg:Hide()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
order = 13.2
|
disabled = function()
|
||||||
|
return not self.moduleSettings.enabled
|
||||||
|
end,
|
||||||
|
order = 29
|
||||||
}
|
}
|
||||||
|
|
||||||
opts["shouldAnimate"] =
|
opts["shouldAnimate"] =
|
||||||
@ -405,7 +415,9 @@ function IceBarElement.prototype:CreateFrame()
|
|||||||
self:CreateTexts()
|
self:CreateTexts()
|
||||||
|
|
||||||
self.frame:SetScale(self.moduleSettings.scale)
|
self.frame:SetScale(self.moduleSettings.scale)
|
||||||
|
if not string.find(self.elementName, "MirrorBar") then
|
||||||
self.frame:SetScript("OnUpdate", function() self:MyOnUpdate() end)
|
self.frame:SetScript("OnUpdate", function() self:MyOnUpdate() end)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -135,6 +135,48 @@ function CastBar.prototype:GetOptions()
|
|||||||
end
|
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"] =
|
opts["textSettings"] =
|
||||||
{
|
{
|
||||||
type = 'group',
|
type = 'group',
|
||||||
|
@ -25,6 +25,7 @@ function MirrorBar.prototype:init(side, offset, name, db)
|
|||||||
self.moduleSettings = {}
|
self.moduleSettings = {}
|
||||||
self.moduleSettings.side = side
|
self.moduleSettings.side = side
|
||||||
self.moduleSettings.offset = offset
|
self.moduleSettings.offset = offset
|
||||||
|
self.moduleSettings.barVisible = {bar = true, bg = true}
|
||||||
|
|
||||||
-- unregister the event superclass registered, we don't want to register
|
-- unregister the event superclass registered, we don't want to register
|
||||||
-- this to the core
|
-- this to the core
|
||||||
@ -180,6 +181,7 @@ function MirrorBarHandler.prototype:GetDefaultSettings()
|
|||||||
settings["barFontBold"] = true
|
settings["barFontBold"] = true
|
||||||
settings["lockTextAlpha"] = true
|
settings["lockTextAlpha"] = true
|
||||||
settings["textVisible"] = {upper = true, lower = true}
|
settings["textVisible"] = {upper = true, lower = true}
|
||||||
|
settings["barVisible"] = {bg = true, bar = true}
|
||||||
return settings
|
return settings
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -230,6 +232,40 @@ function MirrorBarHandler.prototype:GetOptions()
|
|||||||
order = 31
|
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"] =
|
opts["textSettings"] =
|
||||||
{
|
{
|
||||||
type = 'group',
|
type = 'group',
|
||||||
@ -447,6 +483,7 @@ function MirrorBarHandler.prototype:SetSettings(bar)
|
|||||||
bar.moduleSettings.scale = self.moduleSettings.scale
|
bar.moduleSettings.scale = self.moduleSettings.scale
|
||||||
bar.moduleSettings.textVerticalOffset = self.moduleSettings.textVerticalOffset
|
bar.moduleSettings.textVerticalOffset = self.moduleSettings.textVerticalOffset
|
||||||
bar.moduleSettings.textHorizontalOffset = self.moduleSettings.textHorizontalOffset
|
bar.moduleSettings.textHorizontalOffset = self.moduleSettings.textHorizontalOffset
|
||||||
|
bar.moduleSettings.barVisible = self.moduleSettings.barVisible
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -81,6 +81,48 @@ function TargetCast.prototype:GetOptions()
|
|||||||
end
|
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
|
return opts
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user