vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1  
2 function oSkin:Defaults()
3 self:RegisterDefaults("profile", {
4 BackdropBorder = {r = 0.5, g = 0.5, b = 0.5, a = 1},
5 Backdrop = {r = 0, g = 0, b = 0, a = 0.9},
6  
7 CharacterFrames = true,
8 PetStableFrame = true,
9 SpellBookFrame = true,
10 TalentFrame = true,
11  
12 Inspect = true,
13 FriendsFrame = true,
14 TradeFrame = true,
15 QuestLog = true,
16  
17 Tooltips = true,
18 MirrorTimers = true,
19 CastingBar = true,
20 StaticPopups = true,
21 ChatTabs = false,
22 ChatFrames = false,
23 ChatEditBox = true,
24 LootFrame = true,
25 GroupLoot = {shown=true, small=false},
26 ContainerFrames = true,
27 StackSplit = true,
28 ItemText = true,
29 WorldMap = true,
30  
31 MenuFrames = true,
32 BankFrame = true,
33 MailFrame = true,
34 AuctionFrame = true,
35  
36 MerchantFrames = true,
37 GossipFrame = true,
38 ClassTrainer = true,
39 TradeSkill = true,
40 CraftFrame = true,
41 TaxiFrame = true,
42 QuestFrame = true,
43 Battlefields = true,
44  
45 ViewPort = {top = 64, bottom=64, YResolution=1050, scaling = 768/1050, shown=false},
46 TopFrame = {height = 64, width=1920, shown=false, fheight=50, xyOff = true},
47 BottomFrame = {height = 200, width=1920, shown=false, fheight=50, xyOff = true},
48 })
49  
50 end
51  
52 function oSkin:SetBackdrop(a1, a2, a3, a4)
53 if (type(a1) == "string") then
54 local _, _, r, g, b, a = string.find(a1, "([%d%.]+) ([%d%.]+) ([%d%.]+) ([%d%.]+)")
55 r = tonumber(r)
56 g = tonumber(g)
57 b = tonumber(b)
58 a = tonumber(a)
59  
60 if (not a or not b or not r or not g) then return end
61 if (a > 255 or b > 255 or r > 255 or g > 255) then return end
62  
63 if (g > 1) then g = (g or 0) / 255 end
64 if (r > 1) then r = (r or 0) / 255 end
65 if (b > 1) then b = (b or 0) / 255 end
66 if (a > 1) then a = (a or 0) / 255 end
67  
68 self:SetBackdrop(r, g, b, a)
69 elseif (type(a1) == "number") then
70 if (not a2) then a2 = 0 end
71 if (not a3) then a3 = 0 end
72 if (not a4) then a4 = 0.9 end
73  
74 if (not self.db.profile.Backdrop) then self.db.profile.Backdrop = {} end
75 self.db.profile.Backdrop.r = a1
76 self.db.profile.Backdrop.g = a2
77 self.db.profile.Backdrop.b = a3
78 self.db.profile.Backdrop.a = a4
79 end
80 end
81  
82 function oSkin:GetBackdrop()
83 return string.format("%0.2f %0.2f %0.2f %0.2f", self.db.profile.Backdrop.r, self.db.profile.Backdrop.g, self.db.profile.Backdrop.b, self.db.profile.Backdrop.a)
84 end
85  
86 function oSkin:Options()
87 oSkin.options = {
88 type = "group",
89 args = {
90 backdrop = {
91 type = "text",
92 name = "Backdrop Colors",
93 desc = "Set Backdrop Colors",
94 usage = "r g b a",
95 get = function() return self:GetBackdrop() end,
96 set = function(v) self:SetBackdrop(v) end,
97 },
98  
99 character = {
100 name = "Character Frames",
101 type = "toggle",
102 desc = "Toggle the skin of the Character Frames",
103 get = function()
104 return self.db.profile.CharacterFrames
105 end,
106 set = function(v)
107 self.db.profile.CharacterFrames = v
108 self:characterFrames()
109 end,
110 },
111 stable = {
112 name = "Stable Frame",
113 type = "toggle",
114 desc = "Toggle the skin of the Stable Frame",
115 get = function()
116 return self.db.profile.PetStableFrame
117 end,
118 set = function(v)
119 self.db.profile.PetStableFrame = v
120 self:PetStableFrame()
121 end,
122 },
123 spellbook = {
124 name = "SpellBook Frame",
125 type = "toggle",
126 desc = "Toggle the skin of the SpellBook Frame",
127 get = function()
128 return self.db.profile.SpellBookFrame
129 end,
130 set = function(v)
131 self.db.profile.SpellBookFrame = v
132 self:SpellBookFrame()
133 end,
134 },
135 talent = {
136 name = "Talent Frame",
137 type = "toggle",
138 desc = "Toggle the skin of the Talent Frame",
139 get = function()
140 return self.db.profile.TalentFrame
141 end,
142 set = function(v)
143 self.db.profile.TalentFrame = v
144 self:TalentFrame()
145 end,
146 },
147  
148 inspect = {
149 name = "Inspect Frame",
150 type = "toggle",
151 desc = "Toggle the skin of the Inspect Frame",
152 get = function()
153 return self.db.profile.Inspect
154 end,
155 set = function(v)
156 self.db.profile.Inspect = v
157 self:InspectFrame()
158 if IsAddOnLoaded("SuperInspect_UI") then self:SuperInspectFrame() end
159 end,
160 },
161 friends = {
162 name = "Friends Frame",
163 type = "toggle",
164 desc = "Toggle the skin of the Friends Frame",
165 get = function()
166 return self.db.profile.FriendsFrame
167 end,
168 set = function(v)
169 self.db.profile.FriendsFrame = v
170 self:FriendsFrame()
171 end,
172 },
173 trade = {
174 name = "Trade Frame",
175 type = "toggle",
176 desc = "Toggle the skin of the Trade Frame",
177 get = function()
178 return self.db.profile.TradeFrame
179 end,
180 set = function(v)
181 self.db.profile.TradeFrame = v
182 self:TradeFrame()
183 end,
184 },
185 questlog = {
186 name = "Quest Log Frame",
187 type = "toggle",
188 desc = "Toggle the skin of the Quest Log Frame",
189 get = function()
190 return self.db.profile.QuestLog
191 end,
192 set = function(v)
193 self.db.profile.QuestLog = v
194 self:QuestLog()
195 end,
196 },
197  
198 tooltips = {
199 name = "Tooltips",
200 type = "toggle",
201 desc = "Toggle the skin of the Tooltips",
202 get = function()
203 return self.db.profile.Tooltips
204 end,
205 set = function(v)
206 self.db.profile.Tooltips = v
207 self:Tooltips()
208 end,
209 },
210 timers = {
211 name = "Timer Frames",
212 type = "toggle",
213 desc = "Toggle the skin of the Timer Frames",
214 get = function()
215 return self.db.profile.MirrorTimers
216 end,
217 set = function(v)
218 self.db.profile.MirrorTimers = v
219 self:MirrorTimers()
220 end,
221 },
222 castbar = {
223 name = "Casting Bar Frame",
224 type = "toggle",
225 desc = "Toggle the skin of the Casting Bar Frame",
226 get = function()
227 return self.db.profile.CastingBar
228 end,
229 set = function(v)
230 self.db.profile.CastingBar = v
231 self:CastingBar()
232 end,
233 },
234 popups = {
235 name = "Static Popups",
236 type = "toggle",
237 desc = "Toggle the skin of Static Popups",
238 get = function()
239 return self.db.profile.StaticPopups
240 end,
241 set = function(v)
242 self.db.profile.StaticPopups = v
243 self:StaticPopups()
244 if IsAddOnLoaded("Blizzard_RaidUI") then self:ReadyCheckFrame() end
245 end,
246 },
247 chattabs = {
248 name = "Chat Tabs",
249 type = "toggle",
250 desc = "Toggle the skin of the Chat Tabs",
251 get = function()
252 return self.db.profile.ChatTabs
253 end,
254 set = function(v)
255 self.db.profile.ChatTabs = v
256 self:ChatTabs()
257 end,
258 },
259 chatframes = {
260 name = "Chat Frames",
261 type = "toggle",
262 desc = "Toggle the skin of the Chat Frames",
263 get = function()
264 return self.db.profile.ChatFrames
265 end,
266 set = function(v)
267 self.db.profile.ChatFrames = v
268 self:ChatFrames()
269 end,
270 },
271 editbox = {
272 name = "Chat Edit Box",
273 type = "toggle",
274 desc = "Toggle the skin of the Chat Edit Box",
275 get = function()
276 return self.db.profile.ChatEditBox
277 end,
278 set = function(v)
279 self.db.profile.ChatEditBox = v
280 self:ChatEditBox()
281 end,
282 },
283 loot = {
284 name = "Loot Frame",
285 type = "toggle",
286 desc = "Toggle the skin of the Loot Frame",
287 get = function()
288 return self.db.profile.LootFrame
289 end,
290 set = function(v)
291 self.db.profile.LootFrame = v
292 self:LootFrame()
293 end,
294 },
295 grouploot = {
296 name = "Group Loot Frame",
297 desc = "Edit the GroupLoot settings",
298 type = "group",
299 args = {
300 show = {
301 name = "GroupLoot Show",
302 type = "toggle",
303 desc = "Toggle the GroupLoot frame on/off",
304 get = function()
305 return self.db.profile.GroupLoot.shown
306 end,
307 set = function (v)
308 self.db.profile.GroupLoot.shown = v
309 self:GroupLoot()
310 end,
311 },
312 small = {
313 name = "GroupLoot Size",
314 type = "toggle",
315 desc = "Toggle the GroupLoot size",
316 get = function()
317 return self.db.profile.GroupLoot.small
318 end,
319 set = function (v)
320 self.db.profile.GroupLoot.small = v
321 self:GroupLoot()
322 end,
323 },
324 },
325 },
326 container = {
327 name = "Container Frames",
328 type = "toggle",
329 desc = "Toggle the skin of the Container Frames",
330 get = function()
331 return self.db.profile.ContainerFrames
332 end,
333 set = function(v)
334 self.db.profile.ContainerFrames = v
335 self:containerFrames()
336 if IsAddOnLoaded("OneBank") then self:Skin_OneBank() end
337 if IsAddOnLoaded("OneBag") then self:Skin_OneBag() end
338 end,
339 },
340 stack = {
341 name = "Stack Split Frame",
342 type = "toggle",
343 desc = "Toggle the skin of the Stack Split Frame",
344 get = function()
345 return self.db.profile.StackSplit
346 end,
347 set = function(v)
348 self.db.profile.StackSplit = v
349 self:StackSplit()
350 if IsAddOnLoaded("EnhancedStackSplit") then self:EnhancedStackSplit() end
351 end,
352 },
353 itemtext = {
354 name = "Item Text Frame",
355 type = "toggle",
356 desc = "Toggle the skin of the Item Text Frame",
357 get = function()
358 return self.db.profile.ItemText
359 end,
360 set = function(v)
361 self.db.profile.ItemText = v
362 self:ItemText()
363 end,
364 },
365 map = {
366 name = "World Map Frame",
367 type = "toggle",
368 desc = "Toggle the skin of the World Map Frame",
369 get = function()
370 return self.db.profile.WorldMap
371 end,
372 set = function(v)
373 self.db.profile.WorldMap = v
374 self:WorldMap()
375 if IsAddOnLoaded("MetaMap") then self:MetaMap() end
376 end,
377 },
378  
379 menu = {
380 name = "Menu Frames",
381 type = "toggle",
382 desc = "Toggle the skin of the Menu Frames",
383 get = function()
384 return self.db.profile.MenuFrames
385 end,
386 set = function(v)
387 self.db.profile.MenuFrames = v
388 self:menuFrames()
389 end,
390 },
391 bank = {
392 name = "Bank Frame",
393 type = "toggle",
394 desc = "Toggle the skin of the Bank Frame",
395 get = function()
396 return self.db.profile.BankFrame
397 end,
398 set = function(v)
399 self.db.profile.BankFrame = v
400 self:BankFrame()
401 end,
402 },
403 mail = {
404 name = "Mail Frame",
405 type = "toggle",
406 desc = "Toggle the skin of the Mail Frame",
407 get = function()
408 return self.db.profile.MailFrame
409 end,
410 set = function(v)
411 self.db.profile.MailFrame = v
412 self:MailFrame()
413 end,
414 },
415 auction = {
416 name = "Auction Frame",
417 type = "toggle",
418 desc = "Toggle the skin of the Auction Frame",
419 get = function()
420 return self.db.profile.AuctionFrame
421 end,
422 set = function(v)
423 self.db.profile.AuctionFrame = v
424 self:AuctionFrame()
425 end,
426 },
427  
428 merchant = {
429 name = "Merchant Frames",
430 type = "toggle",
431 desc = "Toggle the skin of the Merchant Frames",
432 get = function()
433 return self.db.profile.MerchantFrames
434 end,
435 set = function(v)
436 self.db.profile.MerchantFrames = v
437 self:merchantFrames()
438 end,
439 },
440 gossip = {
441 name = "Gossip Frame",
442 type = "toggle",
443 desc = "Toggle the skin of the Gossip Frame",
444 get = function()
445 return self.db.profile.GossipFrame
446 end,
447 set = function(v)
448 self.db.profile.GossipFrame = v
449 self:GossipFrame()
450 end,
451 },
452 trainer = {
453 name = "Class Trainer Frame",
454 type = "toggle",
455 desc = "Toggle the skin of the Class Trainer Frame",
456 get = function()
457 return self.db.profile.ClassTrainer
458 end,
459 set = function(v)
460 self.db.profile.ClassTrainer = v
461 self:ClassTrainer()
462 end,
463 },
464 tradeskill = {
465 name = "Trade Skill Frame",
466 type = "toggle",
467 desc = "Toggle the skin of the Trade Skill Frame",
468 get = function()
469 return self.db.profile.TradeSkill
470 end,
471 set = function(v)
472 self.db.profile.TradeSkill = v
473 self:TradeSkill()
474 end,
475 },
476 craft = {
477 name = "Craft Frame",
478 type = "toggle",
479 desc = "Toggle the skin of the Craft Frame",
480 get = function()
481 return self.db.profile.CraftFrame
482 end,
483 set = function(v)
484 self.db.profile.CraftFrame = v
485 self:CraftFrame()
486 end,
487 },
488 taxi = {
489 name = "Taxi Frame",
490 type = "toggle",
491 desc = "Toggle the skin of the Taxi Frame",
492 get = function()
493 return self.db.profile.TaxiFrame
494 end,
495 set = function(v)
496 self.db.profile.TaxiFrame = v
497 self:TaxiFrame()
498 end,
499 },
500 quest = {
501 name = "Quest Frame",
502 type = "toggle",
503 desc = "Toggle the skin of the Quest Frame",
504 get = function()
505 return self.db.profile.QuestFrame
506 end,
507 set = function(v)
508 self.db.profile.QuestFrame = v
509 self:QuestFrame()
510 end,
511 },
512 battles = {
513 name = "Battlefields Frame",
514 type = "toggle",
515 desc = "Toggle the skin of the Battlefields Frame",
516 get = function()
517 return self.db.profile.Battlefields
518 end,
519 set = function(v)
520 self.db.profile.Battlefields = v
521 self:Battlefields()
522 end,
523 },
524  
525 viewport = {
526 name = "View Port",
527 desc = "Edit the ViewPort settings",
528 type = "group",
529 args = {
530 top = {
531 name = "VP Top",
532 desc = "Change Height of the Top Band",
533 type = "range",
534 step = 1,
535 min = 0,
536 max = 256,
537 get = function ()
538 return self.db.profile.ViewPort.top
539 end,
540 set = function (v)
541 self.db.profile.ViewPort.top = v
542 self:ViewPort_top()
543 end,
544 },
545 bottom = {
546 name = "VP Bottom",
547 desc = "Change Height of the Bottom Band",
548 type = "range",
549 step = 1,
550 min = 0,
551 max = 256,
552 get = function ()
553 return self.db.profile.ViewPort.bottom
554 end,
555 set = function (v)
556 self.db.profile.ViewPort.bottom = v
557 self:ViewPort_bottom()
558 end,
559 },
560 yres = {
561 name = "VP YResolution",
562 desc = "Change Y Resolution",
563 type = "range",
564 step = 2,
565 min = 0,
566 max = 1600,
567 get = function ()
568 return self.db.profile.ViewPort.YResolution
569 end,
570 set = function (v)
571 self.db.profile.ViewPort.YResolution = v
572 self.db.profile.ViewPort.scaling = 768 / self.db.profile.ViewPort.YResolution
573 self.initialized.ViewPort = nil
574 self:ViewPort()
575 end,
576 },
577 show = {
578 name = "ViewPort Show",
579 type = "toggle",
580 desc = "Toggle the ViewPort on/off",
581 get = function()
582 return self.db.profile.ViewPort.shown
583 end,
584 set = function (v)
585 self.db.profile.ViewPort.shown = v
586 if self.initialized.ViewPort then
587 self:ViewPort_reset()
588 else
589 self:ViewPort()
590 end
591 end,
592 },
593 },
594 },
595 topframe = {
596 name = "Top Frame",
597 desc = "Edit the TopFrame settings",
598 type = "group",
599 args = {
600 xyOff = {
601 name = "TF Move Origin offscreen",
602 desc = "Hide Border on Left and Top",
603 type = "toggle",
604 get = function ()
605 return self.db.profile.TopFrame.xyOff
606 end,
607 set = function (v)
608 self.db.profile.TopFrame.xyOff = v
609 if self.initialized.TopFrame then
610 if self.db.profile.TopFrame.xyOff then
611 self.topframe:SetPoint("TOPLEFT", UIParent, "TOPLEFT", -6, 6)
612 else
613 self.topframe:SetPoint("TOPLEFT", UIParent, "TOPLEFT", -3, 3)
614 end
615 end
616 end,
617 },
618 height = {
619 name = "TF Height",
620 desc = "Change Height of the TopFrame",
621 type = "range",
622 step = 1,
623 min = 0,
624 max = 500,
625 get = function ()
626 return self.db.profile.TopFrame.height
627 end,
628 set = function (v)
629 self.db.profile.TopFrame.height = v
630 if self.initialized.TopFrame then
631 self.topframe:SetHeight(v)
632 end
633 end,
634 },
635 width = {
636 name = "TF Width",
637 desc = "Change Width of the TopFrame",
638 type = "range",
639 step = 1,
640 min = 0,
641 max = 3000,
642 get = function ()
643 return self.db.profile.TopFrame.width
644 end,
645 set = function (v)
646 self.db.profile.TopFrame.width = v
647 if self.initialized.TopFrame then
648 self.topframe:SetWidth(v)
649 end
650 end,
651 },
652 fadeheight = {
653 name = "TF Fade Height",
654 desc = "Change the Height of the Fade Effect",
655 type = "range",
656 step = 1,
657 min = 0,
658 max = 500,
659 get = function ()
660 return self.db.profile.TopFrame.fheight
661 end,
662 set = function (v)
663 self.db.profile.TopFrame.fheight = v
664 if self.initialized.TopFrame then
665 self.topframe.tfade:SetPoint("BOTTOMRIGHT", self.topframe, "TOPRIGHT", -4, -v)
666 end
667 end,
668 },
669 show = {
670 name = "TopFrame Show",
671 type = "toggle",
672 desc = "Toggle the TopFrame on/off",
673 get = function()
674 return self.db.profile.TopFrame.shown
675 end,
676 set = function (v)
677 self.db.profile.TopFrame.shown = v
678 if self.initialized.TopFrame then
679 if self.topframe:IsVisible() then
680 self.topframe:Hide()
681 else
682 self.topframe:Show()
683 end
684 else
685 self:TopFrame()
686 end
687 end,
688 },
689 },
690 },
691 bottomframe = {
692 name = "Bottom Frame",
693 desc = "Edit the BottomFrame settings",
694 type = "group",
695 args = {
696 xyOff = {
697 name = "BF Move Origin offscreen",
698 desc = "Hide Border on Left and Bottom",
699 type = "toggle",
700 get = function ()
701 return self.db.profile.BottomFrame.xyOff
702 end,
703 set = function (v)
704 self.db.profile.BottomFrame.xyOff = v
705 if self.initialized.BottomFrame then
706 if self.db.profile.BottomFrame.xyOff then
707 self.bottomframe:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", -6, -6)
708 else
709 self.bottomframe:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", -3, -3)
710 end
711 end
712 end,
713 },
714 height = {
715 name = "BF Height",
716 desc = "Change Height of the BottomFrame",
717 type = "range",
718 step = 1,
719 min = 0,
720 max = 500,
721 get = function ()
722 return self.db.profile.BottomFrame.height
723 end,
724 set = function (v)
725 self.db.profile.BottomFrame.height = v
726 if self.initialized.BottomFrame then
727 self.bottomframe:SetHeight(v)
728 end
729 end,
730 },
731 width = {
732 name = "BF Width",
733 desc = "Change Width of the BottomFrame",
734 type = "range",
735 step = 1,
736 min = 0,
737 max = 3000,
738 get = function ()
739 return self.db.profile.BottomFrame.width
740 end,
741 set = function (v)
742 self.db.profile.BottomFrame.width = v
743 if self.initialized.BottomFrame then
744 self.bottomframe:SetWidth(v)
745 end
746 end,
747 },
748 fadeheight = {
749 name = "BF Fade Height",
750 desc = "Change the Height of the Fade Effect",
751 type = "range",
752 step = 1,
753 min = 0,
754 max = 500,
755 get = function ()
756 return self.db.profile.BottomFrame.fheight
757 end,
758 set = function (v)
759 self.db.profile.BottomFrame.fheight = v
760 if self.initialized.BottomFrame then
761 self.bottomframe.tfade:SetPoint("BOTTOMRIGHT", self.bottomframe, "TOPRIGHT", -4, -v)
762 end
763 end,
764 },
765 show = {
766 name = "BottomFrame Show",
767 type = "toggle",
768 desc = "Toggle the BottomFrame on/off",
769 get = function()
770 return self.db.profile.BottomFrame.shown
771 end,
772 set = function (v)
773 self.db.profile.BottomFrame.shown = v
774 if self.initialized.BottomFrame then
775 if self.bottomframe:IsVisible() then
776 self.bottomframe:Hide()
777 else
778 self.bottomframe:Show()
779 end
780 else
781 self:BottomFrame()
782 end
783 end,
784 },
785 },
786 },
787 }
788 }
789 end