protected override void OnPanelMessage(string panelName, string msgType, string[] msgParams) { if (msgType == "list_sel_changed") { if (panelName == "filterDropdown") { this._currentFilterMode = (PlanetManagerDialog.PlanetFilterMode) int.Parse(msgParams[0]); this.SyncPlanetList(); } else if (panelName == "orderDropdown") { this._currentOrderMode = (PlanetManagerDialog.PlanetOrderMode) int.Parse(msgParams[0]); if (this._selectedSystem != (StarSystemInfo)null) { this.SetSyncedSystem(this._selectedSystem); } } else if (panelName == "sys_list_left") { StarSystemInfo starSystemInfo = this.App.GameDatabase.GetStarSystemInfo(int.Parse(msgParams[0])); if (starSystemInfo != (StarSystemInfo)null) { this.SetSyncedSystem(starSystemInfo); } } } if (msgType == "button_clicked") { if (panelName == PlanetManagerDialog.UIExitButton) { this.App.UI.CloseDialog((Dialog)this, true); } else if (panelName.StartsWith("btnColoninzePlanet")) { string[] strArray = panelName.Split('|'); int targetSystem = int.Parse(strArray[1]); int targetPlanet = int.Parse(strArray[2]); if (this.App.CurrentState.GetType() == typeof(StarMapState)) { ((StarMapState)this.App.CurrentState).ShowColonizePlanetOverlay(targetSystem, targetPlanet); } this.App.UI.CloseDialog((Dialog)this, true); } } if (!(msgType == "mouse_enter") || !panelName.StartsWith("MoraleRow")) { return; } int orbitalObjectID = int.Parse(panelName.Split('|')[0]); int x = int.Parse(msgParams[0]); int y = int.Parse(msgParams[1]); ColonyInfo colonyInfoForPlanet = this.App.GameDatabase.GetColonyInfoForPlanet(orbitalObjectID); if (colonyInfoForPlanet == null || this.App.LocalPlayer.ID != colonyInfoForPlanet.PlayerID) { return; } StarSystemUI.ShowMoraleEventToolTip(this.App.Game, colonyInfoForPlanet.ID, x, y); }
public override void Initialize() { this.App.UI.UnlockUI(); this.App.UI.AddItem("filterDropdown", "", 0, App.Localize("@UI_PLANET_MANAGER_ALL_PLANETS")); this.App.UI.AddItem("filterDropdown", "", 1, App.Localize("@UI_PLANET_MANAGER_SURVEYED_PLANETS")); this.App.UI.AddItem("filterDropdown", "", 2, App.Localize("@UI_PLANET_MANAGER_OWNED_PLANETS")); this.App.UI.AddItem("filterDropdown", "", 3, App.Localize("@UI_PLANET_MANAGER_ENEMY_PLANETS")); this.App.UI.SetSelection("filterDropdown", 0); this._currentFilterMode = PlanetManagerDialog.PlanetFilterMode.AllPlanets; this.App.UI.AddItem("orderDropdown", "", 0, App.Localize("@UI_PLANET_MANAGER_ORDERBY_POS")); this.App.UI.AddItem("orderDropdown", "", 1, App.Localize("@UI_PLANET_MANAGER_ORDERBY_HAZARD")); this.App.UI.AddItem("orderDropdown", "", 2, App.Localize("@UI_PLANET_MANAGER_ORDERBY_SIZE")); this.App.UI.AddItem("orderDropdown", "", 3, App.Localize("@UI_PLANET_MANAGER_ORDERBY_RESOURCES")); this.App.UI.AddItem("orderDropdown", "", 4, App.Localize("@UI_PLANET_MANAGER_ORDERBY_BIOSPHERE")); this.App.UI.AddItem("orderDropdown", "", 5, App.Localize("@UI_PLANET_MANAGER_ORDERBY_DEVCOST")); this.App.UI.AddItem("orderDropdown", "", 6, App.Localize("@UI_PLANET_MANAGER_ORDERBY_INFRA")); this.App.UI.SetSelection("orderDropdown", 0); this._currentOrderMode = PlanetManagerDialog.PlanetOrderMode.SystemOrder; this.App.UI.SetListCleanClear("system_list", true); EmpireBarUI.SyncTitleFrame(this.App); this._planetWidgets = new List <PlanetWidget>(); this.SyncPlanetList(); }