comparison 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
comparison
equal deleted inserted replaced
12:8238cddaddb1 13:9455693fc290
9 local wrapperPosition = {'RIGHT', UIParent, 'RIGHT', -84, 0} 9 local wrapperPosition = {'RIGHT', UIParent, 'RIGHT', -84, 0}
10 local titleFont, textFont = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Regular.ttf]] 10 local titleFont, textFont = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Regular.ttf]]
11 local titleSize, textSize = 15, 15 11 local titleSize, textSize = 15, 15
12 local titleOutline, textOutline = "OUTLINE", "OUTLINE" 12 local titleOutline, textOutline = "OUTLINE", "OUTLINE"
13 local titleSpacing, textSpacing = 4, 3 13 local titleSpacing, textSpacing = 4, 3
14 local textIndent = 5 14 local unpack, type, pairs, tconcat = unpack, type, pairs, table.concat
15 local wrapperMaxWidth, wrapperMaxHeight = 280, 490 -- these are the hard bounds, actual *Height variables are changed 15 local wrapperMaxWidth, wrapperMaxHeight = 280, 490 -- these are the hard bounds, actual *Height variables are changed
16 local wrapperHeadFont, wrapperHeadSize, wrapperHeadOutline = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], 16, 'NONE' 16 local wrapperHeadFont, wrapperHeadSize, wrapperHeadOutline = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], 16, 'NONE'
17 local headerFont, headerSize, headerHeight = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], 18, 24 17 local headerFont, headerSize, headerHeight = [[Interface\Addons\SharedMedia_MyMedia\font\ArchivoNarrow-Bold.ttf]], 18, 24
18 local headerOutline, headerColor, headerSpacing = 'OUTLINE', {1,1,1,1}, 2 18 local headerOutline, headerColor, headerSpacing = 'OUTLINE', {1,1,1,1}, 2
19
19 20
20 mod.defaults.ObjectiveWrapper = { 21 mod.defaults.ObjectiveWrapper = {
21 ObjectiveTrackerFloat = {'BOTTOM', 'RIGHT'}, 22 ObjectiveTrackerFloat = {'BOTTOM', 'RIGHT'},
22 ObjectiveTrackerParent = 'DebuffButton', 23 ObjectiveTrackerParent = 'DebuffButton',
23 ObjectiveTrackerSize = {250, 600}, 24 ObjectiveTrackerSize = {250, 600},
24 ObjectiveWrapperParent = '', 25 ObjectiveWrapperParent = '',
25 } 26 }
26 mod.defaults.Style = { 27 mod.defaults.Style = {
27 FontBank = { 28 Format = {
29 Frame = {
30 Width = 270,
31 },
32 title = {
33 Indent = 0
34 },
35 status = {
36 Indent = 5
37 }
38 },
39 FontBank = {
28 ['Normal'] = _G.VeneerCriteriaFontNormal, 40 ['Normal'] = _G.VeneerCriteriaFontNormal,
29 ['Progress'] = _G.VeneerCriteriaFontProgress, 41 ['Progress'] = _G.VeneerCriteriaFontProgress,
30 ['Complete'] = _G.VeneerCriteriaFontComplete, 42 ['Complete'] = _G.VeneerCriteriaFontComplete,
31 ['Failed'] = _G.VeneerCriteriaFontFailed, 43 ['Failed'] = _G.VeneerCriteriaFontFailed,
32 }, 44 },
104 Font = {titleFont, titleSize, titleOutline}, 116 Font = {titleFont, titleSize, titleOutline},
105 Spacing = titleSpacing, 117 Spacing = titleSpacing,
106 }, 118 },
107 titlebg = { 119 titlebg = {
108 Gradient = { MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, .4}, }, 120 Gradient = { MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, .4}, },
109 BackgroundFullWidth = true,
110 }, 121 },
111 status = { 122 status = {
112 Font = {textFont, textSize, textOutline}, 123 Font = {textFont, textSize, textOutline},
113 Spacing = textSpacing, 124 Spacing = textSpacing,
114 }, 125 },
115 statusbg = { 126 statusbg = {
116 BackgroundFullWidth = true,
117 Gradient = { MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, .2}, }, 127 Gradient = { MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, .2}, },
118 } 128 }
119 }, 129 },
120 Complete = { 130 Complete = {
121 title = { 131 title = {
122 Font = {titleFont, titleSize, titleOutline}, Spacing = titleSpacing, 132 Font = {titleFont, titleSize, titleOutline}, Spacing = titleSpacing,
123 }, 133 },
124 titlebg = { 134 titlebg = {
125 Gradient = { MinColor = {0, 1, 0, 0.34}, MaxColor = {0, 1, 0, .17}, }, 135 Gradient = { MinColor = {0, 1, 0, 0.34}, MaxColor = {0, 1, 0, .17}, },
126 BackgroundFullWidth = true
127 }, 136 },
128 status = { 137 status = {
129 Font = {textFont, textSize, textOutline}, Spacing = textSpacing, 138 Font = {textFont, textSize, textOutline}, Spacing = textSpacing,
130 }, 139 },
131 statusbg = { 140 statusbg = {
132 Gradient = { MinColor = {0, 1, 0, .25}, MaxColor = {0, 1, 0, 0.12}, }, 141 Gradient = { MinColor = {0, 1, 0, .25}, MaxColor = {0, 1, 0, 0.12}, },
133 BackgroundFullWidth = true
134 } 142 }
143 },
144 Daily = {
145 titlebg = {
146 Gradient = { MinColor = {0, .4, 1, 0.34}, MaxColor = {0, 0.4, 1, .17}, },
147 },
148 statusbg = {
149 Gradient = { MinColor = {0, .4, 1, 0.25}, MaxColor = {0, 0.4, 1, .12}, },
150 },
135 }, 151 },
136 Cheev = { 152 Cheev = {
137 Normal = { 153 Normal = {
138 154
139 title = { 155 title = {
301 else 317 else
302 print('Cache function hit:', styleName) 318 print('Cache function hit:', styleName)
303 end 319 end
304 style_cache_func[styleName](frame) 320 style_cache_func[styleName](frame)
305 321
306 322 --- Hardcoding the sizing vars for sanity
307 --print("Generated func = function()\n",code, "\nend") 323 local normalSettings = mod.defaults.Style.Format
308 --local cache_func[styleName] = loadstring(code)
309
310 -- todo: remove hardcode and rely on attribute handler
311 if frame.status then
312 frame.status:SetWidth(270)
313 end
314 if frame.title then
315 frame.title:SetWidth(270)
316 end
317
318
319 frame.titleHeight = frame.title and (frame.title:GetStringHeight() + frame.title.spacing*2) or 0 324 frame.titleHeight = frame.title and (frame.title:GetStringHeight() + frame.title.spacing*2) or 0
320 frame.statusHeight = frame.status and (frame.status:GetStringHeight() + frame.status.spacing*2 + frame.attachmentHeight) or 0 325 frame.statusHeight = frame.status and (frame.status:GetStringHeight() + frame.status.spacing*2 + frame.attachmentHeight) or 0
321 frame.height = frame.titleHeight + frame.statusHeight 326 frame.height = frame.titleHeight + frame.statusHeight
322 frame.width = 270 327 frame.width = normalSettings.Frame.Width
323 328 frame.statusWidth = frame.width - normalSettings.status.Indent
329 frame.titleWidth = frame.width - normalSettings.title.Indent
324 330
325 if frame.status then 331 if frame.status then
326 print('status ', frame.statusHeight) 332 print('status ', frame.statusHeight, normalSettings.status.Indent, 0)
333 frame.status:SetPoint('LEFT', frame, 'LEFT', normalSettings.status.Indent, 0)
327 frame.status:SetHeight(frame.statusHeight) 334 frame.status:SetHeight(frame.statusHeight)
328 if frame.statusbg then 335 if frame.statusbg then
329 336
330 print('statusbg', frame.statusHeight) 337 print('statusbg', frame.statusHeight)
331 frame.statusbg:SetHeight(frame.statusHeight) 338 frame.statusbg:SetHeight(frame.statusHeight)
332 frame.statusbg:SetWidth(frame.width) 339 frame.statusbg:SetWidth(frame.width)
333 end 340 end
334 end 341 end
335 if frame.title then 342 if frame.title then
336 print('title ',frame.titleHeight) 343 print('title ',frame.titleHeight, normalSettings.title.Indent)
344 frame.title:SetPoint('LEFT', frame, 'LEFT', normalSettings.title.Indent)
337 frame.title:SetHeight(frame.titleHeight) 345 frame.title:SetHeight(frame.titleHeight)
338 if frame.titlebg then 346 if frame.titlebg then
339 print('titlebg',frame.titleHeight) 347 print('titlebg',frame.titleHeight)
340 frame.titlebg:SetHeight(frame.titleHeight) 348 frame.titlebg:SetHeight(frame.titleHeight)
341 frame.titlebg:SetWidth(frame.width) 349 frame.titlebg:SetWidth(frame.width)