Mercurial > wow > worldplan
view QuestPOI.lua @ 59:bc09961d5a98
fix attempts for lingering quest text and filter bar data
author | Nenue |
---|---|
date | Wed, 01 Feb 2017 17:44:20 -0500 |
parents | 54aa7f8ebca8 |
children | 3d8e83ddf603 |
line wrap: on
line source
-- WorldPlan -- QuestPOI.lua -- Created: 10/1/2016 7:21 PM -- %file-revision% -- local _, db = ... local TQ_GetQuestInfoByQuestID = C_TaskQuest.GetQuestInfoByQuestID -- Return the name of a quest with a given ID local TQ_GetQuestLocation = C_TaskQuest.GetQuestLocation local TQ_GetQuestTimeLeftMinutes = C_TaskQuest.GetQuestTimeLeftMinutes local TQ_IsActive = C_TaskQuest.IsActive local TQ_RequestPreloadRewardData = C_TaskQuest.RequestPreloadRewardData local QuestPOIGetIconInfo, WorldMapPOIFrame = QuestPOIGetIconInfo, WorldMapPOIFrame local WorldMap_DoesWorldQuestInfoPassFilters = WorldMap_DoesWorldQuestInfoPassFilters local QuestMapFrame_IsQuestWorldQuest = QuestMapFrame_IsQuestWorldQuest local GetAchievementNumCriteria, GetAchievementCriteriaInfo, GetAchievementInfo = GetAchievementNumCriteria, GetAchievementCriteriaInfo, GetAchievementInfo local pairs, ipairs, tinsert, unpack, select = pairs, ipairs, tinsert, unpack, select local floor, mod, tostring, tonumber, GetSuperTrackedQuestID = floor, mod, tostring, tonumber, GetSuperTrackedQuestID local GameTooltip = GameTooltip local GetItemIcon = GetItemIcon local print = DEVIAN_WORKSPACE and function(...) _G.print('POI', ...) end or function() end local qprint = DEVIAN_WORKSPACE and function(...) _G.print('POI', ...) end or function() end local wprint = DEVIAN_WORKSPACE and function(...) _G.print('WP', ...) end or function() end local wqprint = DEVIAN_WORKSPACE and function(...) _G.print('WorldQuests', ...) end or function() end local iprint = DEVIAN_WORKSPACE and function(...) _G.print('ItemScan', ...) end or function() end local rprint = DEVIAN_WORKSPACE and function(...) _G.print('WQRefresh', ...) end or function() end local dprint = DEVIAN_WORKSPACE and function(...) _G.print('WQData', ...) end or function() end local QuestPOI = WorldPlanPOIMixin local pinBaseIndex = 1300 local overlayBaseIndex = 1350 local previousHighlight local PIN_REFRESH_DELAY = .5 local PIN_REQUEST_DELAY = .1 local ICON_UNKNOWN = "Interface\\ICONS\\inv_misc_questionmark" local ICON_MONEY = "Interface\\Buttons\\UI-GroupLoot-Coin-Up" local WORLD_QUEST_BORDER = "Interface\\UNITPOWERBARALT\\Generic1Target_Circular_Frame" local PENDING_BORDER = "Interface\\BUTTONS\\YELLOWORANGE64" local PENDING_ICON = "Interface\\BUTTONS\\YELLOWORANGE64" local REWARD_CASH = WORLD_QUEST_REWARD_TYPE_FLAG_GOLD local REWARD_ARTIFACT_POWER = WORLD_QUEST_REWARD_TYPE_FLAG_ARTIFACT_POWER local REWARD_GEAR = WORLD_QUEST_REWARD_TYPE_FLAG_EQUIPMENT local REWARD_CURRENCY = WORLD_QUEST_REWARD_TYPE_FLAG_ORDER_RESOURCES local REWARD_REAGENT = WORLD_QUEST_REWARD_TYPE_FLAG_MATERIALS local LE_QUEST_TAG_TYPE_PVP = LE_QUEST_TAG_TYPE_PVP local LE_QUEST_TAG_TYPE_PET_BATTLE = LE_QUEST_TAG_TYPE_PET_BATTLE local LE_QUEST_TAG_TYPE_DUNGEON = LE_QUEST_TAG_TYPE_DUNGEON local LE_QUEST_TAG_TYPE_PROFESSION = LE_QUEST_TAG_TYPE_PROFESSION local LE_QUEST_TAG_TYPE_NORMAL = LE_QUEST_TAG_TYPE_NORMAL local LE_QUEST_TAG_TYPE_PVP = LE_QUEST_TAG_TYPE_PVP local LE_QUEST_TAG_TYPE_PET_BATTLE = LE_QUEST_TAG_TYPE_PET_BATTLE local LE_QUEST_TAG_TYPE_DUNGEON = LE_QUEST_TAG_TYPE_DUNGEON local LE_QUEST_TAG_TYPE_PROFESSION = LE_QUEST_TAG_TYPE_PROFESSION local LE_QUEST_TAG_TYPE_NORMAL = LE_QUEST_TAG_TYPE_NORMAL local STYLE_TYPE_PENDING = 768 -- Pin color/display variables db.TooltipExtras = db.TooltipExtras or {} -- idiot-proofing db.PinAlpha = 1 local familiars = { [42159] = 'Nightwatcher Merayl', [40277] = 'Tiffany Nelson', [40298] = 'Sir Galveston', [40282] = 'Grixis Tinypop', [40278] = 'Robert Craig', [48195] = 'Aulier', [41990] = 'Varenne', [41860] = 'Xorvasc', [40299] = 'Bodhi Sunwayver', [42442] = 'Amalia', [40280] = 'Bredda Tenderhide', [41687] = 'Odrogg', [41944] = 'Trapper Jarrun', [40337] = 'Master Tamer Flummox', [40279] = 'Durian Strongfruit' } local falcosaurs = { [44895] = {44881, 'Sharptalon Hatchling', 115786}, [44894] = {44882, 'Bloodgazer Hatchling', 115787}, [44893] = {44880, 'Direbeak Hatchling', 115785}, [44892] = {44879, 'Snowfeather Hatchling', 115784}, } local familiars_id = 9696 for questID, name in pairs(familiars) do db.TooltipExtras[questID] = {{ achievementID = familiars_id, name = name }} end for questID, info in pairs(falcosaurs) do local trackingQuestID, petName, petID = unpack(info) db.TooltipExtras[questID] = {{ questID = trackingQuestID, pet = petName, petID = petID }} end local GetAchievementTooltipExtras = function(info) local hasInfo local achievementID = info.achievementID local _, name, _, completed, _, _, _, _, _, icon = GetAchievementInfo(achievementID) if not completed then local numItems = GetAchievementNumCriteria(achievementID) local numNeeded = 0 local tooltipLines = {} for i =1, numItems do local criteriaName, criteriaType, completed, _, _, _, _, subAchievementID = GetAchievementCriteriaInfo(achievementID, i) --print(GetAchievementCriteriaInfo(achievementID, i)) if not completed then --print('::', criteriaName, completed, subAchievementID) if criteriaType == 8 then local _, _, _, completed, _, _, _, _, _, subIcon = GetAchievementInfo(subAchievementID) --print(' -', criteriaName, completed, subIcon) if not completed then local numCompleted = 0 local numSubItems = GetAchievementNumCriteria(subAchievementID) local subCriteriaLine for j = 1, numSubItems do local subName, _, completed = GetAchievementCriteriaInfo(subAchievementID, j) --print(' -',subName, completed) if completed then numCompleted = numCompleted + 1 else numNeeded = numNeeded + 1 if subName:match(info.name) then hasInfo = true subCriteriaLine = ' |T'..subIcon..':16:16|t ' .. criteriaName end end end if subCriteriaLine then tinsert(tooltipLines, subCriteriaLine .. ' ('..numCompleted..'/'..numSubItems..')') end end elseif criteriaName:match(info.name) and (not completed) then numNeeded = numNeeded + 1 tinsert(tooltipLines, criteriaName) end end end if hasInfo then WorldMapTooltip:AddLine(" ") WorldMapTooltip:AddLine("Achievements:") WorldMapTooltip:AddLine(' |T'..icon..':20:20|t '..name) for i, line in ipairs(tooltipLines) do WorldMapTooltip:AddLine(line) end end end return hasInfo end local GetQuestTooltipExtras = function(info) local questID = info.questID local hasInfo if info.pet then local index, guid = C_PetJournal.FindPetIDByName(info.pet) if not index then hasInfo = true WorldMapTooltip:AddLine('Pets:') WorldMapTooltip:AddLine(' - ' .. info.petName) if not IsQuestFlaggedCompleted(questID) then WorldMapTooltip:AddLine(' Required Quest Flags', 1, 1, 0) else WorldMapTooltip:AddLine(' Quest Flags Complete!', 0, 1, 0) end end end end local GetFactionInfoByID, GetQuestObjectiveInfo = GetFactionInfoByID, GetQuestObjectiveInfo function QuestPOI:OnEnter() if self.filtered and (self.questID ~= GetSuperTrackedQuestID()) then return end WorldMap_HijackTooltip(self.owningFrame); self:SetFrameLevel(pinBaseIndex+100) self.Overlay:SetFrameLevel(pinBaseIndex+101) if previousHighlight then previousHighlight:SetFrameLevel(pinBaseIndex+previousHighlight:GetID()) previousHighlight.Overlay:SetFrameLevel(overlayBaseIndex+previousHighlight:GetID()) end previousHighlight = self WorldMapTooltip:SetOwner(self, "ANCHOR_RIGHT"); --print('doing tooltip stuff') -- Can't add stuff after, so most of the blizzard tooltip hook is simply copied over local questID = self.questID local color = WORLD_QUEST_QUALITY_COLORS[self.rarity] or NORMAL_FONT_COLOR; WorldMapTooltip:SetText(self.title, color.r, color.g, color.b); QuestUtils_AddQuestTypeToTooltip(WorldMapTooltip, questID, NORMAL_FONT_COLOR); if ( self.factionID ) then local factionName = GetFactionInfoByID(self.factionID); if ( factionName ) then if (self.capped) then WorldMapTooltip:AddLine(factionName, GRAY_FONT_COLOR:GetRGB()); else WorldMapTooltip:AddLine(factionName); end end end if self.worldQuest then WorldMap_AddQuestTimeToTooltip(questID); end for objectiveIndex = 1, self.numObjectives do local objectiveText, objectiveType, finished = GetQuestObjectiveInfo(questID, objectiveIndex, false); if ( objectiveText and #objectiveText > 0 ) then local color = finished and GRAY_FONT_COLOR or HIGHLIGHT_FONT_COLOR; WorldMapTooltip:AddLine(QUEST_DASH .. objectiveText, color.r, color.g, color.b, true); end end local percent = C_TaskQuest.GetQuestProgressBarInfo(self.questID); if ( percent ) then GameTooltip_InsertFrame(WorldMapTooltip, WorldMapTaskTooltipStatusBar); WorldMapTaskTooltipStatusBar.Bar:SetValue(percent); WorldMapTaskTooltipStatusBar.Bar.Label:SetFormattedText(PERCENTAGE_STRING, percent); end if db.TooltipExtras[self.questID] then for index, info in pairs(db.TooltipExtras[questID]) do if info.achievementID then GetAchievementTooltipExtras(info) end if info.questID then GetQuestTooltipExtras(info) end end end WorldMap_AddQuestRewardsToTooltip(questID) self.MouseGlow:Show() WorldMapTooltip:Show() --WorldMapTooltip.recalculatePadding = true; --print(WorldMapTooltip:GetParent()) --print(WorldMapTooltip:IsVisible()) end function QuestPOI:OnLeave() if self.filtered and (self.questID ~= GetSuperTrackedQuestID()) then return end WorldMap_RestoreTooltip() self.MouseGlow:Hide() WorldMapTooltip:Hide(); end -- attempt to pull pin data local GetQuestTagInfo, GetProfessionInfo = GetQuestTagInfo, GetProfessionInfo function QuestPOI:GetData () dprint('|cFF00FF88'..self:GetID()..':GetData()|r') local questID = self.questID if not questID then dprint('|cFFFF4400bad pin|r', self:GetName()) return nil end local questTitle, factionID, capped = TQ_GetQuestInfoByQuestID(questID) -- if the title is nil, then wait and try later if not questTitle then if not self.isPending then C_TaskQuest.RequestPreloadRewardData(questID) self.isPending = true end dprint('|cFFBB8844isPending=true|r|cFF00FFFF', self.questId) else self.title, self.factionID, self.capped = questTitle, factionID, capped dprint('|cFFBB8844 data|r|cFF00FFFF', (self.isPending and '|cFFFF4400delayed|r' or '|cFF00FF00success|r'), self.title, '|r', self.factionID) if self.dataLoaded then dprint(' |cFFFF4400overwriting data|r') end -- set tag details local worldQuestType self.tagID, self.tagName, worldQuestType, self.rarity, self.isElite, self.tradeskillLineIndex = GetQuestTagInfo(questID); local tagAtlas if worldQuestType == LE_QUEST_TAG_TYPE_PET_BATTLE then tagAtlas = "worldquest-icon-petbattle" elseif worldQuestType == LE_QUEST_TAG_TYPE_PVP then tagAtlas = "worldquest-icon-pvp-ffa" elseif worldQuestType == LE_QUEST_TAG_TYPE_PROFESSION then self.isKnownProfession = nil local id = self.tradeskillLineIndex and select(7, GetProfessionInfo(self.tradeskillLineIndex)) if id then self.isKnownProfession = true qprint('profession' , self.title, id) tagAtlas = WORLD_QUEST_ICONS_BY_PROFESSION[id] end elseif worldQuestType == LE_QUEST_TAG_TYPE_DUNGEON then tagAtlas = "worldquest-icon-dungeon" end self.worldQuestType = worldQuestType self.tagAtlas = tagAtlas self:SetRewardInfo() -- force throttle on success --qprint(' |cFF00FFFF'..questID..'|r hasUpdate:', hasUpdate, 'isPending:', isPending, 'isShown', self:IsShown()) --qprint(' ', 'rewardType:', self.rewardType, 'tag:', self.tagID) qprint(' ', tostring(self.title), " |T"..tostring(self.itemTexture)..":12:12|t", tostring(self.itemName)) if self.itemTexture and self.itemName and self.title then self.dataLoaded = true self.isPending = nil self.throttle = 1 self.updateRate = PIN_REFRESH_DELAY self.isStale = true end end self.isCriteria = WorldMapFrame.UIElementsFrame.BountyBoard:IsWorldQuestCriteriaForSelectedBounty(questID) return self.isStale, self.isPending end local GetNumQuestLogRewards, GetNumQuestLogRewardCurrencies, HaveQuestData = GetNumQuestLogRewards, GetNumQuestLogRewardCurrencies, HaveQuestData local GetQuestLogRewardMoney, GetQuestLogRewardCurrencyInfo, GetMoneyString = GetQuestLogRewardMoney, GetQuestLogRewardCurrencyInfo, GetMoneyString function QuestPOI:SetRewardInfo() local questID = self.questID if not HaveQuestData(questID) then self.isPending = true else local rewardIcon, rewardName, rewardCount, rewardStyle, rewardType, itemID, quantity, quality -- set reward category local numRewards = GetNumQuestLogRewards(questID) local numCurrency = GetNumQuestLogRewardCurrencies(questID) local money = GetQuestLogRewardMoney(questID) if numRewards >= 1 then rewardType, rewardIcon, rewardCount, rewardName, itemID, quality = WorldPlanQuests:GetRewardHeader(questID) elseif numCurrency >= 1 then rewardName, rewardIcon, rewardCount = GetQuestLogRewardCurrencyInfo(1, questID) rewardType = REWARD_CURRENCY elseif money >= 1 then rewardIcon = ICON_MONEY rewardName = GetMoneyString(money) rewardType = REWARD_CASH end qprint(' '..self.questID..':|cFFFFFF00SetRewardInfo():', numRewards, rewardType) self.itemNumber = tonumber(rewardCount or self.itemNumber) self.rewardType = rewardType self.quality = quality self.itemTexture = rewardIcon or self.itemTexture self.itemName = rewardName or self.itemName -- flag unresolved info if not (rewardIcon and rewardName) then self.isPending = true self.isStale = nil --WorldPlan:print('|cFFFFFF00'..tostring(self.title)..'|r waiting on texture info') else if (rewardIcon and rewardName) and self.isPending then --WorldPlan:print('|cFF00FF00'..tostring(self.title)..'|r has info', rewardIcon, rewardName) self.isStale = true end self.isPending = nil end end end -- run from OnShow if .isNew is set function QuestPOI:StartFade() if not self.isAnimating then --qprint('|cFFFFFF00'.. self.title .. ' added to quest log.') self:SetAlpha(0) self.FadeIn.FadeIn:SetToAlpha(db.PinAlpha) self.PendingFade.FadeIn:SetToAlpha(db.PinAlpha) self.PendingFade.FadeOut:SetFromAlpha(db.PinAlpha) self.isAnimating = true self.isNew = nil self.isStale = true self.FadeIn:Play() end end function QuestPOI:EndFade() self.isAnimating = nil self:SetAlpha(db.PinAlpha) end function QuestPOI:OnShow () if self.isStale then qprint('|cFF0088FFflagged for refresh') self:Refresh() end if self.isNew or (not self.Overlay:IsShown()) then qprint('|cFFFFFF00'..tostring(self:GetName())..':OnShow()|r update:', self.isStale, 'new:', self.isNew, 'animation:', self.isAnimating) --qprint('|cFFFFFF00popping new pin handler') self:StartFade() end if not self.isAnimating then self:SetAlpha(db.PinAlpha) -- fix stuck alpha end if self.used then self.Overlay:Show() end end function QuestPOI:OnHide() qprint('|cFFFFFF00'..self:GetID()..'r:OnHide()') -- reset flags self:SetAlpha(db.PinAlpha) self.isAnimating = nil self.isStale = true self.Overlay:Hide() end -- different from owningFrame function QuestPOI:SetAnchor(owner, dX, dY, mapWidth, mapHeight) wqprint(self:GetName()..':SetAnchor', self.filtered, self.used) self:SetParent(owner) self:ClearAllPoints() self:SetFrameLevel(pinBaseIndex + self:GetID()) self.Overlay:SetParent(owner) self.Overlay:SetFrameLevel(overlayBaseIndex + self:GetID()) if (dX and dY) then if not (mapHeight and mapWidth) then mapWidth, mapHeight = owner:GetSize() end local pX = (dX * mapWidth) local pY = (-dY * mapHeight) self.x = dX self.y = dY self:SetPoint('CENTER', owner, 'TOPLEFT', pX, pY) else self:SetPoint('CENTER') end self:SetShown(self.used) end function QuestPOI:OnLoad() qprint('|cFF00FF88'..self:GetName()..':OnLoad()|r',db.Config) self:RegisterEvent('SUPER_TRACKED_QUEST_CHANGED') self.title = '|cFF0088FF' .. RETRIEVING_DATA..'|r' self.isPending = true self.count = self.Overlay.count self.Description = self.Overlay.Description self.timeLabel = self.Overlay.timeLabel self.updateRate = PIN_REQUEST_DELAY self.itemName = '|cFF0088FF' .. RETRIEVING_DATA..'|r' self.Overlay:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 4) self.Overlay:SetPoint('BOTTOMRIGHT', self, 'BOTTOMRIGHT', 0, -4) end function QuestPOI:OnMouseDown(button) if button == 'RightButton' then SetSuperTrackedQuestID(nil) else TaskPOI_OnClick(self, button) end end function QuestPOI:OnEvent(event, ...) if event == 'SUPER_TRACKED_QUEST_CHANGED' then self.isStale = true end end function QuestPOI:OnUpdate (sinceLast) -- control update check intervals self.throttle = (self.throttle or self.updateRate) + sinceLast if self.throttle >= self.updateRate then -- factor overtime into the throttle timer self.throttle = self.throttle - self.updateRate else return end if self.isNew then --print('|cFFFFFF00push new poi stuff') self:OnNew() elseif (self.isStale or (not self.title)) and not self.isAnimating then --wprint('|cFFFFFF00push poi update') self:Refresh() return end -- query for reward data if it wasn't found in the original scan local questID = self.questID if self.isPending then --print('|cFFFF4400'..self:GetID()..':|r polling reward info') if not (self.isAnimating) then self.PendingFade:Play() end self:GetData() return else if self.PendingFade:IsPlaying() then self.PendingFade:Stop() end end self:UpdateStatus() end -- Called at static intervals and with Refresh function QuestPOI:UpdateStatus() -- update time elements if TQ_IsActive(self.questID) then local tl = self.alertLevel local timeLeft = TQ_GetQuestTimeLeftMinutes(self.questID) if timeLeft > 0 then local text, timeState = WorldPlan:GetTimeInfo(timeLeft, self.maxAlertLevel) if tl ~= timeState then tl = timeState self.timeLabel:SetText(text) end else if self.worldQuestType ~= LE_QUEST_TAG_TYPE_PROFESSION then self:SetShown(false) end end if tl and (timeLeft < 120) then self.HighlightBorder:SetVertexColor(1,0,0,0.7) elseif self.isBounty then self.HighlightBorder:SetVertexColor(.25,.5,1,1) else self.HighlightBorder:SetVertexColor(0,0,0,0.7) end self.alertLevel = tl else WorldPlan:print('|cFFFFFF00'..tostring(self.title).. '|r is no longer active.') self:Hide() end self.timeLabel:SetShown(self.worldQuest and (self.maxAlertLevel >= 1)) end function QuestPOI:Refresh (fromUser) rprint('|c'..(fromUser and 'FF0088FF' or 'FF00FF88' )..self:GetID()..'|r:Refresh() type =', self.rewardType, 'title =', self.title) local styleType = (self.isPending and STYLE_TYPE_PENDING) or self.rewardType local style,subStyle = self:GetTypeInfo(self.rewardType) if (self.filtered or (not self.dataLoaded)) and (self.questID ~= GetSuperTrackedQuestID()) then subStyle = style.minimized end self.style = style self.subStyle = subStyle --print(style, subStyle) self.currentWidth = subStyle.iconWidth self.borderWidth = subStyle.borderWidth self.highlightWidth = subStyle.highlightWidth self.tagSize = subStyle.TagSize self.maxAlertLevel = subStyle.maxAlertLevel self.NoIcon = subStyle.NoIcon local questID = self.questID local iconBorder = self.RewardBorder local trackingBorder = self.HighlightBorder local icon = self.icon local count = self.count self.isBounty = WorldMapFrame.UIElementsFrame.BountyBoard:IsWorldQuestCriteriaForSelectedBounty(self.questID) if self.itemName then if self.itemNumber then local numberString = self.itemNumber if self.itemNumber >= 1000 then local numeral = floor(self.itemNumber/1000) local decimal = mod(self.itemNumber, 1000) numberString = numeral if decimal > 100 then numberString = numberString .. '.' .. tostring(floor(decimal/100)) end numberString = numberString .. 'k' end self.count:SetText(numberString) else self.count:SetText(nil) end end if db.Config.ShowVerboseInfo then self.Description:SetText(self.title .. "\n" .. floor(self.x*100+.5) .. "," .. floor(self.y*100+.5)) end icon:SetMask("Interface\\Minimap\\UI-Minimap-Background") if self.itemTexture then --iconBorder:SetTexture(WORLD_QUEST_BORDER) if self.NoIcon then icon:SetTexture(PENDING_ICON) icon:SetDesaturated(true) icon:SetVertexColor(style.r, style.g, style.b) else icon:SetTexture(self.itemTexture) icon:SetDesaturated(false) icon:SetVertexColor(1, 1, 1) end else -- icon:SetTexture(PENDING_ICON) icon:SetDesaturated(true) icon:SetVertexColor(style.r, style.g, style.b) end iconBorder:SetMask("Interface\\Minimap\\UI-Minimap-Background") iconBorder:SetTexture(PENDING_BORDER) iconBorder:SetVertexColor(style.r, style.g, style.b, 1) iconBorder:SetDesaturated(true) iconBorder:SetAlpha(subStyle.alpha or 1) trackingBorder:SetMask("Interface\\Minimap\\UI-Minimap-Background") trackingBorder:SetTexture(PENDING_BORDER) self.tagIcon:SetShown((not self.filtered) and true or false) self.tagIcon:SetAtlas(self.tagAtlas) self.EliteBorder:SetShown(self.isElite and not self.filtered) self:UpdateSize() self:UpdateStatus() self.isStale = nil -- signal filter info update WorldPlanSummary.isStale = true end local cvar_check = { [REWARD_CASH] = 'worldQuestFilterGold', [REWARD_ARTIFACT_POWER] = 'worldQuestFilterArtifactPower', [REWARD_CURRENCY] = 'worldQuestFilterOrderResources', [REWARD_REAGENT]= 'worldQuestFilterProfessionMaterials', [REWARD_GEAR] = 'worldQuestFilterEquipment', } function QuestPOI:CheckFilterRules () local print = qprint local qType = self.worldQuestType local filtered local canShow = TQ_IsActive(self.questID) if SpellCanTargetQuest() then -- hiding so player can click a valid target self.used = nil elseif qType == LE_QUEST_TAG_TYPE_PROFESSION then if not(self.isKnownProfession or db.Config.ShowAllProfessionQuests) then canShow = nil end end if canShow then for filterKey, value in pairs(db.UsedFilters) do if self[filterKey] ~= value then if not self.filtered then print('|cFFFF4400filtering', filterKey, value, '~=', self[filterKey], self.title) end filtered = true end end if self.rewardType and cvar_check[self.rewardType] then if not GetCVarBool(cvar_check[self.rewardType]) then filtered = true end end if canShow and self.filtered ~= filtered then self.isStale = true print(' '..self.questID..':|cFFFFFF00CheckFilterRules()|r ', canShow, filtered, self.title) end self.filtered = filtered end self.used = canShow end --- Fixes icons upon size update function QuestPOI:UpdateSize () --qprint('|cFF00BB88'..self:GetID()..'|r:UpdateSize()', self.style, self.subStyle) local style = self.style local subStyle = self.subStyle local icon = self.icon local iconBorder = self.RewardBorder local trackingBorder = self.HighlightBorder local tag = self.tagIcon local iconWidth = subStyle.iconWidth local borderWidth = iconWidth + (subStyle.borderWidth * 2) local highlightWidth = borderWidth + (subStyle.highlightWidth * 2) local iconTexture = self.itemTexture self:SetSize(highlightWidth, highlightWidth) if self.questID == GetSuperTrackedQuestID() then highlightWidth = highlightWidth + 2 if self.filtered then self:SetAlpha(db.PinAlpha * 0.5) else self:SetAlpha(db.PinAlpha) end end if self.rarity and WORLD_QUEST_QUALITY_COLORS[self.rarity] then highlightWidth = highlightWidth + self.rarity end self.tagIcon:SetSize(self.tagSize, self.tagSize) icon:SetSize(iconWidth, iconWidth) iconBorder:SetSize(borderWidth, borderWidth) trackingBorder:SetSize(highlightWidth, highlightWidth) iconBorder:SetPoint('CENTER', (style.x or 0), (style.y or 0)) trackingBorder:SetPoint('CENTER', (style.x or 0), (style.y or 0)) if style.hasNumeric then self.count:SetTextColor(unpack(style.numberRGB)) if subStyle.numberFontObject then --wqprint('change font', _G[subStyle.numberFontObject]:GetName()) self.count:SetFontObject(_G[subStyle.numberFontObject]) end end self.count:SetShown((subStyle.showNumber and self.itemNumber) and style.hasNumeric) end