Пример #1
0
 def EnableMoveMode(self, curve):
     curveID = getattr(curve, 'id', None)
     if not self.initialized:
         return
     self.tacticalCompass.SetMoveMode(True, curve)
     if curveID == session.shipid or curve is None:
         return
     ego = ballpark.GetBall(session.shipid)
     if ego is not None:
         self.tacticalCompass.AddConnector(ego)
Пример #2
0
 def UpdateModuleRange(self, module=None, charge=None):
     if not self.initialized:
         return
     self.showingModuleRange = module is not None
     self.tacticalCompass.HideBombRange()
     if module is None:
         self.tacticalCompass.compassDisc.HideFiringRange()
         return
     maxRange, falloff, bombRadius, cynoRadius = self.tactical.FindMaxRange(
         module, charge)
     if bombRadius:
         self.tacticalCompass.compassDisc.HideFiringRange()
         ball = ballpark.GetBall(session.shipid)
         self.tacticalCompass.ShowBombRange(bombRadius, maxRange, ball)
     elif cynoRadius:
         self.tacticalCompass.compassDisc.HideFiringRange()
         radius = getattr(ballpark.GetBall(session.shipid), 'radius', 0.0)
         self.tacticalCompass.ShowCynoRange(cynoRadius + radius)
     else:
         self.tacticalCompass.SetFiringRange(maxRange, falloff)
Пример #3
0
 def _ShowDirectionTo(self, ballID):
     if self.selectedID == ballID:
         return
     self._ClearSelection()
     targetBall = ballpark.GetBall(ballID)
     if targetBall is None:
         return
     self.tacticalCompass.SetInterest(targetBall)
     self.selectedConnector = tacticalUI.CreateStraightConnector(
         tacticalUI.STYLE_FAINT, tacticalUI.COLOR_GENERIC, None, targetBall)
     self.selectedID = ballID
Пример #4
0
 def _CheckInterest(self, ballID, state, flag):
     if state not in self._interestStates:
         return
     if self.tacticalCompass is None:
         return
     self._UpdateInterest(ballID, state, flag)
     if self._IsInteresting(ballID):
         ball = ballpark.GetBall(ballID)
         if ball is None:
             return
         self.tacticalCompass.AddConnector(ball)
     else:
         self._ClearInterest(ballID)
         bp = ballpark.GetBallpark()
         if bp is None:
             return
         slimItem = bp.GetInvItem(ballID)
         filtered = self.tactical.GetFilteredStatesFunctionNames()
         alwaysShown = self.tactical.GetAlwaysShownStatesFunctionNames()
         if not self.tactical.WantIt(slimItem, filtered, alwaysShown):
             self.RemoveConnector(ballID)
Пример #5
0
 def DisableMoveMode(self):
     if not self.initialized:
         return
     ego = ballpark.GetBall(session.shipid)
     self.RemoveConnector(session.shipid)
     self.tacticalCompass.SetMoveMode(False, ego)
Пример #6
0
 def OnShipChange(self):
     if not self.initialized:
         return
     ball = ballpark.GetBall(session.shipid)
     self.tacticalCompass.SetRootBall(ball)