annotate ui/SummaryTab.lua @ 11:ece9167c0d1c v1.2.14.0

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