示例#1
0
 def __init__(self, parentUI):
     Flash.__init__(self, self.__SWF_FILE_NAME)
     self.component.wg_inputKeyMode = 2
     self.component.position.z = DEPTH_OF_VehicleMarker
     self.component.drawWithRestrictedViewPort = False
     self.movie.backgroundAlpha = 0
     self.colorManager = ColorSchemeManager._ColorSchemeManager()
     self.colorManager.populateUI(weakref.proxy(self))
     self.__plugins = PluginsCollection(self)
     plugins = {'equipments': _EquipmentsMarkerPlugin}
     if isEventBattle():
         plugins.update({'flags': _FlagsMarkerPlugin,
          'repairs': _RepairsMarkerPlugin})
     self.__plugins.addPlugins(plugins)
     self.__ownUI = None
     self.__parentUI = parentUI
     self.__markers = dict()
     return
示例#2
0
 def __init__(self, parentUI):
     Flash.__init__(self, _MARKERS_MANAGER_SWF)
     self.component.wg_inputKeyMode = 2
     self.component.position.z = DEPTH_OF_VehicleMarker
     self.component.drawWithRestrictedViewPort = False
     self.movie.backgroundAlpha = 0
     self.colorManager = ColorSchemeManager._ColorSchemeManager()
     self.colorManager.populateUI(weakref.proxy(self))
     self.__plugins = PluginsCollection(self)
     plugins = {'equipments': _EquipmentsMarkerPlugin}
     if arena_info.hasFlags():
         plugins['flags'] = _FlagsMarkerPlugin
     if arena_info.hasRepairPoints():
         plugins['repairs'] = _RepairsMarkerPlugin
     if arena_info.hasResourcePoints():
         plugins['resources'] = _ResourceMarkerPlugin
     self.__plugins.addPlugins(plugins)
     self.__ownUI = None
     self.__parentUI = parentUI
     self.__markers = {}
示例#3
0
 def __init__(self, parentUI):
     Flash.__init__(self, _MARKERS_MANAGER_SWF)
     self.component.wg_inputKeyMode = 2
     self.component.position.z = DEPTH_OF_VehicleMarker
     self.component.drawWithRestrictedViewPort = False
     self.movie.backgroundAlpha = 0
     self.colorManager = ColorSchemeManager._ColorSchemeManager()
     self.colorManager.populateUI(weakref.proxy(self))
     self.__plugins = PluginsCollection(self)
     plugins = {'equipments': _EquipmentsMarkerPlugin}
     if arena_info.hasFlags():
         plugins['flags'] = _FlagsMarkerPlugin
     if arena_info.hasRepairPoints():
         plugins['repairs'] = _RepairsMarkerPlugin
     if arena_info.hasResourcePoints():
         plugins['resources'] = _ResourceMarkerPlugin
     self.__plugins.addPlugins(plugins)
     self.__ownUI = None
     self.__parentUI = parentUI
     self.__markers = {}
示例#4
0
 def afterCreate(self):
     event = events.AppLifeCycleEvent
     g_eventBus.handleEvent(event(self.__ns, event.INITIALIZING))
     player = BigWorld.player()
     voice = VoiceChatInterface.g_instance
     LOG_DEBUG('[Battle] afterCreate')
     setattr(self.movie, '_global.wg_isShowLanguageBar', GUI_SETTINGS.isShowLanguageBar)
     setattr(self.movie, '_global.wg_isShowServerStats', constants.IS_SHOW_SERVER_STATS)
     setattr(self.movie, '_global.wg_isShowVoiceChat', GUI_SETTINGS.voiceChat)
     setattr(self.movie, '_global.wg_voiceChatProvider', voice.voiceChatProvider)
     setattr(self.movie, '_global.wg_isChina', constants.IS_CHINA)
     setattr(self.movie, '_global.wg_isKorea', constants.IS_KOREA)
     setattr(self.movie, '_global.wg_isReplayPlaying', BattleReplay.g_replayCtrl.isPlaying)
     BattleWindow.afterCreate(self)
     addListener = g_eventBus.addListener
     addListener(events.GameEvent.HELP, self.toggleHelpWindow, scope=_SCOPE)
     addListener(events.GameEvent.GUI_VISIBILITY, self.showAll, scope=_SCOPE)
     player.inputHandler.onPostmortemVehicleChanged += self.onPostmortemVehicleChanged
     player.inputHandler.onCameraChanged += self.onCameraChanged
     g_settingsCore.onSettingsChanged += self.__accs_onSettingsChanged
     g_settingsCore.interfaceScale.onScaleChanged += self.__onRecreateDevice
     isMutlipleTeams = g_sessionProvider.getArenaDP().isMultipleTeams()
     isEvent = isEventBattle()
     self.proxy = weakref.proxy(self)
     self.__battle_flashObject = self.proxy.getMember('_level0')
     if self.__battle_flashObject:
         self.__battle_flashObject.resync()
     voice.populateUI(self.proxy)
     voice.onPlayerSpeaking += self.setPlayerSpeaking
     voice.onVoiceChatInitFailed += self.onVoiceChatInitFailed
     self.colorManager = ColorSchemeManager._ColorSchemeManager()
     self.colorManager.populateUI(self.proxy)
     self.movingText = MovingText()
     self.movingText.populateUI(self.proxy)
     self.__settingsInterface = SettingsInterface()
     self.__settingsInterface.populateUI(self.proxy)
     self.__soundManager = SoundManager()
     self.__soundManager.populateUI(self.proxy)
     self.__timersBar = TimersBar(self.proxy, isEvent)
     self.__teamBasesPanel = TeamBasesPanel(self.proxy)
     self.__debugPanel = DebugPanel(self.proxy)
     self.__consumablesPanel = ConsumablesPanel(self.proxy)
     self.__damagePanel = DamagePanel(self.proxy)
     self.__markersManager = MarkersManager(self.proxy)
     self.__ingameHelp = IngameHelp(self.proxy)
     self.__minimap = Minimap(self.proxy)
     self.__radialMenu = RadialMenu(self.proxy)
     self.__ribbonsPanel = BattleRibbonsPanel(self.proxy)
     self.__indicators = IndicatorsCollection()
     self.__ppSwitcher = PlayersPanelsSwitcher(self.proxy)
     isColorBlind = g_settingsCore.getSetting('isColorBlind')
     self.__leftPlayersPanel = playersPanelFactory(self.proxy, True, isColorBlind, isEvent, isMutlipleTeams)
     self.__rightPlayersPanel = playersPanelFactory(self.proxy, False, isColorBlind, isEvent, isMutlipleTeams)
     self.__damageInfoPanel = VehicleDamageInfoPanel(self.proxy)
     self.__fragCorrelation = scorePanelFactory(self.proxy, isEvent, isMutlipleTeams)
     self.__statsForm = statsFormFactory(self.proxy, isEvent, isMutlipleTeams)
     self.__plugins.init()
     self.isVehicleCountersVisible = g_settingsCore.getSetting('showVehiclesCounter')
     self.__fragCorrelation.showVehiclesCounter(self.isVehicleCountersVisible)
     self.__vErrorsPanel = VehicleErrorMessages(self.proxy)
     self.__vMsgsPanel = VehicleMessages(self.proxy)
     self.__pMsgsPanel = PlayerMessages(self.proxy)
     self.__plugins.start()
     self.__debugPanel.start()
     self.__consumablesPanel.start()
     self.__damagePanel.start()
     self.__ingameHelp.start()
     self.__vErrorsPanel.start()
     self.__vMsgsPanel.start()
     self.__pMsgsPanel.start()
     self.__markersManager.start()
     self.__markersManager.setMarkerDuration(GUI_SETTINGS.markerHitSplashDuration)
     markers = {'enemy': g_settingsCore.getSetting('enemy'),
      'dead': g_settingsCore.getSetting('dead'),
      'ally': g_settingsCore.getSetting('ally')}
     self.__markersManager.setMarkerSettings(markers)
     MessengerEntry.g_instance.gui.invoke('populateUI', self.proxy)
     g_guiResetters.add(self.__onRecreateDevice)
     g_repeatKeyHandlers.add(self.component.handleKeyEvent)
     self.__onRecreateDevice()
     self.__statsForm.populate()
     self.__leftPlayersPanel.populateUI(self.proxy)
     self.__rightPlayersPanel.populateUI(self.proxy)
     if BattleReplay.g_replayCtrl.isPlaying:
         BattleReplay.g_replayCtrl.onBattleSwfLoaded()
     self.__populateData(isMutlipleTeams)
     self.__minimap.start()
     self.__radialMenu.setSettings(self.__settingsInterface)
     self.__radialMenu.populateUI(self.proxy)
     self.__ribbonsPanel.start()
     g_sessionProvider.setBattleUI(self)
     self.__arenaCtrl = battleArenaControllerFactory(self, isEvent, isMutlipleTeams)
     g_sessionProvider.addArenaCtrl(self.__arenaCtrl)
     self.updateFlagsColor()
     self.movie.setFocussed(SCALEFORM_SWF_PATH)
     self.call('battle.initDynamicSquad', self.__getDynamicSquadsInitParams(disableAlly=BattleReplay.g_replayCtrl.isPlaying))
     self.call('sixthSenseIndicator.setDuration', [GUI_SETTINGS.sixthSenseDuration])
     g_tankActiveCamouflage[player.vehicleTypeDescriptor.type.compactDescr] = self.__arena.arenaType.vehicleCamouflageKind
     keyCode = CommandMapping.g_instance.get('CMD_VOICECHAT_MUTE')
     if not BigWorld.isKeyDown(keyCode):
         VOIP.getVOIPManager().setMicMute(True)
     ctrl = g_sessionProvider.getVehicleStateCtrl()
     ctrl.onVehicleStateUpdated += self.__onVehicleStateUpdated
     ctrl.onPostMortemSwitched += self.__onPostMortemSwitched
     self.__dynSquadListener = DynSquadViewListener(self.proxy)
     g_eventBus.handleEvent(event(self.__ns, event.INITIALIZED))
示例#5
0
 def afterCreate(self):
     event = events.AppLifeCycleEvent
     g_eventBus.handleEvent(event(self.__ns, event.INITIALIZING))
     player = BigWorld.player()
     LOG_DEBUG('[Battle] afterCreate')
     setattr(self.movie, '_global.wg_isShowLanguageBar',
             GUI_SETTINGS.isShowLanguageBar)
     setattr(self.movie, '_global.wg_isShowServerStats',
             constants.IS_SHOW_SERVER_STATS)
     setattr(self.movie, '_global.wg_isShowVoiceChat',
             GUI_SETTINGS.voiceChat)
     setattr(self.movie, '_global.wg_voiceChatProvider',
             self.__getVoiceChatProvider())
     setattr(self.movie, '_global.wg_isChina', constants.IS_CHINA)
     setattr(self.movie, '_global.wg_isKorea', constants.IS_KOREA)
     setattr(self.movie, '_global.wg_isReplayPlaying',
             BattleReplay.g_replayCtrl.isPlaying)
     BattleWindow.afterCreate(self)
     addListener = g_eventBus.addListener
     addListener(events.GameEvent.HELP, self.toggleHelpWindow, scope=_SCOPE)
     addListener(events.GameEvent.TOGGLE_GUI, self.showAll, scope=_SCOPE)
     player.inputHandler.onPostmortemVehicleChanged += self.onPostmortemVehicleChanged
     player.inputHandler.onCameraChanged += self.onCameraChanged
     g_settingsCore.onSettingsChanged += self.__accs_onSettingsChanged
     g_settingsCore.interfaceScale.onScaleChanged += self.__onRecreateDevice
     visitor = g_sessionProvider.arenaVisitor
     isMutlipleTeams = visitor.gui.isFalloutMultiTeam()
     isFallout = visitor.gui.isFalloutBattle()
     self.proxy = weakref.proxy(self)
     self.__battle_flashObject = self.proxy.getMember('_level0')
     if self.__battle_flashObject:
         self.__battle_flashObject.resync()
     voice = g_messengerEvents.voip
     voice.onPlayerSpeaking += self.setPlayerSpeaking
     voice.onVoiceChatInitFailed += self.onVoiceChatInitFailed
     self.colorManager = ColorSchemeManager._ColorSchemeManager()
     self.colorManager.populateUI(self.proxy)
     self.movingText = MovingText()
     self.movingText.populateUI(self.proxy)
     self.__settingsInterface = SettingsInterface()
     self.__settingsInterface.populateUI(self.proxy)
     self.__soundManager = SoundManager()
     self.__soundManager.populateUI(self.proxy)
     self.__debugPanel = DebugPanel()
     self.__timersBar = TimersBar(self.proxy, isFallout)
     if visitor.isBattleEndWarningEnabled():
         self.__battleEndWarningPanel = BattleEndWarningPanel(
             self.proxy, visitor.type, SoundGroups.g_instance)
     else:
         self.__battleEndWarningPanel = BattleEndWarningEmptyObject(
             self.proxy, visitor.type, SoundGroups.g_instance)
     self.__teamBasesPanel = TeamBasesPanel(self.proxy)
     self.__consumablesPanel = ConsumablesPanel(self.proxy)
     self.__damagePanel = DamagePanel(self.proxy)
     self.__markersManager = MarkersManager(self.proxy)
     self.__ingameHelp = IngameHelp(self.proxy)
     self.__minimap = Minimap(self.proxy)
     self.__radialMenu = RadialMenu(self.proxy)
     self.__ribbonsPanel = BattleRibbonsPanel(self.proxy)
     self.__ppSwitcher = PlayersPanelsSwitcher(self.proxy)
     isColorBlind = g_settingsCore.getSetting('isColorBlind')
     self.__leftPlayersPanel = playersPanelFactory(self.proxy, True,
                                                   isColorBlind, isFallout,
                                                   isMutlipleTeams)
     self.__rightPlayersPanel = playersPanelFactory(self.proxy, False,
                                                    isColorBlind, isFallout,
                                                    isMutlipleTeams)
     self.__damageInfoPanel = VehicleDamageInfoPanel(self.proxy)
     self.__damageInfoPanel.start()
     self.__fragCorrelation = scorePanelFactory(self.proxy, isFallout,
                                                isMutlipleTeams)
     self.__statsForm = statsFormFactory(self.proxy, isFallout,
                                         isMutlipleTeams)
     self.__plugins.init()
     self.isVehicleCountersVisible = g_settingsCore.getSetting(
         'showVehiclesCounter')
     self.__fragCorrelation.showVehiclesCounter(
         self.isVehicleCountersVisible)
     self.__vErrorsPanel = VehicleErrorMessages(self.proxy)
     self.__vMsgsPanel = VehicleMessages(self.proxy)
     self.__pMsgsPanel = PlayerMessages(self.proxy)
     self.__plugins.start()
     self.__consumablesPanel.start()
     self.__damagePanel.start()
     self.__ingameHelp.start()
     self.__vErrorsPanel.start()
     self.__vMsgsPanel.start()
     self.__pMsgsPanel.start()
     self.__markersManager.start()
     self.__markersManager.setMarkerDuration(
         GUI_SETTINGS.markerHitSplashDuration)
     markers = {
         'enemy': g_settingsCore.getSetting('enemy'),
         'dead': g_settingsCore.getSetting('dead'),
         'ally': g_settingsCore.getSetting('ally')
     }
     self.__markersManager.setMarkerSettings(markers)
     self.__crosshairPanel = CrosshairPanel()
     self.__crosshairPanel.active(True)
     MessengerEntry.g_instance.gui.invoke('populateUI', self.proxy)
     g_guiResetters.add(self.__onRecreateDevice)
     g_repeatKeyHandlers.add(self.component.handleKeyEvent)
     self.__onRecreateDevice()
     self.__statsForm.populate()
     self.__leftPlayersPanel.populateUI(self.proxy)
     self.__rightPlayersPanel.populateUI(self.proxy)
     self.__debugPanel.populateUI(self.proxy)
     if BattleReplay.g_replayCtrl.isPlaying:
         BattleReplay.g_replayCtrl.onBattleSwfLoaded()
     self.__populateData()
     self.__minimap.start()
     self.__radialMenu.setSettings(self.__settingsInterface)
     self.__radialMenu.populateUI(self.proxy)
     self.__ribbonsPanel.start()
     add = g_sessionProvider.addViewComponent
     add('legacy/hitDirection',
         indicators.createDamageIndicator(),
         rule=VIEW_COMPONENT_RULE.NONE)
     add('legacy/teamBasesPanel', self.__teamBasesPanel)
     add('legacy/debugPanel', self.__debugPanel)
     add('legacy/battleTimer', self.__timersBar)
     add('legacy/prebattleTimer', self.__timersBar)
     add('legacy/ppSwitcher', self.__ppSwitcher)
     add(_BATTLE_END_WARNING_COMPONENT, self.__battleEndWarningPanel)
     self.__arenaCtrl = battleArenaControllerFactory(
         self, isFallout, isMutlipleTeams)
     g_sessionProvider.addArenaCtrl(self.__arenaCtrl)
     self.updateFlagsColor()
     self.movie.setFocussed(SCALEFORM_SWF_PATH)
     self.call(
         'battle.initDynamicSquad',
         self.__getDynamicSquadsInitParams(
             enableButton=not BattleReplay.g_replayCtrl.isPlaying))
     self.call('sixthSenseIndicator.setDuration',
               [GUI_SETTINGS.sixthSenseDuration])
     keyCode = CommandMapping.g_instance.get('CMD_VOICECHAT_MUTE')
     if not BigWorld.isKeyDown(keyCode):
         VOIP.getVOIPManager().setMicMute(True)
     ctrl = g_sessionProvider.shared.vehicleState
     ctrl.onVehicleStateUpdated += self.__onVehicleStateUpdated
     ctrl.onPostMortemSwitched += self.__onPostMortemSwitched
     if BattleReplay.g_replayCtrl.isPlaying:
         self.__dynSquadListener = ReplayDynSquadViewListener(self.proxy)
     elif BattleReplay.g_replayCtrl.isRecording:
         self.__dynSquadListener = RecordDynSquadViewListener(self.proxy)
     else:
         self.__dynSquadListener = DynSquadViewListener(self.proxy)
     g_eventBus.handleEvent(event(self.__ns, event.INITIALIZED))
示例#6
0
 def afterCreate(self):
     event = events.AppLifeCycleEvent
     g_eventBus.handleEvent(event(self.__ns, event.INITIALIZING))
     player = BigWorld.player()
     voice = VoiceChatInterface.g_instance
     LOG_DEBUG('[Battle] afterCreate')
     setattr(self.movie, '_global.wg_isShowLanguageBar', GUI_SETTINGS.isShowLanguageBar)
     setattr(self.movie, '_global.wg_isShowServerStats', constants.IS_SHOW_SERVER_STATS)
     setattr(self.movie, '_global.wg_isShowVoiceChat', GUI_SETTINGS.voiceChat)
     setattr(self.movie, '_global.wg_voiceChatProvider', voice.voiceChatProvider)
     setattr(self.movie, '_global.wg_isChina', constants.IS_CHINA)
     setattr(self.movie, '_global.wg_isKorea', constants.IS_KOREA)
     setattr(self.movie, '_global.wg_isReplayPlaying', BattleReplay.g_replayCtrl.isPlaying)
     BattleWindow.afterCreate(self)
     addListener = g_eventBus.addListener
     addListener(events.GameEvent.HELP, self.toggleHelpWindow, scope=_SCOPE)
     addListener(events.GameEvent.GUI_VISIBILITY, self.showAll, scope=_SCOPE)
     player.inputHandler.onPostmortemVehicleChanged += self.onPostmortemVehicleChanged
     player.inputHandler.onCameraChanged += self.onCameraChanged
     g_settingsCore.onSettingsChanged += self.__accs_onSettingsChanged
     g_settingsCore.interfaceScale.onScaleChanged += self.__onRecreateDevice
     isMutlipleTeams = g_sessionProvider.getArenaDP().isMultipleTeams()
     isEvent = isEventBattle()
     self.proxy = weakref.proxy(self)
     self.__battle_flashObject = self.proxy.getMember('_level0')
     if self.__battle_flashObject:
         self.__battle_flashObject.resync()
     voice.populateUI(self.proxy)
     voice.onPlayerSpeaking += self.setPlayerSpeaking
     voice.onVoiceChatInitFailed += self.onVoiceChatInitFailed
     self.colorManager = ColorSchemeManager._ColorSchemeManager()
     self.colorManager.populateUI(self.proxy)
     self.movingText = MovingText()
     self.movingText.populateUI(self.proxy)
     self.__settingsInterface = SettingsInterface()
     self.__settingsInterface.populateUI(self.proxy)
     self.__soundManager = SoundManager()
     self.__soundManager.populateUI(self.proxy)
     self.__timersBar = TimersBar(self.proxy, isEvent)
     self.__teamBasesPanel = TeamBasesPanel(self.proxy)
     self.__debugPanel = DebugPanel(self.proxy)
     self.__consumablesPanel = ConsumablesPanel(self.proxy)
     self.__damagePanel = DamagePanel(self.proxy)
     self.__markersManager = MarkersManager(self.proxy)
     self.__ingameHelp = IngameHelp(self.proxy)
     self.__minimap = Minimap(self.proxy)
     self.__radialMenu = RadialMenu(self.proxy)
     self.__ribbonsPanel = BattleRibbonsPanel(self.proxy)
     self.__indicators = IndicatorsCollection()
     self.__ppSwitcher = PlayersPanelsSwitcher(self.proxy)
     isColorBlind = g_settingsCore.getSetting('isColorBlind')
     self.__leftPlayersPanel = playersPanelFactory(self.proxy, True, isColorBlind, isEvent, isMutlipleTeams)
     self.__rightPlayersPanel = playersPanelFactory(self.proxy, False, isColorBlind, isEvent, isMutlipleTeams)
     self.__damageInfoPanel = VehicleDamageInfoPanel(self.proxy)
     self.__fragCorrelation = scorePanelFactory(self.proxy, isEvent, isMutlipleTeams)
     self.__statsForm = statsFormFactory(self.proxy, isEvent, isMutlipleTeams)
     self.__plugins.init()
     self.isVehicleCountersVisible = g_settingsCore.getSetting('showVehiclesCounter')
     self.__fragCorrelation.showVehiclesCounter(self.isVehicleCountersVisible)
     self.__vErrorsPanel = VehicleErrorMessages(self.proxy)
     self.__vMsgsPanel = VehicleMessages(self.proxy)
     self.__pMsgsPanel = PlayerMessages(self.proxy)
     self.__plugins.start()
     self.__debugPanel.start()
     self.__consumablesPanel.start()
     self.__damagePanel.start()
     self.__ingameHelp.start()
     self.__vErrorsPanel.start()
     self.__vMsgsPanel.start()
     self.__pMsgsPanel.start()
     self.__markersManager.start()
     self.__markersManager.setMarkerDuration(GUI_SETTINGS.markerHitSplashDuration)
     markers = {'enemy': g_settingsCore.getSetting('enemy'),
      'dead': g_settingsCore.getSetting('dead'),
      'ally': g_settingsCore.getSetting('ally')}
     self.__markersManager.setMarkerSettings(markers)
     MessengerEntry.g_instance.gui.invoke('populateUI', self.proxy)
     g_guiResetters.add(self.__onRecreateDevice)
     g_repeatKeyHandlers.add(self.component.handleKeyEvent)
     self.__onRecreateDevice()
     self.__statsForm.populate()
     self.__leftPlayersPanel.populateUI(self.proxy)
     self.__rightPlayersPanel.populateUI(self.proxy)
     if BattleReplay.g_replayCtrl.isPlaying:
         BattleReplay.g_replayCtrl.onBattleSwfLoaded()
     self.__populateData(isMutlipleTeams)
     self.__minimap.start()
     self.__radialMenu.setSettings(self.__settingsInterface)
     self.__radialMenu.populateUI(self.proxy)
     self.__ribbonsPanel.start()
     g_sessionProvider.setBattleUI(self)
     self.__arenaCtrl = battleArenaControllerFactory(self, isEvent, isMutlipleTeams)
     g_sessionProvider.addArenaCtrl(self.__arenaCtrl)
     self.updateFlagsColor()
     self.movie.setFocussed(SCALEFORM_SWF_PATH)
     self.call('battle.initDynamicSquad', self.__getDynamicSquadsInitParams())
     if self.__arena.period == constants.ARENA_PERIOD.BATTLE:
         self.call('players_panel.setState', [g_settingsCore.getSetting('ppState')])
     else:
         self.call('players_panel.setState', ['large'])
     self.call('sixthSenseIndicator.setDuration', [GUI_SETTINGS.sixthSenseDuration])
     g_tankActiveCamouflage[player.vehicleTypeDescriptor.type.compactDescr] = self.__arena.arenaType.vehicleCamouflageKind
     keyCode = CommandMapping.g_instance.get('CMD_VOICECHAT_MUTE')
     if not BigWorld.isKeyDown(keyCode):
         VOIP.getVOIPManager().setMicMute(True)
     ctrl = g_sessionProvider.getVehicleStateCtrl()
     ctrl.onVehicleStateUpdated += self.__onVehicleStateUpdated
     ctrl.onPostMortemSwitched += self.__onPostMortemSwitched
     self.__dynSquadListener = DynSquadViewListener(self.proxy)
     g_eventBus.handleEvent(event(self.__ns, event.INITIALIZED))
示例#7
0
 def afterCreate(self):
     event = events.AppLifeCycleEvent
     g_eventBus.handleEvent(event(self.__ns, event.INITIALIZING))
     player = BigWorld.player()
     LOG_DEBUG('[Battle] afterCreate')
     setattr(self.movie, '_global.wg_isShowLanguageBar', GUI_SETTINGS.isShowLanguageBar)
     setattr(self.movie, '_global.wg_isShowServerStats', constants.IS_SHOW_SERVER_STATS)
     setattr(self.movie, '_global.wg_isShowVoiceChat', GUI_SETTINGS.voiceChat)
     setattr(self.movie, '_global.wg_voiceChatProvider', self.__getVoiceChatProvider())
     setattr(self.movie, '_global.wg_isChina', constants.IS_CHINA)
     setattr(self.movie, '_global.wg_isKorea', constants.IS_KOREA)
     setattr(self.movie, '_global.wg_isReplayPlaying', BattleReplay.g_replayCtrl.isPlaying)
     BattleWindow.afterCreate(self)
     addListener = g_eventBus.addListener
     addListener(events.GameEvent.HELP, self.toggleHelpWindow, scope=_SCOPE)
     addListener(events.GameEvent.TOGGLE_GUI, self.showAll, scope=_SCOPE)
     player.inputHandler.onPostmortemVehicleChanged += self.onPostmortemVehicleChanged
     player.inputHandler.onCameraChanged += self.onCameraChanged
     g_settingsCore.onSettingsChanged += self.__accs_onSettingsChanged
     g_settingsCore.interfaceScale.onScaleChanged += self.__onRecreateDevice
     visitor = g_sessionProvider.arenaVisitor
     isMutlipleTeams = visitor.gui.isFalloutMultiTeam()
     isFallout = visitor.gui.isFalloutBattle()
     self.proxy = weakref.proxy(self)
     self.__battle_flashObject = self.proxy.getMember('_level0')
     if self.__battle_flashObject:
         self.__battle_flashObject.resync()
     voice = g_messengerEvents.voip
     voice.onPlayerSpeaking += self.setPlayerSpeaking
     voice.onVoiceChatInitFailed += self.onVoiceChatInitFailed
     self.colorManager = ColorSchemeManager._ColorSchemeManager()
     self.colorManager.populateUI(self.proxy)
     self.movingText = MovingText()
     self.movingText.populateUI(self.proxy)
     self.__settingsInterface = SettingsInterface()
     self.__settingsInterface.populateUI(self.proxy)
     self.__soundManager = SoundManager()
     self.__soundManager.populateUI(self.proxy)
     self.__debugPanel = DebugPanel()
     self.__timersBar = TimersBar(self.proxy, isFallout)
     if visitor.isBattleEndWarningEnabled():
         self.__battleEndWarningPanel = BattleEndWarningPanel(self.proxy, visitor.type, SoundGroups.g_instance)
     else:
         self.__battleEndWarningPanel = BattleEndWarningEmptyObject(self.proxy, visitor.type, SoundGroups.g_instance)
     self.__teamBasesPanel = TeamBasesPanel(self.proxy)
     self.__consumablesPanel = ConsumablesPanel(self.proxy)
     self.__damagePanel = DamagePanel(self.proxy)
     self.__markersManager = MarkersManager(self.proxy)
     self.__ingameHelp = IngameHelp(self.proxy)
     self.__minimap = Minimap(self.proxy)
     self.__radialMenu = RadialMenu(self.proxy)
     self.__ribbonsPanel = BattleRibbonsPanel(self.proxy)
     self.__ppSwitcher = PlayersPanelsSwitcher(self.proxy)
     isColorBlind = g_settingsCore.getSetting('isColorBlind')
     self.__leftPlayersPanel = playersPanelFactory(self.proxy, True, isColorBlind, isFallout, isMutlipleTeams)
     self.__rightPlayersPanel = playersPanelFactory(self.proxy, False, isColorBlind, isFallout, isMutlipleTeams)
     self.__damageInfoPanel = VehicleDamageInfoPanel(self.proxy)
     self.__damageInfoPanel.start()
     self.__fragCorrelation = scorePanelFactory(self.proxy, isFallout, isMutlipleTeams)
     self.__statsForm = statsFormFactory(self.proxy, isFallout, isMutlipleTeams)
     self.__plugins.init()
     self.isVehicleCountersVisible = g_settingsCore.getSetting('showVehiclesCounter')
     self.__fragCorrelation.showVehiclesCounter(self.isVehicleCountersVisible)
     self.__vErrorsPanel = VehicleErrorMessages(self.proxy)
     self.__vMsgsPanel = VehicleMessages(self.proxy)
     self.__pMsgsPanel = PlayerMessages(self.proxy)
     self.__plugins.start()
     self.__consumablesPanel.start()
     self.__damagePanel.start()
     self.__ingameHelp.start()
     self.__vErrorsPanel.start()
     self.__vMsgsPanel.start()
     self.__pMsgsPanel.start()
     self.__markersManager.start()
     self.__markersManager.setMarkerDuration(GUI_SETTINGS.markerHitSplashDuration)
     markers = {'enemy': g_settingsCore.getSetting('enemy'),
      'dead': g_settingsCore.getSetting('dead'),
      'ally': g_settingsCore.getSetting('ally')}
     self.__markersManager.setMarkerSettings(markers)
     self.__crosshairPanel = CrosshairPanel()
     self.__crosshairPanel.active(True)
     MessengerEntry.g_instance.gui.invoke('populateUI', self.proxy)
     g_guiResetters.add(self.__onRecreateDevice)
     g_repeatKeyHandlers.add(self.component.handleKeyEvent)
     self.__onRecreateDevice()
     self.__statsForm.populate()
     self.__leftPlayersPanel.populateUI(self.proxy)
     self.__rightPlayersPanel.populateUI(self.proxy)
     self.__debugPanel.populateUI(self.proxy)
     if BattleReplay.g_replayCtrl.isPlaying:
         BattleReplay.g_replayCtrl.onBattleSwfLoaded()
     self.__populateData()
     self.__minimap.start()
     self.__radialMenu.setSettings(self.__settingsInterface)
     self.__radialMenu.populateUI(self.proxy)
     self.__ribbonsPanel.start()
     add = g_sessionProvider.addViewComponent
     add('legacy/hitDirection', indicators.createDamageIndicator(), rule=VIEW_COMPONENT_RULE.NONE)
     add('legacy/teamBasesPanel', self.__teamBasesPanel)
     add('legacy/debugPanel', self.__debugPanel)
     add('legacy/battleTimer', self.__timersBar)
     add('legacy/prebattleTimer', self.__timersBar)
     add('legacy/ppSwitcher', self.__ppSwitcher)
     add(_BATTLE_END_WARNING_COMPONENT, self.__battleEndWarningPanel)
     self.__arenaCtrl = battleArenaControllerFactory(self, isFallout, isMutlipleTeams)
     g_sessionProvider.addArenaCtrl(self.__arenaCtrl)
     self.updateFlagsColor()
     self.movie.setFocussed(SCALEFORM_SWF_PATH)
     self.call('battle.initDynamicSquad', self.__getDynamicSquadsInitParams(enableButton=not BattleReplay.g_replayCtrl.isPlaying))
     self.call('sixthSenseIndicator.setDuration', [GUI_SETTINGS.sixthSenseDuration])
     keyCode = CommandMapping.g_instance.get('CMD_VOICECHAT_MUTE')
     if not BigWorld.isKeyDown(keyCode):
         VOIP.getVOIPManager().setMicMute(True)
     ctrl = g_sessionProvider.shared.vehicleState
     ctrl.onVehicleStateUpdated += self.__onVehicleStateUpdated
     ctrl.onPostMortemSwitched += self.__onPostMortemSwitched
     if BattleReplay.g_replayCtrl.isPlaying:
         self.__dynSquadListener = ReplayDynSquadViewListener(self.proxy)
     elif BattleReplay.g_replayCtrl.isRecording:
         self.__dynSquadListener = RecordDynSquadViewListener(self.proxy)
     else:
         self.__dynSquadListener = DynSquadViewListener(self.proxy)
     g_eventBus.handleEvent(event(self.__ns, event.INITIALIZED))