private void CreateUI() { this._strategicTurnLengthSlider = new TimeSlider(this.App.UI, "gameStrategyTurnLength", this.App.GameSetup.StrategicTurnLength, 0.25f, 15f, 0.25f, true); this._combatTurnLengthSlider = new TimeSlider(this.App.UI, "gameCombatTurnLength", this.App.GameSetup.CombatTurnLength, 3f, 12f, 1f, false); this._economicEfficiencySlider = new PercentageSlider(this.App.UI, "gameEconomicEfficiency", this.App.GameSetup.EconomicEfficiency, 50, 200); this._researchEfficiencySlider = new PercentageSlider(this.App.UI, "gameResearchEfficiency", this.App.GameSetup.ResearchEfficiency, 50, 200); this._planetResourcesSlider = (ValueBoundSlider) new PercentageSlider(this.App.UI, "gameStarMapPlanetResSlider", this.App.GameSetup.PlanetResources, 50, 150); this._planetSizeSlider = (ValueBoundSlider) new PercentageSlider(this.App.UI, "gameStarMapPlanetSizeSlider", this.App.GameSetup.PlanetSize, 50, 150); this._initialTreasurySlider = new TreasurySlider(this.App.UI, "gameInitialTreasury", this.App.GameSetup.InitialTreasury, 0, 1000000); this._numPlayersSpinner = new ValueBoundSpinner(this.App.UI, "gameNumPlayers", 2.0, 8.0, (double)this.App.GameSetup.Players.Count, 1.0); this._initialSystemsSpinner = new ValueBoundSpinner(this.App.UI, "gameInitialSystems", 3.0, 9.0, (double)this.App.GameSetup.InitialSystems, 1.0); this._initialTechnologiesSpinner = new ValueBoundSpinner(this.App.UI, "gameInitialTechs", 0.0, 10.0, (double)this.App.GameSetup.InitialTechnologies, 1.0); this._randomEncounterFrequencySlider = new PercentageSlider(this.App.UI, "gameRandomEncounterFrequency", this.App.GameSetup.RandomEncounterFrequency, 0, 200); this._grandMenaceSlider = new ValueBoundSlider(this.App.UI, "gameGrandMenaces", 0, 5, this.App.GameSetup.GrandMenaceCount); foreach (Faction faction in this.App.AssetDatabase.Factions) { if (faction.IsPlayable) { this.App.UI.SetChecked(GameSetupState.UIAvailableFactionCheckBox(faction), this.App.GameSetup.AvailablePlayerFeatures.Factions.ContainsKey(faction)); } } string[] strArray = new string[1] { "loa" }; foreach (string str in strArray) { string expansionFactionName = str; if (!this.App.AssetDatabase.Factions.Any <Faction>((Func <Faction, bool>)(x => x.Name == expansionFactionName))) { this.App.UI.SetChecked(GameSetupState.UIAvailableFactionCheckBox(expansionFactionName), false); this.App.UI.SetVisible(GameSetupState.UIAvailableFactionFrame(expansionFactionName), false); } } this.App.UI.SetVisible("gameScenarioList", false); this.App.UI.SetVisible("gameStarMapList", true); this.App.UI.SetChecked("gameScenariosCheckbox", false); this.App.UI.SetChecked("gameMapsCheckbox", true); this.PopulateScenarioList(); this.PopulateStarMapList(); if (this._starmapIdMap.Count <= 0) { return; } if (ScriptHost.AllowConsole && this._starmapIdMap.Any <KeyValuePair <int, Starmap.StarmapInfo> >((Func <KeyValuePair <int, Starmap.StarmapInfo>, bool>)(x => x.Value.Title == "@STARMAP_TITLE_FIGHT"))) { this.App.UI.SetSelection("gameStarMapList", this._starmapIdMap.FirstOrDefault <KeyValuePair <int, Starmap.StarmapInfo> >((Func <KeyValuePair <int, Starmap.StarmapInfo>, bool>)(x => x.Value.Title == "@STARMAP_TITLE_FIGHT")).Key); } else { this.App.UI.SetSelection("gameStarMapList", this._starmapIdMap.Keys.First <int>()); } }
protected override void OnExit(GameState prev, ExitReason reason) { this.App.UI.DeleteScreen("GameSetup"); if (this._starmapPreview != null) { this._starmapPreview.Dispose(); this._starmapPreview = (StarMapPreview)null; } this._strategicTurnLengthSlider = (TimeSlider)null; this._combatTurnLengthSlider = (TimeSlider)null; this._economicEfficiencySlider = (PercentageSlider)null; this._researchEfficiencySlider = (PercentageSlider)null; this._planetResourcesSlider = (ValueBoundSlider)null; this._planetSizeSlider = (ValueBoundSlider)null; this._initialTreasurySlider = (TreasurySlider)null; this._numPlayersSpinner = (ValueBoundSpinner)null; this._initialSystemsSpinner = (ValueBoundSpinner)null; this._initialTechnologiesSpinner = (ValueBoundSpinner)null; this._randomEncounterFrequencySlider = (PercentageSlider)null; this._grandMenaceSlider = (ValueBoundSlider)null; this._starmapIdMap = (Dictionary <int, Starmap.StarmapInfo>)null; this._scenarioIdMap = (Dictionary <int, Scenario.ScenarioInfo>)null; }