annotate ObjectiveStyle.lua @ 13:9455693fc290

Init - recall XML display state on reload ObjectiveFrame - quest coloring by relative level - quest coloring by daily/weekly/complete status - remember starting scroll value between reload - limit anchor points to edges for regions affected by style attributes ObjectiveInfo - AutoQuest outline definitions - Pull Quest title and tag data in addition to WatchInfo ObjectiveStyle - ensure consistent style table - hardcode certain attributes for sanity XML - ensure consistent naming conventions for heading and content elements - ensure hardcore anchors are based on edges - expansion of file structure to deal with complexities of dynamic widgets and style caching ObjectiveUI - determine primary style by block handler when restoring original style - moved framescript to 'ObjectiveWidgets' lua
author Nenue
date Sat, 02 Apr 2016 17:46:52 -0400
parents fb80e365bab3
children ed642234f017
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 itemButtonSize, itemButtonSpacing = 36, 1
Nenue@10 9 local wrapperPosition = {'RIGHT', UIParent, 'RIGHT', -84, 0}
Nenue@10 10 local titleFont, textFont = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Regular.ttf]]
Nenue@10 11 local titleSize, textSize = 15, 15
Nenue@10 12 local titleOutline, textOutline = "OUTLINE", "OUTLINE"
Nenue@10 13 local titleSpacing, textSpacing = 4, 3
Nenue@13 14 local unpack, type, pairs, tconcat = unpack, type, pairs, table.concat
Nenue@10 15 local wrapperMaxWidth, wrapperMaxHeight = 280, 490 -- these are the hard bounds, actual *Height variables are changed
Nenue@10 16 local wrapperHeadFont, wrapperHeadSize, wrapperHeadOutline = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], 16, 'NONE'
Nenue@10 17 local headerFont, headerSize, headerHeight = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], 18, 24
Nenue@10 18 local headerOutline, headerColor, headerSpacing = 'OUTLINE', {1,1,1,1}, 2
Nenue@10 19
Nenue@13 20
Nenue@10 21 mod.defaults.ObjectiveWrapper = {
Nenue@10 22 ObjectiveTrackerFloat = {'BOTTOM', 'RIGHT'},
Nenue@10 23 ObjectiveTrackerParent = 'DebuffButton',
Nenue@10 24 ObjectiveTrackerSize = {250, 600},
Nenue@10 25 ObjectiveWrapperParent = '',
Nenue@10 26 }
Nenue@10 27 mod.defaults.Style = {
Nenue@13 28 Format = {
Nenue@13 29 Frame = {
Nenue@13 30 Width = 270,
Nenue@13 31 },
Nenue@13 32 title = {
Nenue@13 33 Indent = 0
Nenue@13 34 },
Nenue@13 35 status = {
Nenue@13 36 Indent = 5
Nenue@13 37 }
Nenue@13 38 },
Nenue@13 39 FontBank = {
Nenue@10 40 ['Normal'] = _G.VeneerCriteriaFontNormal,
Nenue@10 41 ['Progress'] = _G.VeneerCriteriaFontProgress,
Nenue@10 42 ['Complete'] = _G.VeneerCriteriaFontComplete,
Nenue@10 43 ['Failed'] = _G.VeneerCriteriaFontFailed,
Nenue@10 44 },
Nenue@10 45 Normal = {
Nenue@10 46 title = {
Nenue@10 47 TextColor = {1, 1, 1, 1},
Nenue@10 48 Width = 270,
Nenue@10 49 },
Nenue@10 50 titlebg = {
Nenue@10 51 Background = {0, 0, 0, 1},
Nenue@10 52 Width = 270,
Nenue@10 53 },
Nenue@10 54 status = {
Nenue@10 55 Width = 270,
Nenue@10 56 },
Nenue@10 57 statusbg = {
Nenue@10 58 Width = 270,
Nenue@10 59 },
Nenue@10 60 Frame = {
Nenue@10 61 Width = 270,
Nenue@10 62 }
Nenue@10 63 },
Nenue@10 64 Wrapper = {
Nenue@10 65 Frame = {
Nenue@10 66 Point = {wrapperPosition},
Nenue@10 67 MaxSize = {wrapperMaxWidth, wrapperMaxHeight},
Nenue@10 68 BackgroundComplex = {Left = {'', 0, 0.4, 0,1, 100}, Right={'', 0.6,1,0,1}, Tile = {'', 0.4,.6,0,1, 100}}, },
Nenue@10 69 title = {
Nenue@10 70 Font = {wrapperHeadFont, wrapperHeadSize, wrapperHeadOutline},
Nenue@10 71 Spacing = 4,}
Nenue@10 72 },
Nenue@10 73 Tracker = {
Nenue@10 74 Normal = {
Nenue@10 75 title = {
Nenue@10 76 Font = {headerFont, headerSize, headerOutline}, Spacing = headerSpacing,
Nenue@10 77 },
Nenue@10 78 titlebg = {
Nenue@10 79 Gradient = {MinColor = {0,0,0,0.7}, MaxColor = {0,0,0,.35}},
Nenue@10 80 }
Nenue@10 81 }
Nenue@10 82 },
Nenue@10 83 TrackerBlock = {
Nenue@10 84 Normal = {
Nenue@10 85 titlebg = {
Nenue@10 86 Gradient = { MinColor = {0.2, .4, 1, 0.45}, MaxColor = {.7, 0, 0.9, .19}},
Nenue@10 87 },
Nenue@10 88 title = {
Nenue@10 89 Font = {titleFont, titleSize, titleOutline},
Nenue@10 90 Spacing = titleSpacing,
Nenue@10 91 },
Nenue@10 92 status = {
Nenue@10 93 Font = {textFont, textSize, textOutline}, Spacing = textSpacing,
Nenue@10 94 },
Nenue@10 95 statusbg = {
Nenue@10 96 Gradient = { MinColor = {0.2, .4, 1, 0.25}, MaxColor = {.7, 0, 0.9, .12}},
Nenue@10 97 }
Nenue@10 98 },
Nenue@10 99 Super = {
Nenue@10 100 title = {
Nenue@10 101 Font = {titleFont, titleSize, titleOutline},
Nenue@10 102 Spacing = titleSpacing, BackgroundFullWidth = true
Nenue@10 103 },
Nenue@10 104 titlebg = {
Nenue@10 105 Gradient = { MinColor = {0, .7, .6, .8}, MaxColor = {0, .7, .6, 0.2}},
Nenue@10 106 },
Nenue@10 107 status = {
Nenue@10 108 Font = {textFont, textSize, textOutline}, Spacing = textSpacing,
Nenue@10 109 },
Nenue@10 110 statusbg = {
Nenue@10 111 Gradient = { MinColor = {0, .7, .6, 0.5}, MaxColor = {0, .7, .6, 0.1} },
Nenue@10 112 },
Nenue@10 113 },
Nenue@10 114 MouseDown = {
Nenue@10 115 title = {
Nenue@10 116 Font = {titleFont, titleSize, titleOutline},
Nenue@10 117 Spacing = titleSpacing,
Nenue@10 118 },
Nenue@10 119 titlebg = {
Nenue@10 120 Gradient = { MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, .4}, },
Nenue@10 121 },
Nenue@10 122 status = {
Nenue@10 123 Font = {textFont, textSize, textOutline},
Nenue@10 124 Spacing = textSpacing,
Nenue@10 125 },
Nenue@10 126 statusbg = {
Nenue@10 127 Gradient = { MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, .2}, },
Nenue@10 128 }
Nenue@10 129 },
Nenue@10 130 Complete = {
Nenue@10 131 title = {
Nenue@10 132 Font = {titleFont, titleSize, titleOutline}, Spacing = titleSpacing,
Nenue@10 133 },
Nenue@10 134 titlebg = {
Nenue@10 135 Gradient = { MinColor = {0, 1, 0, 0.34}, MaxColor = {0, 1, 0, .17}, },
Nenue@10 136 },
Nenue@10 137 status = {
Nenue@10 138 Font = {textFont, textSize, textOutline}, Spacing = textSpacing,
Nenue@10 139 },
Nenue@10 140 statusbg = {
Nenue@10 141 Gradient = { MinColor = {0, 1, 0, .25}, MaxColor = {0, 1, 0, 0.12}, },
Nenue@10 142 }
Nenue@10 143 },
Nenue@13 144 Daily = {
Nenue@13 145 titlebg = {
Nenue@13 146 Gradient = { MinColor = {0, .4, 1, 0.34}, MaxColor = {0, 0.4, 1, .17}, },
Nenue@13 147 },
Nenue@13 148 statusbg = {
Nenue@13 149 Gradient = { MinColor = {0, .4, 1, 0.25}, MaxColor = {0, 0.4, 1, .12}, },
Nenue@13 150 },
Nenue@13 151 },
Nenue@10 152 Cheev = {
Nenue@10 153 Normal = {
Nenue@10 154
Nenue@10 155 title = {
Nenue@10 156 Font = {titleFont, titleSize, titleOutline},
Nenue@10 157 Spacing = titleSpacing,
Nenue@10 158 },
Nenue@10 159 titlebg = {
Nenue@10 160 Gradient = { MinColor = {0.2, .4, 1, 0.45}, MaxColor = {.7, 0, 0.9, .19}},
Nenue@10 161
Nenue@10 162 },
Nenue@10 163 status = {
Nenue@10 164 Font = {textFont, textSize, textOutline},
Nenue@10 165 Spacing = textSpacing,
Nenue@10 166 },
Nenue@10 167 statusbg = {
Nenue@10 168 Gradient = { MinColor = {0.2, .4, 1, 0.25}, MaxColor = {.7, 0, 0.9, .12}},
Nenue@10 169 },
Nenue@10 170 },
Nenue@10 171 Complete = {
Nenue@10 172 title = {
Nenue@10 173 Font = {titleFont, titleSize, titleOutline},
Nenue@10 174 Spacing = titleSpacing,
Nenue@10 175 },
Nenue@10 176 titlebg = {
Nenue@10 177 Gradient = { MinColor = {0.2, .4, 1, 0.45}, MaxColor = {.7, 0, 0.9, .19}},
Nenue@10 178 },
Nenue@10 179 status = {
Nenue@10 180 Font = {textFont, textSize, textOutline},
Nenue@10 181 Spacing = textSpacing,
Nenue@10 182 },
Nenue@10 183 statusbg = {
Nenue@10 184 Gradient = { MinColor = {0.2, .4, 1, 0.25}, MaxColor = {.7, 0, 0.9, .12}},
Nenue@10 185 },
Nenue@10 186 },
Nenue@10 187 }
Nenue@10 188 }
Nenue@10 189 }
Nenue@10 190
Nenue@10 191 local style_cache_func = {}
Nenue@10 192 local block_vars = {
Nenue@10 193 ['titleSize'] = {'titleWidth', 'titleHeight'},
Nenue@10 194 ['FrameSize'] = {'width', 'height'}
Nenue@10 195 }
Nenue@10 196 local attrib_vars = {
Nenue@10 197 ['Font'] = {'height'},
Nenue@10 198 }
Nenue@10 199
Nenue@10 200 mod.BlockStyleCache = {}
Nenue@10 201 local style_cache = mod.BlockStyleCache
Nenue@10 202 mod.regions = {}
Nenue@10 203 mod.regionStyles = {}
Nenue@10 204 mod.SetBlockStyle = function(frame, frameType, ...)
Nenue@10 205 -- var names intended to reflect argument order
Nenue@10 206 --@debug@
Nenue@10 207 local c = mod.defaults.Normal
Nenue@10 208 local style_list = {... }
Nenue@10 209 local styleName = frameType .. '-' .. table.concat(style_list,'')
Nenue@10 210
Nenue@10 211 if not style_cache[styleName] then
Nenue@10 212 local style = {}
Nenue@10 213
Nenue@10 214 if mod.defaults.Style[frameType] then
Nenue@10 215 print(' setting style class |cFF00FFFF'..frameType)
Nenue@10 216 else
Nenue@10 217 print(' resorting to class Normal (missing |cFFFF8800'.. frameType..'|r)')
Nenue@10 218 end
Nenue@10 219 local normal = mod.defaults.Style.Normal
Nenue@10 220 local root = mod.defaults.Style[frameType] or normal
Nenue@10 221 for i, className in ipairs(style_list) do
Nenue@10 222 local class = root[className] or normal[className] or root
Nenue@10 223 if root[className] then
Nenue@10 224
Nenue@10 225 print(' SubClass |cFF0088FF'.. className .. '|r')
Nenue@10 226 elseif normal[className] then
Nenue@10 227 print(' SubClass Normal.|cFFFF0088'..className..'|r')
Nenue@10 228 else
Nenue@10 229 print(' SubClass Normal')
Nenue@10 230 end
Nenue@10 231 for elementName, element in pairs(class) do
Nenue@10 232 if not elementName:match('^%u') then
Nenue@10 233 print(' scanning Element |cFF8800FF'.. elementName ..'|r')
Nenue@10 234 if not style[elementName] then
Nenue@10 235 style[elementName] = {}
Nenue@10 236 end
Nenue@10 237 for key, value in pairs(element) do
Nenue@10 238 if mod.SetBlockAttribute[key] then
Nenue@10 239 print(' |cFF00FF00'..elementName..'|r.|cFF00FFFF'..key..' =', (type(value) == 'table' and ('{'..table.concat(value,', ')..'}') or tostring(value)))
Nenue@10 240 style[elementName][key] = value
Nenue@10 241 end
Nenue@10 242
Nenue@10 243 end
Nenue@10 244 end
Nenue@10 245
Nenue@10 246 end
Nenue@10 247
Nenue@10 248 end
Nenue@10 249
Nenue@10 250 for k, elements in pairs(mod.defaults.Style.Normal) do
Nenue@10 251 if not style[k] and type(elements) ~= 'table' then
Nenue@10 252 style[k] = elements
Nenue@10 253 end
Nenue@10 254 end
Nenue@10 255
Nenue@10 256
Nenue@10 257 print('result for: ', frame:GetName())
Nenue@10 258 for k,v in pairs(style) do
Nenue@10 259 if type(v) == 'table' and not k:match('^%u') then
Nenue@10 260 for kk, vv in pairs(v) do
Nenue@10 261 print(' |cFFFFFF00'..k..'|r.|cFF00FF00'..kk..'|r =', tostring(vv))
Nenue@10 262 end
Nenue@10 263 else
Nenue@10 264 print(' |cFFFFFFFF' .. k ..'|r =', tostring(v))
Nenue@10 265 end
Nenue@10 266 end
Nenue@10 267 style_cache[styleName] = style
Nenue@10 268 else
Nenue@10 269 print('Cache hit: ', styleName)
Nenue@10 270 end
Nenue@10 271
Nenue@10 272 local style = style_cache[styleName]
Nenue@10 273
Nenue@10 274 if not style_cache_func[styleName] then
Nenue@10 275 local code =
Nenue@10 276 "return function (frame)\n"..
Nenue@10 277 " local func = Veneer.ObjectiveTracker.SetBlockAttribute\n"..
Nenue@11 278 " local cache = Veneer.ObjectiveTracker.BlockStyleCache"
Nenue@11 279 --.. " print('CacheFunc', '|cFFFFFF00SET|r "..styleName.." |cFFFFFF00ON|r', frame:GetName()) "
Nenue@10 280
Nenue@10 281 for elementName, styleset in pairs(style) do
Nenue@10 282 code = code ..
Nenue@10 283 "\n if frame['"..elementName.."'] then"
Nenue@10 284
Nenue@10 285 for attributeName, value in pairs(styleset) do
Nenue@10 286 if mod.SetBlockAttribute[attributeName] then
Nenue@10 287 print(' '..elementName..':'.. attributeName ..'(', value, ')')
Nenue@10 288
Nenue@10 289
Nenue@10 290 --mod.SetBlockAttribute[attributeName](region, value)
Nenue@11 291 code = code
Nenue@11 292 --.. "\n print('CacheFunc', ' applying', '|cFF00FFFF" .. attributeName .. "|r to', '|cFF0088FF"..elementName.."|r', cache['"..styleName.."']['"..elementName.."']['".. attributeName .."'])"
Nenue@11 293 .. "\n\n func['" .. attributeName .. "'](frame['"..elementName.."'],"..
Nenue@10 294 " cache['"..styleName.."']['"..elementName.."']['".. attributeName .."'])"
Nenue@10 295
Nenue@10 296 --- Set any frame.blah variables used in Updates
Nenue@10 297 if block_vars[elementName .. attributeName] then
Nenue@10 298 print('|cFF008800BVar|r', elementName..attributeName)
Nenue@10 299 for i, blockKey in ipairs(block_vars[elementName .. attributeName]) do
Nenue@10 300 print(' assigning |cFF008800'..blockKey..'|r')
Nenue@10 301 frame[blockKey] = (type(value) == 'table') and value[i] or value
Nenue@10 302 end
Nenue@10 303 end
Nenue@10 304
Nenue@10 305 end
Nenue@10 306 end
Nenue@10 307 code = code ..
Nenue@10 308 "\n else"..
Nenue@11 309 --"\n print('CacheFunc', ' |cFFFF4400missing', frame:GetName()..'."..elementName.."')"..
Nenue@10 310 "\n end"
Nenue@10 311 end
Nenue@10 312 code = code .. "\nend"
Nenue@10 313 local result = assert(loadstring(code))
Nenue@10 314 print('storing style func', styleName, result())
Nenue@10 315 style_cache_func[styleName] = result()
Nenue@10 316
Nenue@10 317 else
Nenue@10 318 print('Cache function hit:', styleName)
Nenue@10 319 end
Nenue@10 320 style_cache_func[styleName](frame)
Nenue@10 321
Nenue@13 322 --- Hardcoding the sizing vars for sanity
Nenue@13 323 local normalSettings = mod.defaults.Style.Format
Nenue@10 324 frame.titleHeight = frame.title and (frame.title:GetStringHeight() + frame.title.spacing*2) or 0
Nenue@10 325 frame.statusHeight = frame.status and (frame.status:GetStringHeight() + frame.status.spacing*2 + frame.attachmentHeight) or 0
Nenue@10 326 frame.height = frame.titleHeight + frame.statusHeight
Nenue@13 327 frame.width = normalSettings.Frame.Width
Nenue@13 328 frame.statusWidth = frame.width - normalSettings.status.Indent
Nenue@13 329 frame.titleWidth = frame.width - normalSettings.title.Indent
Nenue@10 330
Nenue@10 331 if frame.status then
Nenue@13 332 print('status ', frame.statusHeight, normalSettings.status.Indent, 0)
Nenue@13 333 frame.status:SetPoint('LEFT', frame, 'LEFT', normalSettings.status.Indent, 0)
Nenue@10 334 frame.status:SetHeight(frame.statusHeight)
Nenue@10 335 if frame.statusbg then
Nenue@10 336
Nenue@10 337 print('statusbg', frame.statusHeight)
Nenue@10 338 frame.statusbg:SetHeight(frame.statusHeight)
Nenue@10 339 frame.statusbg:SetWidth(frame.width)
Nenue@10 340 end
Nenue@10 341 end
Nenue@10 342 if frame.title then
Nenue@13 343 print('title ',frame.titleHeight, normalSettings.title.Indent)
Nenue@13 344 frame.title:SetPoint('LEFT', frame, 'LEFT', normalSettings.title.Indent)
Nenue@10 345 frame.title:SetHeight(frame.titleHeight)
Nenue@10 346 if frame.titlebg then
Nenue@10 347 print('titlebg',frame.titleHeight)
Nenue@10 348 frame.titlebg:SetHeight(frame.titleHeight)
Nenue@10 349 frame.titlebg:SetWidth(frame.width)
Nenue@10 350 end
Nenue@10 351 end
Nenue@10 352 print('sizing frame', frame.width, frame.height)
Nenue@10 353 frame:SetSize(frame.width, frame.height)
Nenue@10 354 print(frame:GetSize())
Nenue@10 355 --[[
Nenue@10 356 local titleSpacing, titleSpacing2 = c.Title.Spacing, (c.Title.Spacing * 2)
Nenue@10 357 local textSpacing, textSpacing2 = c.Text.Spacing, (c.Text.Spacing * 2)
Nenue@10 358
Nenue@10 359 block.title:SetSpacing(titleSpacing)
Nenue@10 360 block.objectives:SetSpacing(textSpacing)
Nenue@10 361 block.objectives:SetWordWrap(true)
Nenue@10 362
Nenue@10 363 local titleHeight, textHeight = block.title:GetStringHeight(), block.objectives:GetStringHeight() + block.attachmentHeight
Nenue@10 364 local blockHeight = titleHeight + titleSpacing2 + textHeight + textSpacing2
Nenue@10 365 local blockWidth = wrapperMaxWidth
Nenue@10 366
Nenue@10 367 block.titlebg:SetSize(min(w1, w2), titleHeight + titleSpacing2)
Nenue@10 368 block.bg:SetSize(w1, textHeight + textSpacing2)
Nenue@10 369 block:SetSize(blockWidth, blockHeight)
Nenue@10 370
Nenue@10 371 block.title:SetPoint('TOPLEFT', block.titlebg, 'TOPLEFT', 0, -titleSpacing)
Nenue@10 372 block.objectives:SetPoint('TOPLEFT', block.titlebg, 'BOTTOMLEFT', textIndent, -textSpacing)
Nenue@10 373
Nenue@10 374 -- store
Nenue@10 375 block.titleHeight = titleHeight
Nenue@10 376 block.textHeight = textHeight
Nenue@10 377 block.width = blockWidth
Nenue@10 378 block.height = blockHeight
Nenue@10 379 --]]
Nenue@10 380 --print(' |cFF00FFFF'..block:GetName()..'|r:|cFF0088FFSetStyle|r(', blockWidth, 'x', blockHeight, '(textH', textHeight,', titleH', titleHeight, ')')
Nenue@10 381 end
Nenue@10 382
Nenue@10 383 --- Argument containers
Nenue@10 384 local o = "" -- text flag
Nenue@10 385 local a1, a2, a3, a4, b1, b2, b3, b4 = 0,0,0,1, 0,0,0,1 -- color1, color2
Nenue@10 386 local f1, f2, f3 = "", 0, "" -- font
Nenue@10 387 local w1, w2 = 0, 0 -- size
Nenue@10 388 local p1, p2, p3, x, y = "", "", "", 0, 0 -- path/point args
Nenue@10 389 mod.SetBlockAttribute = {}
Nenue@10 390 local sb = mod.SetBlockAttribute
Nenue@10 391 local print = B.print('Attribute')
Nenue@10 392 sb.Gradient = function(region, value)
Nenue@10 393 print('|cFF8844FFGradient|r', region:GetName(), unpack(value))
Nenue@10 394 o = 'HORIZONTAL'
Nenue@10 395 a1, a2, a3, a4 = unpack(value.MinColor)
Nenue@10 396 b1, b2, b3, b4 = unpack(value.MaxColor)
Nenue@10 397 region:SetVertexColor(1,1,1)
Nenue@10 398 region:SetTexture(1,1,1,1)
Nenue@10 399 region:SetGradientAlpha(o, a1, a2, a3, a4, b1, b2, b3, b4)
Nenue@10 400 end
Nenue@10 401
Nenue@10 402 sb.Background = function(region, value)
Nenue@10 403 print('|cFF0088FFBackground|r', unpack(value))
Nenue@10 404 region:SetVertexColor(1,1,1) -- reset
Nenue@10 405 region:SetTexture(unpack(value))
Nenue@10 406 end
Nenue@10 407 sb.BackgroundComplex = function (region, value)
Nenue@10 408 local left, tile, right = value.Left, value.Tile, value.Right
Nenue@10 409
Nenue@10 410 end
Nenue@10 411 sb.Font = function(region, value)
Nenue@10 412 f1, f2, f3 = unpack(value)
Nenue@10 413 print('|cFFFFFF00Font|r', f1, f2, f3)
Nenue@10 414 region:SetFont(f1, f2, f3)
Nenue@10 415 end
Nenue@10 416
Nenue@10 417 sb.Spacing = function(region, value)
Nenue@10 418 print('FontSpacing', value)
Nenue@10 419 region:SetSpacing(value)
Nenue@10 420 region.spacing = value
Nenue@10 421 end
Nenue@10 422
Nenue@10 423 sb.TextColor = function(region, value)
Nenue@10 424 a1, a2, a3, a4 = unpack(value)
Nenue@10 425 print('TextColor', a1, a2, a3, a4)
Nenue@10 426 region:SetTextColor(a1, a2, a3, a4)
Nenue@10 427 end
Nenue@10 428 sb.Texture = function(region, value)
Nenue@10 429
Nenue@10 430 p1, a1, a2, a3, a4 = unpack(value)
Nenue@10 431 print('Texture', p1, a1, a2, a3, a4)
Nenue@10 432 region:SetTexture(p1)
Nenue@10 433 if a1 then
Nenue@10 434 region:SetTexCoord(a1, a2, a3, a4)
Nenue@10 435 end
Nenue@10 436 end
Nenue@10 437 sb.Width = function(region, value)
Nenue@10 438 w1 = value
Nenue@10 439 region:SetWidth(w1)
Nenue@10 440 end
Nenue@10 441
Nenue@10 442 sb.Height = function(region, value)
Nenue@10 443 w2 = value
Nenue@10 444 region:SetHeight(w2)
Nenue@10 445 end
Nenue@10 446 sb.Size = function(region, value)
Nenue@10 447 w1, w2 = unpack(value)
Nenue@10 448 region:SetSize(w1, w2)
Nenue@10 449 end