Mercurial > wow > buffalo2
comparison ObjectiveStyle.lua @ 21:d5ee940de273
use hardcoded aesthetic manipulations over loadstring cramming
author | Nenue |
---|---|
date | Fri, 08 Apr 2016 06:12:05 -0400 |
parents | 605e8f0e46db |
children |
comparison
equal
deleted
inserted
replaced
20:6bd2102d340b | 21:d5ee940de273 |
---|---|
51 statusbg = { | 51 statusbg = { |
52 }, | 52 }, |
53 Frame = { | 53 Frame = { |
54 } | 54 } |
55 }, | 55 }, |
56 Wrapper = { | |
57 title = { | |
58 Font = {wrapperHeadFont, wrapperHeadSize, wrapperHeadOutline}, | |
59 Spacing = 4,} | |
60 }, | |
61 Tracker = { | 56 Tracker = { |
62 Normal = { | 57 Normal = { |
63 title = { | 58 title = { |
64 Font = {headerFont, headerSize, headerOutline}, Spacing = headerSpacing, | 59 Font = {headerFont, headerSize, headerOutline}, Spacing = headerSpacing, |
65 Indent = 2, | 60 Indent = 2, |
72 }, | 67 }, |
73 TrackerBlock = { | 68 TrackerBlock = { |
74 Normal = { | 69 Normal = { |
75 titlebg = { | 70 titlebg = { |
76 Indent = 2, | 71 Indent = 2, |
77 Gradient = { 'HORIZONTAL', MinColor = {0.7, 0, 0.9, 0}, MaxColor = {.7, 0, 0.9, .25}}, | 72 Gradient = { 'HORIZONTAL', MinColor = {0.7, 0, 0.9, 1}, MaxColor = {.7, 0, 0.9, .1}}, |
78 }, | 73 }, |
79 title = { | 74 title = { |
80 TextColor = {1,1,1,1}, | 75 TextColor = {1,1,1,1}, |
81 Font = {titleFont, titleSize, titleOutline}, | 76 Font = {titleFont, titleSize, titleOutline}, |
82 Spacing = titleSpacing, | 77 Spacing = titleSpacing, |
85 TextColor = {1,1,1,1}, | 80 TextColor = {1,1,1,1}, |
86 Font = {textFont, textSize, textOutline}, | 81 Font = {textFont, textSize, textOutline}, |
87 Spacing = textSpacing, | 82 Spacing = textSpacing, |
88 }, | 83 }, |
89 statusbg = { | 84 statusbg = { |
90 Gradient = { 'HORIZONTAL', MinColor = {0.2, .4, 1, 0}, MaxColor = {.7, 0, 0.9, .11}}, | 85 Gradient = { 'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {.7, 0, 0.9, .1}}, |
91 } | 86 } |
92 }, | 87 }, |
93 Daily = { | 88 Daily = { |
94 titlebg = { | 89 titlebg = { |
95 Gradient = {'HORIZONTAL', MinColor = {0, .4, 1, 0}, MaxColor = {0, 0.4, 1, .35}, }, | 90 Gradient = {'HORIZONTAL', MinColor = {0, .4, 1, 1}, MaxColor = {0, 0.4, 1, .1}, }, |
96 }, | 91 }, |
97 statusbg = { | 92 statusbg = { |
98 Gradient = {'HORIZONTAL', MinColor = {0, .4, 1, 0}, MaxColor = {0, 0.35, .90, .31}, }, | 93 Gradient = {'HORIZONTAL', MinColor = {0, .4, 1, 1}, MaxColor = {0, 0.35, .90, .1}, }, |
99 }, | 94 }, |
100 title = { | 95 title = { |
101 TextColor = {0.7,1,1,1}, | 96 TextColor = {0.7,1,1,1}, |
102 Font = {titleFont, titleSize, titleOutline}, | 97 Font = {titleFont, titleSize, titleOutline}, |
103 Spacing = titleSpacing, | 98 Spacing = titleSpacing, |
113 TextColor = {1,1,1,1}, | 108 TextColor = {1,1,1,1}, |
114 Font = {titleFont, titleSize, titleOutline}, | 109 Font = {titleFont, titleSize, titleOutline}, |
115 Spacing = titleSpacing, BackgroundFullWidth = true | 110 Spacing = titleSpacing, BackgroundFullWidth = true |
116 }, | 111 }, |
117 titlebg = { | 112 titlebg = { |
118 Gradient = { 'HORIZONTAL', MinColor = {0, .7, .6, 0}, MaxColor = {0, .7, .6, 0.23}}, | 113 Gradient = { 'HORIZONTAL', MinColor = {0, .7, .6, 1}, MaxColor = {0, .7, .6, 1}}, |
119 }, | 114 }, |
120 status = { | 115 status = { |
121 TextColor = {1,1,1,1}, | 116 TextColor = {1,1,1,1}, |
122 Font = {textFont, textSize, textOutline}, | 117 Font = {textFont, textSize, textOutline}, |
123 Spacing = textSpacing, | 118 Spacing = textSpacing, |
124 }, | 119 }, |
125 statusbg = { | 120 statusbg = { |
126 Gradient = { 'HORIZONTAL', MinColor = {0, .7, .6, 0}, MaxColor = {0, .7, .6, 0.23} }, | 121 Gradient = { 'HORIZONTAL', MinColor = {0, .7, .6, 1}, MaxColor = {0, .7, .6, 1} }, |
127 }, | 122 }, |
128 }, | 123 }, |
129 MouseDown = { | 124 MouseDown = { |
130 title = { | 125 title = { |
131 Font = {titleFont, titleSize, titleOutline}, | 126 Font = {titleFont, titleSize, titleOutline}, |
132 Spacing = titleSpacing, | 127 Spacing = titleSpacing, |
133 }, | 128 }, |
134 titlebg = { | 129 titlebg = { |
135 Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, .4}, }, | 130 Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, 1}, }, |
136 }, | 131 }, |
137 status = { | 132 status = { |
138 Font = {textFont, textSize, textOutline}, | 133 Font = {textFont, textSize, textOutline}, |
139 Spacing = textSpacing, | 134 Spacing = textSpacing, |
140 }, | 135 }, |
141 statusbg = { | 136 statusbg = { |
142 Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, .2}, }, | 137 Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {0.2, .4, 1, 1}, }, |
143 } | 138 } |
144 }, | 139 }, |
145 Complete = { | 140 Complete = { |
146 title = { | 141 title = { |
147 TextColor = {1,1,1,1}, | 142 TextColor = {1,1,1,1}, |
148 Font = {titleFont, titleSize, titleOutline}, Spacing = titleSpacing, | 143 Font = {titleFont, titleSize, titleOutline}, Spacing = titleSpacing, |
149 }, | 144 }, |
150 titlebg = { | 145 titlebg = { |
151 Gradient = {'HORIZONTAL', MinColor = {0, 1, 0, 0}, MaxColor = {0, 1, 0, 0.34}, }, | 146 Gradient = {'HORIZONTAL', MinColor = {0, 1, 0, 1}, MaxColor = {0, 1, 0, 1}, }, |
152 }, | 147 }, |
153 status = { | 148 status = { |
154 TextColor = {1,1,1,1}, | 149 TextColor = {1,1,1,1}, |
155 Font = {textFont, textSize, textOutline}, Spacing = textSpacing, | 150 Font = {textFont, textSize, textOutline}, Spacing = textSpacing, |
156 }, | 151 }, |
157 statusbg = { | 152 statusbg = { |
158 Gradient = {'HORIZONTAL', MinColor = {0, 1, 0, 0}, MaxColor = {0, 1, 0, .25}, }, | 153 Gradient = {'HORIZONTAL', MinColor = {0, 1, 0, 1}, MaxColor = {0, 1, 0, 1}, }, |
159 } | 154 } |
160 }, | 155 }, |
161 AutoQuest = { | 156 AutoQuest = { |
162 Normal = { | 157 Normal = { |
163 titlebg = { | 158 titlebg = { |
164 Indent = 2, | 159 Indent = 2, |
165 Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0}, MaxColor = {.7, 0, 0.9, .14}}, | 160 Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {.7, 0, 0.9, 1}}, |
166 }, | 161 }, |
167 title = { | 162 title = { |
168 TextColor = {1,1,1,1}, | 163 TextColor = {1,1,1,1}, |
169 Font = {titleFont, titleSize, titleOutline}, | 164 Font = {titleFont, titleSize, titleOutline}, |
170 Spacing = titleSpacing, | 165 Spacing = titleSpacing, |
173 TextColor = {0,1,0,1}, | 168 TextColor = {0,1,0,1}, |
174 Font = {textFont, textSize, textOutline}, | 169 Font = {textFont, textSize, textOutline}, |
175 Spacing = textSpacing, | 170 Spacing = textSpacing, |
176 }, | 171 }, |
177 statusbg = { | 172 statusbg = { |
178 Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0}, MaxColor = {.7, 0, 0.9, .11}}, | 173 Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {.7, 0, 0.9, 1}}, |
179 } | 174 } |
180 }, | 175 }, |
181 }, | 176 }, |
182 Cheevs = { | 177 Cheevs = { |
183 Normal = { | 178 Normal = { |
185 title = { | 180 title = { |
186 Font = {titleFont, titleSize, titleOutline}, | 181 Font = {titleFont, titleSize, titleOutline}, |
187 Spacing = titleSpacing, | 182 Spacing = titleSpacing, |
188 }, | 183 }, |
189 titlebg = { | 184 titlebg = { |
190 Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0.45}, MaxColor = {.7, 0, 0.9, .19}}, | 185 Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {.7, 0, 0.9, 1}}, |
191 | 186 |
192 }, | 187 }, |
193 status = { | 188 status = { |
194 Font = {textFont, textSize, textOutline}, | 189 Font = {textFont, textSize, textOutline}, |
195 Spacing = textSpacing, | 190 Spacing = textSpacing, |
196 }, | 191 }, |
197 statusbg = { | 192 statusbg = { |
198 Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0.25}, MaxColor = {.7, 0, 0.9, .12}}, | 193 Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {.7, 0, 0.9, 1}}, |
199 }, | 194 }, |
200 }, | 195 }, |
201 Complete = { | 196 Complete = { |
202 title = { | 197 title = { |
203 Font = {titleFont, titleSize, titleOutline}, | 198 Font = {titleFont, titleSize, titleOutline}, |
204 Spacing = titleSpacing, | 199 Spacing = titleSpacing, |
205 }, | 200 }, |
206 titlebg = { | 201 titlebg = { |
207 Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0.45}, MaxColor = {.7, 0, 0.9, .19}}, | 202 Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {.7, 0, 0.9, 1}}, |
208 }, | 203 }, |
209 status = { | 204 status = { |
210 Font = {textFont, textSize, textOutline}, | 205 Font = {textFont, textSize, textOutline}, |
211 Spacing = textSpacing, | 206 Spacing = textSpacing, |
212 }, | 207 }, |
213 statusbg = { | 208 statusbg = { |
214 Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 0.25}, MaxColor = {.7, 0, 0.9, .12}}, | 209 Gradient = {'HORIZONTAL', MinColor = {0.2, .4, 1, 1}, MaxColor = {.7, 0, 0.9, 1}}, |
215 }, | 210 }, |
216 }, | 211 }, |
217 } | 212 } |
218 } | 213 } |
219 } | 214 } |
379 local defaultWidth = mod.Conf.Wrapper.Width | 374 local defaultWidth = mod.Conf.Wrapper.Width |
380 local normalSettings = mod.defaults.Style.Format | 375 local normalSettings = mod.defaults.Style.Format |
381 frame.width = defaultWidth | 376 frame.width = defaultWidth |
382 frame.statusWidth = defaultWidth - normalSettings.status.Indent | 377 frame.statusWidth = defaultWidth - normalSettings.status.Indent |
383 frame.titleWidth = defaultWidth - normalSettings.title.Indent | 378 frame.titleWidth = defaultWidth - normalSettings.title.Indent |
379 frame.attachmentHeight = frame.attachmentHeight or 0 | |
384 | 380 |
385 if frame.title then | 381 if frame.title then |
386 frame.titleHeight = frame.title and frame.title:GetStringHeight() or 0 | 382 frame.titleHeight = frame.title and frame.title:GetStringHeight() or 0 |
387 if frame.titleHeight > 0 then | 383 if frame.titleHeight > 0 then |
384 print('add spacing to', frame.titleHeight) | |
388 frame.titleHeight = frame.titleHeight + (frame.title.spacing or 0)*2 | 385 frame.titleHeight = frame.titleHeight + (frame.title.spacing or 0)*2 |
389 end | 386 end |
390 | 387 |
391 frame.title.spacing = frame.title.spacing or frame.title:GetSpacing() | 388 frame.title.spacing = frame.title.spacing or frame.title:GetSpacing() |
392 frame.title:SetPoint('LEFT', frame, 'LEFT', normalSettings.title.Indent) | 389 frame.title:SetPoint('LEFT', frame, 'LEFT', normalSettings.title.Indent) |
395 if frame.titlebg then | 392 if frame.titlebg then |
396 frame.titlebg:SetHeight(frame.titleHeight) | 393 frame.titlebg:SetHeight(frame.titleHeight) |
397 frame.titlebg:SetWidth(frame.width) | 394 frame.titlebg:SetWidth(frame.width) |
398 end | 395 end |
399 print(' titleHeight', frame.titleHeight, 'indent', normalSettings.title.Indent, 'spacing', frame.title.spacing) | 396 print(' titleHeight', frame.titleHeight, 'indent', normalSettings.title.Indent, 'spacing', frame.title.spacing) |
397 print(' -- text:', frame.title:GetSize()) | |
398 print(' -- bg:', frame.titlebg:GetSize()) | |
399 | |
400 else | 400 else |
401 frame.titleHeight = 0 | 401 frame.titleHeight = 0 |
402 end | 402 end |
403 | 403 |
404 if frame.status then | 404 |
405 if frame.status and (frame.status:GetText() or frame.attachmentHeight > 0) then | |
405 frame.statusHeight = frame.status and frame.status:GetStringHeight() or 0 | 406 frame.statusHeight = frame.status and frame.status:GetStringHeight() or 0 |
406 if frame.statusHeight > 0 then | 407 if frame.statusHeight > 0 then |
407 frame.statusHeight = frame.statusHeight + (frame.status.spacing or 0)*2 | 408 frame.statusHeight = frame.statusHeight + (frame.status.spacing or 0)*2 |
408 end | 409 end |
409 | 410 |
410 frame.status.spacing = frame.status.spacing or frame.status:GetSpacing() | 411 frame.status.spacing = frame.status.spacing or frame.status:GetSpacing() |
412 | |
411 frame.status:SetWidth(frame.width) | 413 frame.status:SetWidth(frame.width) |
412 frame.status:SetPoint('LEFT', frame, 'LEFT', normalSettings.status.Indent, 0) | 414 frame.status:SetPoint('LEFT', frame, 'LEFT', normalSettings.status.Indent, 0) |
413 frame.status:SetPoint('TOP', frame.titlebg, 'BOTTOM', 0, 0) | 415 frame.status:SetPoint('TOP', frame.titlebg, 'BOTTOM', 0, 0) |
414 frame.status:SetHeight(frame.statusHeight) | 416 --frame.status:SetHeight(frame.statusHeight) |
415 if frame.statusbg then | 417 if frame.statusbg then |
416 | 418 |
417 frame.statusbg:SetHeight(frame.statusHeight + (frame.attachmentHeight or 0)) | 419 --frame.statusbg:SetHeight(frame.statusHeight + (frame.attachmentHeight or 0)) |
420 --frame.statusbg:SetPoint('BOTTOM', frame, 'BOTTOM', 0, 0) | |
418 frame.statusbg:SetWidth(frame.width) | 421 frame.statusbg:SetWidth(frame.width) |
419 end | 422 end |
420 print(' status tHeight', frame.statusHeight, 'indent', normalSettings.status.Indent, 'spacing', frame.status.spacing) | 423 print(' status tHeight', frame.statusHeight, 'indent', normalSettings.status.Indent, 'spacing', frame.status.spacing) |
421 else | 424 else |
425 if frame.status then | |
426 frame.status:Hide() | |
427 end | |
428 if frame.statusbg then | |
429 frame.statusbg:Hide() | |
430 end | |
422 frame.statusHeight = 0 | 431 frame.statusHeight = 0 |
423 end | 432 end |
424 | 433 |
425 frame.height = frame.titleHeight + frame.statusHeight + (frame.attachmentHeight or 0) | 434 frame.height = frame.titleHeight + frame.statusHeight + (frame.attachmentHeight or 0) |
426 frame:SetSize(frame.width, frame.height) | 435 frame:SetSize(frame.width, frame.height) |