Esempio n. 1
0
 protected override void OnEnter()
 {
     base.OnEnter();
     this.App.UI.SetScreen("StarSystem");
     this._piechart = new BudgetPiechart(this.App.UI, "piechart", this.App.AssetDatabase);
     EmpireBarUI.SyncTitleBar(this.App, "gameEmpireBar", this._piechart);
     EmpireBarUI.SyncTitleFrame(this.App);
     this.InitializeClimateSlider(this.App.UI.Path("colonyControl", "partClimateSlider"));
     this.App.UI.SetPropertyBool(this.App.UI.Path("colonyControl", "partTradeSlider"), "only_user_events", true);
     this.App.UI.SetPropertyBool(this.App.UI.Path("colonyControl", "partTerraSlider"), "only_user_events", true);
     this.App.UI.SetPropertyBool(this.App.UI.Path("colonyControl", "partInfraSlider"), "only_user_events", true);
     this.App.UI.SetPropertyBool(this.App.UI.Path("colonyControl", "partShipConSlider"), "only_user_events", true);
     this.App.UI.SetPropertyBool(this.App.UI.Path("colonyControl", "partCivSlider"), "only_user_events", true);
     this.App.UI.SetPropertyBool(this.App.UI.Path("colonyControl", "partOverDevelopment"), "only_user_events", true);
     this.App.UI.SetPropertyBool("gameSystemContentsList", "only_user_events", true);
     this.App.UI.InitializeSlider(this.App.UI.Path("colonyControl", "partCivSlider"), 0, 100, 50);
     this.App.UI.InitializeSlider(this.App.UI.Path("colonyControl", "partTerraSlider"), 0, 100, 50);
     this.App.UI.InitializeSlider(this.App.UI.Path("colonyControl", "partInfraSlider"), 0, 100, 50);
     this.App.UI.InitializeSlider(this.App.UI.Path("colonyControl", "partShipConSlider"), 0, 100, 50);
     this.App.UI.InitializeSlider(this.App.UI.Path("colonyControl", "partOverDevelopment"), 0, 100, 50);
     this.InitializeClimateSlider(this.App.UI.Path("gamePlanetDetails", "partClimateSlider"));
     StarSystemUI.SyncSystemDetailsWidget(this.App, "systemDetailsWidget", this.CurrentSystem, false, true);
     StarSystemUI.SyncPlanetListWidget(this.App.Game, "planetListWidget", this.App.GameDatabase.GetStarSystemPlanets(this.CurrentSystem));
     StarSystemUI.SyncColonyDetailsWidget(this.App.Game, "colonyDetailsWidget", this.SelectedObject, "");
     StarSystemUI.SyncPlanetDetailsWidget(this.App.Game, "planetDetailsWidget", this.CurrentSystem, this.SelectedObject, this.GetPlanetViewGameObject(this.CurrentSystem, this.SelectedObject), this._planetView);
     this.App.HotKeyManager.AddListener((IKeyBindListener)this);
 }
        protected override void OnEnter()
        {
            base.OnEnter();
            this._crits.Activate();
            this._dummies.Activate();
            this.App.UI.UnlockUI();
            this.App.UI.SetScreen("StationPlacement");
            this.App.UI.SetPropertyBool("gameCancelMissionButton", "lockout_button", true);
            this.App.UI.SetPropertyBool("gameConfirmMissionButton", "lockout_button", true);
            this.App.UI.SetPropertyBool("gameExitButton", "lockout_button", true);
            this._piechart = new BudgetPiechart(this.App.UI, "piechart", this.App.AssetDatabase);
            EmpireBarUI.SyncTitleFrame(this.App);
            EmpireBarUI.SyncTitleBar(this.App, "gameEmpireBar", this._piechart);
            this.Camera.DesiredPitch    = MathHelper.DegreesToRadians(-40f);
            this.Camera.DesiredDistance = 80000f;
            this.Camera.MinPitch        = MathHelper.DegreesToRadians(-60f);
            this.Camera.MaxPitch        = MathHelper.DegreesToRadians(-20f);
            this._manager.Active        = true;
            this._starsystem.SetAutoDrawEnabled(false);
            bool flag = false;

            if (this._stationType == StationType.MINING)
            {
                int?planetForStation = StarSystem.GetSuitablePlanetForStation(this.App.Game, this.App.LocalPlayer.ID, this._targetSystemID, this._stationType);
                if (planetForStation.HasValue)
                {
                    this.SetSelectedObject(planetForStation.Value, "");
                    flag = true;
                }
            }
            else
            {
                foreach (PlanetInfo planetInfo in this.App.GameDatabase.GetPlanetInfosOrbitingStar(this._targetSystemID))
                {
                    if (planetInfo != null)
                    {
                        ColonyInfo colonyInfoForPlanet = this.App.GameDatabase.GetColonyInfoForPlanet(planetInfo.ID);
                        if (colonyInfoForPlanet != null && colonyInfoForPlanet.PlayerID == this.App.LocalPlayer.ID)
                        {
                            this.SetSelectedObject(planetInfo.ID, "");
                            flag = true;
                            break;
                        }
                    }
                }
            }
            if (!flag)
            {
                this.SetSelectedObject(-1, "");
            }
            StationPlacementState.RefreshFleetAdmiralDetails(this.App, this._selectedFleetID);
            OverlayConstructionMission.RefreshMissionUI(this.App, this._selectedPlanetID, this._targetSystemID);
            OverlayConstructionMission.ReRefreshMissionDetails(this.App, this._missionEstimate);
            this.App.UI.AutoSizeContents("gameMissionDetails");
        }