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(); StarSystemUI.SyncSystemDetailsWidget(this.App, "systemDetailsWidget", this.TargetSystem, false, true); this._currentslider = 0; this._GatePoints.Clear(); this.gatecost = this.App.GameDatabase.GetDesignInfosForPlayer(this.App.LocalPlayer.ID).FirstOrDefault <DesignInfo>((Func <DesignInfo, bool>)(x => x.IsAccelerator())).ProductionCost; }
public override void Initialize() { this._systemWidget = new SystemWidget(this.App, this.App.UI.Path(this.ID, "starDetailsCard")); StarSystemInfo starSystemInfo = this._app.GameDatabase.GetStarSystemInfo(this._systemID); this._app.UI.SetText(this._app.UI.Path(this.ID, "intel_desc"), this._descriptor); this._app.UI.SetPropertyString(this._app.UI.Path(this.ID, "playerAvatar"), "sprite", Path.GetFileNameWithoutExtension(this._targetPlayer.AvatarAssetPath)); this._app.UI.SetPropertyString(this._app.UI.Path(this.ID, "playerBadge"), "sprite", Path.GetFileNameWithoutExtension(this._targetPlayer.BadgeAssetPath)); this._app.UI.SetVisible(this._app.UI.Path(this.ID, "system_map"), true); this._app.UI.SetVisible(this._app.UI.Path(this.ID, "gameStarSystemViewport"), false); this._app.UI.AddItem(this._app.UI.Path(this.ID, "gameViewportList"), "", 0, App.Localize("@SYSTEMDETAILS_SYS_MAP")); this._app.UI.AddItem(this._app.UI.Path(this.ID, "gameViewportList"), "", 1, "System"); this._app.UI.SetSelection(this._app.UI.Path(this.ID, "gameViewportList"), 0); this._crits = new GameObjectSet(this._app); this._camera = new OrbitCameraController(this._app); this._sky = new Sky(this._app, SkyUsage.InSystem, this._systemID); this._starsystem = new Kerberos.Sots.GameStates.StarSystem(this.App, 1f, this._systemID, Vector3.Zero, true, (CombatSensor)null, false, 0, false, true); this._starsystem.SetAutoDrawEnabled(false); this._starsystem.SetCamera(this._camera); this._starsystem.SetInputEnabled(true); this._starsystem.PostObjectAddObjects((IGameObject)this._sky); foreach (IGameObject state in this._starsystem.Crits.Objects.Where<IGameObject>((Func<IGameObject, bool>)(x => { if (!(x is StellarBody)) return x is StarModel; return true; }))) state.PostSetProp("AutoDrawEnabled", false); this._crits.Add((IEnumerable<IGameObject>)new IGameObject[3] { (IGameObject) this._camera, (IGameObject) this._sky, (IGameObject) this._starsystem }); this._app.UI.Send((object)"SetGameObject", (object)this._app.UI.Path(this.ID, "gameStarSystemViewport"), (object)this._starsystem.ObjectID); this._critsInitialized = false; this._camera.PostSetLook(new Vector3(0.0f, 0.0f, 0.0f)); this._camera.PostSetPosition(new Vector3(0.0f, 100000f, 0.0f)); this._camera.MaxDistance = 500000f; this._camera.MinDistance = 100000f; StarSystemUI.SyncSystemDetailsWidget(this._app, this._app.UI.Path(this.ID, "system_details"), this._systemID, false, true); StarSystemMapUI.Sync(this._app, this._systemID, this._app.UI.Path(this.ID, "system_map"), true); this._currentFilterMode = DialogSystemIntel.PlanetFilterMode.AllPlanets; this._planetWidgets = new List<PlanetWidget>(); this.SetSyncedSystem(starSystemInfo); this._systemWidget.Sync(this._systemID); }
public override void Initialize() { this._sky = new Sky(this._app, SkyUsage.StarMap, 0); this._crits = new GameObjectSet(this._app); this._planetView = this._crits.Add <PlanetView>(); this._crits.Add((IGameObject)this._sky); OrbitalObjectInfo orbitalObjectInfo = this._app.GameDatabase.GetOrbitalObjectInfo(this._planetID); StarSystemInfo starSystemInfo = this._app.GameDatabase.GetStarSystemInfo(orbitalObjectInfo.StarSystemID); this._app.UI.SetText("gameColonyName", orbitalObjectInfo.Name); this._enteredColonyName = orbitalObjectInfo.Name; this._app.UI.SetVisible(this._app.UI.Path(this.ID, "btnAbandon"), false); this._app.UI.SetText(this._app.UI.Path("colonyCreateTitle"), (this._homeworld ? App.Localize("@UI_STARMAP_HOMEWORLD_ESTABLISHED") : App.Localize("@UI_STARMAP_COLONY_ESTABLISHED")) + " - " + starSystemInfo.Name); this._cameraReduced = new OrbitCameraController(this._app); this._cameraReduced.MinDistance = 2.5f; this._cameraReduced.MaxDistance = 100f; this._cameraReduced.DesiredDistance = 50f; this._cameraReduced.DesiredYaw = MathHelper.DegreesToRadians(45f); this._cameraReduced.DesiredPitch = -MathHelper.DegreesToRadians(25f); this._cameraReduced.SnapToDesiredPosition(); this._starmapReduced = new StarMap(this._app, this._app.Game, this._sky); this._starmapReduced.Initialize(this._crits); this._starmapReduced.SetCamera(this._cameraReduced); this._starmapReduced.FocusEnabled = false; this._starmapReduced.SetFocus((IGameObject)this._starmapReduced.Systems.Reverse[starSystemInfo.ID]); this._starmapReduced.Select((IGameObject)this._starmapReduced.Systems.Reverse[starSystemInfo.ID]); this._starmapReduced.SelectEnabled = false; this._starmapReduced.PostSetProp("MissionTarget", (object)this._starmapReduced.Systems.Reverse[starSystemInfo.ID].ObjectID, (object)true); this._starmapReduced.PostSetProp("CullCenter", this._app.GameDatabase.GetStarSystemInfo(starSystemInfo.ID).Origin); this._starmapReduced.PostSetProp("CullRadius", 15f); this._app.UI.Send((object)"SetGameObject", (object)this._app.UI.Path(this.ID, "gameStarMapViewport"), (object)this._starmapReduced.ObjectID); this.CachePlanet(this._app.GameDatabase.GetPlanetInfo(this._planetID)); this._planetView.PostSetProp("Planet", this._cachedPlanet != null ? this._cachedPlanet.ObjectID : 0); this._app.UI.Send((object)"SetGameObject", (object)this._app.UI.Path(this.ID, "system_details.Planet_panel"), (object)this._planetView.ObjectID); StarSystemMapUI.Sync(this._app, orbitalObjectInfo.StarSystemID, this._app.UI.Path(this.ID, "system_map"), true); StarSystemUI.SyncSystemDetailsWidget(this._app, "colony_event_dialog.system_details", orbitalObjectInfo.StarSystemID, true, true); StarSystemUI.SyncPlanetDetailsControl(this._app.Game, this._app.UI.Path(this.ID, "system_details"), this._planetID); StarSystemUI.SyncColonyDetailsWidget(this._app.Game, this._app.UI.Path(this.ID, "colony_details"), orbitalObjectInfo.ID, ""); this._app.UI.SetVisible(this._app.UI.Path(this.ID, "system_map"), true); this._app.UI.SetVisible(this._app.UI.Path(this.ID, "gameStarMapViewport"), false); this._app.UI.AddItem(this._app.UI.Path(this.ID, "gameViewportList"), "", 0, App.Localize("@SYSTEMDETAILS_SYS_MAP")); this._app.UI.AddItem(this._app.UI.Path(this.ID, "gameViewportList"), "", 1, App.Localize("@SYSTEMDETAILS_STAR_MAP")); this._app.UI.SetSelection(this._app.UI.Path(this.ID, "gameViewportList"), 0); this._crits.Activate(); }
public override void Initialize() { this._systemWidget = new SystemWidget(this.App, this.App.UI.Path(this.ID, "starDetailsCard")); StarSystemInfo starSystemInfo = this._app.GameDatabase.GetStarSystemInfo(this._systemID); this._app.UI.SetPropertyString(this._app.UI.Path(this.ID, "system_title"), "text", App.Localize("@SURVEY_OF") + " " + string.Format(App.Localize("@SURVEY_SYSTEM_THINGY"), (object)starSystemInfo.Name).ToUpperInvariant()); this._app.UI.SetVisible(this._app.UI.Path(this.ID, "system_map"), true); this._app.UI.SetVisible(this._app.UI.Path(this.ID, "gameStarSystemViewport"), false); this._app.UI.AddItem(this._app.UI.Path(this.ID, "gameViewportList"), "", 0, App.Localize("@SYSTEMDETAILS_SYS_MAP")); this._app.UI.SetSelection(this._app.UI.Path(this.ID, "gameViewportList"), 0); StarSystemUI.SyncSystemDetailsWidget(this._app, this._app.UI.Path(this.ID, "system_details"), this._systemID, false, true); StarSystemMapUI.Sync(this._app, this._systemID, this._app.UI.Path(this.ID, "system_map"), true); this._currentFilterMode = SystemSurveyDialog.PlanetFilterMode.AllPlanets; this._planetWidgets = new List <PlanetWidget>(); this.SetSyncedSystem(starSystemInfo); this._systemWidget.Sync(this._systemID); this.UpdateCanPlaceTraps(); }
protected override void OnEnter() { base.OnEnter(); StarSystemUI.SyncSystemDetailsWidget(this.App, "systemDetailsWidget", this.TargetSystem, false, true); if (this.MissionType == MissionType.RELOCATION) { this._RelocatefleetWidget = new FleetWidget(this.App, this.App.UI.Path(this.ID, "gameRelocateFleet")); } if (this.MissionType == MissionType.RELOCATION) { this._RelocatefleetWidget.MissionMode = MissionType.NO_MISSION; this._fleetWidget.LinkWidget(this._RelocatefleetWidget); this._RelocatefleetWidget.LinkWidget(this._fleetWidget); this._RelocatefleetWidget.OnFleetsModified += new FleetWidget.FleetsModifiedDelegate(this.FleetsModified); } this.CaravanMode = false; this.CaravanFleet = new int?(); this.SelectedCaravanSourceSystem = new int?(); if (this._app.AssetDatabase.GetFaction(this._app.GameDatabase.GetPlayerInfo(this._app.LocalPlayer.ID).FactionID).Name == "loa" || this._fleetCentric) { this._app.UI.SetVisible(this.UI.Path(this.ID, "RelocateAssetsBTN"), false); this._app.UI.SetEnabled(this.UI.Path(this.ID, "RelocateAssetsBTN"), false); } else { this._app.UI.SetVisible(this.UI.Path(this.ID, "RelocateAssetsBTN"), true); if (this.CanDoCaravan()) { this._app.UI.SetEnabled(this.UI.Path(this.ID, "RelocateAssetsBTN"), true); } else { this._app.UI.SetEnabled(this.UI.Path(this.ID, "RelocateAssetsBTN"), false); } } this._app.UI.SetVisible(this.UI.Path(this.ID, "caravanFade"), false); }
protected override void OnEnter() { base.OnEnter(); StarSystemUI.SyncSystemDetailsWidget(this.App, "systemDetailsWidget", this.TargetSystem, false, true); }