Nenue@10: local B = select(2,...).frame Nenue@10: local mod = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') Nenue@10: local print = B.print('SetStyle') Nenue@10: ------------------------------------------------------------- Nenue@10: --- Deals with swapping between different color palettes Nenue@10: --- Nenue@10: Nenue@10: local titleFont, textFont = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Regular.ttf]] Nenue@14: local titleSize, textSize = 16, 15 Nenue@10: local titleOutline, textOutline = "OUTLINE", "OUTLINE" Nenue@14: local titleSpacing, textSpacing = 3, 1 Nenue@13: local unpack, type, pairs, tconcat = unpack, type, pairs, table.concat Nenue@10: local wrapperHeadFont, wrapperHeadSize, wrapperHeadOutline = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], 16, 'NONE' Nenue@14: local headerFont, headerSize = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], 24 Nenue@14: local headerOutline, headerSpacing = 'OUTLINE', 2 Nenue@10: Nenue@13: Nenue@14: mod.defaults.Wrapper = { Nenue@14: WrapperPoint = 'TOPRIGHT', Nenue@14: WrapperFloatX = -25, Nenue@14: WrapperFloatV = 'TOP', Nenue@14: WrapperFloatY = -200, Nenue@14: Nenue@14: WrapperWidth = 270, Nenue@14: WrapperHeight = 600, Nenue@10: } Nenue@14: mod.defaults.Tracker = { Nenue@14: HeaderHeight = 24, Nenue@14: } Nenue@14: Nenue@10: mod.defaults.Style = { Nenue@13: Format = { Nenue@13: Frame = { Nenue@13: Width = 270, Nenue@13: }, Nenue@13: title = { Nenue@14: Indent = 0, Nenue@14: Spacing = 0, Nenue@13: }, Nenue@13: status = { Nenue@14: Indent = 5, Nenue@14: Spacing = 0, Nenue@13: } Nenue@13: }, Nenue@13: FontBank = { Nenue@10: ['Normal'] = _G.VeneerCriteriaFontNormal, Nenue@10: ['Progress'] = _G.VeneerCriteriaFontProgress, Nenue@10: ['Complete'] = _G.VeneerCriteriaFontComplete, Nenue@10: ['Failed'] = _G.VeneerCriteriaFontFailed, Nenue@10: }, Nenue@10: Normal = { Nenue@10: title = { Nenue@10: TextColor = {1, 1, 1, 1}, Nenue@10: Width = 270, Nenue@14: Spacing = 0, Nenue@14: Indent = 2, Nenue@10: }, Nenue@10: titlebg = { Nenue@10: Background = {0, 0, 0, 1}, Nenue@10: Width = 270, Nenue@10: }, Nenue@10: status = { Nenue@10: Width = 270, Nenue@14: Spacing = 0, Nenue@10: }, Nenue@10: statusbg = { Nenue@10: Width = 270, Nenue@10: }, Nenue@10: Frame = { Nenue@10: Width = 270, Nenue@10: } Nenue@10: }, Nenue@10: Wrapper = { Nenue@10: Frame = { Nenue@10: BackgroundComplex = {Left = {'', 0, 0.4, 0,1, 100}, Right={'', 0.6,1,0,1}, Tile = {'', 0.4,.6,0,1, 100}}, }, Nenue@10: title = { Nenue@10: Font = {wrapperHeadFont, wrapperHeadSize, wrapperHeadOutline}, Nenue@10: Spacing = 4,} Nenue@10: }, Nenue@10: Tracker = { Nenue@10: Normal = { Nenue@10: title = { Nenue@10: Font = {headerFont, headerSize, headerOutline}, Spacing = headerSpacing, Nenue@14: Indent = 2, Nenue@14: TextColor = {1, .9, .2, 1}, Nenue@10: }, Nenue@10: titlebg = { Nenue@16: Gradient = {'VERTICAL', MinColor = {0,0,0,0.25}, MaxColor = {0,0,0,.15}}, Nenue@10: } Nenue@10: } Nenue@10: }, Nenue@10: TrackerBlock = { Nenue@10: Normal = { Nenue@10: titlebg = { Nenue@14: Indent = 2, Nenue@16: Gradient = { 'HORIZONTAL', MinColor = {0.2, .4, 1, 0}, MaxColor = {.7, 0, 0.9, .14}}, Nenue@10: }, Nenue@10: title = { Nenue@14: TextColor = {1,1,1,0.5}, Nenue@10: Font = {titleFont, titleSize, titleOutline}, Nenue@10: Spacing = titleSpacing, Nenue@10: }, Nenue@10: status = { Nenue@14: TextColor = {1,1,1,0.5}, Nenue@14: Font = {textFont, textSize, textOutline}, Nenue@14: Spacing = textSpacing, Nenue@10: }, Nenue@10: statusbg = { Nenue@16: Gradient = { 'HORIZONTAL', MinColor = {0.2, .4, 1, 0}, MaxColor = {.7, 0, 0.9, .11}}, Nenue@10: } Nenue@10: }, Nenue@10: Super = { Nenue@10: title = { Nenue@14: TextColor = {1,1,1,1}, Nenue@10: Font = {titleFont, titleSize, titleOutline}, Nenue@10: Spacing = titleSpacing, BackgroundFullWidth = true Nenue@10: }, Nenue@10: titlebg = { Nenue@16: Gradient = { 'HORIZONTAL', MinColor = {0, .7, .6, 0}, MaxColor = {0, .7, .6, 0.23}}, Nenue@10: }, Nenue@10: status = { Nenue@14: TextColor = {1,1,1,1}, Nenue@14: Font = {textFont, textSize, textOutline}, Nenue@14: Spacing = textSpacing, Nenue@10: }, Nenue@10: statusbg = { Nenue@16: Gradient = { 'HORIZONTAL', MinColor = {0, .7, .6, 0}, MaxColor = {0, .7, .6, 0.23} }, Nenue@10: }, Nenue@10: }, Nenue@10: MouseDown = { Nenue@10: title = { Nenue@10: Font = {titleFont, titleSize, titleOutline}, Nenue@10: Spacing = titleSpacing, Nenue@10: }, Nenue@10: titlebg = { Nenue@16: Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, .4}, }, Nenue@10: }, Nenue@10: status = { Nenue@10: Font = {textFont, textSize, textOutline}, Nenue@10: Spacing = textSpacing, Nenue@10: }, Nenue@10: statusbg = { Nenue@16: Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, .2}, }, Nenue@10: } Nenue@10: }, Nenue@10: Complete = { Nenue@10: title = { Nenue@14: TextColor = {1,1,1,0.5}, Nenue@10: Font = {titleFont, titleSize, titleOutline}, Spacing = titleSpacing, Nenue@10: }, Nenue@10: titlebg = { Nenue@16: Gradient = {'HORIZONTAL', MinColor = {0, 1, 0, 0}, MaxColor = {0, 1, 0, 0.34}, }, Nenue@10: }, Nenue@10: status = { Nenue@14: TextColor = {1,1,1,0.5}, Nenue@10: Font = {textFont, textSize, textOutline}, Spacing = textSpacing, Nenue@10: }, Nenue@10: statusbg = { Nenue@16: Gradient = {'HORIZONTAL', MinColor = {0, 1, 0, 0}, MaxColor = {0, 1, 0, .25}, }, Nenue@10: } Nenue@10: }, Nenue@13: Daily = { Nenue@13: titlebg = { Nenue@16: Gradient = {'HORIZONTAL', MinColor = {0, .4, 1, 0.34}, MaxColor = {0, 0.4, 1, .17}, }, Nenue@13: }, Nenue@13: statusbg = { Nenue@16: Gradient = {'HORIZONTAL', MinColor = {0, .4, 1, 0.25}, MaxColor = {0, 0.4, 1, .12}, }, Nenue@13: }, Nenue@13: }, Nenue@16: AutoQuest = { Nenue@16: Normal = { Nenue@16: titlebg = { Nenue@16: Indent = 2, Nenue@16: Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0}, MaxColor = {.7, 0, 0.9, .14}}, Nenue@16: }, Nenue@16: title = { Nenue@16: TextColor = {1,1,1,1}, Nenue@16: Font = {titleFont, titleSize, titleOutline}, Nenue@16: Spacing = titleSpacing, Nenue@16: }, Nenue@16: status = { Nenue@16: TextColor = {0,1,0,1}, Nenue@16: Font = {textFont, textSize, textOutline}, Nenue@16: Spacing = textSpacing, Nenue@16: }, Nenue@16: statusbg = { Nenue@16: Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0}, MaxColor = {.7, 0, 0.9, .11}}, Nenue@16: } Nenue@16: }, Nenue@16: }, Nenue@16: Cheevs = { Nenue@10: Normal = { Nenue@10: Nenue@10: title = { Nenue@10: Font = {titleFont, titleSize, titleOutline}, Nenue@10: Spacing = titleSpacing, Nenue@10: }, Nenue@10: titlebg = { Nenue@16: Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0.45}, MaxColor = {.7, 0, 0.9, .19}}, Nenue@10: Nenue@10: }, Nenue@10: status = { Nenue@10: Font = {textFont, textSize, textOutline}, Nenue@10: Spacing = textSpacing, Nenue@10: }, Nenue@10: statusbg = { Nenue@16: Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0.25}, MaxColor = {.7, 0, 0.9, .12}}, Nenue@10: }, Nenue@10: }, Nenue@10: Complete = { Nenue@10: title = { Nenue@10: Font = {titleFont, titleSize, titleOutline}, Nenue@10: Spacing = titleSpacing, Nenue@10: }, Nenue@10: titlebg = { Nenue@16: Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0.45}, MaxColor = {.7, 0, 0.9, .19}}, Nenue@10: }, Nenue@10: status = { Nenue@10: Font = {textFont, textSize, textOutline}, Nenue@10: Spacing = textSpacing, Nenue@10: }, Nenue@10: statusbg = { Nenue@16: Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0.25}, MaxColor = {.7, 0, 0.9, .12}}, Nenue@10: }, Nenue@10: }, Nenue@10: } Nenue@10: } Nenue@10: } Nenue@10: Nenue@10: local style_cache_func = {} Nenue@10: local block_vars = { Nenue@10: ['titleSize'] = {'titleWidth', 'titleHeight'}, Nenue@10: ['FrameSize'] = {'width', 'height'} Nenue@10: } Nenue@10: local attrib_vars = { Nenue@10: ['Font'] = {'height'}, Nenue@10: } Nenue@10: Nenue@10: mod.BlockStyleCache = {} Nenue@10: local style_cache = mod.BlockStyleCache Nenue@10: mod.regions = {} Nenue@10: mod.regionStyles = {} Nenue@10: mod.SetBlockStyle = function(frame, frameType, ...) Nenue@10: -- var names intended to reflect argument order Nenue@16: print('|cFFFFFF00'..frame:GetName()..'|r', frameType, ...) Nenue@10: --@debug@ Nenue@10: local c = mod.defaults.Normal Nenue@10: local style_list = {... } Nenue@10: local styleName = frameType .. '-' .. table.concat(style_list,'') Nenue@16: local previousClass = mod.Conf.Style[frameType] Nenue@10: Nenue@10: if not style_cache[styleName] then Nenue@10: local style = {} Nenue@10: Nenue@10: if mod.defaults.Style[frameType] then Nenue@10: print(' setting style class |cFF00FFFF'..frameType) Nenue@10: else Nenue@10: print(' resorting to class Normal (missing |cFFFF8800'.. frameType..'|r)') Nenue@10: end Nenue@10: local normal = mod.defaults.Style.Normal Nenue@10: local root = mod.defaults.Style[frameType] or normal Nenue@10: for i, className in ipairs(style_list) do Nenue@16: local class = normal Nenue@16: if previousClass and previousClass[className] then Nenue@16: class = previousClass[className] Nenue@16: print(' ChildClass |cFFFF0088'.. className .. '|r') Nenue@16: elseif root[className] then Nenue@16: class = root[className] Nenue@10: print(' SubClass |cFF0088FF'.. className .. '|r') Nenue@10: elseif normal[className] then Nenue@16: class = normal[className] Nenue@10: print(' SubClass Normal.|cFFFF0088'..className..'|r') Nenue@10: else Nenue@16: print(' SubClass not found '..className..'') Nenue@10: end Nenue@16: previousClass = class Nenue@16: Nenue@10: for elementName, element in pairs(class) do Nenue@10: if not elementName:match('^%u') then Nenue@10: print(' scanning Element |cFF8800FF'.. elementName ..'|r') Nenue@10: if not style[elementName] then Nenue@10: style[elementName] = {} Nenue@10: end Nenue@10: for key, value in pairs(element) do Nenue@10: if mod.SetBlockAttribute[key] then Nenue@10: print(' |cFF00FF00'..elementName..'|r.|cFF00FFFF'..key..' =', (type(value) == 'table' and ('{'..table.concat(value,', ')..'}') or tostring(value))) Nenue@10: style[elementName][key] = value Nenue@10: end Nenue@10: Nenue@10: end Nenue@10: end Nenue@10: Nenue@10: end Nenue@10: end Nenue@10: Nenue@10: for k, elements in pairs(mod.defaults.Style.Normal) do Nenue@10: if not style[k] and type(elements) ~= 'table' then Nenue@10: style[k] = elements Nenue@10: end Nenue@10: end Nenue@10: Nenue@10: Nenue@10: print('result for: ', frame:GetName()) Nenue@10: for k,v in pairs(style) do Nenue@10: if type(v) == 'table' and not k:match('^%u') then Nenue@10: for kk, vv in pairs(v) do Nenue@16: print(' |cFFFFFF00'..k..'|r.|cFF00FF00'..kk..'|r =', (type(vv) == 'table' and ('{'..table.concat(vv,', ')..'}') or tostring(vv))) Nenue@10: end Nenue@10: else Nenue@10: print(' |cFFFFFFFF' .. k ..'|r =', tostring(v)) Nenue@10: end Nenue@10: end Nenue@10: style_cache[styleName] = style Nenue@10: end Nenue@10: Nenue@10: local style = style_cache[styleName] Nenue@10: Nenue@10: if not style_cache_func[styleName] then Nenue@10: local code = Nenue@10: "return function (frame)\n".. Nenue@10: " local func = Veneer.ObjectiveTracker.SetBlockAttribute\n".. Nenue@11: " local cache = Veneer.ObjectiveTracker.BlockStyleCache" Nenue@11: --.. " print('CacheFunc', '|cFFFFFF00SET|r "..styleName.." |cFFFFFF00ON|r', frame:GetName()) " Nenue@10: Nenue@10: for elementName, styleset in pairs(style) do Nenue@10: code = code .. Nenue@10: "\n if frame['"..elementName.."'] then" Nenue@10: Nenue@10: for attributeName, value in pairs(styleset) do Nenue@10: if mod.SetBlockAttribute[attributeName] then Nenue@16: print(' add function '..elementName..':'.. attributeName ..'(', (type(value) == 'table' and ('{'..table.concat(value,', ')..'}') or tostring(value)), ')') Nenue@10: Nenue@10: Nenue@10: --mod.SetBlockAttribute[attributeName](region, value) Nenue@11: code = code Nenue@11: --.. "\n print('CacheFunc', ' applying', '|cFF00FFFF" .. attributeName .. "|r to', '|cFF0088FF"..elementName.."|r', cache['"..styleName.."']['"..elementName.."']['".. attributeName .."'])" Nenue@11: .. "\n\n func['" .. attributeName .. "'](frame['"..elementName.."'],".. Nenue@10: " cache['"..styleName.."']['"..elementName.."']['".. attributeName .."'])" Nenue@10: Nenue@10: --- Set any frame.blah variables used in Updates Nenue@10: if block_vars[elementName .. attributeName] then Nenue@10: print('|cFF008800BVar|r', elementName..attributeName) Nenue@10: for i, blockKey in ipairs(block_vars[elementName .. attributeName]) do Nenue@10: print(' assigning |cFF008800'..blockKey..'|r') Nenue@10: frame[blockKey] = (type(value) == 'table') and value[i] or value Nenue@10: end Nenue@10: end Nenue@10: Nenue@10: end Nenue@10: end Nenue@10: code = code .. Nenue@10: "\n else".. Nenue@11: --"\n print('CacheFunc', ' |cFFFF4400missing', frame:GetName()..'."..elementName.."')".. Nenue@10: "\n end" Nenue@10: end Nenue@10: code = code .. "\nend" Nenue@10: local result = assert(loadstring(code)) Nenue@10: print('storing style func', styleName, result()) Nenue@10: style_cache_func[styleName] = result() Nenue@10: Nenue@10: end Nenue@10: style_cache_func[styleName](frame) Nenue@10: Nenue@13: --- Hardcoding the sizing vars for sanity Nenue@13: local normalSettings = mod.defaults.Style.Format Nenue@14: frame.titleHeight = frame.title and (frame.title:GetStringHeight() + (frame.title.spacing or 0)*2) or 0 Nenue@14: frame.statusHeight = frame.status and (frame.status:GetStringHeight() + (frame.status.spacing or 0)*2) or 0 Nenue@14: frame.height = frame.titleHeight + frame.statusHeight + (frame.attachmentHeight or 0) Nenue@13: frame.width = normalSettings.Frame.Width Nenue@13: frame.statusWidth = frame.width - normalSettings.status.Indent Nenue@13: frame.titleWidth = frame.width - normalSettings.title.Indent Nenue@10: Nenue@16: print((frame.status and frame.status:GetText())) Nenue@16: print((frame.status and frame.status:GetWidth())) Nenue@16: print(frame.status and frame.title:GetStringHeight()) Nenue@16: print(frame.title and (frame.title:GetStringHeight() + (frame.title.spacing or 0)*2) or 0) Nenue@16: print(frame.status and frame.status:GetStringHeight()) Nenue@16: print(frame.status and (frame.status:GetStringHeight() + (frame.status.spacing or 0)*2) or 0) Nenue@10: if frame.status then Nenue@14: print('status ', frame.statusHeight, normalSettings.status.Indent, 0, 'statusbg', frame.statusHeight) Nenue@16: frame.status:SetWidth(frame.width) Nenue@13: frame.status:SetPoint('LEFT', frame, 'LEFT', normalSettings.status.Indent, 0) Nenue@17: frame.status:SetPoint('TOP', frame, 'TOP', 0, -frame.status.spacing) Nenue@16: --frame.status:SetHeight(frame.statusHeight) Nenue@10: if frame.statusbg then Nenue@17: Nenue@17: frame.statusbg:SetHeight(frame.statusHeight + frame.status.spacing * 2) Nenue@10: frame.statusbg:SetWidth(frame.width) Nenue@10: end Nenue@10: end Nenue@10: if frame.title then Nenue@14: print('title ',frame.titleHeight, normalSettings.title.Indent, 'titlebg',frame.titleHeight) Nenue@13: frame.title:SetPoint('LEFT', frame, 'LEFT', normalSettings.title.Indent) Nenue@17: frame.title:SetPoint('TOP', frame, 'TOP', 0, -frame.title.spacing) Nenue@16: frame.title:SetWidth(frame.width) Nenue@10: if frame.titlebg then Nenue@17: frame.titlebg:SetHeight(frame.titleHeight + frame.title.spacing * 2) Nenue@10: frame.titlebg:SetWidth(frame.width) Nenue@10: end Nenue@10: end Nenue@14: frame:SetSize(frame.width, frame.height) Nenue@10: print('sizing frame', frame.width, frame.height) Nenue@10: --[[ Nenue@10: local titleSpacing, titleSpacing2 = c.Title.Spacing, (c.Title.Spacing * 2) Nenue@10: local textSpacing, textSpacing2 = c.Text.Spacing, (c.Text.Spacing * 2) Nenue@10: Nenue@10: block.title:SetSpacing(titleSpacing) Nenue@10: block.objectives:SetSpacing(textSpacing) Nenue@10: block.objectives:SetWordWrap(true) Nenue@10: Nenue@10: local titleHeight, textHeight = block.title:GetStringHeight(), block.objectives:GetStringHeight() + block.attachmentHeight Nenue@10: local blockHeight = titleHeight + titleSpacing2 + textHeight + textSpacing2 Nenue@10: local blockWidth = wrapperMaxWidth Nenue@10: Nenue@10: block.titlebg:SetSize(min(w1, w2), titleHeight + titleSpacing2) Nenue@10: block.bg:SetSize(w1, textHeight + textSpacing2) Nenue@10: block:SetSize(blockWidth, blockHeight) Nenue@10: Nenue@10: block.title:SetPoint('TOPLEFT', block.titlebg, 'TOPLEFT', 0, -titleSpacing) Nenue@10: block.objectives:SetPoint('TOPLEFT', block.titlebg, 'BOTTOMLEFT', textIndent, -textSpacing) Nenue@10: Nenue@10: -- store Nenue@10: block.titleHeight = titleHeight Nenue@10: block.textHeight = textHeight Nenue@10: block.width = blockWidth Nenue@10: block.height = blockHeight Nenue@10: --]] Nenue@10: --print(' |cFF00FFFF'..block:GetName()..'|r:|cFF0088FFSetStyle|r(', blockWidth, 'x', blockHeight, '(textH', textHeight,', titleH', titleHeight, ')') Nenue@10: end Nenue@14: local segments = {'Left', 'Right', 'Tile' } Nenue@14: local Wrapper = _G.VeneerObjectiveWrapper Nenue@14: mod.UpdateWrapperStyle = function() Nenue@14: local c = mod.Conf.Wrapper Nenue@14: --Wrapper:ClearAllPoints() Nenue@14: --Wrapper:SetPoint(c.WrapperPoint, UIParent, c.WrapperPoint, c.WrapperFloatX, c.WrapperFloatY) Nenue@14: end Nenue@14: Nenue@14: mod.Tracker.SetBlockTags = function(block, info) Nenue@14: if info.isComplete then Nenue@14: block.mainStyle = 'Complete' Nenue@14: end Nenue@14: if info.superTracked then Nenue@14: block.subStyle = 'Super' Nenue@14: elseif info.isDaily then Nenue@14: block.subStyle = 'Daily' Nenue@14: end Nenue@14: end Nenue@14: local unitLevel = UnitLevel('player') Nenue@14: mod.Quest.SetBlockTags = function(block, info) Nenue@14: Nenue@14: mod.Tracker.SetBlockTags(block, info) Nenue@14: if info.level then Nenue@14: local levelDiff = unitLevel - info.level Nenue@14: if levelDiff > 9 then Nenue@14: block.title:SetTextColor(0.7, 0.7, 0.7, 1) Nenue@14: elseif levelDiff > 1 then Nenue@14: block.title:SetTextColor(0.5, 1, 0.5, 1) Nenue@14: elseif levelDiff < -1 then Nenue@14: block.title:SetTextColor(1, 0.4, 0.25, 1) Nenue@14: elseif levelDiff < -4 then Nenue@14: block.title:SetTextColor(1, 0, 0, 1) Nenue@14: else Nenue@14: block.title:SetTextColor(1,1,1,1) Nenue@14: end Nenue@14: end Nenue@14: end Nenue@14: mod.Cheevs.SetBlockTags = function(block, info) Nenue@14: mod.Tracker.SetBlockTags(block, info) Nenue@14: end Nenue@10: Nenue@10: --- Argument containers Nenue@14: local o -- text flag Nenue@14: local a1, a2, a3, a4, b1, b2, b3, b4 -- color1, color2 Nenue@14: local f1, f2, f3 -- font Nenue@14: local w1, w2 -- size Nenue@14: local p1, p2, p3, x, y -- path/point args Nenue@10: mod.SetBlockAttribute = {} Nenue@10: local sb = mod.SetBlockAttribute Nenue@10: local print = B.print('Attribute') Nenue@10: sb.Gradient = function(region, value) Nenue@10: print('|cFF8844FFGradient|r', region:GetName(), unpack(value)) Nenue@16: o = value[1] Nenue@10: a1, a2, a3, a4 = unpack(value.MinColor) Nenue@10: b1, b2, b3, b4 = unpack(value.MaxColor) Nenue@10: region:SetVertexColor(1,1,1) Nenue@10: region:SetTexture(1,1,1,1) Nenue@10: region:SetGradientAlpha(o, a1, a2, a3, a4, b1, b2, b3, b4) Nenue@10: end Nenue@10: Nenue@10: sb.Background = function(region, value) Nenue@10: print('|cFF0088FFBackground|r', unpack(value)) Nenue@10: region:SetVertexColor(1,1,1) -- reset Nenue@10: region:SetTexture(unpack(value)) Nenue@10: end Nenue@10: sb.BackgroundComplex = function (region, value) Nenue@10: local left, tile, right = value.Left, value.Tile, value.Right Nenue@10: Nenue@10: end Nenue@10: sb.Font = function(region, value) Nenue@10: f1, f2, f3 = unpack(value) Nenue@10: print('|cFFFFFF00Font|r', f1, f2, f3) Nenue@10: region:SetFont(f1, f2, f3) Nenue@10: end Nenue@10: Nenue@10: sb.Spacing = function(region, value) Nenue@14: print('FontSpacing', region:GetName(), value) Nenue@10: region:SetSpacing(value) Nenue@10: region.spacing = value Nenue@10: end Nenue@10: Nenue@10: sb.TextColor = function(region, value) Nenue@10: a1, a2, a3, a4 = unpack(value) Nenue@10: print('TextColor', a1, a2, a3, a4) Nenue@10: region:SetTextColor(a1, a2, a3, a4) Nenue@10: end Nenue@10: sb.Texture = function(region, value) Nenue@10: Nenue@10: p1, a1, a2, a3, a4 = unpack(value) Nenue@10: print('Texture', p1, a1, a2, a3, a4) Nenue@10: region:SetTexture(p1) Nenue@10: if a1 then Nenue@10: region:SetTexCoord(a1, a2, a3, a4) Nenue@10: end Nenue@10: end Nenue@10: sb.Width = function(region, value) Nenue@10: w1 = value Nenue@10: region:SetWidth(w1) Nenue@10: end Nenue@10: Nenue@10: sb.Height = function(region, value) Nenue@10: w2 = value Nenue@10: region:SetHeight(w2) Nenue@10: end Nenue@10: sb.Size = function(region, value) Nenue@10: w1, w2 = unpack(value) Nenue@10: region:SetSize(w1, w2) Nenue@14: end Nenue@14: