annotate ObjectiveStyle.lua @ 20:6bd2102d340b

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