Ejemplo n.º 1
0
        private GTextBox AddTextBox(string name, int index, string initialText, char pc)
        {
            GLabel label;
            int    y = 30 + (index * 0x19);

            label = new GLabel(name, Engine.GetUniFont(2), GumpHues.ControlText, 0, 0)
            {
                X = 10 - label.Image.xMin,
                Y = (y + ((0x16 - ((label.Image.yMax - label.Image.yMin) + 1)) / 2)) - label.Image.yMin
            };
            base.m_Children.Add(label);
            GAlphaBackground toAdd = new GAlphaBackground(60, y, 200, 0x16)
            {
                ShouldHitTest = false,
                FillColor     = GumpColors.Window,
                FillAlpha     = 1f
            };

            base.m_Children.Add(toAdd);
            IHue     windowText = GumpHues.WindowText;
            GTextBox box        = new GTextBox(0, false, 60, y, 200, 0x16, initialText, Engine.GetUniFont(2), windowText, windowText, windowText, pc);

            base.Client.Children.Add(box);
            return(box);
        }
Ejemplo n.º 2
0
 public GMacroEditorForm()
     : base(0, 0, 0x10d, 0x11b)
 {
     Gumps.Focus = this;
     base.m_NonRestrictivePicking = true;
     base.Client.m_NonRestrictivePicking = true;
     base.Text = "Macro Editor";
     GAlphaBackground toAdd = this.m_Sunken = new GAlphaBackground(1, 2, 0x103, 230);
     toAdd.ShouldHitTest = false;
     toAdd.FillAlpha = 1f;
     toAdd.FillColor = GumpColors.AppWorkspace;
     toAdd.DrawBorder = false;
     base.Client.Children.Add(toAdd);
     this.m_KeyboardFlipper = new GSystemButton(0x47, 0xec, 120, 20, SystemColors.Control, SystemColors.ControlText, "Show Keyboard", Engine.GetUniFont(2));
     this.m_KeyboardFlipper.OnClick = new OnClick(this.KeyboardFlipper_OnClick);
     base.Client.Children.Add(this.m_KeyboardFlipper);
     GSystemButton button = new GSystemButton(240, 0xec, 20, 20, SystemColors.Control, SystemColors.ControlText, "→", Engine.GetUniFont(2)) {
         Tooltip = new Tooltip("Advance to the next macro", true),
         OnClick = new OnClick(this.Next_OnClick)
     };
     base.Client.Children.Add(button);
     GSystemButton button2 = new GSystemButton(1, 0xec, 20, 20, SystemColors.Control, SystemColors.ControlText, "←", Engine.GetUniFont(2)) {
         Tooltip = new Tooltip("Go back to the previous macro", true),
         OnClick = new OnClick(this.Prev_OnClick)
     };
     base.Client.Children.Add(button2);
     this.Center();
     this.Y -= 0x5c;
     if (Macros.List.Count > 0)
     {
         this.Current = (Macro) Macros.List[0];
     }
 }
Ejemplo n.º 3
0
        public GPropertyEntry(object obj, ObjectEditorEntry entry) : base(0, 0, 0x117, 0x16)
        {
            IFont uniFont;

            this.m_Object = obj;
            this.m_Entry  = entry;
            base.m_NonRestrictivePicking = true;
            this.m_NameBack               = new GAlphaBackground(0, 0, 140, 0x16);
            this.m_NameBack.FillColor     = GumpColors.Window;
            this.m_NameBack.FillAlpha     = 1f;
            this.m_NameBack.DrawBorder    = false;
            this.m_NameBack.ShouldHitTest = false;
            base.m_Children.Add(this.m_NameBack);
            this.m_ValueBack               = new GAlphaBackground(0x8b, 0, 140, 0x16);
            this.m_ValueBack.FillColor     = GumpColors.Window;
            this.m_ValueBack.FillAlpha     = 1f;
            this.m_ValueBack.BorderColor   = GumpColors.Control;
            this.m_ValueBack.ShouldHitTest = false;
            this.m_ValueBack.DrawBorder    = false;
            base.m_Children.Add(this.m_ValueBack);
            this.m_Name   = new GLabel(entry.Optionable.Name, Engine.GetUniFont(2), GumpHues.WindowText, 0, 0);
            this.m_Name.X = 5 - this.m_Name.Image.xMin;
            this.m_Name.Y = ((0x16 - ((this.m_Name.Image.yMax - this.m_Name.Image.yMin) + 1)) / 2) - this.m_Name.Image.yMin;
            this.m_NameBack.Children.Add(this.m_Name);
            object val       = entry.Property.GetValue(obj, null);
            string valString = this.GetValString(val);

            if ((val is ValueType) ? val.Equals(entry.Optionable.Default) : object.ReferenceEquals(val, entry.Optionable.Default))
            {
                uniFont = Engine.GetUniFont(2);
            }
            else
            {
                uniFont = Engine.GetUniFont(1);
            }
            this.m_Value = new GLabel(valString, uniFont, GumpHues.WindowText, 0, 0);
            if (entry.Hue != null)
            {
                GAlphaBackground toAdd = new GAlphaBackground(4, 4, 0x16, 14)
                {
                    FillColor     = Engine.C16232(Hues.Load((int)val).Pixel(0xffff)),
                    FillAlpha     = 1f,
                    ShouldHitTest = false
                };
                this.m_ValueBack.Children.Add(toAdd);
                this.m_Value.Text = "Hue";
                this.m_Value.X    = 30 - this.m_Value.Image.xMin;
                this.m_Value.Y    = ((0x16 - ((this.m_Value.Image.yMax - this.m_Value.Image.yMin) + 1)) / 2) - this.m_Value.Image.yMin;
                this.m_Hue        = toAdd;
            }
            else
            {
                this.m_Value.X = 5 - this.m_Value.Image.xMin;
                this.m_Value.Y = ((0x16 - ((this.m_Value.Image.yMax - this.m_Value.Image.yMin) + 1)) / 2) - this.m_Value.Image.yMin;
            }
            this.m_ValueBack.Children.Add(this.m_Value);
        }
Ejemplo n.º 4
0
 public GPropertyEntry(object obj, ObjectEditorEntry entry)
     : base(0, 0, 0x117, 0x16)
 {
     IFont uniFont;
     this.m_Object = obj;
     this.m_Entry = entry;
     base.m_NonRestrictivePicking = true;
     this.m_NameBack = new GAlphaBackground(0, 0, 140, 0x16);
     this.m_NameBack.FillColor = GumpColors.Window;
     this.m_NameBack.FillAlpha = 1f;
     this.m_NameBack.DrawBorder = false;
     this.m_NameBack.ShouldHitTest = false;
     base.m_Children.Add(this.m_NameBack);
     this.m_ValueBack = new GAlphaBackground(0x8b, 0, 140, 0x16);
     this.m_ValueBack.FillColor = GumpColors.Window;
     this.m_ValueBack.FillAlpha = 1f;
     this.m_ValueBack.BorderColor = GumpColors.Control;
     this.m_ValueBack.ShouldHitTest = false;
     this.m_ValueBack.DrawBorder = false;
     base.m_Children.Add(this.m_ValueBack);
     this.m_Name = new GLabel(entry.Optionable.Name, Engine.GetUniFont(2), GumpHues.WindowText, 0, 0);
     this.m_Name.X = 5 - this.m_Name.Image.xMin;
     this.m_Name.Y = ((0x16 - ((this.m_Name.Image.yMax - this.m_Name.Image.yMin) + 1)) / 2) - this.m_Name.Image.yMin;
     this.m_NameBack.Children.Add(this.m_Name);
     object val = entry.Property.GetValue(obj, null);
     string valString = this.GetValString(val);
     if ((val is ValueType) ? val.Equals(entry.Optionable.Default) : object.ReferenceEquals(val, entry.Optionable.Default))
     {
         uniFont = Engine.GetUniFont(2);
     }
     else
     {
         uniFont = Engine.GetUniFont(1);
     }
     this.m_Value = new GLabel(valString, uniFont, GumpHues.WindowText, 0, 0);
     if (entry.Hue != null)
     {
         GAlphaBackground toAdd = new GAlphaBackground(4, 4, 0x16, 14) {
             FillColor = Engine.C16232(Hues.Load((int) val).Pixel(0xffff)),
             FillAlpha = 1f,
             ShouldHitTest = false
         };
         this.m_ValueBack.Children.Add(toAdd);
         this.m_Value.Text = "Hue";
         this.m_Value.X = 30 - this.m_Value.Image.xMin;
         this.m_Value.Y = ((0x16 - ((this.m_Value.Image.yMax - this.m_Value.Image.yMin) + 1)) / 2) - this.m_Value.Image.yMin;
         this.m_Hue = toAdd;
     }
     else
     {
         this.m_Value.X = 5 - this.m_Value.Image.xMin;
         this.m_Value.Y = ((0x16 - ((this.m_Value.Image.yMax - this.m_Value.Image.yMin) + 1)) / 2) - this.m_Value.Image.yMin;
     }
     this.m_ValueBack.Children.Add(this.m_Value);
 }
Ejemplo n.º 5
0
 public override Gump CreateGump()
 {
     GEmpty empty = new GEmpty(0, 0, 140, 0x18);
     GLabel toAdd = new GLabel(base.Name + ":", Engine.GetUniFont(2), GumpHues.ControlText, 0, 0);
     empty.Children.Add(toAdd);
     toAdd.Center();
     toAdd.X = 0x41 - toAdd.Image.xMax;
     GAlphaBackground background = new GAlphaBackground(70, 0, 60, 0x18) {
         FillAlpha = 1f,
         FillColor = GumpColors.Window,
         ShouldHitTest = false
     };
     empty.Children.Add(background);
     GTextBox box = new GTextBox(0, false, 70, 0, 60, 0x18, "0", Engine.GetUniFont(2), GumpHues.WindowText, GumpHues.WindowText, GumpHues.WindowText) {
         OnTextChange = new Client.OnTextChange(this.OnTextChange)
     };
     empty.Children.Add(box);
     return empty;
 }
Ejemplo n.º 6
0
 private GTextBox AddTextBox(string name, int index, string initialText, char pc)
 {
     GLabel label;
     int y = 30 + (index * 0x19);
     label = new GLabel(name, Engine.GetUniFont(2), GumpHues.ControlText, 0, 0) {
         X = 10 - label.Image.xMin,
         Y = (y + ((0x16 - ((label.Image.yMax - label.Image.yMin) + 1)) / 2)) - label.Image.yMin
     };
     base.m_Children.Add(label);
     GAlphaBackground toAdd = new GAlphaBackground(60, y, 200, 0x16) {
         ShouldHitTest = false,
         FillColor = GumpColors.Window,
         FillAlpha = 1f
     };
     base.m_Children.Add(toAdd);
     IHue windowText = GumpHues.WindowText;
     GTextBox box = new GTextBox(0, false, 60, y, 200, 0x16, initialText, Engine.GetUniFont(2), windowText, windowText, windowText, pc);
     base.Client.Children.Add(box);
     return box;
 }
Ejemplo n.º 7
0
        public GVirtueItem(GServerGump owner, int x, int y, int gumpID, IHue hue) : base(owner, x, y, gumpID, hue)
        {
            base.m_QuickDrag = false;
            int num  = hue.HueID() - 1;
            int num2 = -1;
            int num3 = 0;

            for (int i = 0; i < m_Table.Length; i += 4)
            {
                if (m_Table[i] == gumpID)
                {
                    num2 = i / 4;
                    for (int j = 1; j < 4; j++)
                    {
                        if (m_Table[i + j] == num)
                        {
                            num3 = j;
                            break;
                        }
                    }
                }
            }
            if (num2 >= 0)
            {
                this.m_Title = new GAlphaBackground(30 - x, 40 - y, 0, 0);
                GLabel toAdd = new GLabel(Localization.GetString((0x100978 + (num3 * 8)) + num2), Engine.GetUniFont(0), hue, 3, 3);
                this.m_Title.Children.Add(toAdd);
                toAdd.X            -= toAdd.Image.xMin;
                toAdd.Y            -= toAdd.Image.yMin;
                this.m_Title.Width  = (toAdd.Image.xMax - toAdd.Image.xMin) + 7;
                this.m_Title.Height = (toAdd.Image.yMax - toAdd.Image.yMin) + 7;
                Size size = Engine.m_Gumps.Measure(0x68);
                this.m_Title.X      += (size.Width - this.m_Title.Width) / 2;
                this.m_Title.Y      += (size.Height - this.m_Title.Height) / 2;
                this.m_Title.Visible = false;
                base.m_Children.Add(this.m_Title);
            }
        }
Ejemplo n.º 8
0
 public GVirtueItem(GServerGump owner, int x, int y, int gumpID, IHue hue)
     : base(owner, x, y, gumpID, hue)
 {
     base.m_QuickDrag = false;
     int num = hue.HueID() - 1;
     int num2 = -1;
     int num3 = 0;
     for (int i = 0; i < m_Table.Length; i += 4)
     {
         if (m_Table[i] == gumpID)
         {
             num2 = i / 4;
             for (int j = 1; j < 4; j++)
             {
                 if (m_Table[i + j] == num)
                 {
                     num3 = j;
                     break;
                 }
             }
         }
     }
     if (num2 >= 0)
     {
         this.m_Title = new GAlphaBackground(30 - x, 40 - y, 0, 0);
         GLabel toAdd = new GLabel(Localization.GetString((0x100978 + (num3 * 8)) + num2), Engine.GetUniFont(0), hue, 3, 3);
         this.m_Title.Children.Add(toAdd);
         toAdd.X -= toAdd.Image.xMin;
         toAdd.Y -= toAdd.Image.yMin;
         this.m_Title.Width = (toAdd.Image.xMax - toAdd.Image.xMin) + 7;
         this.m_Title.Height = (toAdd.Image.yMax - toAdd.Image.yMin) + 7;
         Size size = Engine.m_Gumps.Measure(0x68);
         this.m_Title.X += (size.Width - this.m_Title.Width) / 2;
         this.m_Title.Y += (size.Height - this.m_Title.Height) / 2;
         this.m_Title.Visible = false;
         base.m_Children.Add(this.m_Title);
     }
 }
Ejemplo n.º 9
0
        public GMacroEditorForm() : base(0, 0, 0x10d, 0x11b)
        {
            Gumps.Focus = this;
            base.m_NonRestrictivePicking        = true;
            base.Client.m_NonRestrictivePicking = true;
            base.Text = "Macro Editor";
            GAlphaBackground toAdd = this.m_Sunken = new GAlphaBackground(1, 2, 0x103, 230);

            toAdd.ShouldHitTest = false;
            toAdd.FillAlpha     = 1f;
            toAdd.FillColor     = GumpColors.AppWorkspace;
            toAdd.DrawBorder    = false;
            base.Client.Children.Add(toAdd);
            this.m_KeyboardFlipper         = new GSystemButton(0x47, 0xec, 120, 20, SystemColors.Control, SystemColors.ControlText, "Show Keyboard", Engine.GetUniFont(2));
            this.m_KeyboardFlipper.OnClick = new OnClick(this.KeyboardFlipper_OnClick);
            base.Client.Children.Add(this.m_KeyboardFlipper);
            GSystemButton button = new GSystemButton(240, 0xec, 20, 20, SystemColors.Control, SystemColors.ControlText, "→", Engine.GetUniFont(2))
            {
                Tooltip = new Tooltip("Advance to the next macro", true),
                OnClick = new OnClick(this.Next_OnClick)
            };

            base.Client.Children.Add(button);
            GSystemButton button2 = new GSystemButton(1, 0xec, 20, 20, SystemColors.Control, SystemColors.ControlText, "←", Engine.GetUniFont(2))
            {
                Tooltip = new Tooltip("Go back to the previous macro", true),
                OnClick = new OnClick(this.Prev_OnClick)
            };

            base.Client.Children.Add(button2);
            this.Center();
            this.Y -= 0x5c;
            if (Macros.List.Count > 0)
            {
                this.Current = (Macro)Macros.List[0];
            }
        }
Ejemplo n.º 10
0
        public override Gump CreateGump()
        {
            GEmpty empty = new GEmpty(0, 0, 140, 0x18);
            GLabel toAdd = new GLabel(base.Name + ":", Engine.GetUniFont(2), GumpHues.ControlText, 0, 0);

            empty.Children.Add(toAdd);
            toAdd.Center();
            toAdd.X = 0x41 - toAdd.Image.xMax;
            GAlphaBackground background = new GAlphaBackground(70, 0, 60, 0x18)
            {
                FillAlpha     = 1f,
                FillColor     = GumpColors.Window,
                ShouldHitTest = false
            };

            empty.Children.Add(background);
            GTextBox box = new GTextBox(0, false, 70, 0, 60, 0x18, "0", Engine.GetUniFont(2), GumpHues.WindowText, GumpHues.WindowText, GumpHues.WindowText)
            {
                OnTextChange = new Client.OnTextChange(this.OnTextChange)
            };

            empty.Children.Add(box);
            return(empty);
        }
Ejemplo n.º 11
0
 public GSecureTrade(int serial, Gump container, string myName, string theirName)
     : base(50, 50, 0x119, 0x74)
 {
     this.m_Serial = serial;
     this.m_Container = container;
     base.m_CanDrop = true;
     base.FillAlpha = 0.5f;
     base.FillColor = 0x6080ff;
     GBorder3D toAdd = new GBorder3D(false, 0, 0, this.Width, this.Height) {
         FillAlpha = 0f,
         ShouldHitTest = false
     };
     base.m_Children.Add(toAdd);
     GBorder3D borderd2 = new GBorder3D(true, 6, 6, 0x84, 0x68) {
         FillAlpha = 0f,
         ShouldHitTest = false
     };
     base.m_Children.Add(borderd2);
     GBorder3D borderd3 = new GBorder3D(false, 7, 7, 130, 20) {
         ShouldHitTest = false
     };
     GLabel label = new GLabel(this.Truncate(myName, Engine.GetUniFont(1), borderd3.Width - 0x1c), Engine.GetUniFont(1), Hues.Load(1), 0, 0);
     borderd3.Children.Add(label);
     label.Center();
     label.X = 0x1c - label.Image.xMin;
     base.m_Children.Add(borderd3);
     GBorder3D borderd4 = new GBorder3D(true, 0x8f, 6, 0x84, 0x68) {
         FillAlpha = 0f,
         ShouldHitTest = false
     };
     base.m_Children.Add(borderd4);
     GBorder3D borderd5 = new GBorder3D(false, 0x90, 7, 130, 20) {
         ShouldHitTest = false
     };
     GLabel label2 = new GLabel(this.Truncate(theirName, Engine.GetUniFont(1), borderd5.Width - 0x1c), Engine.GetUniFont(1), Hues.Load(1), 0, 0);
     borderd5.Children.Add(label2);
     label2.Center();
     label2.X = (borderd5.Width - 0x1c) - label2.Image.xMax;
     base.m_Children.Add(borderd5);
     GAlphaBackground background = new GAlphaBackground(1, 1, 5, 0x72) {
         ShouldHitTest = false,
         BorderColor = 0xc0c0c0,
         FillColor = 0xc0c0c0,
         FillAlpha = 1f
     };
     base.m_Children.Add(background);
     background = new GAlphaBackground(0x113, 1, 5, 0x72) {
         ShouldHitTest = false,
         BorderColor = 0xc0c0c0,
         FillColor = 0xc0c0c0,
         FillAlpha = 1f
     };
     base.m_Children.Add(background);
     background = new GAlphaBackground(6, 1, 0x10d, 5) {
         ShouldHitTest = false,
         BorderColor = 0xc0c0c0,
         FillColor = 0xc0c0c0,
         FillAlpha = 1f
     };
     base.m_Children.Add(background);
     background = new GAlphaBackground(6, 110, 0x10d, 5) {
         ShouldHitTest = false,
         BorderColor = 0xc0c0c0,
         FillColor = 0xc0c0c0,
         FillAlpha = 1f
     };
     base.m_Children.Add(background);
     background = new GAlphaBackground(0x8a, 6, 5, 0x68) {
         ShouldHitTest = false,
         BorderColor = 0xc0c0c0,
         FillColor = 0xc0c0c0,
         FillAlpha = 1f
     };
     base.m_Children.Add(background);
 }
Ejemplo n.º 12
0
 private static void OpenDyeWindow(OnClick OnClick, Gump g)
 {
     GAlphaBackground background = new GAlphaBackground(0, 0, 0xb8, 110) {
         m_NonRestrictivePicking = true,
         m_CanDrag = false,
         X = 0,
         Y = g.Parent.Height - 1
     };
     GHuePicker toAdd = new GHuePicker(4, 4) {
         Brightness = 1
     };
     toAdd.SetTag("Dialog", background);
     background.Children.Add(toAdd);
     background.Children.Add(new GSingleBorder(3, 3, 0xa2, 0x52));
     background.Children.Add(new GSingleBorder(0xa4, 3, 0x11, 0x52));
     GBrightnessBar bar = new GBrightnessBar(0xa5, 4, 15, 80, toAdd);
     background.Children.Add(bar);
     bar.Refresh();
     GFlatButton okay = new GFlatButton(0x7b, 0x57, 0x3a, 20, "Okay", OnClick);
     okay.SetTag("Hue Picker", toAdd);
     okay.SetTag("Dialog", background);
     okay.SetTag("Button", g);
     background.Children.Add(new GQuickHues(toAdd, bar, okay));
     background.Children.Add(okay);
     g.Parent.Children.Add(background);
 }
Ejemplo n.º 13
0
        public GMacroEditorPanel(Client.Macro m) : base(0, 0, 0x103, 230)
        {
            GMainMenu menu;
            GMenuItem menuFrom;

            this.m_Macro   = m;
            base.m_CanDrag = false;
            base.m_NonRestrictivePicking = true;
            base.ShouldHitTest           = false;
            this.m_Ctrl          = new GSystemButton(10, 10, 40, 20, GumpPaint.Blend(Color.WhiteSmoke, SystemColors.Control, (float)0.5f), SystemColors.ControlText, "Ctrl", Engine.GetUniFont(2));
            this.m_Alt           = new GSystemButton(0x31, 10, 40, 20, GumpPaint.Blend(Color.WhiteSmoke, SystemColors.Control, (float)0.5f), SystemColors.ControlText, "Alt", Engine.GetUniFont(2));
            this.m_Shift         = new GSystemButton(0x58, 10, 0x2a, 20, GumpPaint.Blend(Color.WhiteSmoke, SystemColors.Control, (float)0.5f), SystemColors.ControlText, "Shift", Engine.GetUniFont(2));
            this.m_Ctrl.OnClick  = new OnClick(this.Ctrl_OnClick);
            this.m_Alt.OnClick   = new OnClick(this.Alt_OnClick);
            this.m_Shift.OnClick = new OnClick(this.Shift_OnClick);
            this.m_Ctrl.Tooltip  = new Tooltip("Toggles the control key modifier", true);
            this.m_Alt.Tooltip   = new Tooltip("Toggles the alt key modifier", true);
            this.m_Shift.Tooltip = new Tooltip("Toggles the shift key modifier", true);
            base.m_Children.Add(this.m_Ctrl);
            base.m_Children.Add(this.m_Alt);
            base.m_Children.Add(this.m_Shift);
            this.UpdateModifiers();
            GAlphaBackground toAdd = new GAlphaBackground(0x81, 10, 0x4a, 20)
            {
                FillAlpha = 1f,
                FillColor = GumpColors.Window
            };

            base.m_Children.Add(toAdd);
            GMacroKeyEntry entry = new GMacroKeyEntry(GetKeyName(m.Key), 0x81, 10, 0x4a, 20)
            {
                Tooltip = new Tooltip("Press any key here to change the macro", true)
            };

            base.m_Children.Add(entry);
            GSystemButton button = new GSystemButton(10, 10, 40, 20, GumpPaint.Blend(Color.WhiteSmoke, SystemColors.Control, (float)0.5f), SystemColors.ControlText, "Delete", Engine.GetUniFont(2));

            button.SetBackColor(GumpPaint.Blend(Color.SteelBlue, SystemColors.Control, (float)0.25f));
            button.InactiveColor = GumpPaint.Blend(Color.WhiteSmoke, SystemColors.Control, (float)0.5f);
            button.Tooltip       = new Tooltip("Deletes the entire macro", true);
            button.OnClick       = new OnClick(this.Delete_OnClick);
            button.X             = (this.Width - 10) - button.Width;
            base.m_Children.Add(button);
            base.FillAlpha = 0.15f;
            for (int i = 0; i < m.Actions.Length; i++)
            {
                try
                {
                    Action action = m.Actions[i];
                    if (action.Handler != null)
                    {
                        ActionHandler ah = action.Handler;
                        menu     = new GMainMenu(10, 0x23 + (i * 0x17));
                        menuFrom = new GActionMenu(this, m, action);
                        menu.Add(this.FormatMenu(menuFrom));
                        if (ah.Params == null)
                        {
                            GAlphaBackground background2 = new GAlphaBackground(0x81, 0x23 + (i * 0x17), 120, 0x18)
                            {
                                FillAlpha = 1f,
                                FillColor = GumpColors.Window
                            };
                            base.m_Children.Add(background2);
                            IHue     windowText = GumpHues.WindowText;
                            GTextBox box        = new GMacroParamEntry(action, action.Param, background2.X, background2.Y, background2.Width, background2.Height)
                            {
                                MaxChars = 0xef
                            };
                            base.m_Children.Add(box);
                        }
                        else if (ah.Params.Length != 0)
                        {
                            string name = Find(action.Param, ah.Params);
                            if (name == null)
                            {
                                name = action.Param;
                            }
                            menuFrom          = this.GetMenuFrom(new ParamNode(name, ah.Params), action, ah);
                            menuFrom.DropDown = i == (m.Actions.Length - 1);
                            menu.Add(menuFrom);
                        }
                        menu.LeftToRight = true;
                        base.m_Children.Add(menu);
                    }
                }
                catch
                {
                }
            }
            menu              = new GMainMenu(10, 0x23 + (m.Actions.Length * 0x17));
            menuFrom          = this.GetMenuFrom(ActionHandler.Root);
            menuFrom.Tooltip  = new Tooltip("To create a new instruction pick one from the menu below", false, 200);
            menuFrom.Text     = "New...";
            menuFrom.DropDown = true;
            menu.Add(this.FormatMenu(menuFrom));
            menu.LeftToRight = true;
            base.m_Children.Add(menu);
        }
Ejemplo n.º 14
0
        public GSecureTrade(int serial, Gump container, string myName, string theirName) : base(50, 50, 0x119, 0x74)
        {
            this.m_Serial    = serial;
            this.m_Container = container;
            base.m_CanDrop   = true;
            base.FillAlpha   = 0.5f;
            base.FillColor   = 0x6080ff;
            GBorder3D toAdd = new GBorder3D(false, 0, 0, this.Width, this.Height)
            {
                FillAlpha     = 0f,
                ShouldHitTest = false
            };

            base.m_Children.Add(toAdd);
            GBorder3D borderd2 = new GBorder3D(true, 6, 6, 0x84, 0x68)
            {
                FillAlpha     = 0f,
                ShouldHitTest = false
            };

            base.m_Children.Add(borderd2);
            GBorder3D borderd3 = new GBorder3D(false, 7, 7, 130, 20)
            {
                ShouldHitTest = false
            };
            GLabel label = new GLabel(this.Truncate(myName, Engine.GetUniFont(1), borderd3.Width - 0x1c), Engine.GetUniFont(1), Hues.Load(1), 0, 0);

            borderd3.Children.Add(label);
            label.Center();
            label.X = 0x1c - label.Image.xMin;
            base.m_Children.Add(borderd3);
            GBorder3D borderd4 = new GBorder3D(true, 0x8f, 6, 0x84, 0x68)
            {
                FillAlpha     = 0f,
                ShouldHitTest = false
            };

            base.m_Children.Add(borderd4);
            GBorder3D borderd5 = new GBorder3D(false, 0x90, 7, 130, 20)
            {
                ShouldHitTest = false
            };
            GLabel label2 = new GLabel(this.Truncate(theirName, Engine.GetUniFont(1), borderd5.Width - 0x1c), Engine.GetUniFont(1), Hues.Load(1), 0, 0);

            borderd5.Children.Add(label2);
            label2.Center();
            label2.X = (borderd5.Width - 0x1c) - label2.Image.xMax;
            base.m_Children.Add(borderd5);
            GAlphaBackground background = new GAlphaBackground(1, 1, 5, 0x72)
            {
                ShouldHitTest = false,
                BorderColor   = 0xc0c0c0,
                FillColor     = 0xc0c0c0,
                FillAlpha     = 1f
            };

            base.m_Children.Add(background);
            background = new GAlphaBackground(0x113, 1, 5, 0x72)
            {
                ShouldHitTest = false,
                BorderColor   = 0xc0c0c0,
                FillColor     = 0xc0c0c0,
                FillAlpha     = 1f
            };
            base.m_Children.Add(background);
            background = new GAlphaBackground(6, 1, 0x10d, 5)
            {
                ShouldHitTest = false,
                BorderColor   = 0xc0c0c0,
                FillColor     = 0xc0c0c0,
                FillAlpha     = 1f
            };
            base.m_Children.Add(background);
            background = new GAlphaBackground(6, 110, 0x10d, 5)
            {
                ShouldHitTest = false,
                BorderColor   = 0xc0c0c0,
                FillColor     = 0xc0c0c0,
                FillAlpha     = 1f
            };
            base.m_Children.Add(background);
            background = new GAlphaBackground(0x8a, 6, 5, 0x68)
            {
                ShouldHitTest = false,
                BorderColor   = 0xc0c0c0,
                FillColor     = 0xc0c0c0,
                FillAlpha     = 1f
            };
            base.m_Children.Add(background);
        }
Ejemplo n.º 15
0
 private static void SelectHue(PacketReader pvSrc)
 {
     GItemArt art;
     int num = pvSrc.ReadInt32();
     short num2 = pvSrc.ReadInt16();
     short itemID = pvSrc.ReadInt16();
     GAlphaBackground background = new GAlphaBackground(0, 0, 0xf4, 110) {
         m_NonRestrictivePicking = true
     };
     background.Center();
     art = new GItemArt(0xb7, 3, itemID) {
         X = art.X + (((0x3a - (art.Image.xMax - art.Image.xMin)) / 2) - art.Image.xMin),
         Y = art.Y + (((0x52 - (art.Image.yMax - art.Image.yMin)) / 2) - art.Image.yMin)
     };
     background.Children.Add(art);
     GHuePicker toAdd = new GHuePicker(4, 4) {
         Brightness = 1
     };
     toAdd.SetTag("ItemID", (int) itemID);
     toAdd.SetTag("Item Art", art);
     toAdd.SetTag("Dialog", background);
     toAdd.OnHueSelect = new OnHueSelect(Engine.HuePicker_OnHueSelect);
     background.Children.Add(toAdd);
     background.Children.Add(new GSingleBorder(3, 3, 0xa2, 0x52));
     background.Children.Add(new GSingleBorder(0xa4, 3, 0x11, 0x52));
     GBrightnessBar bar = new GBrightnessBar(0xa5, 4, 15, 80, toAdd);
     background.Children.Add(bar);
     bar.Refresh();
     GFlatButton button = new GFlatButton(0x7b, 0x57, 0x3a, 20, "Picker", new OnClick(Engine.HuePickerPicker_OnClick));
     GFlatButton okay = new GFlatButton(0xb7, 0x57, 0x3a, 20, "Okay", new OnClick(Engine.HuePickerOk_OnClick));
     okay.SetTag("Hue Picker", toAdd);
     okay.SetTag("Dialog", background);
     okay.SetTag("Serial", num);
     okay.SetTag("ItemID", itemID);
     okay.SetTag("Relay", num2);
     button.SetTag("Hue Picker", toAdd);
     button.SetTag("Brightness Bar", bar);
     background.Children.Add(new GQuickHues(toAdd, bar, okay));
     background.Children.Add(button);
     background.Children.Add(okay);
     Gumps.Desktop.Children.Add(background);
     Engine.HuePicker_OnHueSelect(toAdd.Hue, toAdd);
 }
Ejemplo n.º 16
0
 public GMacroEditorPanel(Client.Macro m)
     : base(0, 0, 0x103, 230)
 {
     GMainMenu menu;
     GMenuItem menuFrom;
     this.m_Macro = m;
     base.m_CanDrag = false;
     base.m_NonRestrictivePicking = true;
     base.ShouldHitTest = false;
     this.m_Ctrl = new GSystemButton(10, 10, 40, 20, GumpPaint.Blend(Color.WhiteSmoke, SystemColors.Control, (float) 0.5f), SystemColors.ControlText, "Ctrl", Engine.GetUniFont(2));
     this.m_Alt = new GSystemButton(0x31, 10, 40, 20, GumpPaint.Blend(Color.WhiteSmoke, SystemColors.Control, (float) 0.5f), SystemColors.ControlText, "Alt", Engine.GetUniFont(2));
     this.m_Shift = new GSystemButton(0x58, 10, 0x2a, 20, GumpPaint.Blend(Color.WhiteSmoke, SystemColors.Control, (float) 0.5f), SystemColors.ControlText, "Shift", Engine.GetUniFont(2));
     this.m_Ctrl.OnClick = new OnClick(this.Ctrl_OnClick);
     this.m_Alt.OnClick = new OnClick(this.Alt_OnClick);
     this.m_Shift.OnClick = new OnClick(this.Shift_OnClick);
     this.m_Ctrl.Tooltip = new Tooltip("Toggles the control key modifier", true);
     this.m_Alt.Tooltip = new Tooltip("Toggles the alt key modifier", true);
     this.m_Shift.Tooltip = new Tooltip("Toggles the shift key modifier", true);
     base.m_Children.Add(this.m_Ctrl);
     base.m_Children.Add(this.m_Alt);
     base.m_Children.Add(this.m_Shift);
     this.UpdateModifiers();
     GAlphaBackground toAdd = new GAlphaBackground(0x81, 10, 0x4a, 20) {
         FillAlpha = 1f,
         FillColor = GumpColors.Window
     };
     base.m_Children.Add(toAdd);
     GMacroKeyEntry entry = new GMacroKeyEntry(GetKeyName(m.Key), 0x81, 10, 0x4a, 20) {
         Tooltip = new Tooltip("Press any key here to change the macro", true)
     };
     base.m_Children.Add(entry);
     GSystemButton button = new GSystemButton(10, 10, 40, 20, GumpPaint.Blend(Color.WhiteSmoke, SystemColors.Control, (float) 0.5f), SystemColors.ControlText, "Delete", Engine.GetUniFont(2));
     button.SetBackColor(GumpPaint.Blend(Color.SteelBlue, SystemColors.Control, (float) 0.25f));
     button.InactiveColor = GumpPaint.Blend(Color.WhiteSmoke, SystemColors.Control, (float) 0.5f);
     button.Tooltip = new Tooltip("Deletes the entire macro", true);
     button.OnClick = new OnClick(this.Delete_OnClick);
     button.X = (this.Width - 10) - button.Width;
     base.m_Children.Add(button);
     base.FillAlpha = 0.15f;
     for (int i = 0; i < m.Actions.Length; i++)
     {
         try
         {
             Action action = m.Actions[i];
             if (action.Handler != null)
             {
                 ActionHandler ah = action.Handler;
                 menu = new GMainMenu(10, 0x23 + (i * 0x17));
                 menuFrom = new GActionMenu(this, m, action);
                 menu.Add(this.FormatMenu(menuFrom));
                 if (ah.Params == null)
                 {
                     GAlphaBackground background2 = new GAlphaBackground(0x81, 0x23 + (i * 0x17), 120, 0x18) {
                         FillAlpha = 1f,
                         FillColor = GumpColors.Window
                     };
                     base.m_Children.Add(background2);
                     IHue windowText = GumpHues.WindowText;
                     GTextBox box = new GMacroParamEntry(action, action.Param, background2.X, background2.Y, background2.Width, background2.Height) {
                         MaxChars = 0xef
                     };
                     base.m_Children.Add(box);
                 }
                 else if (ah.Params.Length != 0)
                 {
                     string name = Find(action.Param, ah.Params);
                     if (name == null)
                     {
                         name = action.Param;
                     }
                     menuFrom = this.GetMenuFrom(new ParamNode(name, ah.Params), action, ah);
                     menuFrom.DropDown = i == (m.Actions.Length - 1);
                     menu.Add(menuFrom);
                 }
                 menu.LeftToRight = true;
                 base.m_Children.Add(menu);
             }
         }
         catch
         {
         }
     }
     menu = new GMainMenu(10, 0x23 + (m.Actions.Length * 0x17));
     menuFrom = this.GetMenuFrom(ActionHandler.Root);
     menuFrom.Tooltip = new Tooltip("To create a new instruction pick one from the menu below", false, 200);
     menuFrom.Text = "New...";
     menuFrom.DropDown = true;
     menu.Add(this.FormatMenu(menuFrom));
     menu.LeftToRight = true;
     base.m_Children.Add(menu);
 }