- added horizontal and vertical text offset sliders to each bar

This commit is contained in:
Parnic
2008-01-21 05:52:45 +00:00
parent 9b27f345ec
commit acf9d57a85

View File

@ -45,6 +45,8 @@ function IceBarElement.prototype:GetDefaultSettings()
settings["textVisible"] = {upper = true, lower = true} settings["textVisible"] = {upper = true, lower = true}
settings["upperText"] = '' settings["upperText"] = ''
settings["lowerText"] = '' settings["lowerText"] = ''
settings["textVerticalOffset"] = -1
settings["textHorizontalOffset"] = 0
return settings return settings
end end
@ -124,6 +126,46 @@ function IceBarElement.prototype:GetOptions()
order = 32 order = 32
} }
opts["textVerticalOffset"] =
{
type = 'range',
name = '|c' .. self.configColor .. 'Text Vertical Offset|r',
desc = 'Offset of the text from the bar vertically (negative is farther below)',
min = -250,
max = 350,
step = 1,
get = function()
return self.moduleSettings.textVerticalOffset
end,
set = function(v)
self.moduleSettings.textVerticalOffset = v
self:Redraw()
end,
disabled = function()
return not self.moduleSettings.enabled
end
}
opts["textHorizontalOffset"] =
{
type = 'range',
name = '|c' .. self.configColor .. 'Text Horizontal Offset|r',
desc = 'Offset of the text from the bar horizontally',
min = -50,
max = 50,
step = 1,
get = function()
return self.moduleSettings.textHorizontalOffset
end,
set = function(v)
self.moduleSettings.textHorizontalOffset = v
self:Redraw()
end,
disabled = function()
return not self.moduleSettings.enabled
end
}
opts["textSettings"] = opts["textSettings"] =
{ {
type = 'group', type = 'group',
@ -385,8 +427,10 @@ function IceBarElement.prototype:CreateTexts()
self.frame.bottomUpperText:ClearAllPoints() self.frame.bottomUpperText:ClearAllPoints()
self.frame.bottomLowerText:ClearAllPoints() self.frame.bottomLowerText:ClearAllPoints()
self.frame.bottomUpperText:SetPoint("TOP"..ownPoint , self.frame, "BOTTOM"..parentPoint, offx, -1) offx = offx + self.moduleSettings.textHorizontalOffset
self.frame.bottomLowerText:SetPoint("TOP"..ownPoint , self.frame, "BOTTOM"..parentPoint, offx, -15)
self.frame.bottomUpperText:SetPoint("TOP"..ownPoint , self.frame, "BOTTOM"..parentPoint, offx, self.moduleSettings.textVerticalOffset)
self.frame.bottomLowerText:SetPoint("TOP"..ownPoint , self.frame, "BOTTOM"..parentPoint, offx, self.moduleSettings.textVerticalOffset - 14)
if (self.moduleSettings.textVisible["upper"]) then if (self.moduleSettings.textVisible["upper"]) then
self.frame.bottomUpperText:Show() self.frame.bottomUpperText:Show()