Beispiel #1
0
 def populate(self):
     super(_FalloutScorePanel, self)._populate(self._proxy.getMember(FALLOUT_SCORE_PANEL))
     g_settingsCore.onSettingsChanged += self.__onSettingsChanged
     arenaType = getArenaType()
     if arenaType is not None:
         self._maxScore = win_points.g_cache[getArenaType().winPoints].pointsCAP
     self.as_initWarningValue(self.WARNING_RATIO * self._maxScore)
     self._makeData()
 def _addArenaExtraData(self, arenaDP):
     winText = text_styles.main(FALLOUT.BATTLELOADING_MULTITEAM_WINTEXT)
     arenaInfoData = {'mapName': toUpper(arena_info.getArenaType().name),
      'battleTypeLocaleStr': '#menu:loading/battleTypes/%d' % arena_info.getArenaGuiType(),
      'winText': winText,
      'battleTypeFrameLabel': arena_info.getArenaGuiTypeLabel()}
     self.as_setArenaInfoS(arenaInfoData)
 def _setTipsInfo(self):
     arena = arena_info.getClientArena()
     arenaDP = self._battleCtx.getArenaDP()
     if arena_info.hasResourcePoints():
         bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTRESOURCEPOINTSEVENT
     elif arena_info.hasFlags():
         bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTFLAGSEVENT
     else:
         bgUrl = ''
     if self.__isFallout:
         self.as_setEventInfoPanelDataS({'bgUrl': bgUrl,
          'items': getHelpTextAsDicts(arena_info.getArenaType())})
         self.as_setVisualTipInfoS(self.__makeVisualTipVO(arenaDP, arena))
     elif not self.__isTipInited:
         battlesCount = DEFAULT_BATTLES_COUNT
         if g_lobbyContext.getBattlesCount() is not None:
             battlesCount = g_lobbyContext.getBattlesCount()
         classTag, vLvl, nation = arenaDP.getVehicleInfo().getTypeInfo()
         criteria = tips.getTipsCriteria(arena)
         criteria.setBattleCount(battlesCount)
         criteria.setClassTag(classTag)
         criteria.setLevel(vLvl)
         criteria.setNation(nation)
         tip = criteria.find()
         self.as_setTipTitleS(text_styles.highTitle(tip.status))
         self.as_setTipS(text_styles.playerOnline(tip.body))
         self.as_setVisualTipInfoS(self.__makeVisualTipVO(arenaDP, arena, tip))
         self.__isTipInited = True
     return
Beispiel #4
0
 def __init__(self, ui = None, isEvent = False):
     super(TimersBar, self).__init__()
     arenaType = arena_info.getArenaType()
     self.__ui = ui
     self.__isTicking = False
     self.__state = COUNTDOWN_STATE.STOP
     self.__roundLength = arenaType.roundLength
     self.__endingSoonTime = arenaType.battleEndingSoonTime
     self.__endWarningIsEnabled = self.__checkEndWarningStatus()
     if isEvent or self.__endWarningIsEnabled:
         timerPath = 'eventBattleTimer.swf'
         _g_sound.playSound2D(_SOUNDS.STOP_TICKING)
     else:
         timerPath = 'BattleTimer.swf'
     self.__ui.movie.loadTimer(timerPath)
Beispiel #5
0
 def __init__(self, ui = None, isEvent = False):
     super(TimersBar, self).__init__()
     arenaType = arena_info.getArenaType()
     self.__ui = ui
     self.__isTicking = False
     self.__state = COUNTDOWN_STATE.STOP
     self.__roundLength = arenaType.roundLength
     self.__endingSoonTime = arenaType.battleEndingSoonTime
     self.__endWarningIsEnabled = self.__checkEndWarningStatus()
     if isEvent or self.__endWarningIsEnabled:
         timerPath = 'eventBattleTimer.swf'
         _g_sound.playSound2D(_SOUNDS.STOP_TICKING)
     else:
         timerPath = 'BattleTimer.swf'
     self.__ui.movie.loadTimer(timerPath)
Beispiel #6
0
    def find(self):
        playerBaseYPos = enemyBaseYPos = 0
        arenaDP = g_sessionProvider.getCtx().getArenaDP()
        playerTeam = 1
        if arenaDP:
            playerTeam = arenaDP.getNumberOfTeam()
        positions = arena_info.getTeamBasePositions()
        for team, position, number in positions:
            if team == playerTeam:
                playerBaseYPos = position[2]
            else:
                enemyBaseYPos = position[2]

        geometryNames = ('100_thepit', '10_hills')
        geometryIndex = 0
        positionIndex = 0
        type = arena_info.getArenaType()
        if type is not None:
            geometryIndex = geometryNames.index(type.geometryName)
            positionIndex = 0 if playerBaseYPos < enemyBaseYPos else 1
        return _FoundTip(i18n.makeString('#tips:howToPlay'), i18n.makeString('#tips:sandbox%s' % geometryIndex), TIPS_IMAGE_SOURCE % ('sandbox' + str(geometryIndex) + str(positionIndex)))
 def _setTipsInfo(self):
     self.as_setEventInfoPanelDataS({'bgUrl': RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTFLAGSEVENT,
      'items': getHelpTextAsDicts(arena_info.getArenaType())})
 def _addArenaTypeData(self):
     arenaType = arena_info.getArenaType()
     if arenaType:
         self.as_setMapIconS(BattleLoading.SMALL_MAP_SOURCE % arenaType.geometryName)
     BigWorld.wg_setGUIBackground(arena_info.getArenaIcon(BattleLoading.MAP_BG_SOURCE))
Beispiel #9
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 = isFalloutMultiTeam()
     isFallout = isFalloutBattle()
     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.__debugPanel = DebugPanel()
     self.__timersBar = TimersBar(self.proxy, isFallout)
     if battleEndWarningEnabled():
         self.__battleEndWarningPanel = BattleEndWarningPanel(self.proxy, getArenaType())
     else:
         self.__battleEndWarningPanel = BattleEndWarningEmptyObject(self.proxy, getArenaType())
     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)
     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])
     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
     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 _addArenaTypeData(self):
     arenaType = arena_info.getArenaType()
     if arenaType is not None:
         self.as_setMapIconS(SMALL_MAP_IMAGE_SF_PATH % arenaType.geometryName)
     BigWorld.wg_setGUIBackground(self._battleCtx.getArenaScreenIcon())
     return