# HG changeset patch # User Nenue # Date 1478127887 14400 # Node ID 0100d923d8c348287b6bd9ac06db2f392706c033 # Parent be4db60219caf245846ee70ae9cd91da6509492d 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. diff -r be4db60219ca -r 0100d923d8c3 QuestPOI.lua --- a/QuestPOI.lua Wed Nov 02 17:25:07 2016 -0400 +++ b/QuestPOI.lua Wed Nov 02 19:04:47 2016 -0400 @@ -344,23 +344,57 @@ print('cheevos') end -function WorldPlanPOIMixin:ShowNew() - self:SetShown(true) - self.isNew = nil - self.isStale = true - self.FadeIn:Play() +-- run from OnShow if .isNew is set +function WorldPlanPOIMixin:OnNew() + self:SetAlpha(0) + + if WorldPlan.db.FadeWhileGrouped then + self.FadeIn.FadeIn:SetToAlpha(0.15) + self.PendingFade.FadeIn:SetToAlpha(0.15) + self.PendingFade.FadeIn:SetFromAlpha(0.15) + else + self.FadeIn.FadeIn:SetToAlpha(1) + self.PendingFade.FadeIn:SetToAlpha(1) + self.PendingFade.FadeIn:SetFromAlpha(1) + end + if not self.isAnimating then + self.isAnimating = true + WorldPlan:OnNext(function() + self.isNew = nil + self.FadeIn:Play() + end) + end end function WorldPlanPOIMixin:OnShow () qprint('|cFFFFFF00["'..tostring(self.title)..'"]|r:OnShow() update:', self.isStale, 'new:', self.isNew, 'animation:', self.isAnimating) -- pop this on principle - if self.isStale then + + if self.isNew or self.isStale then self:Refresh() end + + -- is it a new quest? + if self.isNew then + WorldPlan:print('|cFF0088FF', self.title, '|r', self.isNew and 'new', self.isStale and 'stale', self.isAnimating and 'animating') + self:OnNew() + -- trap new but animating pins here + else + -- hard show existing self + --print('refresh #', questID, 'filtered:', self.filtered, 'hasUpdate', self.hasUpdate) + self:Show() + end + + end function WorldPlanPOIMixin:OnHide() qprint('|cFFFFFF00["'..tostring(self.title)..'"]|r:OnHide()') + if not self:IsShown() then + self.isAnimating = nil + self:SetAlpha(0) + end + end function WorldPlanPOIMixin:SetAnchor(frame, mapID, mapWidth, mapHeight) @@ -581,7 +615,7 @@ self.used = nil end end - print(' |cFFFF4400IsShowable()|r', self.used, self.filtered, self.title) + print(' |cFFFF4400IsShowable()|r', self.isNew, self.isAnimating, self.used, self.filtered, self.title) return self.used, self.filtered end diff -r be4db60219ca -r 0100d923d8c3 WorldPlan.lua --- a/WorldPlan.lua Wed Nov 02 17:25:07 2016 -0400 +++ b/WorldPlan.lua Wed Nov 02 19:04:47 2016 -0400 @@ -66,7 +66,7 @@ DisplayContinentPins = true, NotifyWhenNewQuests = true, EnablePins = true, - FadeWhileGrouped = true, + FadeWhileGrouped = false, } -- operating flags @@ -158,6 +158,8 @@ if self.isStale then self:Refresh() end + + hooksecurefunc(self, 'SetScript', function(...) self:print('|cFFFFFF00'..self:GetName()..':SetScript()|r', ...) end) end function WorldPlan:OnEvent (event, ...) @@ -177,7 +179,7 @@ if event == 'WORLD_MAP_UPDATE' then self.currentMapID = GetCurrentMapAreaID() self.isContinentMap = (self.currentMapID == BROKEN_ISLES_ID) - print('|cFFFF4400currentMapID =', self.currentMapID) + self:print('|cFFFF4400currentMapID =', self.currentMapID) --self.isStale = true end @@ -191,18 +193,19 @@ end function WorldPlanCore:OnNext(func) + + tinsert(self.TaskQueue, func) + self:print('|cFF00FF00adding scheduled task #', #self.TaskQueue) end function WorldPlanCore:OnUpdate() if #self.TaskQueue >= 1 then - local func = tremove(self.TaskQueue, 1) - if func then + local func = tremove(self.TaskQueue, 1) + --self:print('|cFF00FF00running scheduled task #', #self.TaskQueue) func() end - end - if self.isStale then print('|cFF00FF00pushing global update') self.isStale = nil @@ -401,7 +404,7 @@ info.value = "FadeWhileGrouped" info.tooltipTitle = "Group Fade" info.tooltipText = "Reduce pin alpha when grouped, so player dots are easier to see." - info.checked = db.DisplayContinentSummary + info.checked = db.FadeWhileGrouped info.func = DropDown_OnClick UIDropDownMenu_AddButton(info) end diff -r be4db60219ca -r 0100d923d8c3 WorldPlan.xml --- a/WorldPlan.xml Wed Nov 02 17:25:07 2016 -0400 +++ b/WorldPlan.xml Wed Nov 02 19:04:47 2016 -0400 @@ -39,7 +39,7 @@