Mercurial > wow > worldplan
diff WorldQuests.lua @ 36:21bcff08b0f4
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 01:40:39 -0400 |
parents | 26dfa661daa7 |
children | 78cf1f19856a |
line wrap: on
line diff
--- a/WorldQuests.lua Thu Nov 03 17:29:15 2016 -0400 +++ b/WorldQuests.lua Fri Nov 04 01:40:39 2016 -0400 @@ -3,13 +3,6 @@ -- Created: 11/2/2016 3:40 PM -- %file-revision% -WorldPlanDataProvider = {} -WorldPlanDataPinMixin = {} -WorldPlanQuestsMixin = { - QuestsByZone = {}, - QuestsByID = {}, - freePins = {}, -} local WorldQuests = WorldPlanQuestsMixin local MC_GetNumZones, MC_GetZoneInfo = C_MapCanvas.GetNumZones, C_MapCanvas.GetZoneInfo @@ -84,7 +77,7 @@ WorldPlan:AddTypeInfo(self, REWARD_ARTIFACT_POWER, { r = 1, g = .25, b = .5, hasNumeric = true, numberRGB = rgbWhite }) WorldPlan:AddTypeInfo(self, REWARD_GEAR, { r = .1, g = .2, b = 1 }) WorldPlan:AddTypeInfo(self, REWARD_CURRENCY, { r = 1, g = 1, b = 0, hasNumeric = true, numberRGB = {1,1,0}, }) - WorldPlan:AddTypeInfo(self, REWARD_CASH, { r = 0, g = 0, b = 0, }) + WorldPlan:AddTypeInfo(self, REWARD_CASH, { r = .7, g = .6, b = .32, pinMask = false, rewardMask = false }) for areaID, fileName in pairs(WORLD_QUEST_MAPS) do self.QuestsByZone[areaID] = {} @@ -318,101 +311,3 @@ end - - -function WorldPlanDataProvider:OnShow() - assert(self.ticker == nil); - self.ticker = C_Timer.NewTicker(10, function() self:RefreshAllData() end); -end -function WorldPlanDataProvider:OnHide() - self.ticker:Cancel(); - self.ticker = nil; -end - -function WorldPlanDataProvider:OnAdded(mapCanvas) - self.activePins = {}; - self.owningMap = mapCanvas -end - - - -function WorldPlanDataProvider:RefreshAllData() - local print = mprint - print('|cFFFF0088'..self.owningMap:GetName()..':RefreshAllData()|r') - - - local pinsToRemove = {}; - for questId in pairs(self.activePins) do - pinsToRemove[questId] = true; - end - - SetMapZoom(8) - - local mapAreaID = self:GetMap():GetMapID(); - for zoneIndex = 1, C_MapCanvas.GetNumZones(mapAreaID) do - local zoneMapID, zoneName, zoneDepth, left, right, top, bottom = C_MapCanvas.GetZoneInfo(mapAreaID, zoneIndex); - print(zoneMapID, zoneName) - if zoneDepth <= 1 then -- Exclude subzones - local taskInfo = C_TaskQuest.GetQuestsForPlayerByMapID(zoneMapID, mapAreaID); - - if taskInfo then - for i, info in ipairs(taskInfo) do - if HaveQuestData(info.questId) then - if QuestUtils_IsQuestWorldQuest(info.questId) then - local pin = WorldPlanQuests:AcquirePin(info.questId, zoneMapID) - pin:RefreshData(info) - pin:IsShowable() - if pin.used then - print(i, pin.x, pin.y, pin.used, pin.isNew, pin.isStale, pin:IsShown(), pin:GetAlpha()) - pinsToRemove[info.questId] = nil; - - local frame = self.activePins[info.questId] - if not frame then - frame = self:GetMap():AcquirePin("WorldPlanPinContainer") - frame:SetAlphaLimits(1, 0.7, 1) - frame:SetScalingLimits(1, 3, 1.5); - frame:SetFrameLevel(1000 + self:GetMap():GetNumActivePinsByTemplate("WorldPlanPinContainer")); - frame:Show() - self.activePins[info.questId] = frame - end - frame:SetPosition(info.x, info.y) - frame.pin = pin - - pin.isStale = true - pin:SetParent(frame) - pin:ClearAllPoints() - pin:SetPoint('CENTER', frame, 'CENTER') - - end - pin:SetShown(pin.used) - end - end - end - end - end - end - - for questId in pairs(pinsToRemove) do - self:GetMap():RemovePin(self.activePins[questId]); - self.activePins[questId] = nil; - end - self:GetMap():RemoveAllPinsByTemplate("WorldQuestPinTemplate"); - -end - -function WorldPlanDataPinMixin:OnShow() - mprint('|cFFFFFF00'..tostring(self:GetName())..':OnShow()|r') -end - -function WorldPlanDataPinMixin:OnMouseEnter () - self.pin:OnEnter() -end - -function WorldPlanDataPinMixin:OnMouseLeave () - self.pin:OnLeave() -end - -function WorldPlanDataPinMixin:RemoveAllData() - wipe(self.activePins); - self:GetMap():RemoveAllPinsByTemplate("WorldQuestPinTemplate"); -end \ No newline at end of file