Example #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);
                    }
                }
            }
        }
Example #2
0
        public void Update_OnTick(Timer t)
        {
            Profiles.Save();
            GMenuItem item = this.m_Shard.Menu;

            if (item == null)
            {
                Engine.UpdateSmartLoginMenu();
            }
            else
            {
                for (int i = 0; i < this.m_Shard.Characters.Length; i++)
                {
                    GMenuItem item2 = this.m_Shard.Characters[i].Menu;
                    if (item2 == null)
                    {
                        item.Add(this.m_Shard.Characters[i].Menu = item2 = new GPlayCharacterMenu(this.m_Shard.Characters[i]));
                    }
                    else
                    {
                        item2.Text = this.m_Shard.Characters[i].Name;
                    }
                }
                Gump[] gumpArray = item.Children.ToArray();
                for (int j = 0; j < gumpArray.Length; j++)
                {
                    GPlayCharacterMenu child = gumpArray[j] as GPlayCharacterMenu;
                    if ((child != null) && !this.m_Shard.Contains(child.Character))
                    {
                        item.Remove(child);
                    }
                }
            }
        }
Example #3
0
        public GInfoForm() : base(0, 0, 400, 430)
        {
            base.m_NonRestrictivePicking        = true;
            base.Client.m_NonRestrictivePicking = true;
            Gumps.Focus = this;
            base.Text   = "Information Browser";
            InfoProvider[] providerArray = new InfoProvider[] { new CommandInfoProvider(), new CastingInfoProvider(), new SwingInfoProvider() };
            GMainMenu      toAdd         = new GMainMenu((this.Width - 130) - 4, 8);
            GMenuItem      child         = new GMenuItem("Change Provider")
            {
                DropDown = true
            };

            for (int i = 0; i < providerArray.Length; i++)
            {
                child.Add(new ChangeProviderMenu(this, providerArray[i]));
            }
            toAdd.Add(child);
            this.RecurseFormatMenu(child);
            base.Client.Children.Add(toAdd);
            this.m_CPMenu = toAdd;
            this.Provider = providerArray[0];
            base.GUID     = "Info Browser";
            this.Center();
        }
Example #4
0
        public override void OnClick()
        {
            string param = this.m_Param.Param;

            if (param != null)
            {
                Client.Action action = this.m_Action;
                if (action == null)
                {
                    Gump parent = base.m_Parent;
                    while ((parent != null) && !(parent is GMacroEditorPanel))
                    {
                        parent = parent.Parent;
                    }
                    if (parent is GMacroEditorPanel)
                    {
                        Macro macro = ((GMacroEditorPanel)parent).Macro;
                        macro.AddAction(new Client.Action(string.Format("{0} {1}", this.m_Handler.Action, param)));
                        ((GMacroEditorForm)parent.Parent.Parent).Current = macro;
                    }
                }
                else
                {
                    action.Param = param;
                    GMenuItem item = this;
                    while (item.Parent is GMenuItem)
                    {
                        item = (GMenuItem)item.Parent;
                    }
                    item.Text = this.m_Param.Name;
                }
            }
        }
Example #5
0
 private GMenuItem FormatMenu(GMenuItem mi)
 {
     mi.FillAlpha = 1f;
     mi.DefaultColor = GumpPaint.Blend(Color.WhiteSmoke, SystemColors.Control, (float) 0.5f);
     mi.OverColor = GumpPaint.Blend(Color.SteelBlue, SystemColors.Control, (float) 0.5f);
     mi.ExpandedColor = GumpPaint.Blend(Color.SteelBlue, SystemColors.Control, (float) 0.5f);
     mi.SetHue(Hues.Load(1));
     return mi;
 }
Example #6
0
 private GMenuItem FormatMenu(GMenuItem mi)
 {
     mi.FillAlpha     = 1f;
     mi.DefaultColor  = GumpPaint.Blend(Color.WhiteSmoke, SystemColors.Control, (float)0.5f);
     mi.OverColor     = GumpPaint.Blend(Color.SteelBlue, SystemColors.Control, (float)0.5f);
     mi.ExpandedColor = GumpPaint.Blend(Color.SteelBlue, SystemColors.Control, (float)0.5f);
     mi.SetHue(Hues.Load(1));
     return(mi);
 }
Example #7
0
 public void Add(GMenuItem child)
 {
     if ((child != this) && !this.Contains(child))
     {
         base.m_Children.Add(child);
         child.Visible = false;
         this.Layout();
     }
 }
Example #8
0
 private void RecurseFormatMenu(GMenuItem mi)
 {
     this.FormatMenu(mi);
     for (int i = 0; i < mi.Children.Count; i++)
     {
         if (mi.Children[i] is GMenuItem)
         {
             this.RecurseFormatMenu((GMenuItem) mi.Children[i]);
         }
     }
 }
Example #9
0
 private void RecurseFormatMenu(GMenuItem mi)
 {
     this.FormatMenu(mi);
     for (int i = 0; i < mi.Children.Count; i++)
     {
         if (mi.Children[i] is GMenuItem)
         {
             this.RecurseFormatMenu((GMenuItem)mi.Children[i]);
         }
     }
 }
Example #10
0
 public virtual GMenuItem CreateMenu()
 {
     if (this.m_Children.Length > 0)
     {
         GMenuItem item = new GMenuItem(this.Name);
         for (int i = 0; i < this.m_Children.Length; i++)
         {
             item.Add(this.m_Children[i].Menu);
         }
         return item;
     }
     return new InternalMenuItem(this);
 }
Example #11
0
 public virtual GMenuItem CreateMenu()
 {
     if (this.m_Children.Length > 0)
     {
         GMenuItem item = new GMenuItem(this.Name);
         for (int i = 0; i < this.m_Children.Length; i++)
         {
             item.Add(this.m_Children[i].Menu);
         }
         return(item);
     }
     return(new InternalMenuItem(this));
 }
Example #12
0
 public override Gump CreateGump()
 {
     GMainMenu menu = new GMainMenu(0, 0);
     GMenuItem child = new GMenuItem(base.Name) {
         DropDown = true
     };
     for (int i = 0; i < this.m_Nodes.Length; i++)
     {
         child.Add(this.m_Nodes[i].Menu);
     }
     menu.Add(child);
     this.RecurseFormatMenu(child);
     return menu;
 }
Example #13
0
 public void Add(GMenuItem child)
 {
     base.m_Children.Remove(child);
     if (this.m_LeftToRight)
     {
         child.X = base.m_Children.Count * 0x77;
         child.Y = 0;
     }
     else
     {
         child.X = 0;
         child.Y = base.m_Children.Count * 0x17;
     }
     base.m_Children.Add(child);
 }
Example #14
0
        public override void UpdateGump(Gump g)
        {
            GMainMenu menu   = (GMainMenu)g;
            GMenuItem item   = (GMenuItem)menu.Children[0];
            InfoNode  active = base.Active as InfoNode;

            if (active == null)
            {
                item.Text = base.Name;
            }
            else
            {
                item.Text = active.Name;
            }
        }
Example #15
0
 public void Add(GMenuItem child)
 {
     base.m_Children.Remove(child);
     if (this.m_LeftToRight)
     {
         child.X = base.m_Children.Count * 0x77;
         child.Y = 0;
     }
     else
     {
         child.X = 0;
         child.Y = base.m_Children.Count * 0x17;
     }
     base.m_Children.Add(child);
 }
Example #16
0
        public override Gump CreateGump()
        {
            GMainMenu menu  = new GMainMenu(0, 0);
            GMenuItem child = new GMenuItem(base.Name)
            {
                DropDown = true
            };

            for (int i = 0; i < this.m_Nodes.Length; i++)
            {
                child.Add(this.m_Nodes[i].Menu);
            }
            menu.Add(child);
            this.RecurseFormatMenu(child);
            return(menu);
        }
Example #17
0
        private GMenuItem GetMenuFrom(ActionNode n)
        {
            GMenuItem mi = new GMenuItem(n.Name);

            for (int i = 0; i < n.Nodes.Count; i++)
            {
                mi.Add(this.GetMenuFrom((ActionNode)n.Nodes[i]));
            }
            for (int j = 0; j < n.Handlers.Count; j++)
            {
                ActionHandler action = (ActionHandler)n.Handlers[j];
                GMenuItem     item2  = new GNewActionMenu(this, this.m_Macro, action);
                for (int k = 0; (action.Params != null) && (k < action.Params.Length); k++)
                {
                    item2.Add(this.GetMenuFrom(action.Params[k], null, action));
                }
                mi.Add(this.FormatMenu(item2));
            }
            return(this.FormatMenu(mi));
        }
Example #18
0
        private GMenuItem GetMenuFrom(ParamNode n, Action a, ActionHandler ah)
        {
            GMenuItem item;

            if (n.Param != null)
            {
                item = new GParamMenu(n, ah, a);
            }
            else
            {
                item = new GMenuItem(n.Name);
            }
            if (n.Nodes != null)
            {
                for (int i = 0; i < n.Nodes.Length; i++)
                {
                    item.Add(this.GetMenuFrom(n.Nodes[i], a, ah));
                }
            }
            return(this.FormatMenu(item));
        }
Example #19
0
        public void Layout()
        {
            int num = 0;

            Gump[] gumpArray = base.m_Children.ToArray();
            for (int i = 0; i < gumpArray.Length; i++)
            {
                GMenuItem item = gumpArray[i] as GMenuItem;
                if (item != null)
                {
                    if (this.m_LeftToRight)
                    {
                        item.X = num++ *0x77;
                        item.Y = 0;
                    }
                    else
                    {
                        item.X = 0;
                        item.Y = num++ *0x17;
                    }
                }
            }
        }
Example #20
0
 public GInfoForm()
     : base(0, 0, 400, 430)
 {
     base.m_NonRestrictivePicking = true;
     base.Client.m_NonRestrictivePicking = true;
     Gumps.Focus = this;
     base.Text = "Information Browser";
     InfoProvider[] providerArray = new InfoProvider[] { new CommandInfoProvider(), new CastingInfoProvider(), new SwingInfoProvider() };
     GMainMenu toAdd = new GMainMenu((this.Width - 130) - 4, 8);
     GMenuItem child = new GMenuItem("Change Provider") {
         DropDown = true
     };
     for (int i = 0; i < providerArray.Length; i++)
     {
         child.Add(new ChangeProviderMenu(this, providerArray[i]));
     }
     toAdd.Add(child);
     this.RecurseFormatMenu(child);
     base.Client.Children.Add(toAdd);
     this.m_CPMenu = toAdd;
     this.Provider = providerArray[0];
     base.GUID = "Info Browser";
     this.Center();
 }
Example #21
0
        public void Layout()
        {
            int num3;
            int num4;
            int num = 0;

            Gump[] gumpArray = base.m_Children.ToArray();
            for (int i = 0; i < gumpArray.Length; i++)
            {
                if (gumpArray[i] is GMenuItem)
                {
                    num++;
                }
            }
            if (this.m_DropDown)
            {
                num3 = 0;
                num4 = this.Height - 1;
            }
            else
            {
                Gump desktop = Gumps.Desktop;
                num3 = 0x7c;
                num4 = 0;
                if (desktop != null)
                {
                    int   num5 = 1 + (num * 0x17);
                    Point p    = base.PointToScreen(new Point(0, 0));
                    int   y    = desktop.PointToClient(p).Y;
                    int   num7 = (desktop.Height - y) - 1;
                    num7 /= 0x17;
                    if (num7 < 1)
                    {
                        num7 = 1;
                    }
                    if (num7 < num)
                    {
                        num4 = (this.Height - (((num - num7) + 1) * 0x17)) - 1;
                    }
                    if ((y + num4) < 0)
                    {
                        num4 = -y;
                    }
                }
            }
            for (int j = 0; j < gumpArray.Length; j++)
            {
                GMenuItem item2 = gumpArray[j] as GMenuItem;
                if (item2 != null)
                {
                    if (item2.X != num3)
                    {
                        item2.X = num3;
                    }
                    if (item2.Y != num4)
                    {
                        item2.Y = num4;
                    }
                    num4 += 0x17;
                }
            }
        }
Example #22
0
 private GMenuItem GetMenuFrom(ActionNode n)
 {
     GMenuItem mi = new GMenuItem(n.Name);
     for (int i = 0; i < n.Nodes.Count; i++)
     {
         mi.Add(this.GetMenuFrom((ActionNode) n.Nodes[i]));
     }
     for (int j = 0; j < n.Handlers.Count; j++)
     {
         ActionHandler action = (ActionHandler) n.Handlers[j];
         GMenuItem item2 = new GNewActionMenu(this, this.m_Macro, action);
         for (int k = 0; (action.Params != null) && (k < action.Params.Length); k++)
         {
             item2.Add(this.GetMenuFrom(action.Params[k], null, action));
         }
         mi.Add(this.FormatMenu(item2));
     }
     return this.FormatMenu(mi);
 }
Example #23
0
 private GMenuItem GetMenuFrom(ParamNode n, Action a, ActionHandler ah)
 {
     GMenuItem item;
     if (n.Param != null)
     {
         item = new GParamMenu(n, ah, a);
     }
     else
     {
         item = new GMenuItem(n.Name);
     }
     if (n.Nodes != null)
     {
         for (int i = 0; i < n.Nodes.Length; i++)
         {
             item.Add(this.GetMenuFrom(n.Nodes[i], a, ah));
         }
     }
     return this.FormatMenu(item);
 }
Example #24
0
 public bool Contains(GMenuItem child)
 {
     return(base.m_Children.IndexOf(child) >= 0);
 }
Example #25
0
 public void Remove(GMenuItem child)
 {
     base.m_Children.Remove(child);
     this.Layout();
 }
Example #26
0
 public bool Contains(GMenuItem child)
 {
     return (base.m_Children.IndexOf(child) >= 0);
 }
Example #27
0
        protected internal override void Render(int rx, int ry)
        {
            int       num;
            bool      flag;
            GMenuItem lastOver = Gumps.LastOver as GMenuItem;

            if (lastOver == null)
            {
                num  = this.m_DefaultColor.ToArgb() & 0xffffff;
                flag = true;
            }
            else
            {
                GMenuItem parent = lastOver;
                while ((parent != null) && (parent != this))
                {
                    parent = parent.Parent as GMenuItem;
                }
                flag = parent != this;
                if (flag)
                {
                    num = this.m_DefaultColor.ToArgb() & 0xffffff;
                }
                else if (lastOver == this)
                {
                    num = this.m_OverColor.ToArgb() & 0xffffff;
                }
                else
                {
                    num = this.m_ExpandedColor.ToArgb() & 0xffffff;
                }
            }
            base.FillColor = num;
            if (flag)
            {
                if (this.Width != 120)
                {
                    this.Width = 120;
                }
                Gump[] gumpArray = base.m_Children.ToArray();
                for (int i = 0; i < gumpArray.Length; i++)
                {
                    if (gumpArray[i] is GMenuItem)
                    {
                        ((GMenuItem)gumpArray[i]).Visible = false;
                    }
                }
            }
            else
            {
                bool   flag2      = false;
                Gump[] gumpArray2 = base.m_Children.ToArray();
                for (int j = 0; j < gumpArray2.Length; j++)
                {
                    if (gumpArray2[j] is GMenuItem)
                    {
                        ((GMenuItem)gumpArray2[j]).Visible = true;
                        flag2 = true;
                    }
                }
                int num4 = (flag2 && !this.m_DropDown) ? 0x7d : 120;
                if (this.Width != num4)
                {
                    this.Width = num4;
                }
                if (flag2 && this.m_MakeTopmost)
                {
                    base.BringToTop();
                }
                this.Layout();
            }
            base.Render(rx, ry);
        }
Example #28
0
 public void Remove(GMenuItem child)
 {
     if ((child != this) && this.Contains(child))
     {
         base.m_Children.Remove(child);
         child.Visible = false;
         this.Layout();
     }
 }
Example #29
0
 public void Remove(GMenuItem child)
 {
     base.m_Children.Remove(child);
     this.Layout();
 }