Ejemplo n.º 1
0
 def __init__(self, appNS):
     self.__ns = appNS
     self.__soundManager = None
     self.__arena = BigWorld.player().arena
     self.__plugins = PluginsCollection(self)
     plugins = {}
     if hasFlags():
         plugins['flagNotification'] = FlagNotificationPlugin
     if hasRespawns() and not BattleReplay.g_replayCtrl.isPlaying:
         plugins['respawnView'] = RespawnViewPlugin
     if hasResourcePoints():
         plugins['resources'] = ResourcePointsPlugin
     self.__plugins.addPlugins(plugins)
     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)
Ejemplo n.º 2
0
    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
 def __init__(self):
     super(CrosshairPanelContainer, self).__init__(ExternalFlashSettings(BATTLE_VIEW_ALIASES.CROSSHAIR_PANEL, settings.CROSSHAIR_CONTAINER_SWF, settings.CROSSHAIR_ROOT_PATH, settings.CROSSHAIR_INIT_CALLBACK))
     self.__plugins = PluginsCollection(self)
     self.__plugins.addPlugins(plugins.createPlugins())
     self.__gunMarkers = None
     self.__viewID = CROSSHAIR_VIEW_ID.UNDEFINED
     self.__zoomFactor = 0.0
     self.__scale = 1.0
     self.__distance = 0
     self.__hasAmmo = True
     return
Ejemplo n.º 4
0
 def __init__(self, parentUI):
     self.__ui = parentUI
     self.__flashObject = None
     self.__cds = [None] * PANEL_MAX_LENGTH
     self.__mask = 0
     self.__keys = {}
     self.__currentOrderIdx = -1
     self.__plugins = PluginsCollection(self)
     plugins = {}
     if hasRage():
         plugins['rageBar'] = _RageBarPlugin
     self.__plugins.addPlugins(plugins)
Ejemplo n.º 5
0
 def __init__(self):
     super(CrosshairPanel, self).__init__('crosshairPanel.swf', className=_CROSSHAIR_PANEL_COMPONENT, path=SCALEFORM_SWF_PATH_V3)
     self.__plugins = PluginsCollection(self)
     self.__plugins.addPlugins({'core': CorePlugin,
      'settings': SettingsPlugin,
      'events': EventBusPlugin,
      'ammo': AmmoPlugin,
      'vehicleState': VehicleStatePlugin,
      'targetDistance': TargetDistancePlugin,
      'gunMarkerDistance': GunMarkerDistancePlugin})
     self.__viewID = CROSSHAIR_VIEW_ID.UNDEFINED
     self.__zoomFactor = 0.0
     self.__distance = 0
     self.__hasAmmo = True
     self.__configure()
     self.__daapiBridge = DAAPIRootBridge(rootPath='root.g_modeMC', initCallback='registerCrosshairPanel')
     self.__daapiBridge.setPyScript(weakref.proxy(self))
Ejemplo n.º 6
0
def createPlugins(manager):
    if not isinstance(manager, IMarkersManager):
        raise AssertionError('Class of manager must extends IMarkersManager')
        visitor = g_sessionProvider.arenaVisitor
        setup = {'equipments': EquipmentsMarkerPlugin}
        if visitor.hasFlags():
            setup['vehicles_flags'] = VehicleAndFlagsMarkerPlugin
            setup['absorption'] = AbsorptionMarkersPlugin
        elif visitor.hasRespawns():
            setup['vehicles'] = RespawnableVehicleMarkerPlugin
        else:
            setup['vehicles'] = VehicleMarkerPlugin
        if visitor.hasRepairPoints():
            setup['repairs'] = RepairsMarkerPlugin
        if visitor.hasResourcePoints():
            setup['resources'] = ResourceMarkerPlugin
        setup['safe_zone'] = visitor.hasGasAttack() and GasAttackSafeZonePlugin
    plugins = PluginsCollection(manager)
    plugins.addPlugins(setup)
    return plugins
Ejemplo n.º 7
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 = {}
Ejemplo n.º 8
0
 def __createPlugins(self, arenaVisitor):
     setup = self._setupPlugins(arenaVisitor)
     self.__plugins = PluginsCollection(self)
     self.__plugins.addPlugins(setup)
     self.__plugins.init()
     self.__plugins.start()