Mercurial > wow > worldplan
diff FlightMap.lua @ 74:2ba11b25aa7f
flight map data handler adjustments
author | Nenue |
---|---|
date | Sat, 08 Apr 2017 17:07:58 -0400 |
parents | 25f7dbc20a72 |
children | effb42f6fabd |
line wrap: on
line diff
--- a/FlightMap.lua Fri Apr 07 07:20:28 2017 -0400 +++ b/FlightMap.lua Sat Apr 08 17:07:58 2017 -0400 @@ -52,6 +52,7 @@ self.ticker = nil; end + function WorldPlanDataProvider:OnAdded(mapCanvas) self.activePins = {}; self.owningMap = mapCanvas @@ -102,8 +103,6 @@ local frame = self.activePins[info.questId] if not frame then frame = self:GetMap():AcquirePin("WorldPlanFlightPin") - print(alpha1, alpha2, alpha3) - print(scale1, scale2, scale3) frame:SetAlphaLimits(alpha1, alpha2, alpha3) frame:SetScalingLimits(scale1, scale2, scale3); frame:SetFrameLevel(1000 + self:GetMap():GetNumActivePinsByTemplate("WorldPlanFlightPin")); @@ -113,13 +112,10 @@ frame:SetPosition(info.x, info.y) frame.pin = pin - -- sticking it onto the MapCanvas pin - pin:SetAnchor(frame, nil, nil, nil, nil, pin.filtered and 0.5 or 1) + -- fix the scale + pin:SetAnchor(frame, nil, nil, nil, nil, 1) pin.owningFrame = frame:GetMap() pin.throttle = 1 - pin.isStale = true - - pin:CheckFilterRules() pin:ClearAllPoints() pin:SetPoint('CENTER', frame, 'CENTER') --print(pin.Overlay:IsShown(), pin.Overlay:GetPoint(1)) @@ -159,6 +155,18 @@ self:SetNudgeZoomedInFactor(0.25); end +function WorldPlanDataPinMixin:OnUpdate() + local pin = self.pin + if pin and pin.isStale then + print(pin.questID, 'is stale') + pin:SetAnchor(nil, nil, nil, nil, nil, pin.filtered and 0.5 or 1) + if pin.isNew then + pin:OnShow() + end + end +end + + function WorldPlanDataPinMixin:OnShow() end