Mercurial > wow > worldplan
diff WorldQuests.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 |
line wrap: on
line diff
--- a/WorldQuests.lua Wed Nov 02 17:25:07 2016 -0400 +++ b/WorldQuests.lua Wed Nov 02 19:04:47 2016 -0400 @@ -106,7 +106,7 @@ self:RefreshData() end print('WorldMapFrame', WorldMapFrame:IsVisible(), 'hasUpdates:', self.isStale) - elseif event == 'WORLD_MAP_UPDATE' then + elseif event == 'WORLD_MAP_UPDATE' or event == 'PLAYER_ENTERING_WORLD' then self.isStale = true elseif event == 'WORLD_QUEST_COMPLETED_BY_SPELL' then local questID = ... @@ -185,7 +185,14 @@ return end - print('|cFF00FF88'..self:GetName()..':RefreshData()|r', 'map:', mapID, 'realMap:', GetCurrentMapAreaID()) + if not self:IsVisible() then + self.isStale = true + print('frame closed, do it later') + return + end + + + print('|cFF00FF88'..self:GetName()..':RefreshData()|r', 'map:', mapID, 'realMap:', GetCurrentMapAreaID()) if mapID == BROKEN_ISLES_ID then self.isStale = false @@ -209,6 +216,7 @@ info.mapID = mapID local questPOI = self:AcquirePin(questID, mapID) local hasUpdate, isPending = questPOI:RefreshData(info) + -- WorldPlan:print('|cFF0088FF'..questPOI.title..'|r', hasUpdate) self.isStale = (self.isStale or hasUpdate) self.isPending = (self.isPending or isPending) numQuests = numQuests + 1 @@ -227,6 +235,12 @@ function WorldQuests:Refresh() local print = wqprint print('|cFF00FF88'..self:GetName()..':Refresh()|r') + if not self:IsVisible() then + self.isStale = true + print('frame closed, do it later') + return + end + self:Reset() self:UpdateAnchors() self:Cleanup () @@ -277,7 +291,7 @@ pin.hasUpdate = true pin:SetFrameLevel(PinBaseIndex+ (pin.whiteListed and 200 or 0) +numPins) print('level', PinBaseIndex+ (pin.whiteListed and 200 or 0) +numPins) - pin:SetAnchor(WorldMapPOIFrame, currentMap, mapWidth, mapHeight) + pin:SetAnchor(_G.WorldMapPOIFrame, currentMap, mapWidth, mapHeight) numPins = numPins + 1 end end @@ -290,61 +304,19 @@ local debug_hide = {} function WorldQuests:Cleanup () local print = wqprint - local showQuestPOI = db.EnablePins - print('|cFFFFFF00'..tostring(self)..':Cleanup()|r') - local mapID = GetCurrentMapAreaID() - isContinentMap = (mapID == BROKEN_ISLES_ID) + local showQuestPOI = WorldPlan.db.EnablePins + WorldPlan:print('|cFFFFFF00'..self:GetName()..':Cleanup()|r') + -- continent or zone sizing - wipe(debug_show) - wipe(debug_animate) - wipe(debug_hide) - -- continent or zone sizing - local fadeGrouped = (db.FadeWhileGrouped and IsInGroup()) numPins = 0 for questID, pin in pairs(self.QuestsByID) do -- can we show it? - if showQuestPOI and (pin.used) then - - pin.isStale = true - if fadeGrouped then - pin:SetAlpha(0.25) - else - pin:SetAlpha(1) - end - -- is it a new quest? - if pin.isNew then - if not pin.isAnimating then - pin.isAnimating = true - WorldPlan:OnNext(function() - pin:ShowNew() - end) - tinsert(debug_animate,questID) - else - - print('animating? ', questID, 'filtered:', pin.filtered) - end - -- trap new but animating pins here - else - -- hard show existing pin - --print('refresh #', questID, 'filtered:', pin.filtered, 'hasUpdate', pin.hasUpdate) - pin:Show() - tinsert(debug_show,questID) - end - else - if pin:IsShown() then - tinsert(debug_hide,questID) - end - pin.isAnimating = nil - pin.FadeIn:Stop() - pin:Hide() - end + pin:SetShown((showQuestPOI and pin.used)) end print(' adding:', table.concat(debug_animate, ',' )) print(' refresh:', table.concat(debug_show, ',' )) print(' hiding:', table.concat(debug_hide, ',' )) - hasNewQuestPins = nil - notifyPlayed = nil self.isStale = nil end