From acf9d57a85cb35074b414297f569b0f03cef7216 Mon Sep 17 00:00:00 2001 From: Parnic Date: Mon, 21 Jan 2008 05:52:45 +0000 Subject: [PATCH] - added horizontal and vertical text offset sliders to each bar --- IceBarElement.lua | 50 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/IceBarElement.lua b/IceBarElement.lua index 43e0930..51e06a8 100644 --- a/IceBarElement.lua +++ b/IceBarElement.lua @@ -45,7 +45,9 @@ function IceBarElement.prototype:GetDefaultSettings() settings["textVisible"] = {upper = true, lower = true} settings["upperText"] = '' settings["lowerText"] = '' - + settings["textVerticalOffset"] = -1 + settings["textHorizontalOffset"] = 0 + return settings end @@ -123,6 +125,46 @@ function IceBarElement.prototype:GetOptions() end, 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"] = { @@ -385,8 +427,10 @@ function IceBarElement.prototype:CreateTexts() self.frame.bottomUpperText:ClearAllPoints() self.frame.bottomLowerText:ClearAllPoints() - self.frame.bottomUpperText:SetPoint("TOP"..ownPoint , self.frame, "BOTTOM"..parentPoint, offx, -1) - self.frame.bottomLowerText:SetPoint("TOP"..ownPoint , self.frame, "BOTTOM"..parentPoint, offx, -15) + offx = offx + self.moduleSettings.textHorizontalOffset + + 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 self.frame.bottomUpperText:Show()