adam@0
|
1 local _, AskMrRobot = ...
|
yellowfive@11
|
2 local L = AskMrRobot.L;
|
adam@0
|
3
|
adam@0
|
4 AskMrRobot.SummaryTab = AskMrRobot.inheritsFrom(AskMrRobot.Frame)
|
adam@0
|
5
|
adam@0
|
6 function AskMrRobot.SummaryTab:new(parent)
|
adam@0
|
7
|
adam@0
|
8 local tab = AskMrRobot.Frame:new(nil, parent)
|
adam@0
|
9 setmetatable(tab, { __index = AskMrRobot.SummaryTab })
|
adam@0
|
10 tab:SetPoint("TOPLEFT")
|
adam@0
|
11 tab:SetPoint("BOTTOMRIGHT")
|
adam@0
|
12 tab:Hide()
|
adam@0
|
13
|
adam@0
|
14
|
adam@0
|
15 tab.importDate = ""
|
adam@0
|
16
|
adam@0
|
17 local text = tab:CreateFontString("AmrSummaryText1", "ARTWORK", "GameFontNormalLarge")
|
adam@0
|
18 text:SetPoint("TOPLEFT", 0, -5)
|
yellowfive@11
|
19 text:SetFormattedText(L.AMR_SUMMARYTAB_TITLE)
|
adam@0
|
20
|
adam@0
|
21 -- error text
|
adam@0
|
22 tab.errorText1 = tab:CreateFontString("AmrSummaryErrorText1", "ARTWORK", "GameFontRedLarge")
|
adam@0
|
23 tab.errorText1:SetPoint("TOPLEFT", "AmrSummaryText1", "BOTTOMLEFT", 0, -20)
|
yellowfive@11
|
24 tab.errorText1:SetText(L.AMR_SUMMARYTAB_NO_IMPORT)
|
adam@0
|
25 tab.errorText1:SetPoint("RIGHT", -20, 0)
|
adam@0
|
26 tab.errorText1:SetWidth(tab.errorText1:GetWidth())
|
adam@0
|
27 tab.errorText1:SetWordWrap(true)
|
adam@0
|
28 tab.errorText1:SetJustifyH("LEFT")
|
adam@0
|
29
|
adam@0
|
30 tab.errorText2 = tab:CreateFontString("AmrSummaryErrorText2", "ARTWORK", "GameFontWhite")
|
adam@0
|
31 tab.errorText2:SetPoint("TOPLEFT", "AmrSummaryErrorText1", "BOTTOMLEFT", 0, -15)
|
adam@0
|
32 tab.errorText2:SetPoint("RIGHT", -20, 0)
|
adam@0
|
33 tab.errorText2:SetWidth(tab.errorText2:GetWidth())
|
adam@0
|
34 tab.errorText2:SetJustifyH("LEFT")
|
yellowfive@11
|
35 tab.errorText2:SetText(L.AMR_SUMMARYTAB_GET_STARTED)
|
adam@0
|
36
|
adam@0
|
37 -- bad items
|
adam@0
|
38 tab.badItemSlots = {}
|
adam@0
|
39 tab.badItemNames = {}
|
adam@0
|
40
|
adam@0
|
41 local itemText = tab:CreateFontString("AmrBadItemSlot0", "ARTWORK", "GameFontNormal")
|
adam@0
|
42 itemText:SetPoint("TOPLEFT", "AmrSummaryErrorText2", "BOTTOMLEFT", 0, -20)
|
adam@0
|
43 itemText:SetText("Slot")
|
adam@0
|
44 itemText:SetWidth(100)
|
adam@0
|
45 itemText:SetJustifyH("LEFT")
|
adam@0
|
46 itemText:Hide()
|
adam@0
|
47 tinsert(tab.badItemSlots, itemText)
|
adam@0
|
48
|
adam@0
|
49 itemText = tab:CreateFontString("AmrBadItemName0", "ARTWORK", "GameFontNormal")
|
adam@0
|
50 itemText:SetPoint("TOPLEFT", "AmrBadItemSlot0", "TOPLEFT", 120, 0)
|
adam@0
|
51 itemText:SetPoint("RIGHT", -30, 0)
|
adam@0
|
52 itemText:SetText("Item Name")
|
adam@0
|
53 itemText:SetJustifyH("LEFT")
|
adam@0
|
54 itemText:Hide()
|
adam@0
|
55 tinsert(tab.badItemNames, itemText)
|
adam@0
|
56
|
adam@0
|
57 itemText = tab:CreateFontString(nil, "ARTWORK", "GameFontWhite")
|
adam@0
|
58 itemText:SetPoint("LEFT", 0, 0)
|
adam@0
|
59 itemText:SetPoint("RIGHT", -30, 0)
|
adam@0
|
60 itemText:SetPoint("TOP", "AmrBadItemSlot0", "TOP", 0, 0 )
|
yellowfive@11
|
61 itemText:SetText(L.AMR_SUMMARYTAB_GO_UPGRADE)
|
adam@0
|
62 itemText:SetJustifyH("LEFT")
|
adam@0
|
63 itemText:Hide()
|
adam@0
|
64 tab.upgradeInstructions = itemText
|
adam@0
|
65
|
adam@0
|
66 itemText = tab:CreateFontString(nil, "ARTWORK", "GameFontNormal")
|
adam@0
|
67 itemText:SetPoint("LEFT", "AmrBadItemSlot0", "LEFT", 0, -20)
|
adam@0
|
68 itemText:SetPoint("RIGHT", "AmrBadItemSlot0", "RIGHT", 0, -20)
|
adam@0
|
69 itemText:SetPoint("TOP", tab.upgradeInstructions, "BOTTOM", 0, -10 )
|
adam@0
|
70 itemText:SetHeight(20)
|
yellowfive@11
|
71 itemText:SetText(L.AMR_SUMMARYTAB_SLOT)
|
adam@0
|
72 itemText:SetJustifyH("LEFT")
|
adam@0
|
73 itemText:Hide()
|
adam@0
|
74 tab.upgradeSlotHeader = itemText
|
adam@0
|
75
|
adam@0
|
76 itemText = tab:CreateFontString(nil, "ARTWORK", "GameFontNormal")
|
adam@0
|
77 itemText:SetPoint("LEFT", "AmrBadItemName0", "LEFT", 0, 0)
|
adam@0
|
78 itemText:SetPoint("RIGHT", "AmrBadItemName0", "RIGHT", 0, 0)
|
adam@0
|
79 itemText:SetPoint("TOP", tab.upgradeSlotHeader, "TOP", 0, 0)
|
adam@0
|
80 itemText:SetPoint("BOTTOM", tab.upgradeSlotHeader, "BOTTOM", 0, 0)
|
yellowfive@11
|
81 itemText:SetText(L.AMR_SUMMARYTAB_ITEM_NAME)
|
adam@0
|
82 itemText:SetJustifyH("LEFT")
|
adam@0
|
83 itemText:Hide()
|
adam@0
|
84 tab.upgradeItemHeader = itemText
|
adam@0
|
85
|
adam@17
|
86 for i = 1, #AskMrRobot.slotIds do
|
adam@0
|
87 local itemText = tab:CreateFontString("AmrBadItemSlot" .. i, "ARTWORK", "GameFontWhite")
|
adam@0
|
88 itemText:SetPoint("TOPLEFT", "AmrBadItemSlot" .. (i-1), "BOTTOMLEFT", 0, -5)
|
adam@0
|
89 itemText:SetPoint("TOPRIGHT", "AmrBadItemSlot" .. (i-1), "BOTTOMRIGHT", 0, -5)
|
adam@0
|
90 itemText:SetJustifyH("LEFT")
|
adam@0
|
91 itemText:Hide()
|
adam@0
|
92 tinsert(tab.badItemSlots, itemText)
|
adam@0
|
93
|
adam@0
|
94 itemText = AskMrRobot.ItemLinkText:new(nil, tab)
|
adam@0
|
95 itemText:SetPoint("LEFT", "AmrBadItemName0", "TOPLEFT", 0, 0)
|
adam@0
|
96 itemText:SetPoint("RIGHT", "AmrBadItemName0", "BOTTOMRIGHT", 0, 0)
|
adam@0
|
97 itemText:SetPoint("TOP", "AmrBadItemSlot" .. i, 0, 0)
|
adam@0
|
98 itemText:SetPoint("BOTTOM", "AmrBadItemSlot" .. i, 0, 0)
|
adam@0
|
99 itemText:Hide()
|
adam@0
|
100 tinsert(tab.badItemNames, itemText)
|
adam@0
|
101 end
|
adam@0
|
102
|
adam@0
|
103 tab.upgradeItemSlots = {}
|
adam@0
|
104 tab.upgradeItemNames = {}
|
adam@17
|
105 for i = 1, #AskMrRobot.slotIds do
|
adam@0
|
106 local itemText = tab:CreateFontString(nil, "ARTWORK", "GameFontWhite")
|
adam@0
|
107 if i == 1 then
|
adam@0
|
108 itemText:SetPoint("TOPLEFT", tab.upgradeSlotHeader, "BOTTOMLEFT", 0, -5)
|
adam@0
|
109 itemText:SetPoint("TOPRIGHT", tab.upgradeSlotHeader, "BOTTOMRIGHT", 0, -5)
|
adam@0
|
110 else
|
adam@0
|
111 itemText:SetPoint("TOPLEFT", tab.upgradeItemSlots[i-1], "BOTTOMLEFT", 0, -5)
|
adam@0
|
112 itemText:SetPoint("TOPRIGHT", tab.upgradeItemSlots[i-1], "BOTTOMRIGHT", 0, -5)
|
adam@0
|
113 end
|
adam@0
|
114 itemText:SetJustifyH("LEFT")
|
adam@0
|
115 itemText:Hide()
|
adam@0
|
116 tinsert(tab.upgradeItemSlots, itemText)
|
adam@0
|
117
|
adam@0
|
118 itemText = AskMrRobot.ItemLinkText:new(nil, tab)
|
adam@0
|
119 itemText:SetFormat("|cff00ff00Upgrade|r %s")
|
adam@0
|
120 itemText:SetPoint("LEFT", tab.upgradeItemHeader, "LEFT", 0, 0)
|
adam@0
|
121 itemText:SetPoint("RIGHT", tab.upgradeItemHeader, "RIGHT", 0, 0)
|
adam@0
|
122 itemText:SetPoint("TOP", tab.upgradeItemSlots[i], 0, 0)
|
adam@0
|
123 itemText:SetPoint("BOTTOM", tab.upgradeItemSlots[i], 0, 0)
|
adam@0
|
124 itemText:Hide()
|
adam@0
|
125 tinsert(tab.upgradeItemNames, itemText)
|
adam@0
|
126 end
|
adam@0
|
127
|
adam@0
|
128 tab.importInfo = tab:CreateFontString(nil, "ARTWORK", "GameFontNormal")
|
yellowfive@11
|
129 tab.importInfo:SetText(L.AMR_SUMMARYTAB_LAST_IMPORT)
|
adam@0
|
130 tab.importInfo:SetPoint("TOPLEFT", text, "BOTTOMLEFT", 0, -20)
|
adam@0
|
131 tab.importInfo:SetJustifyH("LEFT")
|
adam@0
|
132 tab.importInfo:Hide()
|
adam@0
|
133
|
adam@0
|
134 tab.specIcon = tab:CreateTexture(nil, "BACKGROUND")
|
adam@0
|
135 tab.specIcon:SetPoint("TOPLEFT")
|
adam@0
|
136 tab.specIcon:SetWidth(64)
|
adam@0
|
137 tab.specIcon:SetHeight(64)
|
adam@0
|
138 tab.specIcon:SetPoint("TOPLEFT", tab.importInfo, "BOTTOMLEFT", 0, -10)
|
adam@0
|
139 tab.specIcon:Hide()
|
adam@0
|
140
|
adam@0
|
141 tab.stamp = AskMrRobot.RobotStamp:new(nil, tab)
|
adam@0
|
142 tab.stamp:Hide()
|
yellowfive@11
|
143 tab.stamp.smallText:SetText(L.AMR_SUMMARYTAB_OPTIMAL)
|
adam@0
|
144 tab.stamp:SetPoint("TOPLEFT", tab.specIcon, "BOTTOMLEFT", 2, -25)
|
adam@0
|
145 tab.stamp:SetPoint("RIGHT", tab, "RIGHT", -20, 0)
|
adam@0
|
146 tab.stamp:Hide()
|
adam@0
|
147
|
adam@0
|
148 tab.specText = tab:CreateFontString(nil, "ARTWORK", "GameFontHighlightLarge")
|
adam@0
|
149 local Path, Size, Flags = tab.specText:GetFont()
|
adam@0
|
150 tab.specText:SetFont(Path, 24, Flags);
|
adam@0
|
151 tab.specText:SetPoint("LEFT", tab.specIcon, "RIGHT", 10, 0)
|
adam@0
|
152 tab.specText:SetText("?")
|
adam@0
|
153 tab.specText:Hide()
|
adam@0
|
154
|
adam@0
|
155 tab.optimizationSummary = tab:CreateFontString(nil, "ARTWORK", "GameFontNormal")
|
adam@0
|
156 tab.optimizationSummary:SetPoint("TOPLEFT", tab.specIcon, "BOTTOMLEFT", 0, -15)
|
yellowfive@11
|
157 tab.optimizationSummary:SetText(L.AMR_SUMMARYTAB_OPTIMIZATIONS_TO_GO)
|
adam@0
|
158 tab.optimizationSummary:Hide()
|
adam@0
|
159
|
adam@0
|
160 tab.gemCount = tab:CreateFontString(nil, "ARTWORK", "GameFontWhite")
|
adam@0
|
161 tab.gemCount:SetPoint("TOPLEFT", tab.optimizationSummary, "BOTTOMLEFT", 0, -15)
|
yellowfive@11
|
162 tab.gemCount:SetText(L.AMR_SUMMARYTAB_GEMS_TO_GO)
|
adam@0
|
163 tab.gemCount:Hide()
|
adam@0
|
164
|
adam@0
|
165 tab.enchantCount = tab:CreateFontString(nil, "ARTWORK", "GameFontWhite")
|
adam@0
|
166 tab.enchantCount:SetPoint("TOPLEFT", tab.gemCount, "BOTTOMLEFT", 0, -5)
|
yellowfive@11
|
167 tab.enchantCount:SetText(L.AMR_SUMMARYTAB_ENCHANTS_TO_GO)
|
adam@0
|
168 tab.enchantCount:Hide()
|
adam@0
|
169
|
adam@0
|
170 tab.instructions = tab:CreateFontString(nil, "ARTWORK", "GameFontWhite")
|
adam@17
|
171 tab.instructions:SetPoint("TOPLEFT", tab.enchantCount, "BOTTOMLEFT", 0, -15)
|
yellowfive@11
|
172 tab.instructions:SetText(L.AMR_SUMMARYTAB_VIEW_TABS)
|
adam@0
|
173 tab.instructions:Hide()
|
adam@0
|
174
|
adam@0
|
175 return tab
|
adam@0
|
176 end
|
adam@0
|
177
|
adam@0
|
178 function AskMrRobot.SummaryTab:getSpecIcon(specId)
|
adam@0
|
179 for i = 1, GetNumSpecializations() do
|
adam@0
|
180 local id, _, _, icon = GetSpecializationInfo(i)
|
adam@0
|
181 if id == specId then
|
adam@0
|
182 return icon
|
adam@0
|
183 end
|
adam@0
|
184 end
|
adam@0
|
185 return nil
|
adam@0
|
186 end
|
adam@0
|
187
|
adam@0
|
188 function AskMrRobot.SummaryTab:showBadItems()
|
adam@0
|
189 local i = 2
|
adam@0
|
190
|
adam@17
|
191 -- for all slots
|
adam@17
|
192 for iSlot = 1, #AskMrRobot.slotIds do
|
adam@17
|
193 local slotId = AskMrRobot.slotIds[iSlot]
|
adam@17
|
194 local badItem = AskMrRobot.ComparisonResult.items[slotId]
|
adam@17
|
195 if badItem ~= nil and not badItem.needsUpgrade then
|
adam@17
|
196 self.badItemSlots[i]:SetText(AskMrRobot.slotDisplayText[slotId])
|
adam@0
|
197 self.badItemSlots[i]:Show()
|
adam@0
|
198 if badItem.optimized then
|
yellowfive@31
|
199 self.badItemNames[i]:SetItem(badItem.optimized)
|
adam@0
|
200 else
|
yellowfive@31
|
201 self.badItemNames[i]:SetItem(nil)
|
adam@0
|
202 end
|
adam@0
|
203 self.badItemNames[i]:Show()
|
adam@0
|
204 i = i + 1
|
adam@0
|
205 end
|
adam@0
|
206 end
|
adam@0
|
207
|
adam@0
|
208 -- for all the upgrade items
|
adam@0
|
209 local j = 1
|
adam@17
|
210 for iSlot = 1, #AskMrRobot.slotIds do
|
adam@17
|
211 local slotId = AskMrRobot.slotIds[iSlot]
|
adam@17
|
212 local badItem = AskMrRobot.ComparisonResult.items[slotId]
|
adam@17
|
213 if badItem ~= nil and badItem.needsUpgrade then
|
adam@17
|
214 self.upgradeItemSlots[j]:SetText(AskMrRobot.slotDisplayText[slotId])
|
adam@0
|
215 self.upgradeItemSlots[j]:Show()
|
adam@0
|
216 if badItem.optimized then
|
yellowfive@31
|
217 self.upgradeItemNames[j]:SetItem(badItem)
|
adam@0
|
218 else
|
yellowfive@31
|
219 self.upgradeItemNames[j]:SetItem(nil)
|
adam@0
|
220 end
|
adam@0
|
221 self.upgradeItemNames[j]:Show()
|
adam@0
|
222 j = j + 1
|
adam@0
|
223 end
|
adam@0
|
224 end
|
adam@0
|
225
|
adam@0
|
226 -- hide / show the headers
|
adam@0
|
227 if i == 2 and j == 1 then
|
adam@0
|
228 self.badItemSlots[1]:Hide()
|
adam@0
|
229 self.badItemNames[1]:Hide()
|
adam@0
|
230 self:showImportError(nil)
|
adam@0
|
231 self.importInfo:Show()
|
adam@0
|
232 self.specIcon:Show()
|
adam@0
|
233 self.optimizationSummary:Show()
|
adam@0
|
234 self.gemCount:Show()
|
adam@0
|
235 self.enchantCount:Show()
|
adam@0
|
236 self.instructions:Show()
|
adam@0
|
237 self.specText:Show()
|
adam@0
|
238
|
adam@0
|
239 local gemCount = 0
|
adam@17
|
240 for slotNum, badGems in pairs(AskMrRobot.ComparisonResult.gems) do
|
adam@17
|
241 --for k, v in pairs(badGems.badGems) do
|
adam@17
|
242 --gemCount = gemCount + 1
|
adam@17
|
243 --end
|
adam@17
|
244 for g = 1, 3 do
|
adam@17
|
245 if not AskMrRobot.AreGemsCompatible(badGems.current[g], badGems.optimized[g]) then
|
adam@17
|
246 gemCount = gemCount + 1
|
adam@17
|
247 end
|
adam@0
|
248 end
|
adam@0
|
249 end
|
adam@0
|
250
|
yellowfive@11
|
251 self.gemCount:SetFormattedText(L.AMR_SUMMARYTAB_GEMCOUNT, gemCount)
|
adam@0
|
252
|
adam@0
|
253 local enchantCount = 0
|
adam@17
|
254 for slotNum, badEnchant in pairs(AskMrRobot.ComparisonResult.enchants) do
|
adam@0
|
255 enchantCount = enchantCount + 1
|
adam@0
|
256 end
|
adam@0
|
257
|
yellowfive@11
|
258 self.enchantCount:SetFormattedText(L.AMR_SUMMARYTAB_ENCHANTCOUNT, enchantCount)
|
adam@0
|
259
|
adam@17
|
260 self.optimizationSummary:SetFormattedText(L.AMR_SUMMARYTAB_OPTIMIZATIONCOUNT, gemCount + enchantCount)
|
adam@0
|
261
|
adam@17
|
262 if gemCount + enchantCount == 0 then
|
adam@0
|
263 self.stamp:Show()
|
adam@0
|
264 self.optimizationSummary:Hide()
|
adam@0
|
265 self.enchantCount:Hide()
|
adam@0
|
266 self.instructions:Hide()
|
adam@0
|
267 self.gemCount:Hide()
|
adam@0
|
268 else
|
adam@0
|
269 self.stamp:Hide()
|
adam@0
|
270 self.optimizationSummary:Show()
|
adam@0
|
271 self.enchantCount:Show()
|
adam@0
|
272 self.instructions:Show()
|
adam@0
|
273 self.gemCount:Show()
|
adam@0
|
274 end
|
adam@0
|
275
|
adam@0
|
276 local activeSpecGroup = GetActiveSpecGroup()
|
adam@0
|
277
|
adam@0
|
278 if activeSpecGroup == nil then
|
adam@17
|
279 self.importInfo:SetFormattedText(L.AMR_SUMMARYTAB_LAST_IMPORT_1, AmrDb.LastCharacterImportDate, UnitName("player"))
|
adam@0
|
280 else
|
adam@17
|
281 self.importInfo:SetFormattedText(L.AMR_SUMMARYTAB_LAST_IMPORT_2, AmrDb.LastCharacterImportDate, UnitName("player"))
|
adam@0
|
282 local spec = GetSpecialization(false, false, group);
|
adam@0
|
283 if spec then
|
adam@0
|
284 local _, name, _, icon = GetSpecializationInfo(spec);
|
adam@0
|
285 if activeSpecGroup == 1 then
|
yellowfive@11
|
286 self.specText:SetFormattedText(L.AMR_SUMMARYTAB_LAST_IMPORT_PSPEC, name)
|
adam@0
|
287 else
|
yellowfive@11
|
288 self.specText:SetFormattedText(L.AMR_SUMMARYTAB_LAST_IMPORT_SSPEC, name)
|
adam@0
|
289 end
|
adam@0
|
290 self.specIcon:SetTexture(icon)
|
adam@0
|
291 end
|
adam@0
|
292 end
|
adam@0
|
293
|
adam@0
|
294
|
adam@0
|
295 --local currentSpec = GetAmrSpecialization(GetActiveSpecGroup())
|
adam@0
|
296 --return (not currentSpec and not spec) or tostring(currentSpec) == spec
|
adam@0
|
297 else
|
adam@0
|
298 self.importInfo:Hide()
|
adam@0
|
299 self.specIcon:Hide()
|
adam@0
|
300 self.optimizationSummary:Hide()
|
adam@0
|
301 self.gemCount:Hide()
|
adam@0
|
302 self.enchantCount:Hide()
|
adam@0
|
303 self.instructions:Hide()
|
adam@0
|
304 self.specText:Hide()
|
adam@0
|
305 end
|
adam@0
|
306
|
adam@0
|
307 if i == 2 then
|
adam@0
|
308 self.badItemSlots[1]:Hide()
|
adam@0
|
309 self.badItemNames[1]:Hide()
|
adam@0
|
310 else
|
adam@0
|
311 self.badItemSlots[1]:Show()
|
adam@0
|
312 self.badItemNames[1]:Show()
|
adam@0
|
313 local warnings = {}
|
adam@0
|
314 if self.badRealm then
|
yellowfive@11
|
315 tinsert(warnings, L.AMR_SUMMARYTAB_DIFF_REALM:format(self.badRealm))
|
adam@0
|
316 end
|
adam@0
|
317 if self.badTalents then
|
yellowfive@11
|
318 tinsert(warnings, L.AMR_SUMMARYTAB_DIFF_TALENT)
|
adam@0
|
319 end
|
adam@0
|
320 if self.badGlyphs then
|
yellowfive@11
|
321 tinsert(warnings, L.AMR_SUMMARYTAB_DIFF_GLYPHS)
|
adam@0
|
322 end
|
yellowfive@11
|
323 local message = L.AMR_SUMMARYTAB_DIFF_GEAR
|
adam@0
|
324 if #warnings > 0 then
|
yellowfive@11
|
325 message = message .. " (".. L.AMR_SUMMARYTAB_DIFF_AND.." "
|
adam@0
|
326 for k = 1, #warnings do
|
adam@0
|
327 if k > 1 then
|
adam@0
|
328 message = message .. ', '
|
adam@0
|
329 end
|
adam@0
|
330 message = message .. warnings[k]
|
adam@0
|
331 end
|
adam@0
|
332 message = message .. ")"
|
adam@0
|
333 end
|
yellowfive@11
|
334 message = message .. L.AMR_SUMMARYTAB_DIFF_PLEASE_EQ
|
yellowfive@11
|
335 self:showImportWarning(L.AMR_SUMMARYTAB_DIFF_CHECK_CHAR, message)
|
adam@0
|
336 end
|
adam@0
|
337
|
adam@0
|
338 if j == 1 then
|
adam@0
|
339 self.upgradeItemHeader:Hide()
|
adam@0
|
340 self.upgradeSlotHeader:Hide()
|
adam@0
|
341 self.upgradeInstructions:Hide()
|
adam@0
|
342 else
|
adam@0
|
343 if i == 2 then
|
adam@0
|
344 local warnings = {}
|
adam@0
|
345 if self.badRealm then
|
yellowfive@11
|
346 tinsert(warnings, L.AMR_SUMMARYTAB_DIFF_REALM:format(self.badRealm))
|
adam@0
|
347 end
|
adam@0
|
348 if self.badTalents then
|
yellowfive@11
|
349 tinsert(warnings, L.AMR_SUMMARYTAB_DIFF_TALENT)
|
adam@0
|
350 end
|
adam@0
|
351 if self.badGlyphs then
|
yellowfive@11
|
352 tinsert(warnings, L.AMR_SUMMARYTAB_DIFF_GLYPHS)
|
adam@0
|
353 end
|
adam@0
|
354 local message = nil
|
adam@0
|
355 if #warnings > 0 then
|
yellowfive@11
|
356 message = L.AMR_SUMMARYTAB_DIFF_OPTIMIZED_FOR
|
adam@0
|
357 for k = 1, #warnings do
|
adam@0
|
358 if k > 1 then
|
adam@0
|
359 message = message .. ', '
|
adam@0
|
360 end
|
adam@0
|
361 message = message .. warnings[k]
|
adam@0
|
362 end
|
adam@0
|
363 message = message .. "."
|
adam@0
|
364 end
|
yellowfive@11
|
365 self:showImportWarning(L.AMR_SUMMARYTAB_DIFF_CHECK_CHAR, message)
|
adam@0
|
366 end
|
adam@0
|
367 self.upgradeItemHeader:Show()
|
adam@0
|
368 self.upgradeSlotHeader:Show()
|
adam@0
|
369 self.upgradeInstructions:Show()
|
adam@0
|
370 if i == 2 then
|
adam@0
|
371 self.upgradeInstructions:SetPoint("TOP", self.badItemSlots[1], "TOP", 0, 0)
|
adam@0
|
372 self.errorText2:Hide()
|
adam@0
|
373 else
|
adam@0
|
374 self.upgradeInstructions:SetPoint("TOP", self.badItemSlots[i], "BOTTOM", 0, -20)
|
adam@0
|
375 end
|
adam@0
|
376 end
|
adam@0
|
377
|
adam@0
|
378 -- hide the remaining slots
|
adam@0
|
379 while i <= #self.badItemSlots do
|
adam@0
|
380 self.badItemSlots[i]:Hide()
|
adam@0
|
381 self.badItemNames[i]:Hide()
|
adam@0
|
382 i = i + 1
|
adam@0
|
383 end
|
adam@0
|
384
|
adam@0
|
385 -- hide the remaining slots
|
adam@0
|
386 while j <= #self.upgradeItemSlots do
|
adam@0
|
387 self.upgradeItemSlots[j]:Hide()
|
adam@0
|
388 self.upgradeItemNames[j]:Hide()
|
adam@0
|
389 j = j + 1
|
adam@0
|
390 end
|
adam@0
|
391 end
|
adam@0
|
392
|
adam@0
|
393
|
adam@0
|
394 function AskMrRobot.SummaryTab:showImportError(text, text2)
|
adam@0
|
395 self.stamp:Hide()
|
adam@0
|
396 self.gemCount:Hide()
|
adam@0
|
397 self.instructions:Hide()
|
adam@0
|
398 self.enchantCount:Hide()
|
adam@0
|
399 self.optimizationSummary:Hide()
|
adam@0
|
400 if text then
|
adam@0
|
401 self.errorText1:Show()
|
yellowfive@11
|
402 self.errorText1:SetText(L.AMR_SUMMARYTAB_IMPORT_NOT_WORK:format(text))
|
adam@0
|
403 self.errorText1:Show()
|
adam@0
|
404 self.errorText2:SetText(text2)
|
adam@0
|
405 self.errorText2:Show()
|
adam@0
|
406 self.importInfo:Hide()
|
adam@0
|
407 self.upgradeSlotHeader:Hide()
|
adam@0
|
408 self.upgradeItemHeader:Hide()
|
adam@0
|
409 self.upgradeInstructions:Hide()
|
adam@0
|
410 self.specIcon:Hide()
|
adam@0
|
411 self.specText:Hide()
|
adam@0
|
412 else
|
adam@0
|
413 self.errorText1:Hide()
|
adam@0
|
414 self.errorText2:Hide()
|
adam@0
|
415 self.importInfo:Show()
|
adam@0
|
416 end
|
adam@17
|
417 for i = 1, #self.badItemSlots do
|
adam@0
|
418 self.badItemSlots[i]:Hide()
|
adam@0
|
419 self.badItemNames[i]:Hide()
|
adam@0
|
420 end
|
adam@17
|
421 for i = 1, #self.upgradeItemSlots do
|
adam@0
|
422 self.upgradeItemSlots[i]:Hide()
|
adam@0
|
423 self.upgradeItemNames[i]:Hide()
|
adam@0
|
424 end
|
adam@0
|
425 end
|
adam@0
|
426
|
adam@0
|
427 function AskMrRobot.SummaryTab:showImportWarning (text, text2)
|
adam@0
|
428 self.stamp:Hide()
|
adam@0
|
429 self.hasImportError = false
|
adam@0
|
430 self.gemCount:Hide()
|
adam@0
|
431 self.instructions:Hide()
|
adam@0
|
432 self.enchantCount:Hide()
|
adam@0
|
433 self.specIcon:Hide()
|
adam@0
|
434 self.specText:Hide()
|
adam@0
|
435 self.optimizationSummary:Hide()
|
adam@0
|
436 if text then
|
adam@0
|
437 self.errorText1:SetText(text)
|
adam@0
|
438 self.errorText1:Show()
|
adam@0
|
439 self.errorText2:SetText(text2)
|
adam@0
|
440 self.errorText2:Show()
|
adam@0
|
441 else
|
adam@0
|
442 self.errorText1:Hide()
|
adam@0
|
443 self.errorText2:Hide()
|
adam@0
|
444 end
|
adam@0
|
445 end
|