def start(self): self.__arenaPeriodCtrl.startControl( weakref.proxy(g_sessionProvider.getCtx()), weakref.proxy(g_sessionProvider.arenaVisitor)) self.__arenaPeriodCtrl.setViewComponents(weakref.proxy(self), weakref.proxy(self)) g_sessionProvider.addArenaCtrl(self.__arenaPeriodCtrl)
def start(self): super(BattleSpaceEnv, self).start() g_sessionProvider.addArenaCtrl(self) periodCtrl = g_sessionProvider.shared.arenaPeriod if periodCtrl is not None: self._updateBattleAmbient(periodCtrl.getPeriod()) return
def _populate(self): super(BattleLoading, self)._populate() g_sessionProvider.addArenaCtrl(self) BigWorld.wg_updateColorGrading() BigWorld.wg_enableGUIBackground(True, False) self._addArenaTypeData() Waiting.close()
def onAvatarBecomePlayer(self): """Listener for event onAvatarBecomePlayer """ if not self._isBattleCtrlInit: g_sessionProvider.addArenaCtrl(self) self._isBattleCtrlInit = True self.__checkDbID()
def _populate(self): super(BattleLoading, self)._populate() arena = getClientArena() self.__isFalloutMultiTeam = getIsMultiteam() g_sessionProvider.addArenaCtrl(self) BigWorld.wg_updateColorGrading() BigWorld.wg_enableGUIBackground(True, False) self._addArenaTypeData() Waiting.close()
def _populate(self): super(BattleStatisticsDataController, self)._populate() g_messengerEvents.voip.onStateToggled += self.__onVOIPStateToggled g_settingsCore.onSettingsChanged += self.__onSettingsChanged g_sessionProvider.addArenaCtrl(self) ctrl = g_sessionProvider.shared.vehicleState if ctrl is not None: ctrl.onVehicleStateUpdated += self.__onVehicleStateUpdated self.__setPersonalStatus() return
def _populate(self): super(BattleMessengerView, self)._populate() self._accDbID = getAvatarDatabaseID() self.__receivers = [] self.fireEvent(ChannelManagementEvent(0, ChannelManagementEvent.REGISTER_BATTLE, {'component': self}), scope=EVENT_BUS_SCOPE.BATTLE) self.addListener(ChannelManagementEvent.MESSAGE_FADING_ENABLED, self.__handleMessageFadingEnabled, EVENT_BUS_SCOPE.GLOBAL) self.__restoreLastReceiverInBattle() g_sessionProvider.addArenaCtrl(self) self.as_setupListS(_makeSettingsVO(self._arenaVisitor)) self._ignoreActionCooldown.start() if self.isToxicPanelAvailable(): self.as_enableToxicPanelS()
def start(self): super(ArenaVehiclesPlugin, self).start() vInfo = self._arenaDP.getVehicleInfo() self.__playerVehicleID = self._arenaDP.getPlayerVehicleID() self.__isObserver = vInfo.isObserver() g_eventBus.addListener(events.GameEvent.SHOW_EXTENDED_INFO, self.__handleShowExtendedInfo, scope=EVENT_BUS_SCOPE.BATTLE) ctrl = g_sessionProvider.shared.feedback if ctrl is not None: ctrl.onMinimapVehicleAdded += self.__onMinimapVehicleAdded ctrl.onMinimapVehicleRemoved += self.__onMinimapVehicleRemoved ctrl.onMinimapFeedbackReceived += self.__onMinimapFeedbackReceived g_sessionProvider.addArenaCtrl(self) return
def show(self): g_messengerEvents.channels.onMessageReceived += self.__me_onMessageReceived g_messengerEvents.channels.onCommandReceived += self.__me_onCommandReceived g_messengerEvents.users.onUserActionReceived += self.__me_onUserActionReceived g_messengerEvents.onErrorReceived += self.__me_onErrorReceived g_settings.onUserPreferencesUpdated += self.__ms_onUserPreferencesUpdated g_settings.onColorsSchemesUpdated += self.__ms_onColorsSchemesUpdated self.__initialized = 0 self.__focused = False g_eventBus.addListener(MessengerEvent.BATTLE_CHANNEL_CTRL_INITED, self.__handleChannelControllerInited, scope=EVENT_BUS_SCOPE.BATTLE) self.__channelsCtrl = channels.BattleControllers() self.__channelsCtrl.init() self.__dynSquadMsgController = DynSquadMessagesController(self.__onDynSquadMsgReceivedCallback) g_sessionProvider.addArenaCtrl(self.__dynSquadMsgController)
def _populate(self): super(BattleMessengerView, self)._populate() self._accDbID = getAvatarDatabaseID() self.__receivers = [] self.fireEvent(ChannelManagementEvent( 0, ChannelManagementEvent.REGISTER_BATTLE, {'component': self}), scope=EVENT_BUS_SCOPE.BATTLE) self.addListener(ChannelManagementEvent.MESSAGE_FADING_ENABLED, self.__handleMessageFadingEnabled, EVENT_BUS_SCOPE.GLOBAL) self.__restoreLastReceiverInBattle() g_sessionProvider.addArenaCtrl(self) self.as_setupListS(_makeSettingsVO(self._arenaVisitor)) self._ignoreActionCooldown.start() if self.isToxicPanelAvailable(): self.as_enableToxicPanelS()
def start(self): """ Routine invokes when battle interface is created - player joined to arena. """ self.__isHasGasAttack = hasGasAttack() if self._populate(self.__ui.getMember(DAMAGE_PANEL_PATH)): self.__tankIndicator = _TankIndicatorCtrl(self.__ui) ctrl = g_sessionProvider.getVehicleStateCtrl() ctrl.onVehicleControlling += self.__onVehicleControlling ctrl.onVehicleStateUpdated += self.__onVehicleStateUpdated g_sessionProvider.addArenaCtrl(self) vehicle = ctrl.getControllingVehicle() if vehicle: self.__vehicleID = vehicle.id self._updatePlayerInfo(vehicle.id) self.__onVehicleControlling(vehicle)
def start(self): self.__arenaPeriodCtrl.startControl(weakref.proxy(g_sessionProvider.getCtx()), weakref.proxy(g_sessionProvider.arenaVisitor)) self.__arenaPeriodCtrl.setViewComponents(weakref.proxy(self), weakref.proxy(self)) g_sessionProvider.addArenaCtrl(self.__arenaPeriodCtrl)
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))
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))
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))
def _populate(self): super(BattleLoading, self)._populate() self.__addArenaTypeData() g_sessionProvider.addArenaCtrl(self)
def start(self): super(VehicleMarkerPlugin, self).start() self.__playerVehicleID = avatar_getter.getPlayerVehicleID() g_sessionProvider.addArenaCtrl(self)
def start(self): self.__arenaPeriodCtrl.setViewComponents(weakref.proxy(self), weakref.proxy(self)) g_sessionProvider.addArenaCtrl(self.__arenaPeriodCtrl)
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))