Ejemplo n.º 1
0
 public void SelectItem(SkinMenuItem item)
 {
     this.mSelectedFaction = (SupcomLookups._Factions) item.Tag;
     this.Text = item.Text;
     base.Icon = item.Icon;
     this.Refresh();
     if (this.SelectedFactionChanged != null)
     {
         this.SelectedFactionChanged(this, EventArgs.Empty);
     }
 }
Ejemplo n.º 2
0
 public FactionPicker()
 {
     base.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
     bool hasOriginal = true;
     bool hasExpansion = true;
     SupcomPrefs.TestFactions(out hasOriginal, out hasExpansion);
     SkinMenuItem item = new SkinMenuItem("<LOC>Random", SupcomFactions.random);
     item.Tag = SupcomLookups._Factions.Any;
     item.Name = item.Tag.ToString();
     item.Click += new EventHandler(this.SelectionChanged);
     base.Menu.MenuItems.Add(item);
     if (hasOriginal)
     {
         SkinMenuItem item2 = new SkinMenuItem("Aeon", SupcomFactions.aeon);
         item2.Tag = SupcomLookups._Factions.Aeon;
         item2.Name = item2.Tag.ToString();
         item2.Click += new EventHandler(this.SelectionChanged);
         SkinMenuItem item3 = new SkinMenuItem("Cybran", SupcomFactions.cybran);
         item3.Tag = SupcomLookups._Factions.Cybran;
         item3.Name = item3.Tag.ToString();
         item3.Click += new EventHandler(this.SelectionChanged);
         SkinMenuItem item4 = new SkinMenuItem("UEF", SupcomFactions.uef);
         item4.Tag = SupcomLookups._Factions.UEF;
         item4.Name = item4.Tag.ToString();
         item4.Click += new EventHandler(this.SelectionChanged);
         base.Menu.MenuItems.Add(item2);
         base.Menu.MenuItems.Add(item3);
         base.Menu.MenuItems.Add(item4);
     }
     if (hasExpansion)
     {
         SkinMenuItem item5 = new SkinMenuItem("Seraphim", SupcomFactions.seraphim);
         item5.Tag = SupcomLookups._Factions.Seraphim;
         item5.Name = item5.Tag.ToString();
         item5.Click += new EventHandler(this.SelectionChanged);
         base.Menu.MenuItems.Add(item5);
     }
     this.ForeColor = Color.WhiteSmoke;
     this.SelectItem(item);
 }
Ejemplo n.º 3
0
 private void InitStatusDropdown()
 {
     EventHandler handler = null;
     SkinMenuItem item = new SkinMenuItem(Loc.Get("<LOC>Online"), StatusIcons.online);
     item.Click += delegate (object s, EventArgs e) {
         this.SetAwayStatus(false);
         this.SetDNDStatus(false);
         this.UpdateOnlineStatus(true);
     };
     item.Tag = 0;
     this.skinDropDownStatus.Menu.MenuItems.Add(item);
     SkinMenuItem item2 = new SkinMenuItem(Loc.Get("<LOC>Away"), StatusIcons.idle);
     item2.Click += delegate (object s, EventArgs e) {
         this.skinDropDownStatus.Text = "";
         this.SetAwayStatus(true);
     };
     item2.Tag = 0;
     this.skinDropDownStatus.Menu.MenuItems.Add(item2);
     SkinMenuItem item3 = new SkinMenuItem(Loc.Get("<LOC>Do Not Disturb"), StatusIcons.dnd);
     item3.Click += delegate (object s, EventArgs e) {
         this.skinDropDownStatus.Text = "";
         this.SetDNDStatus(true);
     };
     item3.Tag = 0;
     this.skinDropDownStatus.Menu.MenuItems.Add(item3);
     if (User.Current.IsAdmin)
     {
         SkinMenuItem item4 = new SkinMenuItem(Loc.Get("<LOC>Offline"), StatusIcons.offline);
         if (handler == null)
         {
             handler = delegate (object s, EventArgs e) {
                 this.ChangeStatus("<LOC>Offline", StatusIcons.offline);
                 this.UpdateOnlineStatus(false);
             };
         }
         item4.Click += handler;
         item4.Tag = 0;
         this.skinDropDownStatus.Menu.MenuItems.Add(item4);
     }
     SkinMenuItem item5 = new SkinMenuItem(Loc.Get("<LOC>Cancel"), StatusIcons.cancel);
     item5.Click += delegate (object s, EventArgs e) {
         if (this.mSupcomGameManager != null)
         {
             this.mSupcomGameManager.AbortGame();
             this.mSupcomGameManager = null;
         }
         else
         {
             this.CancelRankedGame();
         }
     };
     item5.Tag = 1;
     item5.Visible = false;
     this.skinDropDownStatus.Menu.MenuItems.Add(item5);
     this.ChangeStatus("<LOC>Online", StatusIcons.online);
 }
Ejemplo n.º 4
0
 public void RefreshGatherings(Chatroom[] rooms, bool clearFirst)
 {
     EventHandler handler = null;
     EventHandler handler2 = null;
     EventHandler handler3 = null;
     bool flag = clearFirst || (this.RoomCount < 1);
     if (clearFirst)
     {
         base.Menu.MenuItems.Clear();
     }
     for (int i = 0; i < rooms.Length; i++)
     {
         if (Chatroom.InChatroom && rooms[i].Equals(Chatroom.Current))
         {
             rooms[i].Population = Chatroom.CurrentPopulation;
         }
         if (base.Menu.MenuItems.ContainsKey(rooms[i].Description))
         {
             base.Menu.MenuItems[rooms[i].Description].Text = string.Format("{0} ({1})", rooms[i].Description, rooms[i].Population);
             if (Program.Settings.Chat.Appearance.ShowChatroomIcons)
             {
                 (base.Menu.MenuItems[rooms[i].Description] as SkinMenuItem).Icon = this.GetPopulationImage(rooms[i].Population);
             }
         }
         else
         {
             SkinMenuItem item = new SkinMenuItem(string.Format("{0} ({1})", rooms[i].Description, rooms[i].Population));
             item.Tag = rooms[i];
             if (Program.Settings.Chat.Appearance.ShowChatroomIcons)
             {
                 item.Icon = this.GetPopulationImage(rooms[i].Population);
             }
             item.SkinBasePath = @"Controls\Menus\DropDownItem";
             item.Name = rooms[i].Description;
             if (handler == null)
             {
                 handler = delegate (object s, EventArgs e) {
                     if (this.GatheringSelected != null)
                     {
                         this.GatheringSelected(((s as MenuItem).Tag as Chatroom).Description);
                     }
                 };
             }
             item.Click += handler;
             base.Menu.MenuItems.Add(item);
         }
     }
     if (flag && ConfigSettings.GetBool("ShowChannels", false))
     {
         SkinMenuItem item2 = new SkinMenuItem(Loc.Get("<LOC>Select Channel..."));
         item2.SkinBasePath = @"Controls\Menus\DropDownItem";
         if (handler2 == null)
         {
             handler2 = delegate (object s, EventArgs e) {
                 this.MainForm.ShowDlgSelectChannel();
             };
         }
         item2.Click += handler2;
         base.Menu.MenuItems.Add(item2);
         SkinMenuItem item3 = new SkinMenuItem(Loc.Get("<LOC>Create Channel..."));
         item3.SkinBasePath = @"Controls\Menus\DropDownItem";
         if (handler3 == null)
         {
             handler3 = delegate (object s, EventArgs e) {
                 new DlgCreateChannel(this.MainForm).ShowDialog();
             };
         }
         item3.Click += handler3;
         base.Menu.MenuItems.Add(item3);
     }
 }
Ejemplo n.º 5
0
 private SkinMenuItem GetMenuItemKick()
 {
     SkinMenuItem item = new SkinMenuItem("<LOC>Kick");
     item.Click += new EventHandler(this.miKick_Click);
     return item;
 }
Ejemplo n.º 6
0
 private SkinMenuItem GetMenuItemLeave()
 {
     SkinMenuItem item = new SkinMenuItem("<LOC>Leave");
     item.Click += new EventHandler(this.miLeave_Click);
     return item;
 }
Ejemplo n.º 7
0
 private SkinMenuItem GetMenuItemInvite()
 {
     SkinMenuItem item = new SkinMenuItem("<LOC>Invite");
     item.Click += new EventHandler(this.miInvite_Click);
     return item;
 }
Ejemplo n.º 8
0
 private SkinMenuItem GetMenuItemDisband()
 {
     SkinMenuItem item = new SkinMenuItem("<LOC>Disband");
     item.Click += new EventHandler(this.miDisband_Click);
     return item;
 }
Ejemplo n.º 9
0
 private SkinMenuItem GetMenuItemClosed()
 {
     SkinMenuItem item = new SkinMenuItem("<LOC>Closed");
     item.Click += new EventHandler(this.miClosed_Click);
     return item;
 }
Ejemplo n.º 10
0
 private SkinMenuItem GetMenuItemOpen()
 {
     SkinMenuItem item = new SkinMenuItem("<LOC>Open");
     item.Click += new EventHandler(this.miOpen_Click);
     return item;
 }
Ejemplo n.º 11
0
 private SkinMenuItem GetMenuItemOccupy()
 {
     SkinMenuItem item = new SkinMenuItem("<LOC>Occupy");
     item.Click += new EventHandler(this.miOccupy_Click);
     return item;
 }