Example #1
0
 public void RefreshStashModeCheckBox()
 {
     if (Service.Get <BaseLayoutToolController>().IsQuickStashModeEnabled)
     {
         this.stashModeCheck.Visible = true;
         BuildingController buildingController = Service.Get <BuildingController>();
         buildingController.EnsureLoweredLiftedBuilding();
         buildingController.EnsureDeselectSelectedBuilding();
     }
     else
     {
         this.stashModeCheck.Visible = false;
     }
     this.stashModeTable.RepositionItems();
     this.RefreshInstructionLabel();
 }
Example #2
0
 private void OnConfirmUnstashStamp(bool accept)
 {
     if (this.buildingSelector.SelectedBuilding != null)
     {
         string                   uid = this.buildingSelector.SelectedBuilding.Get <BuildingComponent>().BuildingType.Uid;
         BuildingController       buildingController       = Service.BuildingController;
         BaseLayoutToolController baseLayoutToolController = Service.BaseLayoutToolController;
         UXController             uXController             = Service.UXController;
         if (!accept)
         {
             this.EnsureLoweredLiftedBuilding();
             baseLayoutToolController.StashBuilding(this.buildingSelector.SelectedBuilding);
             buildingController.EnsureDeselectSelectedBuilding();
             this.buildingController.DisableUnstashStampingState();
             uXController.HUD.BaseLayoutToolView.RefreshStashedBuildingCount(uid);
             return;
         }
         baseLayoutToolController.StampUnstashBuildingByUID(uid);
         uXController.HUD.BaseLayoutToolView.RefreshStashedBuildingCount(uid);
         uXController.HUD.ShowContextButtons(buildingController.SelectedBuilding);
     }
 }
Example #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();
        }