예제 #1
0
 protected override void OnPanelMessage(string panelName, string msgType, string[] msgParams)
 {
     if (msgType == "button_clicked")
     {
         if (!(panelName == "okButton"))
         {
             return;
         }
         this._app.UI.CloseDialog((Dialog)this, true);
     }
     else
     {
         if (msgType == "list_item_dblclk")
         {
             return;
         }
         if (msgType == "list_sel_changed")
         {
             if (!(panelName == "filterDropdown"))
             {
                 return;
             }
             this.CurrentFilterMode = (FleetSummaryDialog.FilterFleets) int.Parse(msgParams[0]);
         }
         else
         {
             if (!(msgType == "checkbox_clicked"))
             {
                 return;
             }
             bool flag = int.Parse(msgParams[0]) > 0;
             if (panelName == "hasColonizer")
             {
                 this._interestedRoles[ShipRole.COLONIZER] = flag;
                 this.RefreshFleets();
             }
             else if (panelName == "hasConstructor")
             {
                 this._interestedRoles[ShipRole.CONSTRUCTOR] = flag;
                 this.RefreshFleets();
             }
             else
             {
                 if (!(panelName == "hasSupply"))
                 {
                     return;
                 }
                 this._interestedRoles[ShipRole.SUPPLY] = flag;
                 this.RefreshFleets();
             }
         }
     }
 }
예제 #2
0
 public override void Initialize()
 {
     this.App.UI.UnlockUI();
     this._mainWidget           = new FleetWidget(this.App, this.UI.Path(this.ID, "fleetList"));
     this._mainWidget.JumboMode = true;
     this.App.UI.AddItem("filterDropdown", "", 0, App.Localize("@UI_GENERAL_ALL"));
     this.App.UI.AddItem("filterDropdown", "", 1, App.Localize("@UI_GENERAL_NORMAL_FLEETS"));
     this.App.UI.AddItem("filterDropdown", "", 2, App.Localize("@UI_GENERAL_NAME"));
     this.App.UI.AddItem("filterDropdown", "", 3, App.Localize("@UI_GENERAL_ADMIRAL"));
     this.App.UI.AddItem("filterDropdown", "", 4, App.Localize("@UI_GENERAL_BASE_SYSTEM"));
     this.App.UI.AddItem("filterDropdown", "", 5, App.Localize("@UI_GENERAL_UNITCOUNT"));
     this.App.UI.AddItem("filterDropdown", "", 6, App.Localize("@UI_GENERAL_MISSION"));
     this.App.UI.AddItem("filterDropdown", "", 7, App.Localize("@UI_MISSIONFLEET_NO_MISSION"));
     this.App.UI.SetSelection("filterDropdown", 0);
     this._currentFilterMode = FleetSummaryDialog.FilterFleets.All;
     this._mainWidget.OnFleetSelectionChanged = new FleetWidget.FleetSelectionChangedDelegate(FleetSummaryDialog.FleetSelectionChanged);
     this.RefreshFleets();
 }