Example #1
0
 def __onVehicleControlling(self, vehicle):
     vTypeDesc = vehicle.typeDescriptor
     vType = vTypeDesc.type
     yawLimits = vehicle_getter.getYawLimits(vTypeDesc)
     if yawLimits:
         inDegrees = (math.degrees(-yawLimits[0]),
                      math.degrees(yawLimits[1]))
     else:
         inDegrees = None
     self.__isAutoRotationOn = True
     self.__isAutoRotationShown = False
     if vehicle.isPlayerVehicle or BigWorld.player().isObserver():
         flag = vehicle_getter.getAutoRotationFlag(vTypeDesc)
         if flag != AUTO_ROTATION_FLAG.IGNORE_IN_UI:
             self.__isAutoRotationOn = flag == AUTO_ROTATION_FLAG.TURN_ON
             self.__isAutoRotationShown = True
     self.__maxHealth = vTypeDesc.maxHealth
     health = vehicle.health
     healthStr = formatHealthProgress(health, self.__maxHealth)
     healthProgress = normalizeHealthPercent(health, self.__maxHealth)
     self.as_setupS(
         healthStr, healthProgress,
         vehicle_getter.getVehicleIndicatorType(vTypeDesc),
         vehicle_getter.getCrewMainRolesWithIndexes(vType.crewRoles),
         inDegrees, vehicle_getter.hasTurretRotator(vTypeDesc),
         self.__isAutoRotationOn)
     self._updatePlayerInfo(vehicle.id)
     if self.__tankIndicator is not None:
         self.__tankIndicator.setup(vehicle, yawLimits)
     self.__setupDevicesStates()
     return
Example #2
0
 def __onVehicleControlling(self, vehicle):
     vTypeDesc = vehicle.typeDescriptor
     vType = vTypeDesc.type
     yawLimits = vehicle_getter.getYawLimits(vTypeDesc)
     if yawLimits:
         inDegrees = (math.degrees(-yawLimits[0]),
                      math.degrees(yawLimits[1]))
     else:
         inDegrees = None
     if vehicle.isPlayerVehicle:
         isAutoRotationOn = vehicle_getter.isAutoRotationOn(vTypeDesc)
     else:
         isAutoRotationOn = None
     self._maxHealth = vTypeDesc.maxHealth
     helthStr, helthProgress = _getHealthParams(vehicle.health,
                                                self._maxHealth)
     self.as_setupS(
         helthStr, helthProgress,
         vehicle_getter.getVehicleIndicatorType(vTypeDesc),
         vehicle_getter.getCrewMainRolesWithIndexes(vType.crewRoles),
         inDegrees, vehicle_getter.hasTurretRotator(vTypeDesc),
         isAutoRotationOn)
     if self.__tankIndicator:
         app = g_appLoader.getDefBattleApp()
         self.__tankIndicator.setup(app, vehicle, yawLimits)
     return
Example #3
0
 def __onVehicleControlling(self, vehicle):
     vTypeDesc = vehicle.typeDescriptor
     vType = vTypeDesc.type
     yawLimits = vehicle_getter.getYawLimits(vTypeDesc)
     if yawLimits:
         inDegrees = (math.degrees(-yawLimits[0]), math.degrees(yawLimits[1]))
     else:
         inDegrees = None
     if vehicle.isPlayer:
         isAutoRotationOn = vehicle_getter.isAutoRotationOn(vTypeDesc)
     else:
         isAutoRotationOn = None
     self.as_setupS((vTypeDesc.maxHealth, vehicle.health), vehicle_getter.getVehicleIndicatorType(vTypeDesc), vehicle_getter.getCrewMainRolesWoIndexes(vType.crewRoles), inDegrees, vehicle_getter.hasTurretRotator(vTypeDesc), isAutoRotationOn)
     if self.__tankIndicator:
         self.__tankIndicator.setup(self.__ui, vehicle, yawLimits)
Example #4
0
 def __onVehicleControlling(self, vehicle):
     vTypeDesc = vehicle.typeDescriptor
     vType = vTypeDesc.type
     yawLimits = vehicle_getter.getYawLimits(vTypeDesc)
     if yawLimits:
         inDegrees = (math.degrees(-yawLimits[0]),
                      math.degrees(yawLimits[1]))
     else:
         inDegrees = None
     self.__isAutoRotationShown = False
     if vehicle.isPlayerVehicle or avatar_getter.isObserver():
         flag = vehicle_getter.getAutoRotationFlag(vTypeDesc)
         if flag != AUTO_ROTATION_FLAG.IGNORE_IN_UI:
             self.__isAutoRotationOff = flag != AUTO_ROTATION_FLAG.TURN_ON
             self.__isAutoRotationShown = True
     self.__isWheeledTech = vehicle.isWheeledTech
     self.__isTrackWithinVehicle = vehicle.isTrackWithinTrack
     prebattleVehicle = self.sessionProvider.shared.prebattleSetups.getPrebattleSetupsVehicle(
     )
     if prebattleVehicle is not None:
         self.__maxHealth = prebattleVehicle.descriptor.maxHealth
         health = self.__maxHealth
     else:
         self.__maxHealth = vehicle.maxHealth
         health = vehicle.health
     healthStr = formatHealthProgress(health, self.__maxHealth)
     healthProgress = normalizeHealthPercent(health, self.__maxHealth)
     self.as_setupS(
         healthStr, healthProgress,
         vehicle_getter.getVehicleIndicatorType(vTypeDesc),
         vehicle_getter.getCrewMainRolesWithIndexes(vType.crewRoles),
         inDegrees, vehicle_getter.hasTurretRotator(vTypeDesc),
         self.__isWheeledTech, not self.__isAutoRotationOff,
         self.__isTrackWithinVehicle)
     if self.__isWheeledTech:
         self.as_setupWheeledS(
             vTypeDesc.chassis.generalWheelsAnimatorConfig.
             getNonTrackWheelsCount())
     self._updatePlayerInfo(vehicle.id)
     if self.__tankIndicator is not None:
         self.__tankIndicator.setup(vehicle, yawLimits)
     self.__setupDevicesStates()
     self._updateRepairTimesState()
     return
Example #5
0
 def __onVehicleControlling(self, vehicle):
     vTypeDesc = vehicle.typeDescriptor
     vType = vTypeDesc.type
     yawLimits = vehicle_getter.getYawLimits(vTypeDesc)
     if yawLimits:
         inDegrees = (math.degrees(-yawLimits[0]), math.degrees(yawLimits[1]))
     else:
         inDegrees = None
     if vehicle.isPlayerVehicle:
         isAutoRotationOn = vehicle_getter.isAutoRotationOn(vTypeDesc)
     else:
         isAutoRotationOn = None
     self._maxHealth = vTypeDesc.maxHealth
     helthStr, helthProgress = _getHealthParams(vehicle.health, self._maxHealth)
     self.as_setupS(helthStr, helthProgress, vehicle_getter.getVehicleIndicatorType(vTypeDesc), vehicle_getter.getCrewMainRolesWithIndexes(vType.crewRoles), inDegrees, vehicle_getter.hasTurretRotator(vTypeDesc), isAutoRotationOn)
     if self.__tankIndicator:
         app = g_appLoader.getDefBattleApp()
         self.__tankIndicator.setup(app, vehicle, yawLimits)
     return
Example #6
0
 def __onVehicleControlling(self, vehicle):
     vTypeDesc = vehicle.typeDescriptor
     vType = vTypeDesc.type
     yawLimits = vehicle_getter.getYawLimits(vTypeDesc)
     if yawLimits:
         inDegrees = (math.degrees(-yawLimits[0]), math.degrees(yawLimits[1]))
     else:
         inDegrees = None
     self.__isAutoRotationOn = True
     self.__isAutoRotationShown = False
     if vehicle.isPlayerVehicle:
         flag = vehicle_getter.getAutoRotationFlag(vTypeDesc)
         if flag != AUTO_ROTATION_FLAG.IGNORE_IN_UI:
             self.__isAutoRotationOn = flag == AUTO_ROTATION_FLAG.TURN_ON
             self.__isAutoRotationShown = True
     self.__maxHealth = vTypeDesc.maxHealth
     health = vehicle.health
     healthStr = formatHealthProgress(health, self.__maxHealth)
     healthProgress = normalizeHealthPercent(health, self.__maxHealth)
     self.as_setupS(healthStr, healthProgress, vehicle_getter.getVehicleIndicatorType(vTypeDesc), vehicle_getter.getCrewMainRolesWithIndexes(vType.crewRoles), inDegrees, vehicle_getter.hasTurretRotator(vTypeDesc), self.__isAutoRotationOn)
     if self.__tankIndicator is not None:
         self.__tankIndicator.setup(vehicle, yawLimits)
     return
Example #7
0
 def isSpg(self):
     vehicle = BigWorld.entity(self.__playerVehicleID)
     vTypeDesc = vehicle.typeDescriptor
     type = vehicle_getter.getVehicleIndicatorType(vTypeDesc)
     return type == 'SPG'