public static ClosableScreen GetDeployableInfoParentScreen() { ScreenController screenController = Service.ScreenController; ClosableScreen highestLevelScreen = screenController.GetHighestLevelScreen <BuildingInfoScreen>(); if (highestLevelScreen != null) { return(highestLevelScreen); } highestLevelScreen = screenController.GetHighestLevelScreen <TroopTrainingScreen>(); if (highestLevelScreen != null) { return(highestLevelScreen); } highestLevelScreen = screenController.GetHighestLevelScreen <TroopUpgradeScreen>(); if (highestLevelScreen != null) { return(highestLevelScreen); } highestLevelScreen = screenController.GetHighestLevelScreen <PrizeInventoryScreen>(); if (highestLevelScreen != null) { return(highestLevelScreen); } return(null); }
private void UpdateParticleEffectVisibility() { ScreenController screenController = Service.ScreenController; MiscElementsManager miscElementsManager = Service.UXController.MiscElementsManager; SquadSlidingScreen highestLevelScreen = screenController.GetHighestLevelScreen <SquadSlidingScreen>(); bool effectsVisible = !miscElementsManager.IsHudFactionIconTooltipVisible() && screenController.GetHighestLevelScreen <EpisodeInfoScreen>() == null && screenController.GetHighestLevelScreen <InventoryCrateCollectionScreen>() == null && screenController.GetHighestLevelScreen <PrizeInventoryScreen>() == null && screenController.GetHighestLevelScreen <SquadJoinScreen>() == null && (highestLevelScreen == null || !highestLevelScreen.IsOpen()); this.UpdateParticleEffectVisibility(effectsVisible); }
public override void Execute() { base.Execute(); ScreenController screenController = Service.Get <ScreenController>(); UXController uXController = Service.Get <UXController>(); ScreenBase highestLevelScreen = screenController.GetHighestLevelScreen <ClosableScreen>(); if (highestLevelScreen != null) { string name = highestLevelScreen.GetType().get_Name(); if (name == "PlanetDetailsScreen") { if (!Service.Get <BuildingLookupController>().HasNavigationCenter()) { Service.Get <GalaxyViewController>().GoToHome(); } else { Service.Get <GalaxyViewController>().TranstionPlanetToGalaxy(); } highestLevelScreen.Close(null); } else { highestLevelScreen.Close(null); } } if (uXController.HUD.IsSquadScreenOpenAndCloseable()) { SquadController squadController = Service.Get <SquadController>(); if (squadController.StateManager.SquadScreenState == SquadScreenState.Donation) { SquadSlidingScreen highestLevelScreen2 = screenController.GetHighestLevelScreen <SquadSlidingScreen>(); highestLevelScreen2.CloseDonationView(); } else { uXController.HUD.SlideSquadScreenClosed(); } } this.parent.ChildComplete(this); }
public override void Execute() { base.Execute(); ScreenController screenController = Service.Get <ScreenController>(); SquadWarInfoScreen squadWarInfoScreen = screenController.GetHighestLevelScreen <SquadWarInfoScreen>(); if (squadWarInfoScreen == null) { squadWarInfoScreen = new SquadWarInfoScreen(this.pageIndex); Service.Get <ScreenController>().AddScreen(squadWarInfoScreen); return; } if (squadWarInfoScreen.IsLoaded()) { squadWarInfoScreen.ShowPage(this.pageIndex); this.parent.ChildComplete(this); return; } Service.Get <EventManager>().RegisterObserver(this, EventId.ScreenLoaded); }
public static bool IsAnySquadScreenOpen() { ScreenController screenController = Service.ScreenController; return(screenController.GetHighestLevelScreen <SquadBuildingScreen>() != null || screenController.GetHighestLevelScreen <SquadCreateScreen>() != null || screenController.GetHighestLevelScreen <SquadIntroScreen>() != null || screenController.GetHighestLevelScreen <SquadJoinRequestScreen>() != null || screenController.GetHighestLevelScreen <SquadJoinScreen>() != null || screenController.GetHighestLevelScreen <AbstractSquadRequestScreen>() != null || screenController.GetHighestLevelScreen <SquadSlidingScreen>() != null || screenController.GetHighestLevelScreen <SquadTroopRequestScreen>() != null || screenController.GetHighestLevelScreen <SquadUpgradeScreen>() != null); }
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(); }