def __onRoundFinished(self, winnerTeam, reason): if BattleReplay.g_replayCtrl.isPlaying: return else: g_bootcampEvents.onUIStateChanged(UI_STATE.STOP) gui_event_dispatcher.toggleGUIVisibility() from gui.Scaleform.daapi.settings.views import VIEW_ALIAS from gui.shared import events, g_eventBus, EVENT_BUS_SCOPE asBattleResultType = BOOTCAMP_BATTLE_RESULT_MESSAGE.DEFEAT if winnerTeam == BigWorld.player().team: asBattleResultType = BOOTCAMP_BATTLE_RESULT_MESSAGE.VICTORY elif winnerTeam == 0: asBattleResultType = BOOTCAMP_BATTLE_RESULT_MESSAGE.DRAW g_bootcamp.setBattleResults(BigWorld.player().arenaUniqueID, asBattleResultType, reason) LOG_DEBUG('Show battle result final message.') g_eventBus.handleEvent( events.LoadViewEvent( VIEW_ALIAS.BOOTCAMP_BATTLE_FINISHED_WINDOW, None), EVENT_BUS_SCOPE.BATTLE) if asBattleResultType == BOOTCAMP_BATTLE_RESULT_MESSAGE.VICTORY: SoundGroups.g_instance.playSound2D('vo_bc_victory') elif asBattleResultType == BOOTCAMP_BATTLE_RESULT_MESSAGE.DEFEAT: SoundGroups.g_instance.playSound2D('vo_bc_defeat') elif asBattleResultType == BOOTCAMP_BATTLE_RESULT_MESSAGE.DRAW: SoundGroups.g_instance.playSound2D('vo_bc_draw') return
def __onCameraChanged(self, cameraName, currentVehicleId=None): if cameraName == 'sniper': if not g_bootcamp.isSniperModeUsed(): camera = BigWorld.player().inputHandler.ctrl.camera camera.setMaxZoom() g_bootcamp.setSniperModeUsed(True) elif cameraName == 'postmortem': g_bootcampEvents.onUIStateChanged(UI_STATE.STOP)
def __onAvatarBecomeNonPlayer(self): player = BigWorld.player() if player is not None and player.inputHandler is not None: player.inputHandler.onCameraChanged -= self.__onCameraChanged g_bootcampEvents.onUIStateChanged(UI_STATE.STOP) self.__avatar = None self.stopScenery() return
def __onRoundFinished(self, winnerTeam, reason): if BattleReplay.g_replayCtrl.isPlaying: return g_bootcampEvents.onUIStateChanged(UI_STATE.STOP) g_bootcampEvents.hideGUIForWinMessage() asBattleResultType = BOOTCAMP_BATTLE_RESULT_MESSAGE.DEFEAT if winnerTeam == BigWorld.player().team: asBattleResultType = BOOTCAMP_BATTLE_RESULT_MESSAGE.VICTORY elif winnerTeam == 0: asBattleResultType = BOOTCAMP_BATTLE_RESULT_MESSAGE.DRAW g_bootcamp.setBattleResults(BigWorld.player().arenaUniqueID, asBattleResultType, reason)
def onKickedFromArena(self, reasonCode): arenaID = BigWorld.player().arenaUniqueID g_bootcamp.setBattleResults(arenaID, BOOTCAMP_BATTLE_RESULT_MESSAGE.FAILURE, reasonCode) g_bootcampEvents.onUIStateChanged(UI_STATE.STOP)
def _populate(self): g_bootcampEvents.onUIStateChanged(UI_STATE.INIT) super(BCBattlePageMeta, self)._populate() g_bootcampEvents.onBattleComponentVisibility += self.__onComponentVisibilityEvent g_playerEvents.onArenaPeriodChange += self.__onArenaPeriodChange