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)
|
yellowfive@49
|
173 tab.instructions:SetPoint("RIGHT", -20, 0)
|
yellowfive@49
|
174 tab.instructions:SetWidth(tab.instructions:GetWidth())
|
yellowfive@49
|
175 tab.instructions:SetWordWrap(true)
|
yellowfive@49
|
176 tab.instructions:SetJustifyH("LEFT")
|
adam@0
|
177 tab.instructions:Hide()
|
adam@0
|
178
|
adam@0
|
179 return tab
|
adam@0
|
180 end
|
adam@0
|
181
|
adam@0
|
182 function AskMrRobot.SummaryTab:getSpecIcon(specId)
|
adam@0
|
183 for i = 1, GetNumSpecializations() do
|
adam@0
|
184 local id, _, _, icon = GetSpecializationInfo(i)
|
adam@0
|
185 if id == specId then
|
adam@0
|
186 return icon
|
adam@0
|
187 end
|
adam@0
|
188 end
|
adam@0
|
189 return nil
|
adam@0
|
190 end
|
adam@0
|
191
|
adam@0
|
192 function AskMrRobot.SummaryTab:showBadItems()
|
adam@0
|
193 local i = 2
|
adam@0
|
194
|
adam@17
|
195 -- for all slots
|
adam@17
|
196 for iSlot = 1, #AskMrRobot.slotIds do
|
adam@17
|
197 local slotId = AskMrRobot.slotIds[iSlot]
|
adam@17
|
198 local badItem = AskMrRobot.ComparisonResult.items[slotId]
|
adam@17
|
199 if badItem ~= nil and not badItem.needsUpgrade then
|
adam@17
|
200 self.badItemSlots[i]:SetText(AskMrRobot.slotDisplayText[slotId])
|
adam@0
|
201 self.badItemSlots[i]:Show()
|
adam@0
|
202 if badItem.optimized then
|
yellowfive@31
|
203 self.badItemNames[i]:SetItem(badItem.optimized)
|
adam@0
|
204 else
|
yellowfive@31
|
205 self.badItemNames[i]:SetItem(nil)
|
adam@0
|
206 end
|
adam@0
|
207 self.badItemNames[i]:Show()
|
adam@0
|
208 i = i + 1
|
adam@0
|
209 end
|
adam@0
|
210 end
|
adam@0
|
211
|
adam@0
|
212 -- for all the upgrade items
|
adam@0
|
213 local j = 1
|
adam@17
|
214 for iSlot = 1, #AskMrRobot.slotIds do
|
adam@17
|
215 local slotId = AskMrRobot.slotIds[iSlot]
|
adam@17
|
216 local badItem = AskMrRobot.ComparisonResult.items[slotId]
|
adam@17
|
217 if badItem ~= nil and badItem.needsUpgrade then
|
adam@17
|
218 self.upgradeItemSlots[j]:SetText(AskMrRobot.slotDisplayText[slotId])
|
adam@0
|
219 self.upgradeItemSlots[j]:Show()
|
adam@0
|
220 if badItem.optimized then
|
yellowfive@31
|
221 self.upgradeItemNames[j]:SetItem(badItem)
|
adam@0
|
222 else
|
yellowfive@31
|
223 self.upgradeItemNames[j]:SetItem(nil)
|
adam@0
|
224 end
|
adam@0
|
225 self.upgradeItemNames[j]:Show()
|
adam@0
|
226 j = j + 1
|
adam@0
|
227 end
|
adam@0
|
228 end
|
adam@0
|
229
|
adam@0
|
230 -- hide / show the headers
|
adam@0
|
231 if i == 2 and j == 1 then
|
adam@0
|
232 self.badItemSlots[1]:Hide()
|
adam@0
|
233 self.badItemNames[1]:Hide()
|
adam@0
|
234 self:showImportError(nil)
|
adam@0
|
235 self.importInfo:Show()
|
adam@0
|
236 self.specIcon:Show()
|
adam@0
|
237 self.optimizationSummary:Show()
|
adam@0
|
238 self.gemCount:Show()
|
adam@0
|
239 self.enchantCount:Show()
|
adam@0
|
240 self.instructions:Show()
|
adam@0
|
241 self.specText:Show()
|
adam@0
|
242
|
adam@0
|
243 local gemCount = 0
|
adam@17
|
244 for slotNum, badGems in pairs(AskMrRobot.ComparisonResult.gems) do
|
adam@17
|
245 --for k, v in pairs(badGems.badGems) do
|
adam@17
|
246 --gemCount = gemCount + 1
|
adam@17
|
247 --end
|
adam@17
|
248 for g = 1, 3 do
|
adam@17
|
249 if not AskMrRobot.AreGemsCompatible(badGems.current[g], badGems.optimized[g]) then
|
adam@17
|
250 gemCount = gemCount + 1
|
adam@17
|
251 end
|
adam@0
|
252 end
|
adam@0
|
253 end
|
adam@0
|
254
|
yellowfive@11
|
255 self.gemCount:SetFormattedText(L.AMR_SUMMARYTAB_GEMCOUNT, gemCount)
|
adam@0
|
256
|
adam@0
|
257 local enchantCount = 0
|
adam@17
|
258 for slotNum, badEnchant in pairs(AskMrRobot.ComparisonResult.enchants) do
|
adam@0
|
259 enchantCount = enchantCount + 1
|
adam@0
|
260 end
|
adam@0
|
261
|
yellowfive@11
|
262 self.enchantCount:SetFormattedText(L.AMR_SUMMARYTAB_ENCHANTCOUNT, enchantCount)
|
adam@0
|
263
|
adam@17
|
264 self.optimizationSummary:SetFormattedText(L.AMR_SUMMARYTAB_OPTIMIZATIONCOUNT, gemCount + enchantCount)
|
adam@0
|
265
|
adam@17
|
266 if gemCount + enchantCount == 0 then
|
adam@0
|
267 self.stamp:Show()
|
adam@0
|
268 self.optimizationSummary:Hide()
|
adam@0
|
269 self.enchantCount:Hide()
|
adam@0
|
270 self.instructions:Hide()
|
adam@0
|
271 self.gemCount:Hide()
|
adam@0
|
272 else
|
adam@0
|
273 self.stamp:Hide()
|
adam@0
|
274 self.optimizationSummary:Show()
|
adam@0
|
275 self.enchantCount:Show()
|
adam@0
|
276 self.instructions:Show()
|
adam@0
|
277 self.gemCount:Show()
|
adam@0
|
278 end
|
adam@0
|
279
|
adam@0
|
280 local activeSpecGroup = GetActiveSpecGroup()
|
adam@0
|
281
|
adam@0
|
282 if activeSpecGroup == nil then
|
adam@17
|
283 self.importInfo:SetFormattedText(L.AMR_SUMMARYTAB_LAST_IMPORT_1, AmrDb.LastCharacterImportDate, UnitName("player"))
|
adam@0
|
284 else
|
adam@17
|
285 self.importInfo:SetFormattedText(L.AMR_SUMMARYTAB_LAST_IMPORT_2, AmrDb.LastCharacterImportDate, UnitName("player"))
|
adam@0
|
286 local spec = GetSpecialization(false, false, group);
|
adam@0
|
287 if spec then
|
adam@0
|
288 local _, name, _, icon = GetSpecializationInfo(spec);
|
adam@0
|
289 if activeSpecGroup == 1 then
|
yellowfive@11
|
290 self.specText:SetFormattedText(L.AMR_SUMMARYTAB_LAST_IMPORT_PSPEC, name)
|
adam@0
|
291 else
|
yellowfive@11
|
292 self.specText:SetFormattedText(L.AMR_SUMMARYTAB_LAST_IMPORT_SSPEC, name)
|
adam@0
|
293 end
|
adam@0
|
294 self.specIcon:SetTexture(icon)
|
adam@0
|
295 end
|
adam@0
|
296 end
|
adam@0
|
297
|
adam@0
|
298
|
adam@0
|
299 --local currentSpec = GetAmrSpecialization(GetActiveSpecGroup())
|
adam@0
|
300 --return (not currentSpec and not spec) or tostring(currentSpec) == spec
|
adam@0
|
301 else
|
adam@0
|
302 self.importInfo:Hide()
|
adam@0
|
303 self.specIcon:Hide()
|
adam@0
|
304 self.optimizationSummary:Hide()
|
adam@0
|
305 self.gemCount:Hide()
|
adam@0
|
306 self.enchantCount:Hide()
|
adam@0
|
307 self.instructions:Hide()
|
adam@0
|
308 self.specText:Hide()
|
adam@0
|
309 end
|
adam@0
|
310
|
adam@0
|
311 if i == 2 then
|
adam@0
|
312 self.badItemSlots[1]:Hide()
|
adam@0
|
313 self.badItemNames[1]:Hide()
|
adam@0
|
314 else
|
adam@0
|
315 self.badItemSlots[1]:Show()
|
adam@0
|
316 self.badItemNames[1]:Show()
|
adam@0
|
317 local warnings = {}
|
adam@0
|
318 if self.badRealm then
|
yellowfive@11
|
319 tinsert(warnings, L.AMR_SUMMARYTAB_DIFF_REALM:format(self.badRealm))
|
adam@0
|
320 end
|
adam@0
|
321 if self.badTalents then
|
yellowfive@11
|
322 tinsert(warnings, L.AMR_SUMMARYTAB_DIFF_TALENT)
|
adam@0
|
323 end
|
adam@0
|
324 if self.badGlyphs then
|
yellowfive@11
|
325 tinsert(warnings, L.AMR_SUMMARYTAB_DIFF_GLYPHS)
|
adam@0
|
326 end
|
yellowfive@11
|
327 local message = L.AMR_SUMMARYTAB_DIFF_GEAR
|
adam@0
|
328 if #warnings > 0 then
|
yellowfive@11
|
329 message = message .. " (".. L.AMR_SUMMARYTAB_DIFF_AND.." "
|
adam@0
|
330 for k = 1, #warnings do
|
adam@0
|
331 if k > 1 then
|
adam@0
|
332 message = message .. ', '
|
adam@0
|
333 end
|
adam@0
|
334 message = message .. warnings[k]
|
adam@0
|
335 end
|
adam@0
|
336 message = message .. ")"
|
adam@0
|
337 end
|
yellowfive@11
|
338 message = message .. L.AMR_SUMMARYTAB_DIFF_PLEASE_EQ
|
yellowfive@11
|
339 self:showImportWarning(L.AMR_SUMMARYTAB_DIFF_CHECK_CHAR, message)
|
adam@0
|
340 end
|
adam@0
|
341
|
adam@0
|
342 if j == 1 then
|
adam@0
|
343 self.upgradeItemHeader:Hide()
|
adam@0
|
344 self.upgradeSlotHeader:Hide()
|
adam@0
|
345 self.upgradeInstructions:Hide()
|
adam@0
|
346 else
|
adam@0
|
347 if i == 2 then
|
adam@0
|
348 local warnings = {}
|
adam@0
|
349 if self.badRealm then
|
yellowfive@11
|
350 tinsert(warnings, L.AMR_SUMMARYTAB_DIFF_REALM:format(self.badRealm))
|
adam@0
|
351 end
|
adam@0
|
352 if self.badTalents then
|
yellowfive@11
|
353 tinsert(warnings, L.AMR_SUMMARYTAB_DIFF_TALENT)
|
adam@0
|
354 end
|
adam@0
|
355 if self.badGlyphs then
|
yellowfive@11
|
356 tinsert(warnings, L.AMR_SUMMARYTAB_DIFF_GLYPHS)
|
adam@0
|
357 end
|
adam@0
|
358 local message = nil
|
adam@0
|
359 if #warnings > 0 then
|
yellowfive@11
|
360 message = L.AMR_SUMMARYTAB_DIFF_OPTIMIZED_FOR
|
adam@0
|
361 for k = 1, #warnings do
|
adam@0
|
362 if k > 1 then
|
adam@0
|
363 message = message .. ', '
|
adam@0
|
364 end
|
adam@0
|
365 message = message .. warnings[k]
|
adam@0
|
366 end
|
adam@0
|
367 message = message .. "."
|
adam@0
|
368 end
|
yellowfive@11
|
369 self:showImportWarning(L.AMR_SUMMARYTAB_DIFF_CHECK_CHAR, message)
|
adam@0
|
370 end
|
adam@0
|
371 self.upgradeItemHeader:Show()
|
adam@0
|
372 self.upgradeSlotHeader:Show()
|
adam@0
|
373 self.upgradeInstructions:Show()
|
adam@0
|
374 if i == 2 then
|
adam@0
|
375 self.upgradeInstructions:SetPoint("TOP", self.badItemSlots[1], "TOP", 0, 0)
|
adam@0
|
376 self.errorText2:Hide()
|
adam@0
|
377 else
|
adam@0
|
378 self.upgradeInstructions:SetPoint("TOP", self.badItemSlots[i], "BOTTOM", 0, -20)
|
adam@0
|
379 end
|
adam@0
|
380 end
|
adam@0
|
381
|
adam@0
|
382 -- hide the remaining slots
|
adam@0
|
383 while i <= #self.badItemSlots do
|
adam@0
|
384 self.badItemSlots[i]:Hide()
|
adam@0
|
385 self.badItemNames[i]:Hide()
|
adam@0
|
386 i = i + 1
|
adam@0
|
387 end
|
adam@0
|
388
|
adam@0
|
389 -- hide the remaining slots
|
adam@0
|
390 while j <= #self.upgradeItemSlots do
|
adam@0
|
391 self.upgradeItemSlots[j]:Hide()
|
adam@0
|
392 self.upgradeItemNames[j]:Hide()
|
adam@0
|
393 j = j + 1
|
adam@0
|
394 end
|
adam@0
|
395 end
|
adam@0
|
396
|
adam@0
|
397
|
adam@0
|
398 function AskMrRobot.SummaryTab:showImportError(text, text2)
|
adam@0
|
399 self.stamp:Hide()
|
adam@0
|
400 self.gemCount:Hide()
|
adam@0
|
401 self.instructions:Hide()
|
adam@0
|
402 self.enchantCount:Hide()
|
adam@0
|
403 self.optimizationSummary:Hide()
|
adam@0
|
404 if text then
|
adam@0
|
405 self.errorText1:Show()
|
yellowfive@11
|
406 self.errorText1:SetText(L.AMR_SUMMARYTAB_IMPORT_NOT_WORK:format(text))
|
adam@0
|
407 self.errorText1:Show()
|
adam@0
|
408 self.errorText2:SetText(text2)
|
adam@0
|
409 self.errorText2:Show()
|
adam@0
|
410 self.importInfo:Hide()
|
adam@0
|
411 self.upgradeSlotHeader:Hide()
|
adam@0
|
412 self.upgradeItemHeader:Hide()
|
adam@0
|
413 self.upgradeInstructions:Hide()
|
adam@0
|
414 self.specIcon:Hide()
|
adam@0
|
415 self.specText:Hide()
|
adam@0
|
416 else
|
adam@0
|
417 self.errorText1:Hide()
|
adam@0
|
418 self.errorText2:Hide()
|
adam@0
|
419 self.importInfo:Show()
|
adam@0
|
420 end
|
adam@17
|
421 for i = 1, #self.badItemSlots do
|
adam@0
|
422 self.badItemSlots[i]:Hide()
|
adam@0
|
423 self.badItemNames[i]:Hide()
|
adam@0
|
424 end
|
adam@17
|
425 for i = 1, #self.upgradeItemSlots do
|
adam@0
|
426 self.upgradeItemSlots[i]:Hide()
|
adam@0
|
427 self.upgradeItemNames[i]:Hide()
|
adam@0
|
428 end
|
adam@0
|
429 end
|
adam@0
|
430
|
adam@0
|
431 function AskMrRobot.SummaryTab:showImportWarning (text, text2)
|
adam@0
|
432 self.stamp:Hide()
|
adam@0
|
433 self.hasImportError = false
|
adam@0
|
434 self.gemCount:Hide()
|
adam@0
|
435 self.instructions:Hide()
|
adam@0
|
436 self.enchantCount:Hide()
|
adam@0
|
437 self.specIcon:Hide()
|
adam@0
|
438 self.specText:Hide()
|
adam@0
|
439 self.optimizationSummary:Hide()
|
adam@0
|
440 if text then
|
adam@0
|
441 self.errorText1:SetText(text)
|
adam@0
|
442 self.errorText1:Show()
|
adam@0
|
443 self.errorText2:SetText(text2)
|
adam@0
|
444 self.errorText2:Show()
|
adam@0
|
445 else
|
adam@0
|
446 self.errorText1:Hide()
|
adam@0
|
447 self.errorText2:Hide()
|
adam@0
|
448 end
|
adam@0
|
449 end
|