Mercurial > wow > worldplan
comparison QuestPOI.lua @ 49:dbd81d49af02
- Solve more frame data flagging issues
- Unify method for resolving filter and visibility states
- Flight Map modifications respect filter settings
- Solve initial draw issues with tag icon, filter state handling
- Solve issues with text layer synchronization during map changes
| author | Nenue |
|---|---|
| date | Thu, 29 Dec 2016 13:31:20 -0500 |
| parents | c0b88bd1e40b |
| children | 3066f3ef1258 |
comparison
equal
deleted
inserted
replaced
| 48:c0b88bd1e40b | 49:dbd81d49af02 |
|---|---|
| 23 local qprint = DEVIAN_WORKSPACE and function(...) _G.print('POI', ...) end or function() end | 23 local qprint = DEVIAN_WORKSPACE and function(...) _G.print('POI', ...) end or function() end |
| 24 local wprint = DEVIAN_WORKSPACE and function(...) _G.print('WP', ...) end or function() end | 24 local wprint = DEVIAN_WORKSPACE and function(...) _G.print('WP', ...) end or function() end |
| 25 local wqprint = DEVIAN_WORKSPACE and function(...) _G.print('WorldQuests', ...) end or function() end | 25 local wqprint = DEVIAN_WORKSPACE and function(...) _G.print('WorldQuests', ...) end or function() end |
| 26 local iprint = DEVIAN_WORKSPACE and function(...) _G.print('ItemScan', ...) end or function() end | 26 local iprint = DEVIAN_WORKSPACE and function(...) _G.print('ItemScan', ...) end or function() end |
| 27 local rprint = DEVIAN_WORKSPACE and function(...) _G.print('WQRefresh', ...) end or function() end | 27 local rprint = DEVIAN_WORKSPACE and function(...) _G.print('WQRefresh', ...) end or function() end |
| 28 local dprint = DEVIAN_WORKSPACE and function(...) _G.print('WQData', ...) end or function() end | |
| 28 local QuestPOI = WorldPlanPOIMixin | 29 local QuestPOI = WorldPlanPOIMixin |
| 29 | 30 |
| 30 | 31 |
| 31 local PIN_REFRESH_DELAY = .5 | 32 local PIN_REFRESH_DELAY = .5 |
| 32 local PIN_REQUEST_DELAY = .2 | 33 local PIN_REQUEST_DELAY = .2 |
| 58 local STYLE_TYPE_PENDING = 768 | 59 local STYLE_TYPE_PENDING = 768 |
| 59 | 60 |
| 60 | 61 |
| 61 -- Pin color/display variables | 62 -- Pin color/display variables |
| 62 db.TooltipExtras = db.TooltipExtras or {} -- idiot-proofing | 63 db.TooltipExtras = db.TooltipExtras or {} -- idiot-proofing |
| 63 | 64 db.PinAlpha = 1 |
| 64 | 65 |
| 65 local familiars = { | 66 local familiars = { |
| 66 [42159] = 'Nightwatcher Merayl', | 67 [42159] = 'Nightwatcher Merayl', |
| 67 [40277] = 'Tiffany Nelson', | 68 [40277] = 'Tiffany Nelson', |
| 68 [40298] = 'Sir Galveston', | 69 [40298] = 'Sir Galveston', |
| 107 local hasInfo | 108 local hasInfo |
| 108 local achievementID = info.achievementID | 109 local achievementID = info.achievementID |
| 109 local _, name, _, completed, _, _, _, _, _, icon = GetAchievementInfo(achievementID) | 110 local _, name, _, completed, _, _, _, _, _, icon = GetAchievementInfo(achievementID) |
| 110 if not completed then | 111 if not completed then |
| 111 | 112 |
| 112 WorldMapTooltip:AddLine(" ") | |
| 113 WorldMapTooltip:AddLine("Achievements:") | |
| 114 WorldMapTooltip:AddLine(' |T'..icon..':20:20|t '..name) | |
| 115 | |
| 116 local numItems = GetAchievementNumCriteria(achievementID) | 113 local numItems = GetAchievementNumCriteria(achievementID) |
| 117 local numNeeded = 0 | 114 local numNeeded = 0 |
| 118 local tooltipLines = {} | 115 local tooltipLines = {} |
| 119 for i =1, numItems do | 116 for i =1, numItems do |
| 120 local criteriaName, criteriaType, completed, _, _, _, _, subAchievementID = GetAchievementCriteriaInfo(achievementID, i) | 117 local criteriaName, criteriaType, completed, _, _, _, _, subAchievementID = GetAchievementCriteriaInfo(achievementID, i) |
| 121 print(GetAchievementCriteriaInfo(achievementID, i)) | 118 --print(GetAchievementCriteriaInfo(achievementID, i)) |
| 122 | 119 |
| 123 if not completed then | 120 if not completed then |
| 124 print('::', criteriaName, completed, subAchievementID) | 121 --print('::', criteriaName, completed, subAchievementID) |
| 125 if criteriaType == 8 then | 122 if criteriaType == 8 then |
| 126 local _, _, _, completed, _, _, _, _, _, subIcon = GetAchievementInfo(subAchievementID) | 123 local _, _, _, completed, _, _, _, _, _, subIcon = GetAchievementInfo(subAchievementID) |
| 127 print(' -', criteriaName, completed, subIcon) | 124 --print(' -', criteriaName, completed, subIcon) |
| 128 if not completed then | 125 if not completed then |
| 129 local numCompleted = 0 | 126 local numCompleted = 0 |
| 130 local numSubItems = GetAchievementNumCriteria(subAchievementID) | 127 local numSubItems = GetAchievementNumCriteria(subAchievementID) |
| 131 local subCriteriaLine | 128 local subCriteriaLine |
| 132 for j = 1, numSubItems do | 129 for j = 1, numSubItems do |
| 133 local subName, _, completed = GetAchievementCriteriaInfo(subAchievementID, j) | 130 local subName, _, completed = GetAchievementCriteriaInfo(subAchievementID, j) |
| 134 | 131 |
| 135 print(' -',subName, completed) | 132 --print(' -',subName, completed) |
| 136 if completed then | 133 if completed then |
| 137 numCompleted = numCompleted + 1 | 134 numCompleted = numCompleted + 1 |
| 138 else | 135 else |
| 139 numNeeded = numNeeded + 1 | 136 numNeeded = numNeeded + 1 |
| 140 if subName:match(info.name) then | 137 if subName:match(info.name) then |
| 152 numNeeded = numNeeded + 1 | 149 numNeeded = numNeeded + 1 |
| 153 tinsert(tooltipLines, criteriaName) | 150 tinsert(tooltipLines, criteriaName) |
| 154 end | 151 end |
| 155 end | 152 end |
| 156 end | 153 end |
| 157 if numNeeded >= 1 then | 154 if hasInfo then |
| 155 WorldMapTooltip:AddLine(" ") | |
| 156 WorldMapTooltip:AddLine("Achievements:") | |
| 157 WorldMapTooltip:AddLine(' |T'..icon..':20:20|t '..name) | |
| 158 for i, line in ipairs(tooltipLines) do | 158 for i, line in ipairs(tooltipLines) do |
| 159 WorldMapTooltip:AddLine(line) | 159 WorldMapTooltip:AddLine(line) |
| 160 end | 160 end |
| 161 else | 161 end |
| 162 WorldMapTooltip:AddLine('Criteria completed!', 0, 1, 0) | |
| 163 end | |
| 164 | |
| 165 end | 162 end |
| 166 return hasInfo | 163 return hasInfo |
| 167 end | 164 end |
| 168 | 165 |
| 169 local GetQuestTooltipExtras = function(info) | 166 local GetQuestTooltipExtras = function(info) |
| 191 local GetFactionInfoByID, GetQuestObjectiveInfo = GetFactionInfoByID, GetQuestObjectiveInfo | 188 local GetFactionInfoByID, GetQuestObjectiveInfo = GetFactionInfoByID, GetQuestObjectiveInfo |
| 192 | 189 |
| 193 function QuestPOI:OnEnter() | 190 function QuestPOI:OnEnter() |
| 194 if not WorldMapFrame:IsVisible() then | 191 if not WorldMapFrame:IsVisible() then |
| 195 WorldMap_HijackTooltip(self.owningFrame) | 192 WorldMap_HijackTooltip(self.owningFrame) |
| 196 else | 193 end |
| 197 if self.filtered then | 194 if self.filtered then |
| 198 return | 195 return |
| 199 end | |
| 200 end | 196 end |
| 201 WorldMapTooltip:SetOwner(self, "ANCHOR_RIGHT"); | 197 WorldMapTooltip:SetOwner(self, "ANCHOR_RIGHT"); |
| 202 print('doing tooltip stuff') | 198 --print('doing tooltip stuff') |
| 203 | 199 |
| 204 -- Can't add stuff after, so most of the blizzard tooltip hook is simply copied over | 200 -- Can't add stuff after, so most of the blizzard tooltip hook is simply copied over |
| 205 local questID = self.questID | 201 local questID = self.questID |
| 206 local color = WORLD_QUEST_QUALITY_COLORS[self.rarity] or NORMAL_FONT_COLOR; | 202 local color = WORLD_QUEST_QUALITY_COLORS[self.rarity] or NORMAL_FONT_COLOR; |
| 207 | 203 |
| 265 end | 261 end |
| 266 | 262 |
| 267 -- attempt to pull pin data | 263 -- attempt to pull pin data |
| 268 local GetQuestTagInfo, GetProfessionInfo = GetQuestTagInfo, GetProfessionInfo | 264 local GetQuestTagInfo, GetProfessionInfo = GetQuestTagInfo, GetProfessionInfo |
| 269 function QuestPOI:GetData () | 265 function QuestPOI:GetData () |
| 270 qprint('|cFF00FF88'..self:GetName()..':GetWorldQuestInfo()|r') | 266 dprint('|cFF00FF88'..self:GetID()..':GetData()|r') |
| 271 local questID = self.questID | 267 local questID = self.questID |
| 272 if not questID then | 268 if not questID then |
| 273 rprint('|cFFFF4400bad pin|r', self:GetName()) | 269 dprint('|cFFFF4400bad pin|r', self:GetName()) |
| 274 return nil | 270 return nil |
| 275 end | 271 end |
| 276 | 272 |
| 277 local questTitle, factionID, capped = TQ_GetQuestInfoByQuestID(questID) | 273 local questTitle, factionID, capped = TQ_GetQuestInfoByQuestID(questID) |
| 278 -- if the title is nil, then wait and try later | 274 -- if the title is nil, then wait and try later |
| 279 if not questTitle then | 275 if not questTitle then |
| 280 self.isPending = true | 276 self.isPending = true |
| 281 rprint('|cFFBB8844nodata|r|cFF00FFFF', self.questId) | 277 dprint('|cFFBB8844isPending=true|r|cFF00FFFF', self.questId) |
| 282 else | 278 else |
| 283 self.title, self.factionID, self.capped = questTitle, factionID, capped | 279 self.title, self.factionID, self.capped = questTitle, factionID, capped |
| 284 rprint('|cFFBB8844 data|r|cFF00FFFF', (self.isPending and 'late|r' or 'jit|r'), self.title, '|r', self.factionID) | 280 dprint('|cFFBB8844 data|r|cFF00FFFF', (self.isPending and '|cFFFF4400delayed|r' or '|cFF00FF00success|r'), self.title, '|r', self.factionID) |
| 281 if self.dataLoaded then | |
| 282 dprint(' |cFFFF4400overwriting data|r') | |
| 283 end | |
| 284 | |
| 285 -- set tag details | 285 -- set tag details |
| 286 local worldQuestType | 286 local worldQuestType |
| 287 self.tagID, self.tagName, worldQuestType, self.rarity, self.isElite, self.tradeskillLineIndex = GetQuestTagInfo(questID); | 287 self.tagID, self.tagName, worldQuestType, self.rarity, self.isElite, self.tradeskillLineIndex = GetQuestTagInfo(questID); |
| 288 local tagAtlas | 288 local tagAtlas |
| 289 if worldQuestType == LE_QUEST_TAG_TYPE_PET_BATTLE then | 289 if worldQuestType == LE_QUEST_TAG_TYPE_PET_BATTLE then |
| 310 --qprint(' |cFF00FFFF'..questID..'|r hasUpdate:', hasUpdate, 'isPending:', isPending, 'isShown', self:IsShown()) | 310 --qprint(' |cFF00FFFF'..questID..'|r hasUpdate:', hasUpdate, 'isPending:', isPending, 'isShown', self:IsShown()) |
| 311 --qprint(' ', 'rewardType:', self.rewardType, 'tag:', self.tagID) | 311 --qprint(' ', 'rewardType:', self.rewardType, 'tag:', self.tagID) |
| 312 qprint(' ', tostring(self.title), " |T"..tostring(self.itemTexture)..":12:12|t", tostring(self.itemName)) | 312 qprint(' ', tostring(self.title), " |T"..tostring(self.itemTexture)..":12:12|t", tostring(self.itemName)) |
| 313 | 313 |
| 314 if self.itemTexture and self.itemName and self.title then | 314 if self.itemTexture and self.itemName and self.title then |
| 315 self.dataLoaded = true | |
| 315 self.isPending = nil | 316 self.isPending = nil |
| 316 self.throttle = 1 | 317 self.throttle = 1 |
| 317 self.updateRate = PIN_REFRESH_DELAY | 318 self.updateRate = PIN_REFRESH_DELAY |
| 318 self.isStale = true | 319 self.isStale = true |
| 319 end | 320 end |
| 346 rewardIcon = ICON_MONEY | 347 rewardIcon = ICON_MONEY |
| 347 rewardName = GetMoneyString(money) | 348 rewardName = GetMoneyString(money) |
| 348 rewardType = REWARD_CASH | 349 rewardType = REWARD_CASH |
| 349 end | 350 end |
| 350 | 351 |
| 351 print(' '..self.questID..':|cFFFFFF00SetRewardInfo():', rewardType) | 352 qprint(' '..self.questID..':|cFFFFFF00SetRewardInfo():', numRewards, rewardType) |
| 352 self.itemNumber = tonumber(rewardCount or self.itemNumber) | 353 self.itemNumber = tonumber(rewardCount or self.itemNumber) |
| 353 self.rewardType = rewardType or REWARD_GEAR | 354 self.rewardType = rewardType |
| 354 self.quality = quality | 355 self.quality = quality |
| 355 | 356 |
| 356 self.itemTexture = rewardIcon or self.itemTexture | 357 self.itemTexture = rewardIcon or self.itemTexture |
| 357 self.itemName = rewardName or self.itemName | 358 self.itemName = rewardName or self.itemName |
| 358 | 359 |
| 371 | 372 |
| 372 end | 373 end |
| 373 end | 374 end |
| 374 | 375 |
| 375 -- run from OnShow if .isNew is set | 376 -- run from OnShow if .isNew is set |
| 376 function QuestPOI:OnNew() | 377 |
| 377 | 378 function QuestPOI:StartFade() |
| 378 if not self.isAnimating then | 379 if not self.isAnimating then |
| 379 --qprint('|cFFFFFF00'.. self.title .. ' added to quest log.') | 380 --qprint('|cFFFFFF00'.. self.title .. ' added to quest log.') |
| 380 self:SetAlpha(0) | 381 self:SetAlpha(0) |
| 381 if db.Config.FadeWhileGrouped then | 382 self.FadeIn.FadeIn:SetToAlpha(db.PinAlpha) |
| 382 self.FadeIn.FadeIn:SetToAlpha(0.15) | 383 self.PendingFade.FadeIn:SetToAlpha(db.PinAlpha) |
| 383 self.PendingFade.FadeIn:SetToAlpha(0.15) | 384 self.PendingFade.FadeOut:SetFromAlpha(db.PinAlpha) |
| 384 self.PendingFade.FadeOut:SetFromAlpha(0.15) | 385 |
| 385 else | |
| 386 self.FadeIn.FadeIn:SetToAlpha(1) | |
| 387 self.PendingFade.FadeIn:SetToAlpha(1) | |
| 388 self.PendingFade.FadeOut:SetFromAlpha(1) | |
| 389 end | |
| 390 self.isAnimating = true | 386 self.isAnimating = true |
| 391 self.isNew = nil | 387 self.isNew = nil |
| 392 self.isStale = true | 388 self.isStale = true |
| 393 self.FadeIn:Play() | 389 self.FadeIn:Play() |
| 394 end | 390 end |
| 395 end | 391 end |
| 396 | 392 |
| 393 function QuestPOI:EndFade() | |
| 394 self.isAnimating = nil | |
| 395 self:SetAlpha(db.PinAlpha) | |
| 396 end | |
| 397 | |
| 397 function QuestPOI:OnShow () | 398 function QuestPOI:OnShow () |
| 398 | 399 |
| 399 if self.isNew then | 400 if self.isNew then |
| 400 qprint('|cFFFFFF00'..tostring(self:GetName())..':OnShow()|r update:', self.isStale, 'new:', self.isNew, 'animation:', self.isAnimating) | 401 qprint('|cFFFFFF00'..tostring(self:GetName())..':OnShow()|r update:', self.isStale, 'new:', self.isNew, 'animation:', self.isAnimating) |
| 401 --qprint('|cFFFFFF00popping new pin handler') | 402 --qprint('|cFFFFFF00popping new pin handler') |
| 402 self:OnNew() | 403 self:StartFade() |
| 403 elseif not self.isAnimating then | 404 elseif not self.isAnimating then |
| 404 self:SetAlpha(1) -- fix stuck alpha | 405 self:SetAlpha(1) -- fix stuck alpha |
| 405 end | 406 end |
| 406 | 407 |
| 407 if self.isNew or self.isStale then | 408 if self.isStale then |
| 409 qprint('|cFF0088FFflagged for refresh') | |
| 408 self:Refresh() | 410 self:Refresh() |
| 409 end | 411 end |
| 410 --WorldPlan:print(self:GetAlpha()) | 412 --WorldPlan:print(self:GetAlpha()) |
| 411 | 413 |
| 414 if not self.Overlay:IsShown() then | |
| 415 self:StartFade() | |
| 416 end | |
| 417 | |
| 418 | |
| 419 self.Overlay:SetShown(true) | |
| 412 end | 420 end |
| 413 function QuestPOI:OnHide() | 421 function QuestPOI:OnHide() |
| 414 --qprint('|cFFFFFF00["'..tostring(self.title)..'"]|r:OnHide()') | 422 qprint('|cFFFFFF00'..self:GetID()..'r:OnHide()') |
| 415 if not self:IsShown() then | 423 self.isAnimating = nil |
| 416 self.isAnimating = nil | 424 self:SetAlpha(db.PinAlpha) |
| 417 self:SetAlpha(1) | |
| 418 end | |
| 419 | |
| 420 self.Overlay:SetShown(false) | 425 self.Overlay:SetShown(false) |
| 421 end | 426 end |
| 422 | 427 |
| 423 function QuestPOI:SetAnchor(frame, mapID, mapWidth, mapHeight) | 428 local overlayBaseIndex = 1300 |
| 424 qprint(' |cFF00FF00'..self:GetName()..':SetAnchor()|r', self.questID, mapID) | 429 function QuestPOI:SetAnchor(dX, dY, mapWidth, mapHeight) |
| 425 self:ClearAllPoints() | |
| 426 local dX, dY = TQ_GetQuestLocation(self.questID) | |
| 427 if not dX or dX == 0 then | |
| 428 local _, x, y = QuestPOIGetIconInfo(self.questID) | |
| 429 if x and floor(x) ~= 0 then | |
| 430 dX, dY = x, y | |
| 431 else | |
| 432 dX, dY = self.x, self.y | |
| 433 end | |
| 434 end | |
| 435 local oX, oY = self.x, self.y | 430 local oX, oY = self.x, self.y |
| 431 if not (dX and dY) then | |
| 432 local dX, dY = TQ_GetQuestLocation(self.questID) | |
| 433 if not dX or dX == 0 then | |
| 434 local _, x, y = QuestPOIGetIconInfo(self.questID) | |
| 435 if x and floor(x) ~= 0 then | |
| 436 dX, dY = x, y | |
| 437 else | |
| 438 dX, dY = self.x, self.y | |
| 439 end | |
| 440 end | |
| 441 end | |
| 442 if not (mapHeight and mapWidth) then | |
| 443 mapWidth, mapHeight = self:GetParent():GetSize() | |
| 444 end | |
| 445 local pX = (dX * mapWidth) | |
| 446 local pY = (-dY * mapHeight) | |
| 447 | |
| 448 | |
| 436 self.x = dX | 449 self.x = dX |
| 437 self.y = dY | 450 self.y = dY |
| 438 | 451 self:ClearAllPoints() |
| 439 | 452 self:SetPoint('CENTER', self:GetParent(), 'TOPLEFT', pX, pY) |
| 440 local pX = (dX * mapWidth) | 453 self:SetShown(self.used) |
| 441 local pY = (-dY * mapHeight) | 454 |
| 442 | 455 self.Overlay:SetParent(self:GetParent()) |
| 443 if oX ~= dX then | 456 self.Overlay:ClearAllPoints() |
| 444 wqprint(' |cFF00FF00'..self.questID..':|r', oX, dX, format("%0.2f %0.2f", pX, pY)) | 457 self.Overlay:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 4) |
| 445 end | 458 self.Overlay:SetPoint('BOTTOMRIGHT', self, 'BOTTOMRIGHT', 0, -4) |
| 446 | 459 self.Overlay:SetFrameLevel(overlayBaseIndex + self:GetID()) |
| 447 self:SetParent(WorldMapPOIFrame) | |
| 448 self:SetPoint('CENTER', frame, 'TOPLEFT', pX, pY) | |
| 449 end | 460 end |
| 450 | 461 |
| 451 function QuestPOI:OnLoad() | 462 function QuestPOI:OnLoad() |
| 452 qprint('|cFF00FF88'..self:GetName()..':OnLoad()|r',db.Config) | 463 qprint('|cFF00FF88'..self:GetName()..':OnLoad()|r',db.Config) |
| 453 self:RegisterEvent('SUPER_TRACKED_QUEST_CHANGED') | 464 self:RegisterEvent('SUPER_TRACKED_QUEST_CHANGED') |
| 487 end | 498 end |
| 488 | 499 |
| 489 -- query for reward data if it wasn't found in the original scan | 500 -- query for reward data if it wasn't found in the original scan |
| 490 local questID = self.questID | 501 local questID = self.questID |
| 491 if self.isPending then | 502 if self.isPending then |
| 492 self:GetData() | 503 print('|cFFFF4400'..self:GetID()..':|r polling reward info') |
| 493 if not (self.PendingFade:IsPlaying() or self.isAnimating) then | 504 if not (self.isAnimating) then |
| 494 self.PendingFade:Play() | 505 self.PendingFade:Play() |
| 495 end | 506 end |
| 507 self:GetData() | |
| 496 return | 508 return |
| 497 else | 509 else |
| 498 if self.PendingFade:IsPlaying() then | 510 if self.PendingFade:IsPlaying() then |
| 499 self.PendingFade:Stop() | 511 self.PendingFade:Stop() |
| 500 end | 512 end |
| 523 self.timeLabel:SetShown(self.worldQuest and (self.maxAlertLevel >= 1)) | 535 self.timeLabel:SetShown(self.worldQuest and (self.maxAlertLevel >= 1)) |
| 524 end | 536 end |
| 525 | 537 |
| 526 | 538 |
| 527 | 539 |
| 528 function QuestPOI:Refresh () | 540 function QuestPOI:Refresh (fromUser) |
| 529 print('|cFF00FF88'..self:GetName()..'|r:Refresh()') | 541 |
| 542 --rprint('|c'..(fromUser and 'FF0088FF' or 'FF00FF88' )..self:GetID()..'|r:Refresh() type =', self.rewardType, 'title =', self.title) | |
| 543 | |
| 544 | |
| 530 | 545 |
| 531 local styleType = (self.isPending and STYLE_TYPE_PENDING) or self.rewardType | 546 local styleType = (self.isPending and STYLE_TYPE_PENDING) or self.rewardType |
| 532 local style,subStyle = self:GetTypeInfo(self.rewardType) | 547 local style,subStyle = self:GetTypeInfo(self.rewardType) |
| 533 if self.filtered then | 548 if self.filtered and (self.questID ~= GetSuperTrackedQuestID()) then |
| 534 subStyle = style.minimized | 549 subStyle = style.minimized |
| 535 end | 550 end |
| 536 self.style = style | 551 self.style = style |
| 537 self.subStyle = subStyle | 552 self.subStyle = subStyle |
| 538 --print(style, subStyle) | 553 --print(style, subStyle) |
| 585 icon:SetTexture(PENDING_ICON) | 600 icon:SetTexture(PENDING_ICON) |
| 586 icon:SetDesaturated(true) | 601 icon:SetDesaturated(true) |
| 587 icon:SetVertexColor(style.r, style.g, style.b) | 602 icon:SetVertexColor(style.r, style.g, style.b) |
| 588 end | 603 end |
| 589 | 604 |
| 590 local borderStyle = style | |
| 591 iconBorder:SetMask("Interface\\Minimap\\UI-Minimap-Background") | 605 iconBorder:SetMask("Interface\\Minimap\\UI-Minimap-Background") |
| 592 iconBorder:SetTexture(PENDING_BORDER) | 606 iconBorder:SetTexture(PENDING_BORDER) |
| 593 | 607 iconBorder:SetVertexColor(style.r, style.g, style.b, 1) |
| 594 iconBorder:SetVertexColor(borderStyle.r, borderStyle.g, borderStyle.b, 1) | |
| 595 iconBorder:SetDesaturated(true) | 608 iconBorder:SetDesaturated(true) |
| 596 iconBorder:SetAlpha(subStyle.alpha or 1) | 609 iconBorder:SetAlpha(subStyle.alpha or 1) |
| 597 | 610 |
| 598 trackingBorder:SetMask("Interface\\Minimap\\UI-Minimap-Background") | 611 trackingBorder:SetMask("Interface\\Minimap\\UI-Minimap-Background") |
| 599 trackingBorder:SetTexture(PENDING_BORDER) | 612 trackingBorder:SetTexture(PENDING_BORDER) |
| 600 trackingBorder:SetVertexColor(0,0,0,1) | 613 trackingBorder:SetVertexColor(0,0,0,1) |
| 601 | 614 |
| 602 self.tagIcon:SetShown(self.tagSize and true or false) | 615 self.tagIcon:SetShown((not self.filtered) and true or false) |
| 603 self.tagIcon:SetAtlas(self.tagAtlas) | 616 self.tagIcon:SetAtlas(self.tagAtlas) |
| 604 self.tagIcon:SetAlpha(subStyle.alpha or 1) | 617 |
| 605 self.Overlay:SetShown(true) | |
| 606 self.Overlay:ClearAllPoints(self) | |
| 607 self.Overlay:SetParent(self:GetParent()) | |
| 608 self.Overlay:SetFrameLevel(self:GetFrameLevel()+200) | |
| 609 self.Overlay:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 4) | |
| 610 self.Overlay:SetPoint('BOTTOMRIGHT', self, 'BOTTOMRIGHT', 0, -4) | |
| 611 self.EliteBorder:SetShown(self.isElite and not self.filtered) | 618 self.EliteBorder:SetShown(self.isElite and not self.filtered) |
| 612 | 619 |
| 613 | 620 |
| 614 self:UpdateSize() | 621 self:UpdateSize() |
| 615 self.isStale = nil | 622 self.isStale = nil |
| 637 if self.rewardType and cvar_check[self.rewardType] then | 644 if self.rewardType and cvar_check[self.rewardType] then |
| 638 if not GetCVarBool(cvar_check[self.rewardType]) then | 645 if not GetCVarBool(cvar_check[self.rewardType]) then |
| 639 filtered = true | 646 filtered = true |
| 640 end | 647 end |
| 641 end | 648 end |
| 642 return filtered | 649 self.filtered = filtered |
| 643 end | 650 end |
| 644 | 651 |
| 645 function QuestPOI:IsShowable () | 652 function QuestPOI:IsShowable () |
| 646 local print = qprint | 653 local print = qprint |
| 647 local qType = self.worldQuestType | 654 local qType = self.worldQuestType |
| 648 | 655 |
| 649 if not self.worldQuest then | 656 if not self.worldQuest then |
| 650 print('ignoring showable check') | 657 --print('ignoring showable check') |
| 651 return self.used, self.filtered | 658 return self.used, self.filtered |
| 652 end | 659 end |
| 653 self.used = TQ_IsActive(self.questID) | 660 self.used = TQ_IsActive(self.questID) |
| 654 | |
| 655 if qType == LE_QUEST_TAG_TYPE_PROFESSION then | 661 if qType == LE_QUEST_TAG_TYPE_PROFESSION then |
| 656 qprint('hide flags:', (not self.isKnownProfession), (db.Config.ShowAllProfessionQuests == false)) | |
| 657 if (not self.isKnownProfession) and (db.Config.ShowAllProfessionQuests == false) then | 662 if (not self.isKnownProfession) and (db.Config.ShowAllProfessionQuests == false) then |
| 658 qprint(self.used) | |
| 659 self.used = nil | 663 self.used = nil |
| 660 qprint(self.used) | 664 end |
| 661 end | 665 end |
| 662 end | 666 rprint(' '..self.questID..':|cFFFFFF00IsShowable()|r ', self.used, self.title) |
| 663 print(' '..self.questID..':|cFFFFFF00IsShowable()|r ', self.used, self.title) | |
| 664 return self.used | |
| 665 end | 667 end |
| 666 | 668 |
| 667 --- Fixes icons upon size update | 669 --- Fixes icons upon size update |
| 668 function QuestPOI:UpdateSize () | 670 function QuestPOI:UpdateSize () |
| 669 | 671 |
| 670 qprint('|cFF00FF88'..self:GetName()..'|r:UpdateSize()', self.style, self.subStyle) | 672 --qprint('|cFF00BB88'..self:GetID()..'|r:UpdateSize()', self.style, self.subStyle) |
| 671 | 673 |
| 672 local style = self.style | 674 local style = self.style |
| 673 local subStyle = self.subStyle | 675 local subStyle = self.subStyle |
| 674 local icon = self.icon | 676 local icon = self.icon |
| 675 local iconBorder = self.RewardBorder | 677 local iconBorder = self.RewardBorder |
