mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
- added ability to specify a different texture on individual bars than the global one chosen on the main bar configuration panel
This commit is contained in:
@ -80,6 +80,7 @@ function IceBarElement.prototype:GetDefaultSettings()
|
||||
settings["usesDogTagStrings"] = true
|
||||
settings["barVerticalOffset"] = 0
|
||||
settings["forceJustifyText"] = "NONE"
|
||||
settings["shouldUseOverride"] = false
|
||||
|
||||
return settings
|
||||
end
|
||||
@ -296,6 +297,44 @@ function IceBarElement.prototype:GetOptions()
|
||||
order = 34
|
||||
}
|
||||
|
||||
opts["shouldUseOverride"] =
|
||||
{
|
||||
type = 'toggle',
|
||||
name = 'Override global texture',
|
||||
desc = 'This will override the global bar texture setting for this bar with the one specified below.',
|
||||
get = function()
|
||||
return self.moduleSettings.shouldUseOverride
|
||||
end,
|
||||
set = function(value)
|
||||
self.moduleSettings.shouldUseOverride = value
|
||||
AceLibrary("Waterfall-1.0"):Refresh("IceHUD")
|
||||
self:Redraw()
|
||||
end,
|
||||
disabled = function()
|
||||
return not self:IsEnabled()
|
||||
end,
|
||||
order = 35
|
||||
}
|
||||
|
||||
opts["barTextureOverride"] =
|
||||
{
|
||||
type = 'text',
|
||||
name = 'Bar Texture Override',
|
||||
desc = 'This will override the global bar texture setting for this bar.',
|
||||
get = function()
|
||||
return self.moduleSettings.barTextureOverride
|
||||
end,
|
||||
set = function(value)
|
||||
self.moduleSettings.barTextureOverride = value
|
||||
self:Redraw()
|
||||
end,
|
||||
disabled = function()
|
||||
return not self:IsEnabled() or not self.moduleSettings.shouldUseOverride
|
||||
end,
|
||||
validate = IceHUD.validBarList,
|
||||
order = 36
|
||||
}
|
||||
|
||||
opts["textSettings"] =
|
||||
{
|
||||
type = 'group',
|
||||
@ -543,7 +582,7 @@ function IceBarElement.prototype:CreateBackground()
|
||||
self.frame.bg = self.frame:CreateTexture(nil, "BACKGROUND")
|
||||
end
|
||||
|
||||
self.frame.bg:SetTexture(IceElement.TexturePath .. self.settings.barTexture.."BG")
|
||||
self.frame.bg:SetTexture(IceElement.TexturePath .. self:GetMyBarTexture() .."BG")
|
||||
self.frame.bg:SetBlendMode(self.settings.barBgBlendMode)
|
||||
self.frame.bg:ClearAllPoints()
|
||||
self.frame.bg:SetAllPoints(self.frame)
|
||||
@ -589,7 +628,7 @@ function IceBarElement.prototype:CreateBar()
|
||||
self.barFrame.bar = self.frame:CreateTexture(nil, "BACKGROUND")
|
||||
end
|
||||
|
||||
self.barFrame.bar:SetTexture(IceElement.TexturePath .. self.settings.barTexture)
|
||||
self.barFrame.bar:SetTexture(IceElement.TexturePath .. self:GetMyBarTexture())
|
||||
self.barFrame.bar:SetBlendMode(self.settings.barBlendMode)
|
||||
self.barFrame.bar:SetAllPoints(self.frame)
|
||||
|
||||
@ -608,6 +647,15 @@ function IceBarElement.prototype:CreateBar()
|
||||
end
|
||||
|
||||
|
||||
function IceBarElement.prototype:GetMyBarTexture()
|
||||
if self.moduleSettings.shouldUseOverride and self.moduleSettings.barTextureOverride then
|
||||
return self.moduleSettings.barTextureOverride
|
||||
else
|
||||
return self.settings.barTexture
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function IceBarElement.prototype:CreateTexts()
|
||||
self.frame.bottomUpperText = self:FontFactory(self.moduleSettings.barFontSize, nil, self.frame.bottomUpperText)
|
||||
self.frame.bottomLowerText = self:FontFactory(self.moduleSettings.barFontSize, nil, self.frame.bottomLowerText)
|
||||
|
@ -8,6 +8,8 @@ IceHUD.debugging = false
|
||||
|
||||
IceHUD.WowVer = select(4, GetBuildInfo())
|
||||
|
||||
IceHUD.validBarList = { "Bar", "HiBar", "RoundBar", "ColorBar", "RivetBar", "RivetBar2", "CleanCurves", "GlowArc", "BloodGlaives", "ArcHUD" }
|
||||
|
||||
IceHUD.Location = "Interface\\AddOns\\IceHUD"
|
||||
IceHUD.options =
|
||||
{
|
||||
@ -321,7 +323,7 @@ IceHUD.options =
|
||||
set = function(value)
|
||||
IceHUD.IceCore:SetBarPreset(value)
|
||||
end,
|
||||
validate = { "Bar", "HiBar", "RoundBar", "ColorBar", "RivetBar", "RivetBar2", "CleanCurves", "GlowArc", "BloodGlaives", "ArcHUD" },
|
||||
validate = IceHUD.validBarList,
|
||||
order = 9
|
||||
},
|
||||
|
||||
@ -343,7 +345,7 @@ IceHUD.options =
|
||||
set = function(value)
|
||||
IceHUD.IceCore:SetBarTexture(value)
|
||||
end,
|
||||
validate = { "Bar", "HiBar", "RoundBar", "ColorBar", "RivetBar", "RivetBar2", "CleanCurves", "GlowArc", "BloodGlaives", "FangRune", "RuneBar", "RuneColor", "ArcHUD" },
|
||||
validate = IceHUD.validBarList,
|
||||
order = 11
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user