vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | if not SimpleCombatLog then return end |
2 | |||
3 | local dewdrop = AceLibrary("Dewdrop-2.0") |
||
4 | |||
5 | local L = SimpleCombatLog.loc.event |
||
6 | |||
7 | |||
8 | function SimpleCombatLog:SetEvent(id, event, flag) |
||
9 | if flag == false then flag = nil end |
||
10 | |||
11 | if not self.settings[id] then |
||
12 | self.settings[id] = {} |
||
13 | self.settingDB[id] = self.settings[id] |
||
14 | else |
||
15 | if self.settings[id].theme then |
||
16 | self.settings[id] = SimpleCombatLog.CopyTable({}, self.settings[id]) |
||
17 | self.settings[id].theme = nil |
||
18 | self.settingDB[id] = self.settings[id] |
||
19 | end |
||
20 | end |
||
21 | |||
22 | |||
23 | if not self.settings[id].events then |
||
24 | self.settings[id].events = {} |
||
25 | end |
||
26 | |||
27 | self.settings[id].events[event] = flag |
||
28 | |||
29 | end |
||
30 | |||
31 | |||
32 | local function LoadMenuChatTypeGroups(self, id, title, chatTypeGroups) |
||
33 | dewdrop:AddLine( |
||
34 | 'text', title, |
||
35 | 'isTitle', true |
||
36 | ) |
||
37 | |||
38 | for i, v in pairs(chatTypeGroups) do |
||
39 | local eventName = ChatTypeGroup[v][1] |
||
40 | local eventDesc = getglobal(eventName) |
||
41 | dewdrop:AddLine( |
||
42 | 'text', eventDesc, |
||
43 | 'func', function(id, event) |
||
44 | self:SetEvent(id, event, not self:GetEvent(id, event) ) |
||
45 | self:RefreshSettings() |
||
46 | end, |
||
47 | 'arg1', id, |
||
48 | 'arg2', eventName, |
||
49 | 'checked', self:GetEvent(id, eventName) |
||
50 | ) |
||
51 | end |
||
52 | end |
||
53 | |||
54 | |||
55 | local function UpdateEventOptionsTable(self, id, level, value) |
||
56 | if level == 1 then |
||
57 | |||
58 | dewdrop:AddLine( |
||
59 | 'text', L["Events"], |
||
60 | 'tooltipTitle', L["Events"], |
||
61 | 'tooltipText', L.tooltip_Events, |
||
62 | 'hasArrow', true, |
||
63 | 'value', 'event', |
||
64 | 'notCheckable', true |
||
65 | ) |
||
66 | |||
67 | |||
68 | elseif level == 2 and value == 'event' then |
||
69 | |||
70 | self.currMenuType = 'event' |
||
71 | |||
72 | dewdrop:AddLine( |
||
73 | 'text', L["Events"], |
||
74 | 'isTitle', true, |
||
75 | 'notCheckable', true |
||
76 | ) |
||
77 | -- I decided not to bother messing with the event groups, just use Blizzard's groupings. |
||
78 | dewdrop:AddLine( |
||
79 | 'text', COMBAT_MESSAGES, |
||
80 | 'notCheckable', true, |
||
81 | 'hasArrow', true, |
||
82 | 'value', COMBAT_MESSAGES |
||
83 | ) |
||
84 | dewdrop:AddLine( |
||
85 | 'text', SPELL_MESSAGES, |
||
86 | 'notCheckable', true, |
||
87 | 'hasArrow', true, |
||
88 | 'value', SPELL_MESSAGES |
||
89 | ) |
||
90 | dewdrop:AddLine( |
||
91 | 'text', SPELL_OTHER_MESSAGES, |
||
92 | 'notCheckable', true, |
||
93 | 'hasArrow', true, |
||
94 | 'value', SPELL_OTHER_MESSAGES |
||
95 | ) |
||
96 | dewdrop:AddLine( |
||
97 | 'text', PERIODIC_MESSAGES, |
||
98 | 'notCheckable', true, |
||
99 | 'hasArrow', true, |
||
100 | 'value', PERIODIC_MESSAGES |
||
101 | ) |
||
102 | |||
103 | elseif level == 3 and self.currMenuType == 'event' then |
||
104 | if value == COMBAT_MESSAGES then |
||
105 | LoadMenuChatTypeGroups(self, id, COMBAT_MESSAGES, CombatLogMenuChatTypeGroups) |
||
106 | elseif value == SPELL_MESSAGES then |
||
107 | LoadMenuChatTypeGroups(self, id, SPELL_MESSAGES, SpellLogMenuChatTypeGroups) |
||
108 | elseif value == SPELL_OTHER_MESSAGES then |
||
109 | LoadMenuChatTypeGroups(self, id, SPELL_OTHER_MESSAGES, SpellLogOtherMenuChatTypeGroups) |
||
110 | elseif value == PERIODIC_MESSAGES then |
||
111 | LoadMenuChatTypeGroups(self, id, PERIODIC_MESSAGES, PeriodicLogMenuChatTypeGroups) |
||
112 | end |
||
113 | |||
114 | end |
||
115 | |||
116 | end |
||
117 | |||
118 | |||
119 | if SimpleCombatLog.menuFunc then |
||
120 | SimpleCombatLog.menuFunc[2] = UpdateEventOptionsTable |
||
121 | end |