(DynamicAliases.EPIC_DRONE_MUSIC_PLAYER, )),
             (BATTLE_CTRL_ID.GAME_MESSAGES_PANEL,
              (BATTLE_VIEW_ALIASES.GAME_MESSAGES_PANEL, ))),
            ((DynamicAliases.PERIOD_MUSIC_LISTENER,
              period_music_listener.PeriodMusicListener),
             (DynamicAliases.EPIC_DRONE_MUSIC_PLAYER,
              drone_music_player.EpicDroneMusicPlayer)))


EPIC_BATTLE_CLASSIC_CONFIG = _EpicBattleComponentsConfig()
_EPIC_BATTLE_CLASSICS_COMPONENTS = EPIC_BATTLE_CLASSIC_CONFIG
_EPIC_BATTLE_EXTENDED_COMPONENTS = EPIC_BATTLE_CLASSIC_CONFIG + ComponentsConfig(
    config=((BATTLE_CTRL_ID.ARENA_PERIOD,
             (DynamicAliases.EPIC_FINISH_SOUND_PLAYER, )),
            (BATTLE_CTRL_ID.TEAM_BASES,
             (DynamicAliases.EPIC_FINISH_SOUND_PLAYER, )),
            (BATTLE_CTRL_ID.BATTLE_FIELD_CTRL,
             (DynamicAliases.EPIC_FINISH_SOUND_PLAYER, ))),
    viewsConfig=((DynamicAliases.EPIC_FINISH_SOUND_PLAYER,
                  finish_sound_player.EpicFinishSoundPlayer), ))


class PageStates(object):
    NONE = -1
    GAME = 0
    LOADING = 1
    TABSCREEN = 2
    OVERVIEWMAP = 3
    RADIAL = 4
    RESPAWN = 5
    COUNTDOWN = 6
Example #2
0
from gui.shared import EVENT_BUS_SCOPE, events
from gui.battle_control.battle_constants import BATTLE_CTRL_ID
from gui.Scaleform.genConsts.BATTLE_VIEW_ALIASES import BATTLE_VIEW_ALIASES
from gui.Scaleform.daapi.view.battle.shared import period_music_listener
from gui.Scaleform.daapi.view.battle.shared.page import ComponentsConfig
from gui.Scaleform.daapi.view.battle.shared.crosshair import CrosshairPanelContainer
from gui.Scaleform.daapi.view.battle.classic.page import ClassicPage
from gui.Scaleform.daapi.view.battle.classic.page import DynamicAliases
from gui.Scaleform.daapi.settings.views import VIEW_ALIAS
from gui.Scaleform.daapi.view.battle.event.manager import EventMarkersManager
from gui.shared.events import LoadViewEvent
from gui.Scaleform.framework.managers.loaders import SFViewLoadParams
EVENT_CONFIG = ComponentsConfig(config=((BATTLE_CTRL_ID.BATTLE_HINTS, (BATTLE_VIEW_ALIASES.BATTLE_HINT,)),
 (BATTLE_CTRL_ID.ARENA_PERIOD, (BATTLE_VIEW_ALIASES.BATTLE_TIMER,
   BATTLE_VIEW_ALIASES.PREBATTLE_TIMER,
   BATTLE_VIEW_ALIASES.BATTLE_END_WARNING_PANEL,
   DynamicAliases.PERIOD_MUSIC_LISTENER)),
 (BATTLE_CTRL_ID.CALLOUT, (BATTLE_VIEW_ALIASES.CALLOUT_PANEL,)),
 (BATTLE_CTRL_ID.DEBUG, (BATTLE_VIEW_ALIASES.DEBUG_PANEL,)),
 (BATTLE_CTRL_ID.MAPS, (BATTLE_VIEW_ALIASES.MINIMAP,))), viewsConfig=((DynamicAliases.PERIOD_MUSIC_LISTENER, period_music_listener.PeriodMusicListener),))
_TUTORIAL_PAGES = ('eventHint1', 'eventHint2')
_EVENT_EXTERNAL_COMPONENTS = (CrosshairPanelContainer, EventMarkersManager)

class EventBattlePage(ClassicPage):

    def __init__(self, components=None, external=_EVENT_EXTERNAL_COMPONENTS, fullStatsAlias=None):
        components = EVENT_CONFIG if not components else components + EVENT_CONFIG
        self.__isRadialMenuShown = False
        super(EventBattlePage, self).__init__(components=components, external=external, fullStatsAlias=fullStatsAlias)

    def _populate(self):
        super(EventBattlePage, self)._populate()
Example #3
0
    def setDistanceToObject(self, objectID, distance):
        if objectID in self.__objects:
            self._invokeMarker(self.__objects[objectID], 'setDistance',
                               distance)


class TutorialMarkersManager(MarkersManager):
    def _setupPlugins(self, arenaVisitor):
        setup = super(TutorialMarkersManager, self)._setupPlugins(arenaVisitor)
        setup['tutorial'] = TutorialStaticObjectsPlugin
        return setup


_TUTORIAL_COMPONENTS_CONFIG = ComponentsConfig(
    ((BATTLE_CTRL_ID.ARENA_PERIOD, (BATTLE_VIEW_ALIASES.BATTLE_TIMER,
                                    BATTLE_VIEW_ALIASES.PREBATTLE_TIMER)),
     (BATTLE_CTRL_ID.GAME_MESSAGES_PANEL,
      (BATTLE_VIEW_ALIASES.GAME_MESSAGES_PANEL, ))))
_TUTORIAL_EXTERNAL_COMPONENTS = (CrosshairPanelContainer,
                                 TutorialMarkersManager)


class TutorialPage(SharedPage):
    def __init__(self):
        super(TutorialPage,
              self).__init__(components=_TUTORIAL_COMPONENTS_CONFIG,
                             external=_TUTORIAL_EXTERNAL_COMPONENTS)

    def _onBattleLoadingStart(self):
        self._blToggling = set(self.as_getComponentsVisibilityS())
        self._blToggling.difference_update(
Example #4
0
    def __init__(self):
        super(_ClassicComponentsConfig, self).__init__(((BATTLE_CTRL_ID.ARENA_PERIOD, (BATTLE_VIEW_ALIASES.BATTLE_TIMER,
           BATTLE_VIEW_ALIASES.PREBATTLE_TIMER,
           BATTLE_VIEW_ALIASES.PLAYERS_PANEL,
           BATTLE_VIEW_ALIASES.BATTLE_END_WARNING_PANEL,
           DynamicAliases.DRONE_MUSIC_PLAYER,
           DynamicAliases.PERIOD_MUSIC_LISTENER)),
         (BATTLE_CTRL_ID.TEAM_BASES, (BATTLE_VIEW_ALIASES.TEAM_BASES_PANEL, DynamicAliases.DRONE_MUSIC_PLAYER)),
         (BATTLE_CTRL_ID.DEBUG, (BATTLE_VIEW_ALIASES.DEBUG_PANEL,)),
         (BATTLE_CTRL_ID.BATTLE_FIELD_CTRL, (DynamicAliases.DRONE_MUSIC_PLAYER,)),
         (BATTLE_CTRL_ID.ARENA_LOAD_PROGRESS, (DynamicAliases.DRONE_MUSIC_PLAYER,)),
         (BATTLE_CTRL_ID.GAME_MESSAGES_PANEL, (BATTLE_VIEW_ALIASES.GAME_MESSAGES_PANEL,))), ((DynamicAliases.PERIOD_MUSIC_LISTENER, lambda : period_music_listener.PeriodMusicListener()), (DynamicAliases.DRONE_MUSIC_PLAYER, lambda : drone_music_player.DroneMusicPlayer())))


COMMON_CLASSIC_CONFIG = _ClassicComponentsConfig()
EXTENDED_CLASSIC_CONFIG = COMMON_CLASSIC_CONFIG + ComponentsConfig(config=((BATTLE_CTRL_ID.ARENA_PERIOD, (DynamicAliases.FINISH_SOUND_PLAYER,)), (BATTLE_CTRL_ID.TEAM_BASES, (DynamicAliases.FINISH_SOUND_PLAYER,)), (BATTLE_CTRL_ID.BATTLE_FIELD_CTRL, (DynamicAliases.FINISH_SOUND_PLAYER,))), viewsConfig=((DynamicAliases.FINISH_SOUND_PLAYER, lambda : finish_sound_player.FinishSoundPlayer()),))

class ClassicPage(SharedPage):

    def __init__(self, components = None, external = None, fullStatsAlias = BATTLE_VIEW_ALIASES.FULL_STATS):
        self._fullStatsAlias = fullStatsAlias
        if components is None:
            components = COMMON_CLASSIC_CONFIG if self.sessionProvider.isReplayPlaying else EXTENDED_CLASSIC_CONFIG
        super(ClassicPage, self).__init__(components=components, external=external)
        return

    def __del__(self):
        LOG_DEBUG('ClassicPage is deleted')

    def _toggleRadialMenu(self, isShown):
        manager = self.app.containerManager
Example #5
0
from helpers import i18n
from messenger.gui import events_dispatcher as msg_events_dispatcher

_COMPONENTS_HIDE_DONT_REVEAL = {BATTLE_VIEW_ALIASES.RADIAL_MENU}
_COMPONENTS_HIDE_WHEN_RESPAWN = {
    BATTLE_VIEW_ALIASES.FALLOUT_CONSUMABLES_PANEL,
    BATTLE_VIEW_ALIASES.DAMAGE_PANEL
}
_COMPONENTS_SHOW_WHEN_RESPAWN = {BATTLE_VIEW_ALIASES.FALLOUT_RESPAWN_VIEW}
_PERMANENT_COMPONENTS = {
    BATTLE_VIEW_ALIASES.DEBUG_PANEL, BATTLE_VIEW_ALIASES.FALLOUT_SCORE_PANEL,
    BATTLE_VIEW_ALIASES.BATTLE_TIMER
}
_FALLOUT_COMPONENTS_CONFIG = ComponentsConfig(
    ((BATTLE_CTRL_ID.ARENA_PERIOD, (BATTLE_VIEW_ALIASES.BATTLE_TIMER,
                                    BATTLE_VIEW_ALIASES.PREBATTLE_TIMER)),
     (BATTLE_CTRL_ID.DEBUG, (BATTLE_VIEW_ALIASES.DEBUG_PANEL, )),
     (BATTLE_CTRL_ID.RESPAWN, (BATTLE_VIEW_ALIASES.FALLOUT_RESPAWN_VIEW, )),
     (BATTLE_CTRL_ID.FLAG_NOTS, (BATTLE_VIEW_ALIASES.FLAG_NOTIFICATION, ))))
_VEHICLE_STATE_HANDLERS = {
    VEHICLE_VIEW_STATE.DESTROYED: '_updateDestroyed',
    VEHICLE_VIEW_STATE.SWITCHING: '_switching'
}
_FALLOUT_EXTERNAL_COMPONENTS = (crosshair.CrosshairPanelContainer,
                                markers2d.FalloutMarkersManager)


class FalloutBasePage(FalloutBattlePageMeta):
    def __init__(self,
                 components=_FALLOUT_COMPONENTS_CONFIG,
                 external=_FALLOUT_EXTERNAL_COMPONENTS,
                 fullStatsAlias=''):
            self._invokeMarker(self.__objects[objectID], 'setDistance',
                               distance)


class TutorialMarkersManager(MarkersManager):
    def _setupPlugins(self, arenaVisitor):
        setup = super(TutorialMarkersManager, self)._setupPlugins(arenaVisitor)
        setup['tutorial'] = TutorialStaticObjectsPlugin
        return setup


_TUTORIAL_COMPONENTS_CONFIG = ComponentsConfig(
    config=((BATTLE_CTRL_ID.ARENA_PERIOD,
             (BATTLE_VIEW_ALIASES.BATTLE_TIMER,
              BATTLE_VIEW_ALIASES.PREBATTLE_TIMER,
              DynamicAliases.PREBATTLE_TIMER_SOUND_PLAYER)),
            (BATTLE_CTRL_ID.GAME_MESSAGES_PANEL,
             (BATTLE_VIEW_ALIASES.GAME_MESSAGES_PANEL, ))),
    viewsConfig=((DynamicAliases.PREBATTLE_TIMER_SOUND_PLAYER,
                  StartCountdownSoundPlayer), ))
_TUTORIAL_EXTERNAL_COMPONENTS = (CrosshairPanelContainer,
                                 TutorialMarkersManager)


class TutorialPage(SharedPage):
    def __init__(self):
        super(TutorialPage,
              self).__init__(components=_TUTORIAL_COMPONENTS_CONFIG,
                             external=_TUTORIAL_EXTERNAL_COMPONENTS)

    def _onBattleLoadingStart(self):
Example #7
0

MAPS_TRAINING_CONFIG = ComponentsConfig(
    config=((BATTLE_CTRL_ID.ARENA_PERIOD,
             (BATTLE_VIEW_ALIASES.BATTLE_TIMER,
              BATTLE_VIEW_ALIASES.PREBATTLE_TIMER,
              DynamicAliases.PREBATTLE_TIMER_SOUND_PLAYER,
              DynamicAliases.TIME_NOTIFIER, BATTLE_VIEW_ALIASES.HINT_PANEL,
              DynamicAliases.DRONE_MUSIC_PLAYER,
              DynamicAliases.FINISH_SOUND_PLAYER)),
            (BATTLE_CTRL_ID.CALLOUT, (BATTLE_VIEW_ALIASES.CALLOUT_PANEL, )),
            (BATTLE_CTRL_ID.MAPS, (BATTLE_VIEW_ALIASES.MINIMAP, )),
            (BATTLE_CTRL_ID.DEBUG, (BATTLE_VIEW_ALIASES.DEBUG_PANEL, )),
            (BATTLE_CTRL_ID.BATTLE_FIELD_CTRL,
             (DynamicAliases.DRONE_MUSIC_PLAYER,
              DynamicAliases.FINISH_SOUND_PLAYER)),
            (BATTLE_CTRL_ID.ARENA_LOAD_PROGRESS,
             (DynamicAliases.DRONE_MUSIC_PLAYER, )),
            (BATTLE_CTRL_ID.GAME_MESSAGES_PANEL,
             (BATTLE_VIEW_ALIASES.GAME_MESSAGES_PANEL, )),
            (BATTLE_CTRL_ID.BATTLE_HINTS,
             (BATTLE_VIEW_ALIASES.MAPS_TRAINING_GOALS, ))),
    viewsConfig=((DynamicAliases.DRONE_MUSIC_PLAYER,
                  drone_music_player.DroneMusicPlayer),
                 (DynamicAliases.PREBATTLE_TIMER_SOUND_PLAYER,
                  StartCountdownSoundPlayer),
                 (DynamicAliases.FINISH_SOUND_PLAYER,
                  finish_sound_player.FinishSoundPlayer),
                 (DynamicAliases.TIME_NOTIFIER,
                  arena_time_notificator.MapsTrainingArenaTimeNotificator)))
_MAPS_TRAINING_EXTERNAL_COMPONENTS = (CrosshairPanelContainer,
                                      markers2d.MapsTrainingMarkersManager)
from adisp import process
from PlayerEvents import g_playerEvents
from frameworks.wulf import WindowLayer
from gui.shared import EVENT_BUS_SCOPE, events
from gui.battle_control.battle_constants import BATTLE_CTRL_ID
from gui.Scaleform.genConsts.BATTLE_VIEW_ALIASES import BATTLE_VIEW_ALIASES
from gui.Scaleform.daapi.view.battle.shared.page import ComponentsConfig
from gui.Scaleform.daapi.view.battle.shared.crosshair import CrosshairPanelContainer
from gui.Scaleform.daapi.view.battle.classic.page import ClassicPage
from gui.Scaleform.daapi.settings.views import VIEW_ALIAS
from gui.Scaleform.daapi.view.battle.event.manager import EventMarkersManager
from gui.shared.events import LoadViewEvent
from gui.Scaleform.framework.managers.loaders import SFViewLoadParams
EVENT_CONFIG = ComponentsConfig(config=((BATTLE_CTRL_ID.BATTLE_HINTS, (BATTLE_VIEW_ALIASES.BATTLE_HINT,)),
 (BATTLE_CTRL_ID.ARENA_PERIOD, (BATTLE_VIEW_ALIASES.BATTLE_TIMER, BATTLE_VIEW_ALIASES.PREBATTLE_TIMER, BATTLE_VIEW_ALIASES.BATTLE_END_WARNING_PANEL)),
 (BATTLE_CTRL_ID.CALLOUT, (BATTLE_VIEW_ALIASES.CALLOUT_PANEL,)),
 (BATTLE_CTRL_ID.DEBUG, (BATTLE_VIEW_ALIASES.DEBUG_PANEL,)),
 (BATTLE_CTRL_ID.MAPS, (BATTLE_VIEW_ALIASES.MINIMAP,))), viewsConfig=())
_TUTORIAL_PAGES = ('eventHint1', 'eventHint2')
_EVENT_EXTERNAL_COMPONENTS = (CrosshairPanelContainer, EventMarkersManager)

class EventBattlePage(ClassicPage):

    def __init__(self, components=None, external=_EVENT_EXTERNAL_COMPONENTS, fullStatsAlias=None):
        components = EVENT_CONFIG if not components else components + EVENT_CONFIG
        self.__isRadialMenuShown = False
        super(EventBattlePage, self).__init__(components=components, external=external, fullStatsAlias=fullStatsAlias)

    def _populate(self):
        super(EventBattlePage, self)._populate()
        self.addListener(events.GameEvent.EVENT_STATS, self.__handleToggleEventStats, scope=EVENT_BUS_SCOPE.BATTLE)