コード例 #1
0
 public void OnEnter()
 {
     Service.Get <EventManager>().RegisterObserver(this, EventId.IntroComplete, EventPriority.Default);
     Service.Get <EventManager>().SendEvent(EventId.PurgeHomeStateRUFTask, null);
     this.animation = Service.Get <UXController>().Intro;
     this.animation.Start();
 }
コード例 #2
0
 private void Done()
 {
     Service.Get <EventManager>().UnregisterObserver(this, EventId.IntroComplete);
     if (this.animation != null)
     {
         this.animation = null;
         Service.Get <UXController>().Intro = null;
         Service.Get <UXController>().HUD.ConfigureControls(new HudConfig(new string[0]));
         Service.Get <UXController>().HUD.Visible = true;
         if (Service.Get <CurrentPlayer>().HasNotCompletedFirstFueStep() && GameConstants.START_FUE_IN_BATTLE_MODE)
         {
             Service.Get <GameStateMachine>().SetState(new FueBattleStartState(GameConstants.FUE_BATTLE));
             Service.Get <BattleController>().PrepareWorldForBattle();
             return;
         }
         GameServicesManager.OnReady();
         HomeState.GoToHomeState(null, true);
     }
 }
コード例 #3
0
        private void HandleBackButton()
        {
            IState currentState = Service.GameStateMachine.CurrentState;

            if (currentState is IntroCameraState)
            {
                IntroCameraAnimation intro = Service.UXController.Intro;
                if (intro != null)
                {
                    intro.FinishUp(true);
                }
                return;
            }
            for (int i = this.backButtonHandlers.Count - 1; i >= 0; i--)
            {
                if (this.backButtonHandlers[i].HandleBackButtonPress())
                {
                    return;
                }
            }
            UICamera.selectedObject = null;
            UICamera.hoveredObject  = null;
            if (TouchScreenKeyboard.visible)
            {
                return;
            }
            ScreenController screenController = null;

            if (Service.ScreenController != null)
            {
                screenController = Service.ScreenController;
                AlertScreen highestLevelScreen = screenController.GetHighestLevelScreen <AlertScreen>();
                if (highestLevelScreen != null && highestLevelScreen.IsAlwaysOnTop)
                {
                    this.HandleScreenBack(highestLevelScreen);
                    return;
                }
            }
            if (Service.HoloController != null)
            {
                HoloController holoController = Service.HoloController;
                if (holoController.HasAnyCharacter())
                {
                    Service.EventManager.SendEvent(EventId.StoryNextButtonClicked, null);
                    return;
                }
            }
            if (screenController != null)
            {
                ScreenBase     highestLevelScreen2 = screenController.GetHighestLevelScreen <ScreenBase>();
                ClosableScreen highestLevelScreen3 = screenController.GetHighestLevelScreen <ClosableScreen>();
                if (Service.CurrentPlayer.CampaignProgress.FueInProgress || Service.UserInputInhibitor.IsDenying())
                {
                    if (highestLevelScreen2 != null && highestLevelScreen2.AllowFUEBackButton && this.HandleScreenBack(highestLevelScreen2))
                    {
                        return;
                    }
                    this.TryQuit();
                    return;
                }
                else
                {
                    if (highestLevelScreen2 != null && this.HandleScreenBack(highestLevelScreen2))
                    {
                        return;
                    }
                    if (highestLevelScreen3 != null && this.HandleScreenBack(highestLevelScreen3))
                    {
                        return;
                    }
                }
            }
            if (currentState is EditBaseState)
            {
                HomeState.GoToHomeState(null, false);
                return;
            }
            if (Service.BuildingController != null)
            {
                BuildingController buildingController = Service.BuildingController;
                if (buildingController.SelectedBuilding != null)
                {
                    buildingController.EnsureDeselectSelectedBuilding();
                    return;
                }
            }
            if (currentState is BaseLayoutToolState)
            {
                UXController uXController = Service.UXController;
                uXController.HUD.BaseLayoutToolView.CancelBaseLayoutTool();
                return;
            }
            if (Service.GalaxyViewController != null && currentState is GalaxyState)
            {
                GalaxyViewController galaxyViewController = Service.GalaxyViewController;
                galaxyViewController.GoToHome();
                return;
            }
            this.TryQuit();
        }