def __init__(self, cmProxy, ctx=None): self.__denunciator = BattleDenunciator() g_eventBus.addListener(events.GameEvent.HIDE_CURSOR, self.__handleHideCursor, EVENT_BUS_SCOPE.GLOBAL) super(PlayerMenuHandler, self).__init__(cmProxy, ctx=ctx, handlers=_OPTIONS_HANDLERS)
def __init__(self, appNS): self.__ns = appNS self.__isVisible = True self.__soundManager = None self.__arena = BigWorld.player().arena self.__crosshairPanel = None components = _COMPONENTS_TO_CTRLS[:] self.__plugins = PluginsCollection(self) plugins = {} visitor = g_sessionProvider.arenaVisitor if visitor.hasFlags(): components.append( (BATTLE_CTRL_ID.FLAG_NOTS, ('fallout/flagsNots', ))) plugins['flagNotification'] = FlagNotificationPlugin if visitor.hasRepairPoints(): plugins['repairTimer'] = RepairTimerPlugin if visitor.hasRespawns() and (constants.IS_DEVELOPMENT or not BattleReplay.g_replayCtrl.isPlaying): components.append((BATTLE_CTRL_ID.RESPAWN, ('fallout/respawn', ))) plugins['respawnView'] = RespawnViewPlugin if visitor.hasResourcePoints(): plugins['resources'] = ResourcePointsPlugin if visitor.hasGasAttack(): components.append( (BATTLE_CTRL_ID.GAS_ATTACK, ('fallout/gasAttack', ))) plugins['gasAttack'] = GasAttackPlugin g_sessionProvider.registerViewComponents(*components) self.__plugins.addPlugins(plugins) self.__denunciator = BattleDenunciator() self.__timerSounds = {} for timer, sounds in self.VEHICLE_DEATHZONE_TIMER_SOUND.iteritems(): self.__timerSounds[timer] = {} for level, sound in sounds.iteritems(): self.__timerSounds[timer][ level] = SoundGroups.g_instance.getSound2D(sound) self.__timerSound = None BattleWindow.__init__(self, 'battle.swf') self.__isHelpWindowShown = False self.__cameraMode = None self.component.wg_inputKeyMode = 1 self.component.position.z = DEPTH_OF_Battle self.movie.backgroundAlpha = 0 self.addFsCallbacks({'battle.leave': self.onExitBattle}) self.addExternalCallbacks({ 'battle.showCursor': self.cursorVisibility, 'battle.tryLeaveRequest': self.tryLeaveRequest, 'battle.populateFragCorrelationBar': self.populateFragCorrelationBar, 'Battle.UsersRoster.Appeal': self.onDenunciationReceived, 'Battle.selectPlayer': self.selectPlayer, 'battle.helpDialogOpenStatus': self.helpDialogOpenStatus, 'battle.initLobbyDialog': self._initLobbyDialog, 'battle.reportBug': self.reportBug }) self.__dynSquadListener = None BigWorld.wg_setRedefineKeysMode(False) self.onPostmortemVehicleChanged(BigWorld.player().playerVehicleID) return