Ejemplo n.º 1
0
 def __setInFocusForPlayer(self, oldTargetID, oldTargetType, newTargetID, newTargetType, isOneShot):
     if oldTargetType == self.getMarkerType() and oldTargetID in self._markers:
         self.__makeMarkerSticky(oldTargetID, False, isOneShot)
     if newTargetType == self.getMarkerType() and newTargetID in self._markers:
         newMarker = self._markers[newTargetID]
         pos = self.__getVehicleMarkerPositionByVehicleID(newTargetID)
         if pos is not None:
             pos = Math.Vector3(pos[0], pos[1], pos[2])
             if pos.distTo(avatar_getter.getOwnVehiclePosition()) > MAX_DISTANCE_TEMP_STICKY and not newMarker.getIsRepliedByPlayer() and newMarker.getActionState() == _HELP_ME_STATE:
                 return
         self.__makeMarkerSticky(newTargetID, True, isOneShot)
     return
 def __checkDistanceForRepliersCB(self):
     if self.__activeLocationMarkerID is None or self.__activeLocationMarkerID not in self.__markedAreas:
         return
     else:
         distanceToWaypoint = (
             self.__markedAreas[self.__activeLocationMarkerID].position -
             avatar_getter.getOwnVehiclePosition()).length
         if distanceToWaypoint < _DISTANCE_FOR_MARKER_REMOVAL:
             commandName = _ACTIONS.battleChatCommandFromActionID(
                 self.__markedAreas[
                     self.__activeLocationMarkerID].commandID).name
             targetID = self.__markedAreas[
                 self.__activeLocationMarkerID].targetID
             commands = self.sessionProvider.shared.chatCommands
             if commands is not None:
                 commands.sendCancelReplyChatCommand(targetID, commandName)
         return _CHECK_DISTANCE_CALLBACK_TIME
 def __setInFocusForPlayer(self, oldTargetID, oldTargetType, newTargetID,
                           newTargetType, oneShot):
     if oldTargetType == self.getMarkerType(
     ) and oldTargetID in self._markers:
         self.__makeMarkerSticky(oldTargetID, False)
     if newTargetType == self.getMarkerType(
     ) and newTargetID in self._markers:
         newMarker = self._markers[newTargetID]
         pos = newMarker.getPosition()
         if pos is not None and newMarker.getMarkerSubtype() in [
                 LocationMarkerSubType.SPG_AIM_AREA_SUBTYPE,
                 LocationMarkerSubType.ATTENTION_TO_MARKER_SUBTYPE
         ]:
             if pos.distTo(avatar_getter.getOwnVehiclePosition()
                           ) > MAX_DISTANCE_TEMP_STICKY:
                 return
         self.__makeMarkerSticky(newTargetID, True)
     return
Ejemplo n.º 4
0
 def updatePositions(self, iterator):
     if not self.__marker or not self.__currentWaypointSector:
         return
     else:
         sectorComponent = getattr(
             self.sessionProvider.arenaVisitor.getComponentSystem(),
             'sectorComponent', None)
         if sectorComponent is None:
             LOG_ERROR('Expected SectorComponent not present!')
             return
         waypointPosition = sectorComponent.getClosestWayPointForSectorAndTeam(
             self.__currentWaypointSector.sectorID,
             self.sessionProvider.arenaVisitor.type,
             avatar_getter.getPlayerTeam(),
             avatar_getter.getOwnVehiclePosition())
         if waypointPosition is None:
             return
         if waypointPosition != self.__currentWaypointPositon:
             self.__currentWaypointPositon = waypointPosition
             self._setMarkerPosition(
                 self.__marker, self.__currentWaypointPositon +
                 settings.MARKER_POSITION_ADJUSTMENT)
         return