comparison QuestPOI.lua @ 34:0100d923d8c3

WorldPlan: - Reward filter toggle changed to clear out other reward filters. The assumption being that one is most often looking only for that particular type of quest when they go to use it. - Fixed filter bar info falling out of sync after player-triggered world map updates. - Code stuff: -- Quest pin shown-state management makes better use of OnShow OnHide handlers, SetShown is toggled and it all goes from there -- WorldQuests module re-factored outside of the top level frame script. ClassPlan: - Available missions are now recorded; the mission list can be toggled between in-progress and available by clicking the heading.
author Nenue
date Wed, 02 Nov 2016 19:04:47 -0400
parents be4db60219ca
children 26dfa661daa7
comparison
equal deleted inserted replaced
33:be4db60219ca 34:0100d923d8c3
342 342
343 function WorldPlanPOIMixin:SetAchievementProgressTooltip() 343 function WorldPlanPOIMixin:SetAchievementProgressTooltip()
344 print('cheevos') 344 print('cheevos')
345 end 345 end
346 346
347 function WorldPlanPOIMixin:ShowNew() 347 -- run from OnShow if .isNew is set
348 self:SetShown(true) 348 function WorldPlanPOIMixin:OnNew()
349 self.isNew = nil 349 self:SetAlpha(0)
350 self.isStale = true 350
351 self.FadeIn:Play() 351 if WorldPlan.db.FadeWhileGrouped then
352 self.FadeIn.FadeIn:SetToAlpha(0.15)
353 self.PendingFade.FadeIn:SetToAlpha(0.15)
354 self.PendingFade.FadeIn:SetFromAlpha(0.15)
355 else
356 self.FadeIn.FadeIn:SetToAlpha(1)
357 self.PendingFade.FadeIn:SetToAlpha(1)
358 self.PendingFade.FadeIn:SetFromAlpha(1)
359 end
360 if not self.isAnimating then
361 self.isAnimating = true
362 WorldPlan:OnNext(function()
363 self.isNew = nil
364 self.FadeIn:Play()
365 end)
366 end
352 end 367 end
353 368
354 function WorldPlanPOIMixin:OnShow () 369 function WorldPlanPOIMixin:OnShow ()
355 qprint('|cFFFFFF00["'..tostring(self.title)..'"]|r:OnShow() update:', self.isStale, 'new:', self.isNew, 'animation:', self.isAnimating) 370 qprint('|cFFFFFF00["'..tostring(self.title)..'"]|r:OnShow() update:', self.isStale, 'new:', self.isNew, 'animation:', self.isAnimating)
356 -- pop this on principle 371 -- pop this on principle
357 if self.isStale then 372
373 if self.isNew or self.isStale then
358 self:Refresh() 374 self:Refresh()
359 end 375 end
376
377
378 -- is it a new quest?
379 if self.isNew then
380 WorldPlan:print('|cFF0088FF', self.title, '|r', self.isNew and 'new', self.isStale and 'stale', self.isAnimating and 'animating')
381 self:OnNew()
382 -- trap new but animating pins here
383 else
384 -- hard show existing self
385 --print('refresh #', questID, 'filtered:', self.filtered, 'hasUpdate', self.hasUpdate)
386 self:Show()
387 end
388
360 389
361 end 390 end
362 function WorldPlanPOIMixin:OnHide() 391 function WorldPlanPOIMixin:OnHide()
363 qprint('|cFFFFFF00["'..tostring(self.title)..'"]|r:OnHide()') 392 qprint('|cFFFFFF00["'..tostring(self.title)..'"]|r:OnHide()')
393 if not self:IsShown() then
394 self.isAnimating = nil
395 self:SetAlpha(0)
396 end
397
364 end 398 end
365 399
366 function WorldPlanPOIMixin:SetAnchor(frame, mapID, mapWidth, mapHeight) 400 function WorldPlanPOIMixin:SetAnchor(frame, mapID, mapWidth, mapHeight)
367 --qprint(' |cFF00FF00'..self:GetName()..':SetAnchor()|r', self.questID, mapID, mapWidth) 401 --qprint(' |cFF00FF00'..self:GetName()..':SetAnchor()|r', self.questID, mapID, mapWidth)
368 self:ClearAllPoints() 402 self:ClearAllPoints()
579 elseif qType == LE_QUEST_TAG_TYPE_PROFESSION then 613 elseif qType == LE_QUEST_TAG_TYPE_PROFESSION then
580 if not (db.ShowAllProfessionQuests or (self.tradeskillLineIndex and GetProfessionInfo(self.tradeskillLineIndex))) then 614 if not (db.ShowAllProfessionQuests or (self.tradeskillLineIndex and GetProfessionInfo(self.tradeskillLineIndex))) then
581 self.used = nil 615 self.used = nil
582 end 616 end
583 end 617 end
584 print(' |cFFFF4400IsShowable()|r', self.used, self.filtered, self.title) 618 print(' |cFFFF4400IsShowable()|r', self.isNew, self.isAnimating, self.used, self.filtered, self.title)
585 return self.used, self.filtered 619 return self.used, self.filtered
586 end 620 end
587 621
588 function QuestPOI:UpdateTimer (timeLeft, timeType) 622 function QuestPOI:UpdateTimer (timeLeft, timeType)
589 print('|cFF0088FFUpdatePinTimer()|r') 623 print('|cFF0088FFUpdatePinTimer()|r')