comparison FlightMap.lua @ 37:78cf1f19856a

WorldPlan: - Quest pins are now placed on the flight map. Their visibility rules will mirror the filter options from the world map. - Filter controls polish: - First click negates other reward type filters. Subsequent clicks will then toggle individual reward types until the filters are reset via Right-click. - Adheres to the Blizzard CVars added in patch 7.1 - Numerous optimizations to how data and visual updates are handled; should see an even better load time, and snappier world map interaction. ClassPlan: - The 'Available Missions' list is now recorded. It can be reviewed by clicking on the mission list heading. - Information filtering by character and realm.
author Nenue
date Fri, 04 Nov 2016 02:47:17 -0400
parents 21bcff08b0f4
children a93cae445d3f
comparison
equal deleted inserted replaced
36:21bcff08b0f4 37:78cf1f19856a
46 end 46 end
47 47
48 function WorldPlanDataProvider:OnAdded(mapCanvas) 48 function WorldPlanDataProvider:OnAdded(mapCanvas)
49 self.activePins = {}; 49 self.activePins = {};
50 self.owningMap = mapCanvas 50 self.owningMap = mapCanvas
51 self:RegisterEvent('QUEST_LOG_UPDATE')
52
53 -- remove the the blizzard data provider
54 for frame in pairs(FlightMapFrame.dataProviders) do
55 if frame.OnAdded == WorldQuestDataProviderMixin.OnAdded then
56 FlightMapFrame:RemoveDataProvider(frame)
57 break
58 end
59 end
51 end 60 end
52 61
53 62
54 function WorldPlanDataProvider:RefreshAllData() 63 function WorldPlanDataProvider:RefreshAllData()
55 local print = print 64 local print = print
90 self.activePins[info.questId] = frame 99 self.activePins[info.questId] = frame
91 end 100 end
92 frame:SetPosition(info.x, info.y) 101 frame:SetPosition(info.x, info.y)
93 frame.pin = pin 102 frame.pin = pin
94 103
104 pin.owningFrame = self:GetMap()
95 pin.isStale = true 105 pin.isStale = true
96 pin:SetParent(frame) 106 pin:SetParent(frame)
97 pin:ClearAllPoints() 107 pin:ClearAllPoints()
98 pin:SetPoint('CENTER', frame, 'CENTER') 108 pin:SetPoint('CENTER', frame, 'CENTER')
99 109
109 for questId in pairs(pinsToRemove) do 119 for questId in pairs(pinsToRemove) do
110 self:GetMap():RemovePin(self.activePins[questId]); 120 self:GetMap():RemovePin(self.activePins[questId]);
111 self.activePins[questId] = nil; 121 self.activePins[questId] = nil;
112 end 122 end
113 --self:GetMap():RemoveAllPinsByTemplate("WorldQuestPinTemplate"); 123 --self:GetMap():RemoveAllPinsByTemplate("WorldQuestPinTemplate");
124 for pin in self:GetMap():EnumeratePinsByTemplate("WorldQuestPinTemplate") do
125 pin:Hide()
126 end
114 127
128 end
129 function WorldPlanDataProvider:OnEvent()
130 for pin in self:GetMap():EnumeratePinsByTemplate("WorldQuestPinTemplate") do
131 pin:Hide()
132 end
115 end 133 end
116 134
117 function WorldPlanDataPinMixin:OnShow() 135 function WorldPlanDataPinMixin:OnShow()
118 print('|cFFFFFF00'..tostring(self:GetName())..':OnShow()|r') 136 print('|cFFFFFF00'..tostring(self:GetName())..':OnShow()|r')
119 end 137 end
120 138
121 function WorldPlanDataPinMixin:OnMouseEnter () 139 function WorldPlanDataPinMixin:OnMouseEnter ()
122 self.pin:OnEnter() 140
123 end 141 end
124 142
125 function WorldPlanDataPinMixin:OnMouseLeave () 143 function WorldPlanDataPinMixin:OnMouseLeave ()
126 self.pin:OnLeave() 144
127 end 145 end
128 146
129 function WorldPlanDataPinMixin:RemoveAllData() 147 function WorldPlanDataPinMixin:RemoveAllData()
130 wipe(self.activePins); 148 wipe(self.activePins);
131 self:GetMap():RemoveAllPinsByTemplate("WorldPlanFlightPin"); 149 self:GetMap():RemoveAllPinsByTemplate("WorldPlanFlightPin");