comparison CombatLog.lua @ 124:e31b02b24488

Updated for 8.0 pre-patch and BfA.
author yellowfive
date Tue, 17 Jul 2018 09:57:39 -0700
parents f1da233629be
children a0894ffebd15
comparison
equal deleted inserted replaced
123:7a6364917f86 124:e31b02b24488
21 -- render a group of controls for auto-logging of a raid zone 21 -- render a group of controls for auto-logging of a raid zone
22 local function renderAutoLogSection(instanceId, container) 22 local function renderAutoLogSection(instanceId, container)
23 _autoChecks[instanceId] = {} 23 _autoChecks[instanceId] = {}
24 24
25 local lbl = AceGUI:Create("AmrUiLabel") 25 local lbl = AceGUI:Create("AmrUiLabel")
26 container:AddChild(lbl)
26 lbl:SetWidth(200) 27 lbl:SetWidth(200)
27 lbl:SetText(L.InstanceNames[instanceId]) 28 lbl:SetText(L.InstanceNames[instanceId])
28 lbl:SetFont(Amr.CreateFont("Regular", 20, Amr.Colors.White)) 29 lbl:SetFont(Amr.CreateFont("Regular", 20, Amr.Colors.White))
29 container:AddChild(lbl)
30 30
31 local line = AceGUI:Create("AmrUiPanel") 31 local line = AceGUI:Create("AmrUiPanel")
32 line:SetHeight(1) 32 line:SetHeight(1)
33 line:SetBackgroundColor(Amr.Colors.White) 33 line:SetBackgroundColor(Amr.Colors.White)
34 container:AddChild(line)
34 line:SetPoint("TOPLEFT", lbl.frame, "BOTTOMLEFT", 1, -7) 35 line:SetPoint("TOPLEFT", lbl.frame, "BOTTOMLEFT", 1, -7)
35 line:SetPoint("TOPRIGHT", lbl.frame, "BOTTOMRIGHT", 0, -7) 36 line:SetPoint("TOPRIGHT", lbl.frame, "BOTTOMRIGHT", 0, -7)
36 container:AddChild(line)
37 37
38 local chkMythic = createDifficultyCheckBox(instanceId, Amr.Difficulties.Mythic) 38 local chkMythic = createDifficultyCheckBox(instanceId, Amr.Difficulties.Mythic)
39 container:AddChild(chkMythic)
39 chkMythic:SetPoint("TOPLEFT", line.frame, "BOTTOMLEFT", 0, -8) 40 chkMythic:SetPoint("TOPLEFT", line.frame, "BOTTOMLEFT", 0, -8)
40 container:AddChild(chkMythic)
41 41
42 local chkNormal = createDifficultyCheckBox(instanceId, Amr.Difficulties.Normal) 42 local chkNormal = createDifficultyCheckBox(instanceId, Amr.Difficulties.Normal)
43 container:AddChild(chkNormal)
43 chkNormal:SetPoint("TOPLEFT", line.frame, "BOTTOMLEFT", 0, -30) 44 chkNormal:SetPoint("TOPLEFT", line.frame, "BOTTOMLEFT", 0, -30)
44 container:AddChild(chkNormal)
45 45
46 -- find the widest of mythic/normal 46 -- find the widest of mythic/normal
47 local w = math.max(chkMythic:GetWidth(), chkNormal:GetWidth()) 47 local w = math.max(chkMythic:GetWidth(), chkNormal:GetWidth())
48 48
49 local chkHeroic = createDifficultyCheckBox(instanceId, Amr.Difficulties.Heroic) 49 local chkHeroic = createDifficultyCheckBox(instanceId, Amr.Difficulties.Heroic)
50 container:AddChild(chkHeroic)
50 chkHeroic:SetPoint("TOPLEFT", line.frame, "BOTTOMLEFT", w + 20, -8) 51 chkHeroic:SetPoint("TOPLEFT", line.frame, "BOTTOMLEFT", w + 20, -8)
51 container:AddChild(chkHeroic)
52 52
53 local chkLfr = createDifficultyCheckBox(instanceId, Amr.Difficulties.Lfr) 53 local chkLfr = createDifficultyCheckBox(instanceId, Amr.Difficulties.Lfr)
54 container:AddChild(chkLfr)
54 chkLfr:SetPoint("TOPLEFT", line.frame, "BOTTOMLEFT", w + 20, -30) 55 chkLfr:SetPoint("TOPLEFT", line.frame, "BOTTOMLEFT", w + 20, -30)
55 container:AddChild(chkLfr)
56 56
57 return lbl, chkNormal 57 return lbl, chkNormal
58 end 58 end
59 59
60 -- renders the main UI for the Combat Log tab 60 -- renders the main UI for the Combat Log tab
65 _btnToggle:SetText(L.LogButtonStartText) 65 _btnToggle:SetText(L.LogButtonStartText)
66 _btnToggle:SetBackgroundColor(Amr.Colors.Green) 66 _btnToggle:SetBackgroundColor(Amr.Colors.Green)
67 _btnToggle:SetFont(Amr.CreateFont("Bold", 16, Amr.Colors.White)) 67 _btnToggle:SetFont(Amr.CreateFont("Bold", 16, Amr.Colors.White))
68 _btnToggle:SetWidth(200) 68 _btnToggle:SetWidth(200)
69 _btnToggle:SetHeight(26) 69 _btnToggle:SetHeight(26)
70 _btnToggle:SetPoint("TOPLEFT", container.content, "TOPLEFT", 0, -40)
71 _btnToggle:SetCallback("OnClick", function() Amr:ToggleLogging() end) 70 _btnToggle:SetCallback("OnClick", function() Amr:ToggleLogging() end)
72 container:AddChild(_btnToggle) 71 container:AddChild(_btnToggle)
72 _btnToggle:SetPoint("TOPLEFT", container.content, "TOPLEFT", 0, -40)
73 73
74 _lblLogging = AceGUI:Create("AmrUiLabel") 74 _lblLogging = AceGUI:Create("AmrUiLabel")
75 container:AddChild(_lblLogging)
75 _lblLogging:SetText(L.LogNote) 76 _lblLogging:SetText(L.LogNote)
76 _lblLogging:SetWidth(200) 77 _lblLogging:SetWidth(200)
77 _lblLogging:SetFont(Amr.CreateFont("Italic", 14, Amr.Colors.BrightGreen)) 78 _lblLogging:SetFont(Amr.CreateFont("Italic", 14, Amr.Colors.BrightGreen))
78 _lblLogging:SetJustifyH("MIDDLE") 79 _lblLogging:SetJustifyH("MIDDLE")
79 _lblLogging:SetPoint("TOP", _btnToggle.frame, "BOTTOM", 0, -5) 80 _lblLogging:SetPoint("TOP", _btnToggle.frame, "BOTTOM", 0, -5)
80 container:AddChild(_lblLogging)
81 81
82 local btnReload = AceGUI:Create("AmrUiButton") 82 local btnReload = AceGUI:Create("AmrUiButton")
83 btnReload:SetText(L.LogButtonReloadText) 83 btnReload:SetText(L.LogButtonReloadText)
84 btnReload:SetBackgroundColor(Amr.Colors.Blue) 84 btnReload:SetBackgroundColor(Amr.Colors.Blue)
85 btnReload:SetFont(Amr.CreateFont("Bold", 16, Amr.Colors.White)) 85 btnReload:SetFont(Amr.CreateFont("Bold", 16, Amr.Colors.White))
86 btnReload:SetWidth(200) 86 btnReload:SetWidth(200)
87 btnReload:SetHeight(26) 87 btnReload:SetHeight(26)
88 btnReload:SetPoint("TOPLEFT", _btnToggle.frame, "TOPRIGHT", 40, 0)
89 btnReload:SetCallback("OnClick", ReloadUI) 88 btnReload:SetCallback("OnClick", ReloadUI)
90 container:AddChild(btnReload) 89 container:AddChild(btnReload)
90 btnReload:SetPoint("TOPLEFT", _btnToggle.frame, "TOPRIGHT", 40, 0)
91 91
92 --[[ 92 --[[
93 local lbl = AceGUI:Create("AmrUiLabel") 93 local lbl = AceGUI:Create("AmrUiLabel")
94 lbl:SetText(L.LogReloadNote) 94 lbl:SetText(L.LogReloadNote)
95 lbl:SetWidth(200) 95 lbl:SetWidth(200)
158 container:AddChild(lbl2) 158 container:AddChild(lbl2)
159 ]] 159 ]]
160 160
161 -- auto-logging controls 161 -- auto-logging controls
162 local lbl = AceGUI:Create("AmrUiLabel") 162 local lbl = AceGUI:Create("AmrUiLabel")
163 container:AddChild(lbl)
163 lbl:SetWidth(600) 164 lbl:SetWidth(600)
164 lbl:SetText(L.LogAutoTitle) 165 lbl:SetText(L.LogAutoTitle)
165 lbl:SetFont(Amr.CreateFont("Bold", 24, Amr.Colors.TextHeaderActive)) 166 lbl:SetFont(Amr.CreateFont("Bold", 24, Amr.Colors.TextHeaderActive))
166 lbl:SetPoint("TOPLEFT", _btnToggle.frame, "BOTTOMLEFT", 0, -40) 167 lbl:SetPoint("TOPLEFT", _btnToggle.frame, "BOTTOMLEFT", 0, -40)
167 container:AddChild(lbl)
168 168
169 _chkAutoAll = AceGUI:Create("AmrUiCheckBox") 169 _chkAutoAll = AceGUI:Create("AmrUiCheckBox")
170 _chkAutoAll:SetText(L.LogAutoAllText) 170 _chkAutoAll:SetText(L.LogAutoAllText)
171 _chkAutoAll:SetPoint("TOPLEFT", lbl.frame, "BOTTOMLEFT", 1, -15)
172 _chkAutoAll:SetCallback("OnClick", function(widget) Amr:ToggleAllAutoLog() end) 171 _chkAutoAll:SetCallback("OnClick", function(widget) Amr:ToggleAllAutoLog() end)
173 container:AddChild(_chkAutoAll) 172 container:AddChild(_chkAutoAll)
173 _chkAutoAll:SetPoint("TOPLEFT", lbl.frame, "BOTTOMLEFT", 1, -15)
174 174
175 _autoChecks = {} 175 _autoChecks = {}
176 176
177 -- go through all supported instances, rendering in a left->right pattern, 2 per row 177 -- go through all supported instances, rendering in a left->right pattern, 2 per row
178 local autoLbls = {} 178 local autoLbls = {}
188 end 188 end
189 189
190 table.insert(autoLbls, autoLbl) 190 table.insert(autoLbls, autoLbl)
191 table.insert(autoChks, autoChk) 191 table.insert(autoChks, autoChk)
192 end 192 end
193 autoSections = nil 193 autoLbls = nil
194 194 autoChks = nil
195
195 -- instructions 196 -- instructions
196 --[[ 197 --[[
197 lbl = AceGUI:Create("AmrUiLabel") 198 lbl = AceGUI:Create("AmrUiLabel")
198 lbl:SetText(L.LogInstructionsTitle) 199 lbl:SetText(L.LogInstructionsTitle)
199 lbl:SetWidth(480) 200 lbl:SetWidth(480)