コード例 #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
コード例 #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
コード例 #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
コード例 #4
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
コード例 #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
コード例 #6
0
 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
コード例 #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)
コード例 #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
コード例 #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
コード例 #10
0
ファイル: sharedribbons_panel.py プロジェクト: aevitas/wotsdk
 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)
コード例 #11
0
 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
コード例 #12
0
ファイル: vehicle_state_ctrl.py プロジェクト: kblw/wot_client
 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()
コード例 #13
0
 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
コード例 #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
コード例 #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
コード例 #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()
コード例 #17
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 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
コード例 #18
0
 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()
コード例 #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
コード例 #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
コード例 #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
コード例 #22
0
 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
コード例 #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
コード例 #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
コード例 #25
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:
             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
コード例 #26
0
ファイル: minimapplugins.py プロジェクト: aevitas/wotsdk
 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
コード例 #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
コード例 #28
0
 def movingToRespawn(self):
     self.__respawnInfo = None
     self.__stopTimer()
     self.__cancelDelayedShow()
     getSoundNotifications().play(_RESPAWN_SOUND_ID)
     return
コード例 #29
0
 def playReady():
     avatar_getter.getSoundNotifications().play('combat_reserve')
コード例 #30
0
 def __playSound(self, cmd):
     soundNotifications = avatar_getter.getSoundNotifications()
     if soundNotifications and hasattr(soundNotifications, 'play'):
         soundNotifications.play(cmd.getSoundEventName())
コード例 #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)
コード例 #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
コード例 #33
0
 def movingToRespawn(self):
     self.__respawnInfo = None
     self.__stopTimer()
     getSoundNotifications().play(self.__respawnSndName)
     return
コード例 #34
0
 def __playSound(self, eventName):
     if not EPIC_SOUND.EPIC_MSG_SOUNDS_ENABLED:
         return
     soundNotifications = getSoundNotifications()
     if soundNotifications and hasattr(soundNotifications, 'play'):
         soundNotifications.play(eventName)
コード例 #35
0
 def movingToRespawn(self):
     self.__respawnInfo = None
     self.__stopTimer()
     self.__cancelDelayedShow()
     getSoundNotifications().play(_RESPAWN_SOUND_ID)
     return
コード例 #36
0
 def playSoundNotification(cls, eventName):
     if not EPIC_SOUND.EPIC_MSG_SOUNDS_ENABLED:
         return
     soundNotifications = getSoundNotifications()
     if soundNotifications:
         soundNotifications.play(eventName)
コード例 #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)
コード例 #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)
コード例 #39
0
 def movingToRespawn(self):
     self.__respawnInfo = None
     self.__stopTimer()
     getSoundNotifications().play(self.__respawnSndName)
     return
コード例 #40
0
 def __playSound(self, cmd):
     soundNotifications = avatar_getter.getSoundNotifications()
     if soundNotifications and hasattr(soundNotifications, 'play'):
         soundNotifications.play(cmd.getSoundEventName())
コード例 #41
0
 def _playSoundByAction(self, action):
     if action in _ACTION_SOUND_IDS:
         nots = getSoundNotifications()
         if nots is not None:
             nots.play(_ACTION_SOUND_IDS[action])
     return
コード例 #42
0
ファイル: respawn_ctrl.py プロジェクト: kusaku/wot_scripts
 def __triggerRespawnSoundNotification(self):
     getSoundNotifications().play(_RESPAWN_SOUND_ID)
コード例 #43
0
 def playReady(item):
     if item.requiresSoundNotification:
         avatar_getter.getSoundNotifications().play('combat_reserve')
コード例 #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)
コード例 #45
0
 def playReady():
     avatar_getter.getSoundNotifications().play('combat_reserve')