Mercurial > wow > worldplan
comparison FlightMap.lua @ 74:2ba11b25aa7f
flight map data handler adjustments
author | Nenue |
---|---|
date | Sat, 08 Apr 2017 17:07:58 -0400 |
parents | 25f7dbc20a72 |
children | effb42f6fabd |
comparison
equal
deleted
inserted
replaced
73:25f7dbc20a72 | 74:2ba11b25aa7f |
---|---|
50 function WorldPlanDataProvider:OnHide() | 50 function WorldPlanDataProvider:OnHide() |
51 self.ticker:Cancel(); | 51 self.ticker:Cancel(); |
52 self.ticker = nil; | 52 self.ticker = nil; |
53 end | 53 end |
54 | 54 |
55 | |
55 function WorldPlanDataProvider:OnAdded(mapCanvas) | 56 function WorldPlanDataProvider:OnAdded(mapCanvas) |
56 self.activePins = {}; | 57 self.activePins = {}; |
57 self.owningMap = mapCanvas | 58 self.owningMap = mapCanvas |
58 self:RegisterEvent('QUEST_LOG_UPDATE') | 59 self:RegisterEvent('QUEST_LOG_UPDATE') |
59 | 60 |
100 pinsToRemove[info.questId] = nil; | 101 pinsToRemove[info.questId] = nil; |
101 | 102 |
102 local frame = self.activePins[info.questId] | 103 local frame = self.activePins[info.questId] |
103 if not frame then | 104 if not frame then |
104 frame = self:GetMap():AcquirePin("WorldPlanFlightPin") | 105 frame = self:GetMap():AcquirePin("WorldPlanFlightPin") |
105 print(alpha1, alpha2, alpha3) | |
106 print(scale1, scale2, scale3) | |
107 frame:SetAlphaLimits(alpha1, alpha2, alpha3) | 106 frame:SetAlphaLimits(alpha1, alpha2, alpha3) |
108 frame:SetScalingLimits(scale1, scale2, scale3); | 107 frame:SetScalingLimits(scale1, scale2, scale3); |
109 frame:SetFrameLevel(1000 + self:GetMap():GetNumActivePinsByTemplate("WorldPlanFlightPin")); | 108 frame:SetFrameLevel(1000 + self:GetMap():GetNumActivePinsByTemplate("WorldPlanFlightPin")); |
110 frame:Show() | 109 frame:Show() |
111 self.activePins[info.questId] = frame | 110 self.activePins[info.questId] = frame |
112 end | 111 end |
113 frame:SetPosition(info.x, info.y) | 112 frame:SetPosition(info.x, info.y) |
114 frame.pin = pin | 113 frame.pin = pin |
115 | 114 |
116 -- sticking it onto the MapCanvas pin | 115 -- fix the scale |
117 pin:SetAnchor(frame, nil, nil, nil, nil, pin.filtered and 0.5 or 1) | 116 pin:SetAnchor(frame, nil, nil, nil, nil, 1) |
118 pin.owningFrame = frame:GetMap() | 117 pin.owningFrame = frame:GetMap() |
119 pin.throttle = 1 | 118 pin.throttle = 1 |
120 pin.isStale = true | |
121 | |
122 pin:CheckFilterRules() | |
123 pin:ClearAllPoints() | 119 pin:ClearAllPoints() |
124 pin:SetPoint('CENTER', frame, 'CENTER') | 120 pin:SetPoint('CENTER', frame, 'CENTER') |
125 --print(pin.Overlay:IsShown(), pin.Overlay:GetPoint(1)) | 121 --print(pin.Overlay:IsShown(), pin.Overlay:GetPoint(1)) |
126 end | 122 end |
127 pin:SetShown(pin.used) | 123 pin:SetShown(pin.used) |
157 self:SetNudgeTargetFactor(0.015); | 153 self:SetNudgeTargetFactor(0.015); |
158 self:SetNudgeZoomedOutFactor(1.0); | 154 self:SetNudgeZoomedOutFactor(1.0); |
159 self:SetNudgeZoomedInFactor(0.25); | 155 self:SetNudgeZoomedInFactor(0.25); |
160 end | 156 end |
161 | 157 |
158 function WorldPlanDataPinMixin:OnUpdate() | |
159 local pin = self.pin | |
160 if pin and pin.isStale then | |
161 print(pin.questID, 'is stale') | |
162 pin:SetAnchor(nil, nil, nil, nil, nil, pin.filtered and 0.5 or 1) | |
163 if pin.isNew then | |
164 pin:OnShow() | |
165 end | |
166 end | |
167 end | |
168 | |
169 | |
162 function WorldPlanDataPinMixin:OnShow() | 170 function WorldPlanDataPinMixin:OnShow() |
163 end | 171 end |
164 | 172 |
165 function WorldPlanDataPinMixin:OnMouseEnter () | 173 function WorldPlanDataPinMixin:OnMouseEnter () |
166 WorldMap_HijackTooltip(self:GetMap()) | 174 WorldMap_HijackTooltip(self:GetMap()) |