Exemple #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
Exemple #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
     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
Exemple #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
     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
 def _updateHealth(self, health):
     if health <= self.__maxHealth and self.__maxHealth > 0:
         healthStr = formatHealthProgress(health, self.__maxHealth)
         healthProgress = normalizeHealthPercent(health, self.__maxHealth)
         self.as_updateHealthS(healthStr, healthProgress)
Exemple #5
0
 def _updateHealth(self, health):
     healthStr = formatHealthProgress(health, self.__maxHealth)
     healthProgress = normalizeHealthPercent(health, self.__maxHealth)
     self.as_updateHealthS(healthStr, healthProgress)