comparison QuestPOI.lua @ 96:8591401ec278

- Fixed quest markers for other maps becoming visible due to ambiguous interpretations of pin.used. - Removed some redundant filter checking calls on pins obtained through Acquire()
author Nenue
date Sun, 14 May 2017 23:45:08 -0400
parents b29b35cb8539
children d594c5c4a4a3
comparison
equal deleted inserted replaced
95:b29b35cb8539 96:8591401ec278
22 local GetNumQuestLogRewards, GetNumQuestLogRewardCurrencies, HaveQuestData = GetNumQuestLogRewards, GetNumQuestLogRewardCurrencies, HaveQuestData 22 local GetNumQuestLogRewards, GetNumQuestLogRewardCurrencies, HaveQuestData = GetNumQuestLogRewards, GetNumQuestLogRewardCurrencies, HaveQuestData
23 local GetQuestLogRewardMoney, GetQuestLogRewardCurrencyInfo, GetMoneyString = GetQuestLogRewardMoney, GetQuestLogRewardCurrencyInfo, GetMoneyString 23 local GetQuestLogRewardMoney, GetQuestLogRewardCurrencyInfo, GetMoneyString = GetQuestLogRewardMoney, GetQuestLogRewardCurrencyInfo, GetMoneyString
24 local SpellCanTargetQuest, GetCVarBool = SpellCanTargetQuest, GetCVarBool 24 local SpellCanTargetQuest, GetCVarBool = SpellCanTargetQuest, GetCVarBool
25 local SetSuperTrackedQuestID = SetSuperTrackedQuestID 25 local SetSuperTrackedQuestID = SetSuperTrackedQuestID
26 local HaveQuestRewardData = HaveQuestRewardData 26 local HaveQuestRewardData = HaveQuestRewardData
27 local GetTime = GetTime
27 28
28 29
29 local pairs, ipairs, tinsert, tremove, unpack, select = pairs, ipairs, tinsert, tremove, unpack, select 30 local pairs, ipairs, tinsert, tremove, unpack, select = pairs, ipairs, tinsert, tremove, unpack, select
30 local floor, mod, tostring, tonumber, GetSuperTrackedQuestID = floor, mod, tostring, tonumber, GetSuperTrackedQuestID 31 local floor, mod, tostring, tonumber, GetSuperTrackedQuestID = floor, mod, tostring, tonumber, GetSuperTrackedQuestID
31 local GameTooltip = GameTooltip 32 local GameTooltip = GameTooltip
427 end 428 end
428 WorldMap_RestoreTooltip() 429 WorldMap_RestoreTooltip()
429 WorldMapTooltip:Hide(); 430 WorldMapTooltip:Hide();
430 end 431 end
431 432
433
434
432 local updateTime, markTime 435 local updateTime, markTime
433 function QuestPOI:OnUpdate (sinceLast) 436 function QuestPOI:OnUpdate (sinceLast)
434 -- control update check intervals 437 -- control update check intervals
435 438
436 if self.toAlpha then 439 if self.toAlpha then
439 end 442 end
440 443
441 444
442 local alpha = self.icon:GetAlpha() 445 local alpha = self.icon:GetAlpha()
443 local alphaMod = ((GetTime()-self.alphaStart) *FADE_TIMING_MULTIPLIER) 446 local alphaMod = ((GetTime()-self.alphaStart) *FADE_TIMING_MULTIPLIER)
444 if self:GetID() == 1 then 447
445 print(alpha, self.toAlpha, sinceLast, alphaMod)
446 end
447 if alpha > self.toAlpha then 448 if alpha > self.toAlpha then
448 alpha = alpha - (sinceLast*FADE_TIMING_MULTIPLIER) 449 alpha = alpha - (sinceLast*FADE_TIMING_MULTIPLIER)
449 450
450 if (alpha <= self.toAlpha) then 451 if (alpha <= self.toAlpha) then
451 alpha = self.toAlpha 452 alpha = self.toAlpha
514 end 515 end
515 516
516 if self.maxAlertLevel then 517 if self.maxAlertLevel then
517 self:UpdateStatus() 518 self:UpdateStatus()
518 end 519 end
520
521
522 if self.isStale then
523 self:Refresh()
524 end
525
519 end 526 end
520 527
521 528
522 function QuestPOI:StartFading() 529 function QuestPOI:StartFading()
523 if not self.toAlpha then 530 if not self.toAlpha then
857 864
858 865
859 function QuestPOI:CheckFilterRules () 866 function QuestPOI:CheckFilterRules ()
860 local print = qprint 867 local print = qprint
861 local qType = self.worldQuestType 868 local qType = self.worldQuestType
869
870 self.canShow = false
871
862 if not TQ_IsActive(self.questID) then 872 if not TQ_IsActive(self.questID) then
863 self.hideReason = 'Filter check ended because quest is inactive.' 873 self.hideReason = 'Filter check ended because quest is inactive.'
864 self.used = nil 874 self.used = nil
865 self:SetShown(false) 875 self:SetShown(false)
866 return 876 return
894 if self.filtered ~= filtered then 904 if self.filtered ~= filtered then
895 wqprint('|cFF00FF00filter changed') 905 wqprint('|cFF00FF00filter changed')
896 self.isStale = true 906 self.isStale = true
897 end 907 end
898 908
909 self.canShow = true
899 self.filtered = filtered 910 self.filtered = filtered
900 self.used = true
901 self:SetShown(true)
902 end 911 end
903 912
904 function QuestPOI:Refresh (event) 913 function QuestPOI:Refresh (event)
905 print('|cFF00FF88Refresh(|r'..self:GetID()..'|cFF00FF88)|r', event, self.title) 914 print('|cFF00FF88Refresh(|r'..self:GetID()..'|cFF00FF88)|r', event, self.title)
906 915