vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | -- |
2 | -- Option handlers for Satrina Buff Frames |
||
3 | -- |
||
4 | function SatrinaBuffFrame_InitOptions() |
||
5 | if SBFVar[SATBUFF.player].addonmenu then |
||
6 | AddonMenu:AddMenuItem(SBF_MENU, SatrinaBuffFrame_ShowOptions, "Satrina Addons") |
||
7 | end |
||
8 | |||
9 | SatrinaBuffFrameOptionsCloseButton:SetText(CLOSE) |
||
10 | SatrinaBuffFrameHomeButton:SetText(SBF_HOME) |
||
11 | SatrinaBuffFrame_SetTextSlider("Buff") |
||
12 | SatrinaBuffFrame_SetTextSlider("Debuff") |
||
13 | SatrinaBuffFrame_SetTextSlider("Enchant") |
||
14 | SatrinaBuffFrame_SetSpacingSlider("Buff") |
||
15 | SatrinaBuffFrame_SetSpacingSlider("Debuff") |
||
16 | SatrinaBuffFrame_SetEnchantSpacingSlider() |
||
17 | SatrinaBuffFrame_SetScaleSlider("Buff", SBF_BUFF_SCALE) |
||
18 | SatrinaBuffFrame_SetScaleSlider("Debuff", SBF_DEBUFF_SCALE) |
||
19 | SatrinaBuffFrame_SetScaleSlider("Enchant", SBF_ENCHANT_SCALE) |
||
20 | SatrinaBuffFrame_SetOpacitySlider("Buff", SBF_BUFF_OPACITY) |
||
21 | SatrinaBuffFrame_SetOpacitySlider("Debuff", SBF_DEBUFF_OPACITY) |
||
22 | SatrinaBuffFrame_SetOpacitySlider("Enchant", SBF_ENCHANT_OPACITY) |
||
23 | |||
24 | OptionsFrame_EnableSlider(SatrinaBuffCountSlider) |
||
25 | if SBFVar[SATBUFF.player].buffHorizontal then |
||
26 | SatrinaBuffCountSliderText:SetText(SBF_BUFFROWS) |
||
27 | else |
||
28 | SatrinaBuffCountSliderText:SetText(SBF_BUFFCOLUMNS) |
||
29 | end |
||
30 | SatrinaBuffCountSliderLow:SetText("1") |
||
31 | SatrinaBuffCountSliderHigh:SetText("10") |
||
32 | SatrinaBuffCountSlider:SetMinMaxValues(1, 10) |
||
33 | SatrinaBuffCountSlider:SetValueStep(1) |
||
34 | SatrinaBuffCountSlider:SetValue(SBFVar[SATBUFF.player].count["Buff"]) |
||
35 | |||
36 | OptionsFrame_EnableSlider(SatrinaDebuffCountSlider) |
||
37 | if SBFVar[SATBUFF.player].debuffHorizontal then |
||
38 | SatrinaDebuffCountSliderText:SetText(SBF_DEBUFFROWS) |
||
39 | else |
||
40 | SatrinaDebuffCountSliderText:SetText(SBF_DEBUFFCOLUMNS) |
||
41 | end |
||
42 | SatrinaDebuffCountSliderLow:SetText("1") |
||
43 | SatrinaDebuffCountSliderHigh:SetText("10") |
||
44 | SatrinaDebuffCountSlider:SetMinMaxValues(1, 10) |
||
45 | SatrinaDebuffCountSlider:SetValueStep(1) |
||
46 | SatrinaDebuffCountSlider:SetValue(SBFVar[SATBUFF.player].count["Debuff"]) |
||
47 | |||
48 | SatrinaBuffFrameOptionsVersionString:SetText(string.format("%s%.2f|r", SBF_VERSION, SatBuff_Version)) |
||
49 | SatrinaBuffFrameUIScaleCheckButton:SetChecked(SBFVar[SATBUFF.player].uiscale) |
||
50 | SatrinaBuffHorizontalCheckButton:SetChecked(SBFVar[SATBUFF.player].buffHorizontal) |
||
51 | SatrinaDebuffHorizontalCheckButton:SetChecked(SBFVar[SATBUFF.player].debuffHorizontal) |
||
52 | SatrinaBuffTimerStyleButton:SetChecked(SBFVar[SATBUFF.player].blizzardTimers) |
||
53 | SatrinaBuffReverseCheckButton:SetChecked(SBFVar[SATBUFF.player].reverseBuffs) |
||
54 | SatrinaDebuffReverseCheckButton:SetChecked(SBFVar[SATBUFF.player].reverseDebuffs) |
||
55 | SatrinaBuffFrameVerticalEnchantCheckButton:SetChecked(SBFVar[SATBUFF.player].verticalEnchants) |
||
56 | SatrinaBuffFrameSixteenBuffsCheckButton:SetChecked(SBFVar[SATBUFF.player].sixteenBuffs) |
||
57 | SatrinaDebuffBottomCheckButton:SetChecked(SBFVar[SATBUFF.player].bottomDebuffs) |
||
58 | SatrinaBuffBottomCheckButton:SetChecked(SBFVar[SATBUFF.player].bottomBuffs) |
||
59 | |||
60 | SatrinaBuffFrameUIScaleCheckButtonText:SetText(SBF_UISCALE) |
||
61 | SatrinaBuffHorizontalCheckButtonText:SetText(SBF_BUFFHORIZONTAL) |
||
62 | SatrinaDebuffHorizontalCheckButtonText:SetText(SBF_DEBUFFHORIZONTAL) |
||
63 | SatrinaBuffReverseCheckButtonText:SetText(SBF_REVERSEBUFF) |
||
64 | SatrinaDebuffReverseCheckButtonText:SetText(SBF_REVERSEDEBUFF) |
||
65 | SatrinaBuffTimerStyleButtonText:SetText(SBF_BLIZZARDTIMERS) |
||
66 | SatrinaBuffFrameSoundWarningDropDownLabel:SetText(SBF_WARNSOUND) |
||
67 | SatrinaBuffFrameLongBuffDropDownLabel:SetText(SBF_MINTIME) |
||
68 | SatrinaBuffFrameAddonMenuCheckButtonText:SetText(SBF_ADDONMENU) |
||
69 | SatrinaBuffFrameSixteenBuffsCheckButtonText:SetText(SBF_SIXTEENBUFFS) |
||
70 | SatrinaDebuffBottomCheckButtonText:SetText(SBF_BOTTOM) |
||
71 | SatrinaBuffBottomCheckButtonText:SetText(SBF_BOTTOM) |
||
72 | |||
73 | SatrinaBuffFrameAddonMenuCheckButton:SetChecked(SBFVar[SATBUFF.player].addonmenu) |
||
74 | SatrinaBuffFrameTextWarningCheckButton:SetChecked(SBFVar[SATBUFF.player].textWarning) |
||
75 | SatrinaBuffFrameSoundWarningCheckButton:SetChecked(SBFVar[SATBUFF.player].soundWarning) |
||
76 | SatrinaBuffFrameLongBuffCheckButton:SetChecked(SBFVar[SATBUFF.player].longBuff) |
||
77 | SatrinaBuffFrameTextWarningCheckButtonText:SetText(SBF_EXPIREWARN) |
||
78 | SatrinaBuffFrameSoundWarningCheckButtonText:SetText(SBF_EXPIRESOUND) |
||
79 | SatrinaBuffFrameLongBuffCheckButtonText:SetText(SBF_LONGBUFF) |
||
80 | SatrinaBuffFrameVerticalEnchantCheckButtonText:SetText(SBF_VERTICALENCHANTS) |
||
81 | |||
82 | SatrinaBuffFrameDragTabLabel:SetText("Buffs") |
||
83 | SatrinaDebuffFrameDragTabLabel:SetText("Debuffs") |
||
84 | SatrinaEnchantFrameDragTabLabel:SetText("Enchants") |
||
85 | |||
86 | SATBUFF.sounds = { |
||
87 | "Sound\\Spells\\AntiHoly.wav", |
||
88 | "Sound\\interface\\iTellMessage.wav", |
||
89 | "Sound\\interface\\AuctionWindowOpen.wav", |
||
90 | "Sound\\interface\\FriendJoin.wav", |
||
91 | "Sound\\Creature\\Murloc\\mMurlocAggroOld.wav", |
||
92 | } |
||
93 | |||
94 | UIDropDownMenu_Initialize(SatrinaBuffFrameLongBuffDropDown, SatrinaBuffFrame_LongBuffDropDown_Initialise) |
||
95 | UIDropDownMenu_Initialize(SatrinaBuffFrameSoundWarningDropDown, SatrinaBuffFrame_SoundWarningDropDown_Initialise) |
||
96 | SatrinaBuffFrame_DropDown(SBFVar[SATBUFF.player].soundWarning, SatrinaBuffFrameSoundWarningDropDown) |
||
97 | SatrinaBuffFrame_DropDown(SBFVar[SATBUFF.player].longBuff, SatrinaBuffFrameLongBuffDropDown) |
||
98 | end |
||
99 | |||
100 | function SatrinaBuffFrame_SetScaleSlider(frame, title) |
||
101 | slider = getglobal("Satrina"..frame.."ScaleSlider") |
||
102 | OptionsFrame_EnableSlider(slider) |
||
103 | getglobal(slider:GetName().."Text"):SetText(title) |
||
104 | getglobal(slider:GetName().."Low"):SetText("0.5") |
||
105 | getglobal(slider:GetName().."High"):SetText("2.0") |
||
106 | slider:SetMinMaxValues(0.5, 2.0) |
||
107 | slider:SetValueStep(0.05) |
||
108 | slider:SetValue(SBFVar[SATBUFF.player].iconScale[frame]) |
||
109 | end |
||
110 | |||
111 | function SatrinaBuffFrame_SetTextSlider(frame) |
||
112 | slider = getglobal("Satrina"..frame.."TextSlider") |
||
113 | OptionsFrame_EnableSlider(slider) |
||
114 | getglobal(slider:GetName().."Text"):SetText(SBF_TEXT_SCALE) |
||
115 | getglobal(slider:GetName().."Low"):SetText("0.5") |
||
116 | getglobal(slider:GetName().."High"):SetText("2.0") |
||
117 | slider:SetMinMaxValues(0.5, 2.0) |
||
118 | slider:SetValueStep(0.05) |
||
119 | slider:SetValue(SBFVar[SATBUFF.player].textScale[frame]) |
||
120 | end |
||
121 | |||
122 | function SatrinaBuffFrame_SetSpacingSlider(frame) |
||
123 | slider = getglobal("Satrina"..frame.."SpacingSlider") |
||
124 | OptionsFrame_EnableSlider(slider) |
||
125 | getglobal(slider:GetName().."Text"):SetText(SBF_SPACING) |
||
126 | getglobal(slider:GetName().."Low"):SetText("-10") |
||
127 | getglobal(slider:GetName().."High"):SetText("10") |
||
128 | slider:SetMinMaxValues(-10, 10) |
||
129 | slider:SetValueStep(1) |
||
130 | slider:SetValue(SBFVar[SATBUFF.player].spacing[frame]) |
||
131 | end |
||
132 | |||
133 | function SatrinaBuffFrame_SetEnchantSpacingSlider() |
||
134 | OptionsFrame_EnableSlider(SatrinaEnchantSpacingSlider) |
||
135 | SatrinaEnchantSpacingSliderText:SetText(SBF_SPACING) |
||
136 | if SBFVar[SATBUFF.player].verticalEnchants then |
||
137 | SatrinaEnchantSpacingSliderLow:SetText("-10") |
||
138 | SatrinaEnchantSpacingSliderHigh:SetText("100") |
||
139 | SatrinaEnchantSpacingSlider:SetMinMaxValues(-10, 100) |
||
140 | if (SBFVar[SATBUFF.player].spacing["Enchant"] < -10) then |
||
141 | SBFVar[SATBUFF.player].spacing["Enchant"] = -10 |
||
142 | end |
||
143 | else |
||
144 | SatrinaEnchantSpacingSliderLow:SetText("-100") |
||
145 | SatrinaEnchantSpacingSliderHigh:SetText("10") |
||
146 | SatrinaEnchantSpacingSlider:SetMinMaxValues(-100, 10) |
||
147 | if (SBFVar[SATBUFF.player].spacing["Enchant"] > 10) then |
||
148 | SBFVar[SATBUFF.player].spacing["Enchant"] = 10 |
||
149 | end |
||
150 | end |
||
151 | SatrinaEnchantSpacingSlider:SetValueStep(1) |
||
152 | SatrinaEnchantSpacingSlider:SetValue(SBFVar[SATBUFF.player].spacing["Enchant"]) |
||
153 | end |
||
154 | |||
155 | function SatrinaBuffFrame_SetOpacitySlider(frame, title) |
||
156 | slider = getglobal("Satrina"..frame.."OpacitySlider") |
||
157 | OptionsFrame_EnableSlider(slider) |
||
158 | getglobal(slider:GetName().."Text"):SetText(title) |
||
159 | getglobal(slider:GetName().."Low"):SetText("0.1") |
||
160 | getglobal(slider:GetName().."High"):SetText("1.0") |
||
161 | slider:SetMinMaxValues(0.1, 1.0) |
||
162 | slider:SetValueStep(0.1) |
||
163 | slider:SetValue(SBFVar[SATBUFF.player].opacity[frame]) |
||
164 | end |
||
165 | |||
166 | function SatrinaBuffFrame_ShowOptions() |
||
167 | SatrinaBuffFrameDragTab:Show() |
||
168 | SatrinaDebuffFrameDragTab:Show() |
||
169 | SatrinaEnchantFrameDragTab:Show() |
||
170 | |||
171 | SATBUFF.showingOptions = 1 |
||
172 | SatrinaBuffFrameOptions:Show() |
||
173 | SatrinaBuffFrame_OptionIcons() |
||
174 | end |
||
175 | |||
176 | function SatrinaBuffFrame_OptionIcons() |
||
177 | buffCount = (SBFVar[SATBUFF.player].sixteenBuffs and 16) or 20 |
||
178 | for i=1,20do |
||
179 | button = getglobal("SatrinaBuffButton"..i) |
||
180 | if (i <= buffCount) then |
||
181 | button.icon:SetTexture("Spells\\GENERICGLOW64") |
||
182 | button:Show() |
||
183 | button.durationText:Show() |
||
184 | if SBFVar[SATBUFF.player].blizzardTimers then |
||
185 | button.durationText:SetText(i.."m") |
||
186 | else |
||
187 | button.durationText:SetText(i..":00") |
||
188 | end |
||
189 | |||
190 | if (i < 17) then |
||
191 | button = getglobal("SatrinaDebuffButton"..i) |
||
192 | button.icon:SetTexture("Spells\\GENERICGLOW64") |
||
193 | button:Show() |
||
194 | button.durationText:Show() |
||
195 | if SBFVar[SATBUFF.player].blizzardTimers then |
||
196 | button.durationText:SetText(i.."m") |
||
197 | else |
||
198 | button.durationText:SetText(i..":00") |
||
199 | end |
||
200 | end |
||
201 | else |
||
202 | button:Hide() |
||
203 | end |
||
204 | end |
||
205 | |||
206 | SatrinaEnchant1.icon:SetTexture("Spells\\GenericGlow2_64_BLUE") |
||
207 | SatrinaEnchant1:Show() |
||
208 | if SBFVar[SATBUFF.player].blizzardTimers then |
||
209 | SatrinaEnchant1.durationText:SetText("31m") |
||
210 | else |
||
211 | SatrinaEnchant1.durationText:SetText("31:00") |
||
212 | end |
||
213 | SatrinaEnchant2.icon:SetTexture("Spells\\GenericGlow2_64_BLUE") |
||
214 | SatrinaEnchant2:Show() |
||
215 | if SBFVar[SATBUFF.player].blizzardTimers then |
||
216 | SatrinaEnchant2.durationText:SetText("32m") |
||
217 | else |
||
218 | SatrinaEnchant2.durationText:SetText("32:00") |
||
219 | end |
||
220 | end |
||
221 | |||
222 | function SatrinaBuffFrame_CloseOptions() |
||
223 | SatrinaBuffFrameOptions:Hide() |
||
224 | for i=1,20 do |
||
225 | SatrinaBuffFrame_BuffButton_Update(getglobal("SatrinaBuffButton"..i)) |
||
226 | if (i < 17) then |
||
227 | SatrinaBuffFrame_BuffButton_Update(getglobal("SatrinaDebuffButton"..i)) |
||
228 | end |
||
229 | end |
||
230 | SATBUFF.showingOptions = nil |
||
231 | SatrinaBuffFrameDragTab:Hide() |
||
232 | SatrinaDebuffFrameDragTab:Hide() |
||
233 | SatrinaEnchantFrameDragTab:Hide() |
||
234 | end |
||
235 | |||
236 | local SBF_optionsElapsed = 0 |
||
237 | function SatrinaBuffFrame_OnOptionsUpdate(elapsed) |
||
238 | if (SBF_optionsElapsed > 0.1) then |
||
239 | SBF_optionsElapsed = 0 |
||
240 | |||
241 | -- Scaling |
||
242 | if not SBFVar[SATBUFF.player].uiscale then |
||
243 | if (SBFVar[SATBUFF.player].iconScale["Buff"] ~= SatrinaBuffScaleSlider:GetValue()) then |
||
244 | SBFVar[SATBUFF.player].iconScale["Buff"] = SatrinaBuffScaleSlider:GetValue() |
||
245 | SatrinaBuffFrame_ScaleBuffs() |
||
246 | end |
||
247 | |||
248 | if (SBFVar[SATBUFF.player].iconScale["Debuff"] ~= SatrinaDebuffScaleSlider:GetValue()) then |
||
249 | SBFVar[SATBUFF.player].iconScale["Debuff"] = SatrinaDebuffScaleSlider:GetValue() |
||
250 | SatrinaBuffFrame_ScaleBuffs() |
||
251 | end |
||
252 | |||
253 | if (SBFVar[SATBUFF.player].iconScale["Enchant"] ~= SatrinaEnchantScaleSlider:GetValue()) then |
||
254 | SBFVar[SATBUFF.player].iconScale["Enchant"] = SatrinaEnchantScaleSlider:GetValue() |
||
255 | SatrinaBuffFrame_ScaleBuffs() |
||
256 | end |
||
257 | end |
||
258 | |||
259 | -- Text |
||
260 | if (SBFVar[SATBUFF.player].textScale["Buff"] ~= SatrinaBuffTextSlider:GetValue()) then |
||
261 | SBFVar[SATBUFF.player].textScale["Buff"] = SatrinaBuffTextSlider:GetValue() |
||
262 | SatrinaBuffFrame_ScaleBuffs() |
||
263 | end |
||
264 | |||
265 | if (SBFVar[SATBUFF.player].textScale["Debuff"] ~= SatrinaDebuffTextSlider:GetValue()) then |
||
266 | SBFVar[SATBUFF.player].textScale["Debuff"] = SatrinaDebuffTextSlider:GetValue() |
||
267 | SatrinaBuffFrame_ScaleBuffs() |
||
268 | end |
||
269 | |||
270 | if (SBFVar[SATBUFF.player].textScale["Enchant"] ~= SatrinaEnchantTextSlider:GetValue()) then |
||
271 | SBFVar[SATBUFF.player].textScale["Enchant"] = SatrinaEnchantTextSlider:GetValue() |
||
272 | SatrinaBuffFrame_ScaleBuffs() |
||
273 | end |
||
274 | |||
275 | -- Opacity |
||
276 | if (SBFVar[SATBUFF.player].opacity["Buff"] ~= SatrinaBuffOpacitySlider:GetValue()) then |
||
277 | SBFVar[SATBUFF.player].opacity["Buff"] = SatrinaBuffOpacitySlider:GetValue() |
||
278 | SatrinaBuffFrame:SetAlpha(SBFVar[SATBUFF.player].opacity["Buff"]) |
||
279 | end |
||
280 | |||
281 | if (SBFVar[SATBUFF.player].opacity["Debuff"] ~= SatrinaDebuffOpacitySlider:GetValue()) then |
||
282 | SBFVar[SATBUFF.player].opacity["Debuff"] = SatrinaDebuffOpacitySlider:GetValue() |
||
283 | SatrinaDebuffFrame:SetAlpha(SBFVar[SATBUFF.player].opacity["Debuff"]) |
||
284 | end |
||
285 | |||
286 | if (SBFVar[SATBUFF.player].opacity["Enchant"] ~= SatrinaEnchantOpacitySlider:GetValue()) then |
||
287 | SBFVar[SATBUFF.player].opacity["Enchant"] = SatrinaEnchantOpacitySlider:GetValue() |
||
288 | SatrinaEnchantFrame:SetAlpha(SBFVar[SATBUFF.player].opacity["Enchant"]) |
||
289 | end |
||
290 | |||
291 | -- Spacing |
||
292 | if (SBFVar[SATBUFF.player].spacing["Buff"] ~= SatrinaBuffSpacingSlider:GetValue()) then |
||
293 | SBFVar[SATBUFF.player].spacing["Buff"] = SatrinaBuffSpacingSlider:GetValue() |
||
294 | SatrinaBuffFrame_ArrangeIcons("SatrinaBuffFrame") |
||
295 | end |
||
296 | |||
297 | if (SBFVar[SATBUFF.player].spacing["Debuff"] ~= SatrinaDebuffSpacingSlider:GetValue()) then |
||
298 | SBFVar[SATBUFF.player].spacing["Debuff"] = SatrinaDebuffSpacingSlider:GetValue() |
||
299 | SatrinaBuffFrame_ArrangeIcons("SatrinaDebuffFrame") |
||
300 | end |
||
301 | |||
302 | if (SBFVar[SATBUFF.player].spacing["Enchant"] ~= SatrinaEnchantSpacingSlider:GetValue()) then |
||
303 | SBFVar[SATBUFF.player].spacing["Enchant"] = SatrinaEnchantSpacingSlider:GetValue() |
||
304 | SatrinaBuffFrame_ArrangeEnchantIcons() |
||
305 | end |
||
306 | |||
307 | -- Icon Counts |
||
308 | if (SBFVar[SATBUFF.player].count["Buff"] ~= SatrinaBuffCountSlider:GetValue()) then |
||
309 | SBFVar[SATBUFF.player].count["Buff"] = SatrinaBuffCountSlider:GetValue() |
||
310 | SatrinaBuffFrame_ArrangeIcons("SatrinaBuffFrame") |
||
311 | end |
||
312 | |||
313 | if (SBFVar[SATBUFF.player].count["Debuff"] ~= SatrinaDebuffCountSlider:GetValue()) then |
||
314 | SBFVar[SATBUFF.player].count["Debuff"] = SatrinaDebuffCountSlider:GetValue() |
||
315 | SatrinaBuffFrame_ArrangeIcons("SatrinaDebuffFrame") |
||
316 | end |
||
317 | |||
318 | else |
||
319 | SBF_optionsElapsed = SBF_optionsElapsed + elapsed |
||
320 | end |
||
321 | end |
||
322 | |||
323 | function SatrinaBuffFrame_SixteenBuffs() |
||
324 | SBFVar[SATBUFF.player].sixteenBuffs = this:GetChecked() |
||
325 | SatrinaBuffFrame_OptionIcons() |
||
326 | SatrinaBuffFrame_ArrangeEnchantIcons() |
||
327 | end |
||
328 | |||
329 | function SatrinaBuffFrame_VerticalEnchants() |
||
330 | SBFVar[SATBUFF.player].verticalEnchants = this:GetChecked() |
||
331 | SatrinaBuffFrame_SetEnchantSpacingSlider() |
||
332 | SatrinaBuffFrame_ArrangeEnchantIcons() |
||
333 | end |
||
334 | |||
335 | function SatrinaBuffFrame_UIScale() |
||
336 | SBFVar[SATBUFF.player].uiscale = this:GetChecked() |
||
337 | SatrinaBuffFrame_DoUIScale() |
||
338 | end |
||
339 | |||
340 | function SatrinaBuffFrame_BuffHorizontal() |
||
341 | SBFVar[SATBUFF.player].buffHorizontal = this:GetChecked() |
||
342 | if SBFVar[SATBUFF.player].buffHorizontal then |
||
343 | SatrinaBuffCountSliderText:SetText(SBF_BUFFROWS) |
||
344 | else |
||
345 | SatrinaBuffCountSliderText:SetText(SBF_BUFFCOLUMNS) |
||
346 | end |
||
347 | SatrinaBuffFrame_ArrangeIcons("SatrinaBuffFrame") |
||
348 | end |
||
349 | |||
350 | function SatrinaBuffFrame_DebuffHorizontal() |
||
351 | SBFVar[SATBUFF.player].debuffHorizontal = this:GetChecked() |
||
352 | if SBFVar[SATBUFF.player].debuffHorizontal then |
||
353 | SatrinaDebuffCountSliderText:SetText(SBF_DEBUFFROWS) |
||
354 | else |
||
355 | SatrinaDebuffCountSliderText:SetText(SBF_DEBUFFCOLUMNS) |
||
356 | end |
||
357 | SatrinaBuffFrame_ArrangeIcons("SatrinaDebuffFrame") |
||
358 | end |
||
359 | |||
360 | function SatrinaBuffFrame_TimerStyle() |
||
361 | SBFVar[SATBUFF.player].blizzardTimers = this:GetChecked() |
||
362 | SatrinaBuffFrame_OptionIcons() |
||
363 | end |
||
364 | |||
365 | function SatrinaBuffFrame_ReverseBuffs() |
||
366 | SBFVar[SATBUFF.player].reverseBuffs = this:GetChecked() |
||
367 | SatrinaBuffFrame_ArrangeIcons("SatrinaBuffFrame") |
||
368 | end |
||
369 | |||
370 | function SatrinaBuffFrame_ReverseDebuffs() |
||
371 | SBFVar[SATBUFF.player].reverseDebuffs = this:GetChecked() |
||
372 | SatrinaBuffFrame_ArrangeIcons("SatrinaDebuffFrame") |
||
373 | end |
||
374 | |||
375 | function SatrinaBuffFrame_BottomBuffs() |
||
376 | SBFVar[SATBUFF.player].bottomBuffs = this:GetChecked() |
||
377 | SatrinaBuffFrame_ArrangeIcons("SatrinaBuffFrame") |
||
378 | end |
||
379 | |||
380 | function SatrinaBuffFrame_BottomDebuffs() |
||
381 | SBFVar[SATBUFF.player].bottomDebuffs = this:GetChecked() |
||
382 | SatrinaBuffFrame_ArrangeIcons("SatrinaDebuffFrame") |
||
383 | end |
||
384 | |||
385 | function SatrinaBuffFrame_TextWarning() |
||
386 | SBFVar[SATBUFF.player].textWarning = this:GetChecked() |
||
387 | end |
||
388 | |||
389 | function SatrinaBuffFrame_SoundWarning() |
||
390 | SBFVar[SATBUFF.player].soundWarning = this:GetChecked() |
||
391 | SatrinaBuffFrame_DropDown(SBFVar[SATBUFF.player].soundWarning, SatrinaBuffFrameSoundWarningDropDown) |
||
392 | end |
||
393 | |||
394 | function SatrinaBuffFrame_LongBuff() |
||
395 | SBFVar[SATBUFF.player].longBuff = this:GetChecked() |
||
396 | SatrinaBuffFrame_DropDown(SBFVar[SATBUFF.player].longBuff, SatrinaBuffFrameLongBuffDropDown) |
||
397 | end |
||
398 | |||
399 | function SatrinaBuffFrame_AddonMenu() |
||
400 | SBFVar[SATBUFF.player].addonmenu = this:GetChecked() |
||
401 | if not SBFVar[SATBUFF.player].addonmenu then |
||
402 | DEFAULT_CHAT_FRAME:AddMessage(SBF_ADDONMENU_DISABLE) |
||
403 | end |
||
404 | end |
||
405 | |||
406 | function SatrinaBuffFrame_SoundWarningDropDown_Initialise() |
||
407 | for i=1,5 do |
||
408 | info = {} |
||
409 | info.text = i |
||
410 | info.value = i |
||
411 | info.func = SatrinaBuffFrame_SoundWarningDropDown_OnClick |
||
412 | if (SBFVar[SATBUFF.player].sound == i) then |
||
413 | info.checked = true |
||
414 | UIDropDownMenu_SetText(i, SatrinaBuffFrameSoundWarningDropDown) |
||
415 | end |
||
416 | UIDropDownMenu_AddButton(info) |
||
417 | end |
||
418 | end |
||
419 | |||
420 | function SatrinaBuffFrame_SoundWarningDropDown_OnClick() |
||
421 | UIDropDownMenu_SetSelectedID(SatrinaBuffFrameSoundWarningDropDown, this:GetID(), 1) |
||
422 | SBFVar[SATBUFF.player].sound = this:GetID() |
||
423 | PlaySoundFile(SATBUFF.sounds[this:GetID()]) |
||
424 | end |
||
425 | |||
426 | function SatrinaBuffFrame_LongBuffDropDown_Initialise() |
||
427 | for i,t in {3,5,10,20,30} do |
||
428 | info = {} |
||
429 | info.text = t |
||
430 | info.value = t |
||
431 | info.func = SatrinaBuffFrame_LongBuffDropDown_OnClick |
||
432 | if (SBFVar[SATBUFF.player].warnTime == t) then |
||
433 | info.checked = true |
||
434 | SatrinaBuffFrameLongBuffDropDownText:SetText(t) |
||
435 | end |
||
436 | UIDropDownMenu_AddButton(info) |
||
437 | end |
||
438 | end |
||
439 | |||
440 | function SatrinaBuffFrame_LongBuffDropDown_OnClick() |
||
441 | UIDropDownMenu_SetSelectedID(SatrinaBuffFrameLongBuffDropDown, this:GetID(), 1) |
||
442 | SBFVar[SATBUFF.player].warnTime = this.value |
||
443 | end |
||
444 | |||
445 | function SatrinaBuffFrame_DropDown(flag, frame) |
||
446 | if flag then |
||
447 | OptionsFrame_EnableDropDown(frame) |
||
448 | else |
||
449 | OptionsFrame_DisableDropDown(frame) |
||
450 | end |
||
451 | end |
||
452 | |||
453 | function SatrinaBuffFrame_DoSavedVars() |
||
454 | default = 1.0 |
||
455 | |||
456 | if not SBFVar[SATBUFF.player].iconScale then |
||
457 | SBFVar[SATBUFF.player].iconScale = {} |
||
458 | SBFVar[SATBUFF.player].iconScale["Buff"] = default |
||
459 | SBFVar[SATBUFF.player].iconScale["Debuff"] = default |
||
460 | SBFVar[SATBUFF.player].iconScale["Enchant"] = default |
||
461 | end |
||
462 | |||
463 | if not SBFVar[SATBUFF.player].textScale then |
||
464 | SBFVar[SATBUFF.player].textScale = {} |
||
465 | SBFVar[SATBUFF.player].textScale["Buff"] = default |
||
466 | SBFVar[SATBUFF.player].textScale["Debuff"] = default |
||
467 | SBFVar[SATBUFF.player].textScale["Enchant"] = default |
||
468 | end |
||
469 | |||
470 | if not SBFVar[SATBUFF.player].spacing then |
||
471 | SBFVar[SATBUFF.player].spacing = {} |
||
472 | SBFVar[SATBUFF.player].spacing["Buff"] = 0 |
||
473 | SBFVar[SATBUFF.player].spacing["Debuff"] = 0 |
||
474 | SBFVar[SATBUFF.player].spacing["Enchant"] = 0 |
||
475 | end |
||
476 | |||
477 | if not SBFVar[SATBUFF.player].spacing["Enchant"] then |
||
478 | SBFVar[SATBUFF.player].spacing["Enchant"] = 0 |
||
479 | end |
||
480 | |||
481 | if not SBFVar[SATBUFF.player].opacity then |
||
482 | SBFVar[SATBUFF.player].opacity = {} |
||
483 | SBFVar[SATBUFF.player].opacity["Buff"] = 1.0 |
||
484 | SBFVar[SATBUFF.player].opacity["Debuff"] = 1.0 |
||
485 | SBFVar[SATBUFF.player].opacity["Enchant"] = 1.0 |
||
486 | end |
||
487 | |||
488 | if not SBFVar[SATBUFF.player].count then |
||
489 | SBFVar[SATBUFF.player].count = {} |
||
490 | SBFVar[SATBUFF.player].count["Buff"] = 1 |
||
491 | SBFVar[SATBUFF.player].count["Debuff"] = 1 |
||
492 | end |
||
493 | |||
494 | if not SBFVar[SATBUFF.player].warnTime then |
||
495 | SBFVar[SATBUFF.player].warnTime = 10 |
||
496 | end |
||
497 | |||
498 | if not SBFVar["spells"] then |
||
499 | SBFVar["spells"] = {} |
||
500 | end |
||
501 | |||
502 | -- Copy to new format if old saved vars are there |
||
503 | if SBFVar[SATBUFF.player].scales then |
||
504 | SBFVar[SATBUFF.player].iconScale["Buff"] = SBFVar[SATBUFF.player].scales["Buff"] |
||
505 | SBFVar[SATBUFF.player].iconScale["Debuff"] = SBFVar[SATBUFF.player].scales["Debuff"] |
||
506 | SBFVar[SATBUFF.player].iconScale["Enchant"] = SBFVar[SATBUFF.player].scales["Enchant"] |
||
507 | SBFVar[SATBUFF.player].scales = nil |
||
508 | |||
509 | SBFVar[SATBUFF.player].textScale["Buff"] = SBFVar[SATBUFF.player].text["Buff"] |
||
510 | SBFVar[SATBUFF.player].textScale["Debuff"] = SBFVar[SATBUFF.player].text["Debuff"] |
||
511 | SBFVar[SATBUFF.player].textScale["Enchant"] = SBFVar[SATBUFF.player].text["Enchant"] |
||
512 | SBFVar[SATBUFF.player].text = nil |
||
513 | end |
||
514 | |||
515 | SBFVar[SATBUFF.player].version = nil |
||
516 | end |