Ejemplo n.º 1
0
 def playReady(item):
     if item.requiresSoundNotification:
         equipment = vehicles.g_cache.equipments()[item.getEquipmentID()]
         if equipment is not None:
             if equipment.soundNotification is not None:
                 avatar_getter.getSoundNotifications().play(
                     equipment.soundNotification)
                 return
         avatar_getter.getSoundNotifications().play('combat_reserve')
     return
Ejemplo n.º 2
0
 def action(self, repairPointIndex, action, nextActionTime):
     if self.__ui is None:
         return
     else:
         timeLeft = max(0, nextActionTime - BigWorld.serverTime())
         if action in (REPAIR_POINT_ACTION.START_REPAIR, REPAIR_POINT_ACTION.RESTART_REPAIR):
             self.__ui.showTimer(timeLeft, _REPAIR_STATE.PROGRESS, INGAME_GUI.REPAIRPOINT_TITLE, None)
         elif action == REPAIR_POINT_ACTION.COMPLETE_REPAIR:
             self.__ui.showTimer(timeLeft, _REPAIR_STATE.COOLDOWN, INGAME_GUI.REPAIRPOINT_TITLE, INGAME_GUI.REPAIRPOINT_UNAVAILABLE)
             getSoundNotifications().play(self.__repairSndName)
         elif action == REPAIR_POINT_ACTION.ENTER_WHILE_CD:
             self.__ui.showTimer(timeLeft, _REPAIR_STATE.COOLDOWN, INGAME_GUI.REPAIRPOINT_TITLE, INGAME_GUI.REPAIRPOINT_UNAVAILABLE)
         elif action in (REPAIR_POINT_ACTION.LEAVE_WHILE_CD, REPAIR_POINT_ACTION.CANCEL_REPAIR, REPAIR_POINT_ACTION.BECOME_DISABLED):
             self.__ui.hideTimer()
         self.onRepairPointStateChanged(repairPointIndex, action, timeLeft)
         return
Ejemplo n.º 3
0
 def setEquipment(self, intCD, quantity, stage, timeRemaining):
     if not intCD:
         self.onEquipmentAdded(intCD, None)
         return
     else:
         if intCD in self._equipments:
             item = self._equipments[intCD]
             item.update(quantity, stage, timeRemaining)
             self.onEquipmentUpdated(intCD, item)
             if item.getPrevStage() in (EQUIPMENT_STAGES.DEPLOYING, EQUIPMENT_STAGES.UNAVAILABLE, EQUIPMENT_STAGES.COOLDOWN) and item.getStage() == EQUIPMENT_STAGES.READY:
                 avatar_getter.getSoundNotifications().play(self.__readySndName)
         else:
             descriptor = vehicles.getDictDescr(intCD)
             item = self.createItem(descriptor, quantity, stage, timeRemaining)
             self._equipments[intCD] = item
             self.onEquipmentAdded(intCD, item)
         return
 def __playSound(self, sound):
     app = self.app
     if app is not None and app.soundManager is not None:
         app.soundManager.playEffectSound(SoundEffectsId.DYN_SQUAD_STARTING_DYNAMIC_PLATOON)
     notifications = avatar_getter.getSoundNotifications()
     if notifications is not None and hasattr(notifications, 'play'):
         notifications.play(sound)
     return
Ejemplo n.º 5
0
 def __playSound(self, sound):
     app = self.app
     if app is not None and app.soundManager is not None:
         app.soundManager.playEffectSound(SoundEffectsId.DYN_SQUAD_STARTING_DYNAMIC_PLATOON)
     notifications = avatar_getter.getSoundNotifications()
     if notifications is not None and hasattr(notifications, 'play'):
         notifications.play(sound)
     return
 def __playSound(self, eventName):
     if not EPIC_SOUND.EPIC_MSG_SOUNDS_ENABLED or eventName is None:
         return
     else:
         soundNotifications = avatar_getter.getSoundNotifications()
         if soundNotifications and hasattr(soundNotifications, 'play'):
             soundNotifications.play(eventName)
         return
Ejemplo n.º 7
0
 def __playSound(self, eventName):
     if not self.__isVisible or not _RIBBON_SOUNDS_ENABLED:
         return
     soundNotifications = avatar_getter.getSoundNotifications()
     if soundNotifications and hasattr(soundNotifications, 'play') and hasattr(soundNotifications, 'isPlaying'):
         for soundName in _SOUNDS:
             if soundNotifications.isPlaying(soundName):
                 break
         else:
             soundNotifications.play(eventName)
Ejemplo n.º 8
0
 def startControl(self):
     nots = avatar_getter.getSoundNotifications()
     if nots is not None:
         self.__soundNotifications = weakref.proxy(nots)
     self.__setPlayerFlagBearerIfNeed()
     g_ctfManager.onFlagCapturedByVehicle += self.__onFlagCapturedByVehicle
     g_ctfManager.onFlagAbsorbed += self.__onFlagAbsorbed
     g_ctfManager.onFlagDroppedToGround += self.__onFlagDroppedToGround
     g_ctfManager.onFlagRemoved += self.__onFlagRemoved
     return
Ejemplo n.º 9
0
 def startControl(self):
     nots = avatar_getter.getSoundNotifications()
     if nots is not None:
         self.__soundNotifications = weakref.proxy(nots)
     self.__setPlayerFlagBearerIfNeed()
     g_ctfManager.onFlagCapturedByVehicle += self.__onFlagCapturedByVehicle
     g_ctfManager.onFlagAbsorbed += self.__onFlagAbsorbed
     g_ctfManager.onFlagDroppedToGround += self.__onFlagDroppedToGround
     g_ctfManager.onFlagRemoved += self.__onFlagRemoved
     return
Ejemplo n.º 10
0
 def __playSound(self, eventName):
     if not self.__isVisible or not _RIBBON_SOUNDS_ENABLED:
         return
     soundNotifications = avatar_getter.getSoundNotifications()
     if soundNotifications and hasattr(soundNotifications, 'play') and hasattr(soundNotifications, 'isPlaying'):
         for eventName in _SOUNDS:
             if soundNotifications.isPlaying(eventName):
                 break
         else:
             soundNotifications.play(eventName)
 def _playSoundNotification(self, winnerTeam, reason):
     playerTeam = avatar_getter.getPlayerTeam()
     notification = _EPIC_SOUND_NOTIFICATIONS.get(reason, None)
     if notification is None:
         return
     else:
         victory = True if winnerTeam == playerTeam else False
         notification = notification.get(victory, None)
         soundNotifications = avatar_getter.getSoundNotifications()
         if soundNotifications and hasattr(soundNotifications, 'play'):
             soundNotifications.play(notification)
         return
Ejemplo n.º 12
0
 def _setup(self, vehicle):
     self.__updater = self.__updater.switch(vehicle.isPlayer)
     if self.__isRqToSwitch:
         nationID = vehicle.typeDescriptor.type.id[0]
         notifications = avatar_getter.getSoundNotifications()
         if notifications:
             notifications.clear()
         SoundGroups.g_instance.soundModes.setCurrentNation(nations.NAMES[nationID])
     self.onVehicleControlling(vehicle)
     if not vehicle.isAlive():
         self.onVehicleStateUpdated(VEHICLE_VIEW_STATE.DESTROYED, None)
     else:
         self.__updateTI.start()
 def __playSound(self, cmd):
     soundNotifications = avatar_getter.getSoundNotifications()
     if soundNotifications and hasattr(soundNotifications, 'play'):
         soundNotifications.play(cmd.getSoundEventName())
     if cmd is None:
         return
     else:
         if cmd.isEpicGlobalMessage:
             if soundNotifications and hasattr(soundNotifications, 'play'):
                 soundNotifications.play(EPIC_SOUND.BF_EB_GLOBAL_MESSAGE)
         elif soundNotifications and hasattr(soundNotifications, 'play'):
             soundNotifications.play(cmd.getSoundEventName())
         return
Ejemplo n.º 14
0
 def _setup(self, vehicle):
     if self.__updater is not None:
         self.__updater = self.__updater.switch(self.__vehicleID)
     if self.__isRqToSwitch:
         nationID = vehicle.typeDescriptor.type.id[0]
         notifications = avatar_getter.getSoundNotifications()
         if notifications is not None:
             notifications.clear()
         SoundGroups.g_instance.soundModes.setCurrentNation(nations.NAMES[nationID])
     self.onVehicleControlling(vehicle)
     if self.__updater is not None:
         self.__updater.start()
     return
Ejemplo n.º 15
0
 def setEquipment(self, intCD, quantity, stage, timeRemaining):
     if not intCD:
         self.onEquipmentAdded(intCD, None)
         return
     else:
         if intCD in self._equipments:
             item = self._equipments[intCD]
             item.update(quantity, stage, timeRemaining)
             self.onEquipmentUpdated(intCD, item)
             if item.getPrevStage() in (
                     EQUIPMENT_STAGES.DEPLOYING,
                     EQUIPMENT_STAGES.UNAVAILABLE, EQUIPMENT_STAGES.COOLDOWN
             ) and item.getStage() == EQUIPMENT_STAGES.READY:
                 avatar_getter.getSoundNotifications().play(
                     self.__readySndName)
         else:
             descriptor = vehicles.getDictDescr(intCD)
             item = self.createItem(descriptor, quantity, stage,
                                    timeRemaining)
             self._equipments[intCD] = item
             self._order.append(intCD)
             self.onEquipmentAdded(intCD, item)
         return
Ejemplo n.º 16
0
 def _setup(self, vehicle):
     self.__updater = self.__updater.switch(vehicle.isPlayer)
     if self.__isRqToSwitch:
         nationID = vehicle.typeDescriptor.type.id[0]
         notifications = avatar_getter.getSoundNotifications()
         if notifications:
             notifications.clear()
         SoundGroups.g_instance.soundModes.setCurrentNation(
             nations.NAMES[nationID])
     self.onVehicleControlling(vehicle)
     if not vehicle.isAlive():
         self.onVehicleStateUpdated(VEHICLE_VIEW_STATE.DESTROYED, None)
     else:
         self.__updateTI.start()
 def _setup(self, vehicle):
     if self.__updater is not None:
         self.__updater = self.__updater.switch(self.__vehicleID)
     if self.__isRqToSwitch:
         nationID = vehicle.typeDescriptor.type.id[0]
         notifications = avatar_getter.getSoundNotifications()
         if notifications is not None:
             notifications.clear()
         SoundGroups.g_instance.soundModes.setCurrentNation(nations.NAMES[nationID])
     self.onVehicleControlling(vehicle)
     if VEHICLE_VIEW_STATE.DUAL_GUN_STATE_UPDATED in self.__cachedStateValues.keys():
         self.onVehicleStateUpdated(VEHICLE_VIEW_STATE.DUAL_GUN_STATE_UPDATED, self.getStateValue(VEHICLE_VIEW_STATE.DUAL_GUN_STATE_UPDATED))
     if self.__updater is not None:
         self.__updater.start()
     return
 def start(self, ui):
     self.__ui = weakref.proxy(ui)
     player = BigWorld.player()
     self.__playerVehicleID = player.playerVehicleID
     self.__playerTeam = player.team
     self.__soundNotifications = weakref.proxy(getSoundNotifications())
     arena = player.arena
     arenaType = arena.arenaType
     self.__isTeamPlayer = self.__playerTeam in arenaType.squadTeamNumbers if isFalloutMultiTeam() else True
     g_ctfManager.onFlagCapturedByVehicle += self.__onFlagCapturedByVehicle
     g_ctfManager.onFlagAbsorbed += self.__onFlagAbsorbed
     g_ctfManager.onFlagDroppedToGround += self.__onFlagDroppedToGround
     g_ctfManager.onFlagRemoved += self.__onFlagRemoved
     if g_ctfManager.isFlagBearer(self.__playerVehicleID):
         self.__ui.showFlagCaptured()
Ejemplo n.º 19
0
 def action(self, repairPointIndex, action, nextActionTime):
     if self.__ui is None:
         return
     else:
         timeLeft = max(0, nextActionTime - BigWorld.serverTime())
         if action in (REPAIR_POINT_ACTION.START_REPAIR,
                       REPAIR_POINT_ACTION.RESTART_REPAIR):
             self.__ui.showTimer(timeLeft, _REPAIR_STATE.PROGRESS,
                                 INGAME_GUI.REPAIRPOINT_TITLE, None)
         elif action == REPAIR_POINT_ACTION.COMPLETE_REPAIR:
             self.__ui.showTimer(timeLeft, _REPAIR_STATE.COOLDOWN,
                                 INGAME_GUI.REPAIRPOINT_TITLE,
                                 INGAME_GUI.REPAIRPOINT_UNAVAILABLE)
             getSoundNotifications().play(self.__repairSndName)
         elif action == REPAIR_POINT_ACTION.ENTER_WHILE_CD:
             self.__ui.showTimer(timeLeft, _REPAIR_STATE.COOLDOWN,
                                 INGAME_GUI.REPAIRPOINT_TITLE,
                                 INGAME_GUI.REPAIRPOINT_UNAVAILABLE)
         elif action in (REPAIR_POINT_ACTION.LEAVE_WHILE_CD,
                         REPAIR_POINT_ACTION.CANCEL_REPAIR,
                         REPAIR_POINT_ACTION.BECOME_DISABLED):
             self.__ui.hideTimer()
         self.onRepairPointStateChanged(repairPointIndex, action, timeLeft)
         return
Ejemplo n.º 20
0
 def _playSoundNotification(self, winnerTeam, reason):
     if self.__notificationDelayCB is not None:
         self.__notificationDelayCB = None
     playerTeam = avatar_getter.getPlayerTeam()
     notification = _EPIC_SOUND_NOTIFICATIONS.get(reason, None)
     if notification is None:
         return
     else:
         victory = True if winnerTeam == playerTeam else False
         notification = notification.get(victory, None)
         soundNotifications = avatar_getter.getSoundNotifications()
         if soundNotifications and hasattr(soundNotifications, 'play'):
             soundNotifications.play(notification)
         EPIC_SOUND.EPIC_MSG_SOUNDS_ENABLED = False
         return
Ejemplo n.º 21
0
 def _setup(self, vehicle):
     """
     Set up the updater and other properties
     :param vehicle: Vehicle entity.
     """
     if self.__updater is not None:
         self.__updater = self.__updater.switch(self.__vehicleID)
     if self.__isRqToSwitch:
         nationID = vehicle.typeDescriptor.type.id[0]
         notifications = avatar_getter.getSoundNotifications()
         if notifications is not None:
             notifications.clear()
         SoundGroups.g_instance.soundModes.setCurrentNation(nations.NAMES[nationID])
     self.onVehicleControlling(vehicle)
     if self.__updater is not None:
         self.__updater.start()
     return
 def start(self, ui):
     self.__ui = weakref.proxy(ui)
     player = BigWorld.player()
     self.__playerVehicleID = player.playerVehicleID
     self.__playerTeam = player.team
     self.__soundNotifications = weakref.proxy(getSoundNotifications())
     arena = player.arena
     arenaType = arena.arenaType
     self.__isTeamPlayer = self.__playerTeam in arenaType.squadTeamNumbers if isFalloutMultiTeam(
     ) else True
     g_ctfManager.onFlagCapturedByVehicle += self.__onFlagCapturedByVehicle
     g_ctfManager.onFlagAbsorbed += self.__onFlagAbsorbed
     g_ctfManager.onFlagDroppedToGround += self.__onFlagDroppedToGround
     g_ctfManager.onFlagRemoved += self.__onFlagRemoved
     if g_ctfManager.getVehicleCarriedFlagID(
             self.__playerVehicleID) is not None:
         self.__ui.showFlagCaptured()
     return
Ejemplo n.º 23
0
 def __onCombatEquipmentUsed(self, shooterID, eqID):
     battleCxt = self.sessionProvider.getCtx()
     if not battleCxt.isCurrentPlayer(shooterID):
         equipment = vehicles.g_cache.equipments().get(eqID)
         getFullName = battleCxt.getPlayerFullName
         if equipment is not None:
             postfix = equipment.name.split('_')[0].upper()
             self.showMessage('COMBAT_EQUIPMENT_USED', {'player': getFullName(shooterID, showClan=False)}, extra=(('player', shooterID),), postfix=postfix)
     else:
         equipment = vehicles.g_cache.equipments().get(eqID)
         if equipment is None:
             return
         postfix = equipment.name.split('_')[0].upper()
         if postfix in EPIC_SOUND.BF_EB_ABILITY_LIST:
             soundNotifications = avatar_getter.getSoundNotifications()
             if soundNotifications is not None:
                 notification = EPIC_SOUND.BF_EB_ABILITY_USED.get(postfix, None)
                 if notification is not None:
                     soundNotifications.play(notification)
     return
Ejemplo n.º 24
0
 def _setup(self, vehicle):
     """
     Set up the updater and other properties
     :param vehicle: Vehicle entity.
     """
     if self.__updater is not None:
         self.__updater = self.__updater.switch(self.__vehicleID)
     if self.__isRqToSwitch:
         nationID = vehicle.typeDescriptor.type.id[0]
         notifications = avatar_getter.getSoundNotifications()
         if notifications is not None:
             notifications.clear()
         SoundGroups.g_instance.soundModes.setCurrentNation(
             nations.NAMES[nationID])
     self.onVehicleControlling(vehicle)
     if not vehicle.isAlive():
         self.notifyStateChanged(VEHICLE_VIEW_STATE.DESTROYED, None)
     elif self.__updater is not None:
         self.__updater.start()
     return
 def __onCombatEquipmentUsed(self, shooterID, eqID):
     battleCxt = self.sessionProvider.getCtx()
     if not battleCxt.isCurrentPlayer(shooterID):
         equipment = vehicles.g_cache.equipments().get(eqID)
         getFullName = battleCxt.getPlayerFullName
         if equipment is not None:
             messageKey = _EQUIPMENT_NAME_TO_MESSAGE_KEY.get(equipment.name)
             if messageKey is None:
                 postfix = equipment.name.split('_')[0].upper()
                 messageKey = 'COMBAT_EQUIPMENT_USED'
             else:
                 postfix = ''
             self.showMessage(
                 messageKey,
                 {'player': getFullName(shooterID, showClan=False)},
                 extra=(('player', shooterID), ),
                 postfix=postfix)
     else:
         equipment = vehicles.g_cache.equipments().get(eqID)
         if equipment is None:
             return
         postfix = equipment.name.split('_')[0].upper()
         if postfix in EPIC_SOUND.BF_EB_ABILITY_LIST:
             soundNotifications = avatar_getter.getSoundNotifications()
             if soundNotifications is not None:
                 notification = EPIC_SOUND.BF_EB_ABILITY_USED.get(
                     postfix, None)
                 if notification is not None:
                     soundNotifications.play(notification)
         elif postfix in EPIC_SOUND.BF_EB_EQUIPMENT_SOUND_LIST:
             if equipment.wwsoundEquipmentUsed:
                 if SoundGroups.g_instance:
                     SoundGroups.g_instance.playSound2D(
                         equipment.wwsoundEquipmentUsed)
                 else:
                     _logger.warning(
                         'Can not play "%s" ability. SoundGroups.g_instance is None',
                         postfix)
     return
Ejemplo n.º 26
0
 def __playSpottedSound(entry):
     nots = avatar_getter.getSoundNotifications()
     if nots is not None:
         nots.play('enemy_sighted_for_team', None, None, Math.Matrix(entry.getMatrix()).translation)
     return
Ejemplo n.º 27
0
def playSoundByAction(action):
    if action in _ACTIONS_SOUND_IDS:
        nots = getSoundNotifications()
        if nots is not None:
            nots.play(_ACTIONS_SOUND_IDS[action])
    return
Ejemplo n.º 28
0
 def movingToRespawn(self):
     self.__respawnInfo = None
     self.__stopTimer()
     self.__cancelDelayedShow()
     getSoundNotifications().play(_RESPAWN_SOUND_ID)
     return
Ejemplo n.º 29
0
 def playReady():
     avatar_getter.getSoundNotifications().play('combat_reserve')
Ejemplo n.º 30
0
 def __playSound(self, cmd):
     soundNotifications = avatar_getter.getSoundNotifications()
     if soundNotifications and hasattr(soundNotifications, 'play'):
         soundNotifications.play(cmd.getSoundEventName())
Ejemplo n.º 31
0
 def _triggerSoundNotification(self, notificationName):
     if not EPIC_SOUND.EPIC_MSG_SOUNDS_ENABLED:
         return
     soundNotifications = avatar_getter.getSoundNotifications()
     if soundNotifications and hasattr(soundNotifications, 'play'):
         soundNotifications.play(notificationName)
Ejemplo n.º 32
0
 def __playSpottedSound(entry):
     nots = avatar_getter.getSoundNotifications()
     if nots is not None:
         nots.play('enemy_sighted_for_team', None, None,
                   Math.Matrix(entry.getMatrix()).translation)
     return
Ejemplo n.º 33
0
 def movingToRespawn(self):
     self.__respawnInfo = None
     self.__stopTimer()
     getSoundNotifications().play(self.__respawnSndName)
     return
 def __playSound(self, eventName):
     if not EPIC_SOUND.EPIC_MSG_SOUNDS_ENABLED:
         return
     soundNotifications = getSoundNotifications()
     if soundNotifications and hasattr(soundNotifications, 'play'):
         soundNotifications.play(eventName)
Ejemplo n.º 35
0
 def movingToRespawn(self):
     self.__respawnInfo = None
     self.__stopTimer()
     self.__cancelDelayedShow()
     getSoundNotifications().play(_RESPAWN_SOUND_ID)
     return
 def playSoundNotification(cls, eventName):
     if not EPIC_SOUND.EPIC_MSG_SOUNDS_ENABLED:
         return
     soundNotifications = getSoundNotifications()
     if soundNotifications:
         soundNotifications.play(eventName)
Ejemplo n.º 37
0
 def __playSound(self, sound):
     self.__soundManager.playSound('effects.%s' % SoundEffectsId.DYN_SQUAD_STARTING_DYNAMIC_PLATOON)
     soundNotifications = avatar_getter.getSoundNotifications()
     if soundNotifications and hasattr(soundNotifications, 'play'):
         soundNotifications.play(sound)
Ejemplo n.º 38
0
 def __playSound(self, eventName):
     if not _RIBBON_SOUNDS_ENABLED:
         return
     soundNotifications = avatar_getter.getSoundNotifications()
     if soundNotifications and hasattr(soundNotifications, 'play'):
         soundNotifications.play(eventName)
Ejemplo n.º 39
0
 def movingToRespawn(self):
     self.__respawnInfo = None
     self.__stopTimer()
     getSoundNotifications().play(self.__respawnSndName)
     return
Ejemplo n.º 40
0
 def __playSound(self, cmd):
     soundNotifications = avatar_getter.getSoundNotifications()
     if soundNotifications and hasattr(soundNotifications, 'play'):
         soundNotifications.play(cmd.getSoundEventName())
 def _playSoundByAction(self, action):
     if action in _ACTION_SOUND_IDS:
         nots = getSoundNotifications()
         if nots is not None:
             nots.play(_ACTION_SOUND_IDS[action])
     return
Ejemplo n.º 42
0
 def __triggerRespawnSoundNotification(self):
     getSoundNotifications().play(_RESPAWN_SOUND_ID)
Ejemplo n.º 43
0
 def playReady(item):
     if item.requiresSoundNotification:
         avatar_getter.getSoundNotifications().play('combat_reserve')
Ejemplo n.º 44
0
 def __playSound(self, eventName):
     if not _RIBBON_SOUNDS_ENABLED:
         return
     soundNotifications = avatar_getter.getSoundNotifications()
     if soundNotifications and hasattr(soundNotifications, 'play'):
         soundNotifications.play(eventName)
Ejemplo n.º 45
0
 def playReady():
     avatar_getter.getSoundNotifications().play('combat_reserve')