def _populate(self): super(BCOutroVideoPage, self)._populate() g_appLoader.detachCursor(APP_NAME_SPACE.SF_LOBBY) if self.__movieFiles: self.__showNextMovie() else: self.__onFinish()
def start(self): g_guiResetters.add(self.__onRecreateDevice) import aims aims.clearState() self.__identifySPG() for control in self.__ctrls.itervalues(): control.create() self.__addBattleCtrlListeners() g_appLoader.detachCursor(settings.APP_NAME_SPACE.SF_BATTLE) if not self.__curCtrl.isManualBind(): BigWorld.player().positionControl.bindToVehicle(True) self.__curCtrl.enable(ctrlState=control_modes.dumpStateEmpty()) self.onCameraChanged('arcade') tmp = self.__curCtrl.getPreferredAutorotationMode() if tmp is not None: self.__isAutorotation = tmp self.__prevModeAutorotation = True else: self.__isAutorotation = True self.__prevModeAutorotation = None BigWorld.player().enableOwnVehicleAutorotation(self.__isAutorotation) self.__targeting.enable(True) self.__isStarted = True self.__isGUIVisible = True self.__killerVehicleID = None arena = BigWorld.player().arena arena.onPeriodChange += self.__onArenaStarted from account_helpers.settings_core.SettingsCore import g_settingsCore g_settingsCore.onSettingsChanged += self.__onSettingsChanged BigWorld.player().consistentMatrices.onVehicleMatrixBindingChanged += self.__onVehicleChanged self.__onArenaStarted(arena.period) return
def _dispose(self): g_playerEvents.onDisconnected -= self.__onDisconnected for highlightType in (INTRO_HIGHLIGHT_TYPE.ARROWS, INTRO_HIGHLIGHT_TYPE.START_BUTTON): if self._isCurrentlyHighlighting(highlightType): self._setHighlighting(highlightType, False) g_appLoader.detachCursor(APP_NAME_SPACE.SF_BATTLE) super(BCIntroPage, self)._dispose()
def _dispose(self): for highlightType in (INTRO_HIGHLIGHT_TYPE.ARROWS, INTRO_HIGHLIGHT_TYPE.START_BUTTON): if self.__isCurrentlyHighlighting(highlightType): self.__setHighlighting(highlightType, False) g_bootcampEvents.onIntroVideoLoaded -= self.onIntroVideoLoaded self.sessionProvider.removeArenaCtrl(self) g_appLoader.detachCursor(APP_NAME_SPACE.SF_BATTLE) super(BCIntroVideoPage, self)._dispose()
def _populate(self): super(BCOverlayFinalWindow, self)._populate() from gui.app_loader.settings import APP_NAME_SPACE from gui.app_loader import g_appLoader g_appLoader.detachCursor(APP_NAME_SPACE.SF_BATTLE) from bootcamp.Bootcamp import g_bootcamp resultType, _, resultTypeStr, _, _ = g_bootcamp.getBattleResults() from debug_utils_bootcamp import LOG_DEBUG_DEV_BOOTCAMP LOG_DEBUG_DEV_BOOTCAMP('BCOverlayFinalWindow', resultType) self.as_msgTypeHandlerS(resultType, resultTypeStr)
def _populate(self): super(BCOutroVideoPage, self)._populate() from gui.app_loader import g_appLoader from gui.app_loader.settings import APP_NAME_SPACE g_appLoader.detachCursor(APP_NAME_SPACE.SF_LOBBY) if self.__movieFiles is not None and len(self.__movieFiles): self.__showNextMovie() else: self.__onFinish() return
def __enableVideoCamera(self): playerVehicle = self.hangarSpace.space.getVehicleEntity() if playerVehicle is not None and playerVehicle.state != CameraMovementStates.ON_OBJECT: self.__enabled = False return else: self.__videoCamera.enable() g_appLoader.detachCursor(app_settings.APP_NAME_SPACE.SF_LOBBY) BigWorld.player().objectsSelectionEnabled(False) g_eventDispatcher.loadHangar() return
def detachCursor(self, isDetached, enableAiming): if not self.__isStarted: return self.__detachCount += -1 if isDetached else 1 if not self.__detachCount <= 0: raise AssertionError if self.__detachCount == -1 and isDetached: self.__targeting.enable(False) g_appLoader.attachCursor(settings.APP_NAME_SPACE.SF_BATTLE) enableAiming and self.setAimingMode(False, AIMING_MODE.USER_DISABLED) elif not self.__detachCount: self.__targeting.enable(True) g_appLoader.detachCursor(settings.APP_NAME_SPACE.SF_BATTLE)
def setForcedGuiControlMode(self, flags): result = False detached = flags & GUI_CTRL_MODE_FLAG.CURSOR_ATTACHED > 0 if detached ^ self.__isDetached: self.__isDetached = detached self.__targeting.detach(self.__isDetached) if detached: g_appLoader.attachCursor(settings.APP_NAME_SPACE.SF_BATTLE, flags=flags) result = True if flags & GUI_CTRL_MODE_FLAG.AIMING_ENABLED > 0: self.setAimingMode(False, AIMING_MODE.USER_DISABLED) else: g_appLoader.detachCursor(settings.APP_NAME_SPACE.SF_BATTLE) result = True self.__curCtrl.setForcedGuiControlMode(detached) elif detached: g_appLoader.syncCursor(settings.APP_NAME_SPACE.SF_BATTLE, flags=flags) return result
def setForcedGuiControlMode(self, flags): result = False if not self.__isStarted: return result detached = flags & GUI_CTRL_MODE_FLAG.CURSOR_ATTACHED > 0 if detached ^ self.__isDetached: self.__isDetached = detached self.__targeting.detach(self.__isDetached) if detached: g_appLoader.attachCursor(settings.APP_NAME_SPACE.SF_BATTLE, flags=flags) result = True if flags & GUI_CTRL_MODE_FLAG.AIMING_ENABLED > 0: self.setAimingMode(False, AIMING_MODE.USER_DISABLED) else: g_appLoader.detachCursor(settings.APP_NAME_SPACE.SF_BATTLE) result = True self.__curCtrl.setForcedGuiControlMode(not detached) elif detached: g_appLoader.syncCursor(settings.APP_NAME_SPACE.SF_BATTLE, flags=flags) return result
def _populate(self): super(BCOverlayFinalWindow, self)._populate() g_appLoader.detachCursor(app_settings.APP_NAME_SPACE.SF_BATTLE) battleResults = g_bootcamp.getBattleResults() LOG_DEBUG_DEV_BOOTCAMP('BCOverlayFinalWindow', battleResults.type) self.as_msgTypeHandlerS(battleResults.type, battleResults.typeStr)