comparison Modules/ArtifactPower.lua @ 133:86621c60512b v7.3.2-20171222

- Fixed AP calc tooltip appearing while hidden - Fixed PaperDoll relic tooltips missing nether crucible info
author Nenue
date Fri, 22 Dec 2017 20:36:40 -0500
parents 15a7f27b11e6
children 4979b5cca6de
comparison
equal deleted inserted replaced
132:4cb1d2a0c110 133:86621c60512b
400 elseif event == 'PLAYER_REGEN_DISABLED' then 400 elseif event == 'PLAYER_REGEN_DISABLED' then
401 self:Hide() 401 self:Hide()
402 end 402 end
403 end 403 end
404 404
405 local hasShownHeaderTip
405 function Module:OnUpdate() 406 function Module:OnUpdate()
406 if #self.scanQueue >= 1 then 407 if #self.scanQueue >= 1 then
407 local scanInfo = tremove(self.scanQueue, 1) 408 local scanInfo = tremove(self.scanQueue, 1)
408 end 409 end
409 if IsShiftKeyDown() then 410 if IsShiftKeyDown() then
410 self.Refresh:Show() 411 self.Refresh:Show()
411 else 412 else
412 self.Refresh:Hide() 413 self.Refresh:Hide()
413 end 414 end
415
416 if self.SummaryHeader:IsMouseOver() and self:IsShown() then
417 if not hasShownHeaderTip then
418 hasShownHeaderTip = true
419 GameTooltip:SetOwner(self, 'ANCHOR_BOTTOM')
420 GameTooltip:AddLine("World Quests")
421
422 for zone, data in pairs(self.apQuests) do
423
424 if #data >= 1 then
425 GameTooltip:AddLine(zone)
426 for i, quest in ipairs(data) do
427
428 if IsQuestComplete(quest[1]) then
429 GameTooltip:AddDoubleLine(quest[2], ShortNumberString(quest[3]), 0.5,0.5,0.5, 0.5,0.5,0.5)
430 else
431 GameTooltip:AddDoubleLine(quest[2], ShortNumberString(quest[3]), 1,1,1, 0,1,0)
432
433 end
434
435 end
436 end
437
438
439 end
440
441 GameTooltip:Show()
442 end
443 else
444 if GameTooltip:IsOwned(self) then
445 hasShownHeaderTip = nil
446 GameTooltip:Hide()
447 end
448
449 end
450
414 451
415 end 452 end
416 453
417 function Module:OnMouseDown(button) 454 function Module:OnMouseDown(button)
418 self.enabled = nil 455 self.enabled = nil
490 self:SetWidth(contentsWidth) 527 self:SetWidth(contentsWidth)
491 self:SetHeight(contentsHeight) 528 self:SetHeight(contentsHeight)
492 self:Reanchor() 529 self:Reanchor()
493 end 530 end
494 531
532 Module.apQuests = {}
495 function Module:GetContinentAP(mapAreaID) 533 function Module:GetContinentAP(mapAreaID)
496 534
497 for zoneIndex = 1, C_MapCanvas.GetNumZones(mapAreaID) do 535 for zoneIndex = 1, C_MapCanvas.GetNumZones(mapAreaID) do
498 local zoneMapID, zoneName, zoneDepth, left, right, top, bottom = C_MapCanvas.GetZoneInfo(mapAreaID, zoneIndex); 536 local zoneMapID, zoneName, zoneDepth, left, right, top, bottom = C_MapCanvas.GetZoneInfo(mapAreaID, zoneIndex);
499 --print(zoneMapID, zoneName) 537 --print(zoneMapID, zoneName)
500 if zoneDepth <= 1 then -- Exclude subzones 538 if zoneDepth <= 1 then -- Exclude subzones
501 local taskInfo = C_TaskQuest.GetQuestsForPlayerByMapID(zoneMapID, mapAreaID, (mapAreaID == 1184) and 1 or nil); 539 local taskInfo = C_TaskQuest.GetQuestsForPlayerByMapID(zoneMapID, mapAreaID, (mapAreaID == 1184) and 1 or nil);
502 540
541 self.apQuests[zoneName] = self.apQuests[zoneName] or {}
542 wipe(self.apQuests[zoneName])
543
503 if taskInfo then 544 if taskInfo then
504 for i, info in ipairs(taskInfo) do 545 for i, info in ipairs(taskInfo) do
505 local questID = info.questId 546 local questID = info.questId
506 547
507 local questTitle, factionID, capped = C_TaskQuest.GetQuestInfoByQuestID(questID) 548 local questTitle, factionID, capped = C_TaskQuest.GetQuestInfoByQuestID(questID)
508 --print(questTitle, HaveQuestRewardData(questID)) 549 if HaveQuestRewardData(questID) then
509 if HaveQuestRewardData(questID) and not IsQuestComplete(questID) then
510 550
511 551
512 for i = 1, GetNumQuestLogRewards(questID) or 0 do 552 for i = 1, GetNumQuestLogRewards(questID) or 0 do
513 local name, texture, numItems, quality, isUsable, itemID = GetQuestLogRewardInfo(i, questID) 553 local name, texture, numItems, quality, isUsable, itemID = GetQuestLogRewardInfo(i, questID)
514 if IsArtifactPowerItem(itemID) then 554 if IsArtifactPowerItem(itemID) then
555
556 print(questTitle, HaveQuestRewardData(questID))
515 local _, link = GetItemInfo(itemID) 557 local _, link = GetItemInfo(itemID)
516 if link then 558 if link then
517 local ap = self:GetItemAP(itemID, link) 559 local ap = self:GetItemAP(itemID, link)
518 --print('ap =', ap) 560 --print('ap =', ap)
519 if ap then 561 if ap then
520 self.worldQuestAP = self.worldQuestAP + ap 562
521 if mapAreaID == ZONE_ID_ARGUS then 563 if not IsQuestComplete(questID) then
522 self.argusAP = self.argusAP + ap 564 self.worldQuestAP = self.worldQuestAP + ap
565 if mapAreaID == ZONE_ID_ARGUS then
566 self.argusAP = self.argusAP + ap
567 end
523 end 568 end
569
570
571 tinsert(self.apQuests[zoneName], {questID, questTitle, ap})
572
524 573
525 end 574 end
526 575
527 self.worldQuestItems[itemID] = (self.worldQuestItems[itemID] or 0) + 1 576 self.worldQuestItems[itemID] = (self.worldQuestItems[itemID] or 0) + 1
528 end 577 end
547 function Module:UpdateWorldQuestsAP() 596 function Module:UpdateWorldQuestsAP()
548 self.waitingForQuestRewardData = false 597 self.waitingForQuestRewardData = false
549 self.worldQuestAP = 0 598 self.worldQuestAP = 0
550 self.argusAP = 0 599 self.argusAP = 0
551 wipe(self.worldQuestItems) 600 wipe(self.worldQuestItems)
552 601 wipe(self.apQuests)
553 self:GetContinentAP(ZONE_ID_BROKEN_ISLE) 602 self:GetContinentAP(ZONE_ID_BROKEN_ISLE)
554 self:GetContinentAP(ZONE_ID_ARGUS) 603 self:GetContinentAP(ZONE_ID_ARGUS)
555 604
556 end 605 end
557 606