Пример #1
0
        public void Update_OnTick(Timer t)
        {
            Profiles.Save();
            GMenuItem item = this.m_Account.Menu;

            if ((item == null) || ((item == this.m_Server.Menu) && (this.m_Account.Shards.Length != 1)))
            {
                Engine.UpdateSmartLoginMenu();
            }
            else if (this.m_Account.Shards.Length > 1)
            {
                for (int i = 0; i < this.m_Account.Shards.Length; i++)
                {
                    GMenuItem item2 = this.m_Account.Shards[i].Menu;
                    if (item2 == null)
                    {
                        item.Add(this.m_Account.Shards[i].Menu = item2 = new GShardMenu(this.m_Account.Shards[i]));
                    }
                    else
                    {
                        item2.Text = this.m_Account.Shards[i].Name;
                    }
                }
                Gump[] gumpArray = item.Children.ToArray();
                for (int j = 0; j < gumpArray.Length; j++)
                {
                    GShardMenu child = gumpArray[j] as GShardMenu;
                    if ((child != null) && !this.m_Account.Contains(child.Shard))
                    {
                        item.Remove(child);
                    }
                }
            }
        }
Пример #2
0
 public static GMainMenu BuildSmartLoginMenu()
 {
     ServerProfile[] list = Profiles.List;
     GMainMenu menu = new GMainMenu(0, 270);
     for (int i = 0; i < list.Length; i++)
     {
         ServerProfile server = list[i];
         GMenuItem child = new GNewAccountMenu(server, server.Title);
         server.Menu = child;
         for (int j = 0; j < server.Accounts.Length; j++)
         {
             GMenuItem item2;
             AccountProfile account = server.Accounts[j];
             if (server.Accounts.Length == 1)
             {
                 item2 = child;
             }
             else
             {
                 item2 = new GAccountMenu(account);
                 child.Add(item2);
             }
             account.Menu = item2;
             for (int k = 0; k < account.Shards.Length; k++)
             {
                 GMenuItem item3;
                 ShardProfile shard = account.Shards[k];
                 if (account.Shards.Length == 1)
                 {
                     item3 = item2;
                 }
                 else
                 {
                     item3 = new GShardMenu(shard);
                     item2.Add(item3);
                 }
                 shard.Menu = item3;
                 int num4 = 0;
                 for (int m = 0; m < shard.Characters.Length; m++)
                 {
                     if (shard.Characters[m] != null)
                     {
                         GMenuItem item4 = new GPlayCharacterMenu(shard.Characters[m]);
                         shard.Characters[m].Menu = item4;
                         item3.Add(item4);
                         num4++;
                     }
                 }
             }
             if (item2 != child)
             {
                 child.Add(item2);
             }
         }
         menu.Add(child);
     }
     menu.Add(new GNewServerMenu());
     menu.GUID = "Smart Login";
     return menu;
 }
Пример #3
0
 public void Update_OnTick(Timer t)
 {
     Profiles.Save();
     GMenuItem item = this.m_Account.Menu;
     if ((item == null) || ((item == this.m_Server.Menu) && (this.m_Account.Shards.Length != 1)))
     {
         Engine.UpdateSmartLoginMenu();
     }
     else if (this.m_Account.Shards.Length > 1)
     {
         for (int i = 0; i < this.m_Account.Shards.Length; i++)
         {
             GMenuItem item2 = this.m_Account.Shards[i].Menu;
             if (item2 == null)
             {
                 item.Add(this.m_Account.Shards[i].Menu = item2 = new GShardMenu(this.m_Account.Shards[i]));
             }
             else
             {
                 item2.Text = this.m_Account.Shards[i].Name;
             }
         }
         Gump[] gumpArray = item.Children.ToArray();
         for (int j = 0; j < gumpArray.Length; j++)
         {
             GShardMenu child = gumpArray[j] as GShardMenu;
             if ((child != null) && !this.m_Account.Contains(child.Shard))
             {
                 item.Remove(child);
             }
         }
     }
 }