annotate ObjectiveStyle.lua @ 18:d1812fb10ae6

ObjectiveStyle - move tag/template logic into the corresponding GetInfo
author Nenue
date Tue, 05 Apr 2016 02:38:01 -0400
parents c33497b116d6
children 605e8f0e46db
rev   line source
Nenue@10 1 local B = select(2,...).frame
Nenue@10 2 local mod = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame')
Nenue@10 3 local print = B.print('SetStyle')
Nenue@10 4 -------------------------------------------------------------
Nenue@10 5 --- Deals with swapping between different color palettes
Nenue@10 6 ---
Nenue@10 7
Nenue@10 8 local titleFont, textFont = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Regular.ttf]]
Nenue@14 9 local titleSize, textSize = 16, 15
Nenue@10 10 local titleOutline, textOutline = "OUTLINE", "OUTLINE"
Nenue@18 11 local titleSpacing, textSpacing = 3, 3
Nenue@13 12 local unpack, type, pairs, tconcat = unpack, type, pairs, table.concat
Nenue@10 13 local wrapperHeadFont, wrapperHeadSize, wrapperHeadOutline = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], 16, 'NONE'
Nenue@14 14 local headerFont, headerSize = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], 24
Nenue@14 15 local headerOutline, headerSpacing = 'OUTLINE', 2
Nenue@10 16
Nenue@13 17
Nenue@14 18 mod.defaults.Wrapper = {
Nenue@14 19 WrapperPoint = 'TOPRIGHT',
Nenue@14 20 WrapperFloatX = -25,
Nenue@14 21 WrapperFloatV = 'TOP',
Nenue@14 22 WrapperFloatY = -200,
Nenue@14 23
Nenue@14 24 WrapperWidth = 270,
Nenue@14 25 WrapperHeight = 600,
Nenue@10 26 }
Nenue@14 27 mod.defaults.Tracker = {
Nenue@14 28 HeaderHeight = 24,
Nenue@14 29 }
Nenue@14 30
Nenue@10 31 mod.defaults.Style = {
Nenue@13 32 Format = {
Nenue@13 33 Frame = {
Nenue@13 34 Width = 270,
Nenue@13 35 },
Nenue@13 36 title = {
Nenue@14 37 Indent = 0,
Nenue@14 38 Spacing = 0,
Nenue@13 39 },
Nenue@13 40 status = {
Nenue@14 41 Indent = 5,
Nenue@14 42 Spacing = 0,
Nenue@13 43 }
Nenue@13 44 },
Nenue@13 45 FontBank = {
Nenue@10 46 ['Normal'] = _G.VeneerCriteriaFontNormal,
Nenue@10 47 ['Progress'] = _G.VeneerCriteriaFontProgress,
Nenue@10 48 ['Complete'] = _G.VeneerCriteriaFontComplete,
Nenue@10 49 ['Failed'] = _G.VeneerCriteriaFontFailed,
Nenue@10 50 },
Nenue@10 51 Normal = {
Nenue@10 52 title = {
Nenue@10 53 TextColor = {1, 1, 1, 1},
Nenue@10 54 Width = 270,
Nenue@14 55 Spacing = 0,
Nenue@14 56 Indent = 2,
Nenue@10 57 },
Nenue@10 58 titlebg = {
Nenue@10 59 Background = {0, 0, 0, 1},
Nenue@10 60 Width = 270,
Nenue@10 61 },
Nenue@10 62 status = {
Nenue@10 63 Width = 270,
Nenue@14 64 Spacing = 0,
Nenue@10 65 },
Nenue@10 66 statusbg = {
Nenue@10 67 Width = 270,
Nenue@10 68 },
Nenue@10 69 Frame = {
Nenue@10 70 Width = 270,
Nenue@10 71 }
Nenue@10 72 },
Nenue@10 73 Wrapper = {
Nenue@10 74 Frame = {
Nenue@10 75 BackgroundComplex = {Left = {'', 0, 0.4, 0,1, 100}, Right={'', 0.6,1,0,1}, Tile = {'', 0.4,.6,0,1, 100}}, },
Nenue@10 76 title = {
Nenue@10 77 Font = {wrapperHeadFont, wrapperHeadSize, wrapperHeadOutline},
Nenue@10 78 Spacing = 4,}
Nenue@10 79 },
Nenue@10 80 Tracker = {
Nenue@10 81 Normal = {
Nenue@10 82 title = {
Nenue@10 83 Font = {headerFont, headerSize, headerOutline}, Spacing = headerSpacing,
Nenue@14 84 Indent = 2,
Nenue@14 85 TextColor = {1, .9, .2, 1},
Nenue@10 86 },
Nenue@10 87 titlebg = {
Nenue@16 88 Gradient = {'VERTICAL', MinColor = {0,0,0,0.25}, MaxColor = {0,0,0,.15}},
Nenue@10 89 }
Nenue@10 90 }
Nenue@10 91 },
Nenue@10 92 TrackerBlock = {
Nenue@10 93 Normal = {
Nenue@10 94 titlebg = {
Nenue@14 95 Indent = 2,
Nenue@18 96 Gradient = { 'HORIZONTAL', MinColor = {0.7, 0, 0.9, 0}, MaxColor = {.7, 0, 0.9, .25}},
Nenue@10 97 },
Nenue@10 98 title = {
Nenue@18 99 TextColor = {1,1,1,0.8},
Nenue@18 100 Font = {titleFont, titleSize, titleOutline},
Nenue@18 101 Spacing = titleSpacing,
Nenue@18 102 },
Nenue@18 103 status = {
Nenue@18 104 TextColor = {1,1,1,0.8},
Nenue@18 105 Font = {textFont, textSize, textOutline},
Nenue@18 106 Spacing = textSpacing,
Nenue@18 107 },
Nenue@18 108 statusbg = {
Nenue@18 109 Gradient = { 'HORIZONTAL', MinColor = {0.2, .4, 1, 0}, MaxColor = {.7, 0, 0.9, .11}},
Nenue@18 110 }
Nenue@18 111 },
Nenue@18 112 Daily = {
Nenue@18 113 titlebg = {
Nenue@18 114 Gradient = {'HORIZONTAL', MinColor = {0, .4, 1, 0}, MaxColor = {0, 0.4, 1, .35}, },
Nenue@18 115 },
Nenue@18 116 statusbg = {
Nenue@18 117 Gradient = {'HORIZONTAL', MinColor = {0, .4, 1, 0}, MaxColor = {0, 0.35, .90, .31}, },
Nenue@18 118 },
Nenue@18 119 title = {
Nenue@18 120 TextColor = {0.7,1,1,1},
Nenue@10 121 Font = {titleFont, titleSize, titleOutline},
Nenue@10 122 Spacing = titleSpacing,
Nenue@10 123 },
Nenue@10 124 status = {
Nenue@14 125 TextColor = {1,1,1,0.5},
Nenue@14 126 Font = {textFont, textSize, textOutline},
Nenue@14 127 Spacing = textSpacing,
Nenue@10 128 },
Nenue@10 129 },
Nenue@10 130 Super = {
Nenue@10 131 title = {
Nenue@14 132 TextColor = {1,1,1,1},
Nenue@10 133 Font = {titleFont, titleSize, titleOutline},
Nenue@10 134 Spacing = titleSpacing, BackgroundFullWidth = true
Nenue@10 135 },
Nenue@10 136 titlebg = {
Nenue@16 137 Gradient = { 'HORIZONTAL', MinColor = {0, .7, .6, 0}, MaxColor = {0, .7, .6, 0.23}},
Nenue@10 138 },
Nenue@10 139 status = {
Nenue@14 140 TextColor = {1,1,1,1},
Nenue@14 141 Font = {textFont, textSize, textOutline},
Nenue@14 142 Spacing = textSpacing,
Nenue@10 143 },
Nenue@10 144 statusbg = {
Nenue@16 145 Gradient = { 'HORIZONTAL', MinColor = {0, .7, .6, 0}, MaxColor = {0, .7, .6, 0.23} },
Nenue@10 146 },
Nenue@10 147 },
Nenue@10 148 MouseDown = {
Nenue@10 149 title = {
Nenue@10 150 Font = {titleFont, titleSize, titleOutline},
Nenue@10 151 Spacing = titleSpacing,
Nenue@10 152 },
Nenue@10 153 titlebg = {
Nenue@16 154 Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, .4}, },
Nenue@10 155 },
Nenue@10 156 status = {
Nenue@10 157 Font = {textFont, textSize, textOutline},
Nenue@10 158 Spacing = textSpacing,
Nenue@10 159 },
Nenue@10 160 statusbg = {
Nenue@16 161 Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, .2}, },
Nenue@10 162 }
Nenue@10 163 },
Nenue@10 164 Complete = {
Nenue@10 165 title = {
Nenue@14 166 TextColor = {1,1,1,0.5},
Nenue@10 167 Font = {titleFont, titleSize, titleOutline}, Spacing = titleSpacing,
Nenue@10 168 },
Nenue@10 169 titlebg = {
Nenue@16 170 Gradient = {'HORIZONTAL', MinColor = {0, 1, 0, 0}, MaxColor = {0, 1, 0, 0.34}, },
Nenue@10 171 },
Nenue@10 172 status = {
Nenue@14 173 TextColor = {1,1,1,0.5},
Nenue@10 174 Font = {textFont, textSize, textOutline}, Spacing = textSpacing,
Nenue@10 175 },
Nenue@10 176 statusbg = {
Nenue@16 177 Gradient = {'HORIZONTAL', MinColor = {0, 1, 0, 0}, MaxColor = {0, 1, 0, .25}, },
Nenue@10 178 }
Nenue@10 179 },
Nenue@16 180 AutoQuest = {
Nenue@16 181 Normal = {
Nenue@16 182 titlebg = {
Nenue@16 183 Indent = 2,
Nenue@16 184 Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0}, MaxColor = {.7, 0, 0.9, .14}},
Nenue@16 185 },
Nenue@16 186 title = {
Nenue@16 187 TextColor = {1,1,1,1},
Nenue@16 188 Font = {titleFont, titleSize, titleOutline},
Nenue@16 189 Spacing = titleSpacing,
Nenue@16 190 },
Nenue@16 191 status = {
Nenue@16 192 TextColor = {0,1,0,1},
Nenue@16 193 Font = {textFont, textSize, textOutline},
Nenue@16 194 Spacing = textSpacing,
Nenue@16 195 },
Nenue@16 196 statusbg = {
Nenue@16 197 Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0}, MaxColor = {.7, 0, 0.9, .11}},
Nenue@16 198 }
Nenue@16 199 },
Nenue@16 200 },
Nenue@16 201 Cheevs = {
Nenue@10 202 Normal = {
Nenue@10 203
Nenue@10 204 title = {
Nenue@10 205 Font = {titleFont, titleSize, titleOutline},
Nenue@10 206 Spacing = titleSpacing,
Nenue@10 207 },
Nenue@10 208 titlebg = {
Nenue@16 209 Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0.45}, MaxColor = {.7, 0, 0.9, .19}},
Nenue@10 210
Nenue@10 211 },
Nenue@10 212 status = {
Nenue@10 213 Font = {textFont, textSize, textOutline},
Nenue@10 214 Spacing = textSpacing,
Nenue@10 215 },
Nenue@10 216 statusbg = {
Nenue@16 217 Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0.25}, MaxColor = {.7, 0, 0.9, .12}},
Nenue@10 218 },
Nenue@10 219 },
Nenue@10 220 Complete = {
Nenue@10 221 title = {
Nenue@10 222 Font = {titleFont, titleSize, titleOutline},
Nenue@10 223 Spacing = titleSpacing,
Nenue@10 224 },
Nenue@10 225 titlebg = {
Nenue@16 226 Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0.45}, MaxColor = {.7, 0, 0.9, .19}},
Nenue@10 227 },
Nenue@10 228 status = {
Nenue@10 229 Font = {textFont, textSize, textOutline},
Nenue@10 230 Spacing = textSpacing,
Nenue@10 231 },
Nenue@10 232 statusbg = {
Nenue@16 233 Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0.25}, MaxColor = {.7, 0, 0.9, .12}},
Nenue@10 234 },
Nenue@10 235 },
Nenue@10 236 }
Nenue@10 237 }
Nenue@10 238 }
Nenue@10 239
Nenue@10 240 local style_cache_func = {}
Nenue@10 241 local block_vars = {
Nenue@10 242 ['titleSize'] = {'titleWidth', 'titleHeight'},
Nenue@10 243 ['FrameSize'] = {'width', 'height'}
Nenue@10 244 }
Nenue@10 245 local attrib_vars = {
Nenue@10 246 ['Font'] = {'height'},
Nenue@10 247 }
Nenue@10 248
Nenue@10 249 mod.BlockStyleCache = {}
Nenue@10 250 local style_cache = mod.BlockStyleCache
Nenue@10 251 mod.regions = {}
Nenue@10 252 mod.regionStyles = {}
Nenue@10 253 mod.SetBlockStyle = function(frame, frameType, ...)
Nenue@10 254 -- var names intended to reflect argument order
Nenue@16 255 print('|cFFFFFF00'..frame:GetName()..'|r', frameType, ...)
Nenue@10 256 --@debug@
Nenue@10 257 local c = mod.defaults.Normal
Nenue@10 258 local style_list = {... }
Nenue@10 259 local styleName = frameType .. '-' .. table.concat(style_list,'')
Nenue@16 260 local previousClass = mod.Conf.Style[frameType]
Nenue@10 261
Nenue@10 262 if not style_cache[styleName] then
Nenue@10 263 local style = {}
Nenue@10 264
Nenue@10 265 if mod.defaults.Style[frameType] then
Nenue@10 266 print(' setting style class |cFF00FFFF'..frameType)
Nenue@10 267 else
Nenue@10 268 print(' resorting to class Normal (missing |cFFFF8800'.. frameType..'|r)')
Nenue@10 269 end
Nenue@10 270 local normal = mod.defaults.Style.Normal
Nenue@10 271 local root = mod.defaults.Style[frameType] or normal
Nenue@10 272 for i, className in ipairs(style_list) do
Nenue@16 273 local class = normal
Nenue@16 274 if previousClass and previousClass[className] then
Nenue@16 275 class = previousClass[className]
Nenue@16 276 print(' ChildClass |cFFFF0088'.. className .. '|r')
Nenue@16 277 elseif root[className] then
Nenue@16 278 class = root[className]
Nenue@10 279 print(' SubClass |cFF0088FF'.. className .. '|r')
Nenue@10 280 elseif normal[className] then
Nenue@16 281 class = normal[className]
Nenue@10 282 print(' SubClass Normal.|cFFFF0088'..className..'|r')
Nenue@10 283 else
Nenue@16 284 print(' SubClass not found '..className..'')
Nenue@10 285 end
Nenue@16 286 previousClass = class
Nenue@16 287
Nenue@10 288 for elementName, element in pairs(class) do
Nenue@10 289 if not elementName:match('^%u') then
Nenue@10 290 print(' scanning Element |cFF8800FF'.. elementName ..'|r')
Nenue@10 291 if not style[elementName] then
Nenue@10 292 style[elementName] = {}
Nenue@10 293 end
Nenue@10 294 for key, value in pairs(element) do
Nenue@10 295 if mod.SetBlockAttribute[key] then
Nenue@10 296 print(' |cFF00FF00'..elementName..'|r.|cFF00FFFF'..key..' =', (type(value) == 'table' and ('{'..table.concat(value,', ')..'}') or tostring(value)))
Nenue@10 297 style[elementName][key] = value
Nenue@10 298 end
Nenue@10 299
Nenue@10 300 end
Nenue@10 301 end
Nenue@10 302
Nenue@10 303 end
Nenue@10 304 end
Nenue@10 305
Nenue@10 306 for k, elements in pairs(mod.defaults.Style.Normal) do
Nenue@10 307 if not style[k] and type(elements) ~= 'table' then
Nenue@10 308 style[k] = elements
Nenue@10 309 end
Nenue@10 310 end
Nenue@10 311
Nenue@10 312
Nenue@10 313 print('result for: ', frame:GetName())
Nenue@10 314 for k,v in pairs(style) do
Nenue@10 315 if type(v) == 'table' and not k:match('^%u') then
Nenue@10 316 for kk, vv in pairs(v) do
Nenue@16 317 print(' |cFFFFFF00'..k..'|r.|cFF00FF00'..kk..'|r =', (type(vv) == 'table' and ('{'..table.concat(vv,', ')..'}') or tostring(vv)))
Nenue@10 318 end
Nenue@10 319 else
Nenue@10 320 print(' |cFFFFFFFF' .. k ..'|r =', tostring(v))
Nenue@10 321 end
Nenue@10 322 end
Nenue@10 323 style_cache[styleName] = style
Nenue@10 324 end
Nenue@10 325
Nenue@10 326 local style = style_cache[styleName]
Nenue@10 327
Nenue@10 328 if not style_cache_func[styleName] then
Nenue@10 329 local code =
Nenue@10 330 "return function (frame)\n"..
Nenue@10 331 " local func = Veneer.ObjectiveTracker.SetBlockAttribute\n"..
Nenue@11 332 " local cache = Veneer.ObjectiveTracker.BlockStyleCache"
Nenue@11 333 --.. " print('CacheFunc', '|cFFFFFF00SET|r "..styleName.." |cFFFFFF00ON|r', frame:GetName()) "
Nenue@10 334
Nenue@10 335 for elementName, styleset in pairs(style) do
Nenue@10 336 code = code ..
Nenue@10 337 "\n if frame['"..elementName.."'] then"
Nenue@10 338
Nenue@10 339 for attributeName, value in pairs(styleset) do
Nenue@10 340 if mod.SetBlockAttribute[attributeName] then
Nenue@16 341 print(' add function '..elementName..':'.. attributeName ..'(', (type(value) == 'table' and ('{'..table.concat(value,', ')..'}') or tostring(value)), ')')
Nenue@10 342
Nenue@10 343
Nenue@10 344 --mod.SetBlockAttribute[attributeName](region, value)
Nenue@11 345 code = code
Nenue@11 346 --.. "\n print('CacheFunc', ' applying', '|cFF00FFFF" .. attributeName .. "|r to', '|cFF0088FF"..elementName.."|r', cache['"..styleName.."']['"..elementName.."']['".. attributeName .."'])"
Nenue@11 347 .. "\n\n func['" .. attributeName .. "'](frame['"..elementName.."'],"..
Nenue@10 348 " cache['"..styleName.."']['"..elementName.."']['".. attributeName .."'])"
Nenue@10 349
Nenue@10 350 --- Set any frame.blah variables used in Updates
Nenue@10 351 if block_vars[elementName .. attributeName] then
Nenue@10 352 print('|cFF008800BVar|r', elementName..attributeName)
Nenue@10 353 for i, blockKey in ipairs(block_vars[elementName .. attributeName]) do
Nenue@10 354 print(' assigning |cFF008800'..blockKey..'|r')
Nenue@10 355 frame[blockKey] = (type(value) == 'table') and value[i] or value
Nenue@10 356 end
Nenue@10 357 end
Nenue@10 358
Nenue@10 359 end
Nenue@10 360 end
Nenue@10 361 code = code ..
Nenue@10 362 "\n else"..
Nenue@11 363 --"\n print('CacheFunc', ' |cFFFF4400missing', frame:GetName()..'."..elementName.."')"..
Nenue@10 364 "\n end"
Nenue@10 365 end
Nenue@10 366 code = code .. "\nend"
Nenue@10 367 local result = assert(loadstring(code))
Nenue@10 368 print('storing style func', styleName, result())
Nenue@10 369 style_cache_func[styleName] = result()
Nenue@10 370
Nenue@10 371 end
Nenue@10 372 style_cache_func[styleName](frame)
Nenue@10 373
Nenue@13 374 --- Hardcoding the sizing vars for sanity
Nenue@13 375 local normalSettings = mod.defaults.Style.Format
Nenue@13 376 frame.width = normalSettings.Frame.Width
Nenue@13 377 frame.statusWidth = frame.width - normalSettings.status.Indent
Nenue@13 378 frame.titleWidth = frame.width - normalSettings.title.Indent
Nenue@10 379
Nenue@10 380 if frame.title then
Nenue@18 381 frame.titleHeight = frame.title and (frame.title:GetStringHeight() + (frame.title.spacing or 0)*2) or 0
Nenue@18 382 frame.title.spacing = frame.title.spacing or frame.title:GetSpacing()
Nenue@13 383 frame.title:SetPoint('LEFT', frame, 'LEFT', normalSettings.title.Indent)
Nenue@17 384 frame.title:SetPoint('TOP', frame, 'TOP', 0, -frame.title.spacing)
Nenue@16 385 frame.title:SetWidth(frame.width)
Nenue@10 386 if frame.titlebg then
Nenue@18 387 frame.titlebg:SetHeight(frame.titleHeight)
Nenue@10 388 frame.titlebg:SetWidth(frame.width)
Nenue@10 389 end
Nenue@18 390 print(' title, textHeight', frame.titleHeight, 'indent', normalSettings.title.Indent, 'spacing', frame.title.spacing)
Nenue@18 391 else
Nenue@18 392 frame.titleHeight = 0
Nenue@10 393 end
Nenue@18 394
Nenue@18 395 if frame.status then
Nenue@18 396 frame.statusHeight = frame.status and (frame.status:GetStringHeight() + (frame.status.spacing or 0)*2) or 0
Nenue@18 397 frame.status.spacing = frame.status.spacing or frame.status:GetSpacing()
Nenue@18 398 frame.status:SetWidth(frame.width)
Nenue@18 399 frame.status:SetPoint('LEFT', frame, 'LEFT', normalSettings.status.Indent, 0)
Nenue@18 400 frame.status:SetPoint('TOPLEFT', frame.titlebg, 'BOTTOMLEFT', normalSettings.status.Indent, -frame.status.spacing)
Nenue@18 401 --frame.status:SetHeight(frame.statusHeight)
Nenue@18 402 if frame.statusbg then
Nenue@18 403
Nenue@18 404 frame.statusbg:SetHeight(frame.statusHeight)
Nenue@18 405 frame.statusbg:SetWidth(frame.width)
Nenue@18 406 end
Nenue@18 407 print(' status, textHeight', frame.statusHeight, 'indent', normalSettings.status.Indent, 'spacing', frame.status.spacing)
Nenue@18 408 else
Nenue@18 409 frame.statusHeight = 0
Nenue@18 410 end
Nenue@18 411
Nenue@18 412 frame.height = frame.titleHeight + frame.statusHeight + (frame.attachmentHeight or 0)
Nenue@14 413 frame:SetSize(frame.width, frame.height)
Nenue@18 414 print(' sizing frame', frame.width, frame.height)
Nenue@10 415 end
Nenue@14 416 mod.UpdateWrapperStyle = function()
Nenue@14 417 local c = mod.Conf.Wrapper
Nenue@14 418 --Wrapper:ClearAllPoints()
Nenue@14 419 --Wrapper:SetPoint(c.WrapperPoint, UIParent, c.WrapperPoint, c.WrapperFloatX, c.WrapperFloatY)
Nenue@14 420 end
Nenue@14 421
Nenue@10 422 --- Argument containers
Nenue@14 423 local o -- text flag
Nenue@14 424 local a1, a2, a3, a4, b1, b2, b3, b4 -- color1, color2
Nenue@14 425 local f1, f2, f3 -- font
Nenue@14 426 local w1, w2 -- size
Nenue@14 427 local p1, p2, p3, x, y -- path/point args
Nenue@10 428 mod.SetBlockAttribute = {}
Nenue@10 429 local sb = mod.SetBlockAttribute
Nenue@10 430 local print = B.print('Attribute')
Nenue@10 431 sb.Gradient = function(region, value)
Nenue@10 432 print('|cFF8844FFGradient|r', region:GetName(), unpack(value))
Nenue@16 433 o = value[1]
Nenue@10 434 a1, a2, a3, a4 = unpack(value.MinColor)
Nenue@10 435 b1, b2, b3, b4 = unpack(value.MaxColor)
Nenue@10 436 region:SetVertexColor(1,1,1)
Nenue@10 437 region:SetTexture(1,1,1,1)
Nenue@10 438 region:SetGradientAlpha(o, a1, a2, a3, a4, b1, b2, b3, b4)
Nenue@10 439 end
Nenue@10 440
Nenue@10 441 sb.Background = function(region, value)
Nenue@10 442 print('|cFF0088FFBackground|r', unpack(value))
Nenue@10 443 region:SetVertexColor(1,1,1) -- reset
Nenue@10 444 region:SetTexture(unpack(value))
Nenue@10 445 end
Nenue@10 446 sb.BackgroundComplex = function (region, value)
Nenue@10 447 local left, tile, right = value.Left, value.Tile, value.Right
Nenue@10 448
Nenue@10 449 end
Nenue@10 450 sb.Font = function(region, value)
Nenue@10 451 f1, f2, f3 = unpack(value)
Nenue@10 452 print('|cFFFFFF00Font|r', f1, f2, f3)
Nenue@10 453 region:SetFont(f1, f2, f3)
Nenue@10 454 end
Nenue@10 455
Nenue@10 456 sb.Spacing = function(region, value)
Nenue@14 457 print('FontSpacing', region:GetName(), value)
Nenue@10 458 region:SetSpacing(value)
Nenue@10 459 region.spacing = value
Nenue@10 460 end
Nenue@10 461
Nenue@10 462 sb.TextColor = function(region, value)
Nenue@10 463 a1, a2, a3, a4 = unpack(value)
Nenue@10 464 print('TextColor', a1, a2, a3, a4)
Nenue@10 465 region:SetTextColor(a1, a2, a3, a4)
Nenue@10 466 end
Nenue@10 467 sb.Texture = function(region, value)
Nenue@10 468
Nenue@10 469 p1, a1, a2, a3, a4 = unpack(value)
Nenue@10 470 print('Texture', p1, a1, a2, a3, a4)
Nenue@10 471 region:SetTexture(p1)
Nenue@10 472 if a1 then
Nenue@10 473 region:SetTexCoord(a1, a2, a3, a4)
Nenue@10 474 end
Nenue@10 475 end
Nenue@10 476 sb.Width = function(region, value)
Nenue@10 477 w1 = value
Nenue@10 478 region:SetWidth(w1)
Nenue@10 479 end
Nenue@10 480
Nenue@10 481 sb.Height = function(region, value)
Nenue@10 482 w2 = value
Nenue@10 483 region:SetHeight(w2)
Nenue@10 484 end
Nenue@10 485 sb.Size = function(region, value)
Nenue@10 486 w1, w2 = unpack(value)
Nenue@10 487 region:SetSize(w1, w2)
Nenue@14 488 end
Nenue@14 489