Esempio 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);
        }
Esempio n. 2
0
 public GWindowsTextBox(int x, int y, int width, int height, string initialText, IFont font, IHue normalHue, IHue overHue, IHue focusHue, char passChar) : base(x, y)
 {
     this.m_Width   = width;
     this.m_Height  = height;
     this.m_TextBox = new GTextBox(0, false, 3, 3, width - 6, height - 6, initialText, font, normalHue, overHue, focusHue, passChar);
     this.Layout();
     base.m_Children.Add(this.m_TextBox);
 }
Esempio n. 3
0
 public GNewServer() : base(0, 0, 320, 110)
 {
     Gumps.Focus    = this;
     base.Text      = "New Server";
     this.m_Title   = this.AddTextBox("Title:", 0);
     this.m_Address = this.AddTextBox("Address:", 1);
     this.m_Port    = this.AddTextBox("Port:", 2);
     this.AddButton("Okay", 1, new OnClick(this.Okay_OnClick));
     this.AddButton("Cancel", 2, new OnClick(this.Cancel_OnClick));
     this.Center();
 }
Esempio n. 4
0
 public GNewAccount(ServerProfile server) : base(0, 0, 320, 110)
 {
     this.m_Server   = server;
     Gumps.Focus     = this;
     base.Text       = "New Account";
     this.m_Title    = this.AddTextBox("Title:", 0, '\0');
     this.m_Username = this.AddTextBox("Username:"******"Password:"******"Okay", 1, new OnClick(this.Okay_OnClick));
     this.AddButton("Cancel", 2, new OnClick(this.Cancel_OnClick));
     this.Center();
 }
Esempio n. 5
0
 public GNewServer()
     : base(0, 0, 320, 110)
 {
     Gumps.Focus = this;
     base.Text = "New Server";
     this.m_Title = this.AddTextBox("Title:", 0);
     this.m_Address = this.AddTextBox("Address:", 1);
     this.m_Port = this.AddTextBox("Port:", 2);
     this.AddButton("Okay", 1, new OnClick(this.Okay_OnClick));
     this.AddButton("Cancel", 2, new OnClick(this.Cancel_OnClick));
     this.Center();
 }
Esempio n. 6
0
 public GEditAccount(AccountProfile account) : base(0, 0, 320, 110)
 {
     this.m_Account  = account;
     Gumps.Focus     = this;
     base.Text       = "Edit Account";
     this.m_Title    = this.AddTextBox("Title:", 0, account.Title, '\0');
     this.m_Username = this.AddTextBox("Username:"******"Password:"******"Remove", 0, new OnClick(this.Remove_OnClick));
     this.AddButton("Okay", 1, new OnClick(this.Okay_OnClick));
     this.AddButton("Cancel", 2, new OnClick(this.Cancel_OnClick));
     this.Center();
 }
Esempio n. 7
0
 public GNewAccount(ServerProfile server)
     : base(0, 0, 320, 110)
 {
     this.m_Server = server;
     Gumps.Focus = this;
     base.Text = "New Account";
     this.m_Title = this.AddTextBox("Title:", 0, '\0');
     this.m_Username = this.AddTextBox("Username:"******"Password:"******"Okay", 1, new OnClick(this.Okay_OnClick));
     this.AddButton("Cancel", 2, new OnClick(this.Cancel_OnClick));
     this.Center();
 }
Esempio n. 8
0
 public GEditAccount(AccountProfile account)
     : base(0, 0, 320, 110)
 {
     this.m_Account = account;
     Gumps.Focus = this;
     base.Text = "Edit Account";
     this.m_Title = this.AddTextBox("Title:", 0, account.Title, '\0');
     this.m_Username = this.AddTextBox("Username:"******"Password:"******"Remove", 0, new OnClick(this.Remove_OnClick));
     this.AddButton("Okay", 1, new OnClick(this.Okay_OnClick));
     this.AddButton("Cancel", 2, new OnClick(this.Cancel_OnClick));
     this.Center();
 }
Esempio n. 9
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;
 }
Esempio n. 10
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;
 }
Esempio n. 11
0
        public GDragAmount(Client.Item item) : base(0x85c, 0, 0)
        {
            GTextBox box;

            this.m_First = true;
            this.m_Item  = item;
            int amount = (ushort)this.m_Item.Amount;

            this.m_Amount        = amount;
            this.m_Okay          = new GButtonNew(0x81a, 0x81c, 0x81b, 0x66, 0x25);
            this.m_Okay.CanEnter = true;
            this.m_Okay.Clicked += new EventHandler(this.Okay_Clicked);
            base.m_Children.Add(this.m_Okay);
            GSlider toAdd = new GSlider(0x845, 0x23, 0x10, 0x5f, 15, (double)amount, 0.0, (double)amount, 1.0)
            {
                OnValueChange = new OnValueChange(this.Slider_OnValueChange)
            };

            base.m_Children.Add(toAdd);
            this.m_Slider = toAdd;
            GHotspot hotspot = new GHotspot(0x1c, 0x10, 0x6d, 15, toAdd);

            base.m_Children.Add(hotspot);
            box = new GTextBox(0, false, 0x1a, 0x2b, 0x42, 15, amount.ToString(), Engine.GetFont(1), Hues.Load(0x455), Hues.Load(0x455), Hues.Load(0x455))
            {
                OnTextChange       = (OnTextChange)Delegate.Combine(box.OnTextChange, new OnTextChange(this.TextBox_OnTextChange)),
                OnBeforeTextChange = (OnBeforeTextChange)Delegate.Combine(box.OnBeforeTextChange, new OnBeforeTextChange(this.TextBox_OnBeforeTextChange)),
                EnterButton        = this.m_Okay
            };
            base.m_Children.Add(box);
            this.m_TextBox = box;
            box.Focus();
            base.m_IsDragging = true;
            base.m_OffsetX    = this.Width / 2;
            base.m_OffsetY    = this.Height / 2;
            Gumps.LastOver    = this;
            Gumps.Drag        = this;
            Gumps.Focus       = this;
            base.m_X          = Engine.m_xMouse - base.m_OffsetX;
            base.m_Y          = Engine.m_yMouse - base.m_OffsetY;
        }
Esempio n. 12
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);
        }
Esempio n. 13
0
 public GDragAmount(Client.Item item)
     : base(0x85c, 0, 0)
 {
     GTextBox box;
     this.m_First = true;
     this.m_Item = item;
     int amount = (ushort) this.m_Item.Amount;
     this.m_Amount = amount;
     this.m_Okay = new GButtonNew(0x81a, 0x81c, 0x81b, 0x66, 0x25);
     this.m_Okay.CanEnter = true;
     this.m_Okay.Clicked += new EventHandler(this.Okay_Clicked);
     base.m_Children.Add(this.m_Okay);
     GSlider toAdd = new GSlider(0x845, 0x23, 0x10, 0x5f, 15, (double) amount, 0.0, (double) amount, 1.0) {
         OnValueChange = new OnValueChange(this.Slider_OnValueChange)
     };
     base.m_Children.Add(toAdd);
     this.m_Slider = toAdd;
     GHotspot hotspot = new GHotspot(0x1c, 0x10, 0x6d, 15, toAdd);
     base.m_Children.Add(hotspot);
     box = new GTextBox(0, false, 0x1a, 0x2b, 0x42, 15, amount.ToString(), Engine.GetFont(1), Hues.Load(0x455), Hues.Load(0x455), Hues.Load(0x455)) {
         OnTextChange = (OnTextChange) Delegate.Combine(box.OnTextChange, new OnTextChange(this.TextBox_OnTextChange)),
         OnBeforeTextChange = (OnBeforeTextChange) Delegate.Combine(box.OnBeforeTextChange, new OnBeforeTextChange(this.TextBox_OnBeforeTextChange)),
         EnterButton = this.m_Okay
     };
     base.m_Children.Add(box);
     this.m_TextBox = box;
     box.Focus();
     base.m_IsDragging = true;
     base.m_OffsetX = this.Width / 2;
     base.m_OffsetY = this.Height / 2;
     Gumps.LastOver = this;
     Gumps.Drag = this;
     Gumps.Focus = this;
     base.m_X = Engine.m_xMouse - base.m_OffsetX;
     base.m_Y = Engine.m_yMouse - base.m_OffsetY;
 }
Esempio n. 14
0
 public static void ShowCharAppearance(int Str, int Dex, int Int, int vSkill1, int vSkill2, int vSkill3, int iSkill1, int iSkill2, int iSkill3)
 {
     Cursor.Hourglass = false;
     Gumps.Desktop.Children.Clear();
     Gumps.Desktop.Children.Add(new GBackground(0x588, ScreenWidth, ScreenHeight, false));
     Gumps.Desktop.Children.Add(new GImage(0x157c, 0, 0));
     Gumps.Desktop.Children.Add(new GImage(0x15a0, 0, 4));
     GButton toAdd = new GButton(0x1589, 0x22b, 4, new OnClick(Engine.Quit_OnClick)) {
         Tooltip = new Tooltip(Strings.GetString("Tooltips.Quit"))
     };
     Gumps.Desktop.Children.Add(toAdd);
     Gumps.Desktop.Children.Add(new GImage(0x709, 280, 0x35));
     GTextBox box = new GTextBox(0, false, 0xf8, 0x4b, 0xd7, 0x10, "Name", GetFont(5), Hues.Load(0x76b), Hues.Load(0x835), Hues.Load(0x25)) {
         Tooltip = new Tooltip(Strings.GetString("Tooltips.CharCreateName"))
     };
     Gumps.Desktop.Children.Add(new GImage(0x70a, 240, 0x49));
     Gumps.Desktop.Children.Add(new GBackground(0x70b, 0xd7, 0x10, 0xf8, 0x49, false));
     Gumps.Desktop.Children.Add(new GImage(0x70c, 0x1cf, 0x49));
     Gumps.Desktop.Children.Add(box);
     GImage image = new GImage(0x708, 0xee, 0x62);
     GButton button2 = new GButton(0x710, 0x48, 320, new OnClick(Engine.CharGender_OnClick));
     button2.SetTag("Gender", 0);
     image.Children.Add(button2);
     Gumps.Desktop.Children.Add(image);
     Gumps.Desktop.Children.Add(new GBackground(0xe14, 0x97, 310, 0x52, 0x7d, true));
     GBackground background = new GBackground(0xe14, 0x97, 310, 0x1db, 0x7d, true);
     string[] strArray = new string[] { "Skin Tone", "Shirt Color", "Pants Color", "Hair Color", "Facial Hair Color" };
     string[] strArray2 = new string[] { Strings.GetString("Tooltips.CharCreateSkinTone"), Strings.GetString("Tooltips.CharCreateShirtHue"), Strings.GetString("Tooltips.CharCreatePantsHue"), Strings.GetString("Tooltips.CharCreateHairHue"), Strings.GetString("Tooltips.CharCreateFHairHue") };
     int[] numArray = new int[] { GetRandomSkinHue(), GetRandomHue(), GetRandomHue(), GetRandomHairHue(), GetRandomHairHue(), GetRandomYellowHue() };
     numArray[0] ^= 0x8000;
     if (!Map.m_ItemFlags[0x1517][TileFlag.PartialHue])
     {
         numArray[1] ^= 0x8000;
     }
     if (!Map.m_ItemFlags[0x152e][TileFlag.PartialHue])
     {
         numArray[2] ^= 0x8000;
     }
     if (!Map.m_ItemFlags[0x203b][TileFlag.PartialHue])
     {
         numArray[3] ^= 0x8000;
     }
     if (!Map.m_ItemFlags[0x2040][TileFlag.PartialHue])
     {
         numArray[4] ^= 0x8000;
     }
     if (!Map.m_ItemFlags[0x170f][TileFlag.PartialHue])
     {
         numArray[5] ^= 0x8000;
     }
     Gump[] gumpArray = new Gump[] { new GImage(0x761, Hues.Load(numArray[0]), 0, 0), new GImage(0x739, Hues.Load(numArray[1]), 0, 0), new GImage(0x738, Hues.Load(numArray[2]), 0, 0), new GImage(0x753, Hues.Load(numArray[3]), 0, 0), new GImage(0x759, Hues.Load(numArray[4]), 0, 0), new GImage(0x762, Hues.Load(numArray[5]), 0, 0) };
     gumpArray[0].SetTag("ItemID", 0);
     gumpArray[1].SetTag("ItemID", 0x1517);
     gumpArray[2].SetTag("ItemID", 0x152e);
     gumpArray[3].SetTag("ItemID", 0x203b);
     gumpArray[4].SetTag("ItemID", 0x2040);
     gumpArray[5].SetTag("ItemID", 0x170f);
     button2.SetTag("Image", gumpArray[0]);
     int offsetY = background.OffsetY;
     image.Children.Add(gumpArray[0]);
     image.Children.Add(gumpArray[5]);
     image.Children.Add(gumpArray[1]);
     image.Children.Add(gumpArray[2]);
     image.Children.Add(gumpArray[4]);
     image.Children.Add(gumpArray[3]);
     GButton button3 = new GButton(0x15a4, 610, 0x1bd, new OnClick(Engine.CharCreationAppearanceArrow_OnClick));
     button2.SetTag("Image[5]", gumpArray[5]);
     button2.SetTag("Arrow", button3);
     UnicodeFont uniFont = GetUniFont(0);
     for (int i = 0; i < 5; i++)
     {
         GTextButton button4 = new GTextButton(strArray[i], uniFont, Hues.Bright, Hues.Load(0x26), background.OffsetX, offsetY, new OnClick(Engine.AppearanceHueProperty_OnClick)) {
             SpaceWidth = 6
         };
         offsetY += button4.Height - 2;
         GHuePreview preview = new GHuePreview(background.OffsetX, offsetY, 100, 0x10, numArray[i], false);
         offsetY += 0x10;
         button4.Tooltip = new Tooltip(strArray2[i]);
         button4.SetTag("Property", strArray[i]);
         button4.SetTag("Preview", preview);
         button4.SetTag("Image", gumpArray[i]);
         button2.SetTag(string.Format("Image[{0}]", i), gumpArray[i]);
         button3.SetTag(strArray[i], preview);
         background.Children.Add(button4);
         background.Children.Add(preview);
         GHotspot hotspot = new GHotspot(button4.X, button4.Y, Biggest(button4.Width, preview.Width), (preview.Y + preview.Height) - button4.Y, button4) {
             Tooltip = new Tooltip(strArray2[i])
         };
         background.Children.Add(hotspot);
         if (i == 4)
         {
             button2.SetTag("HideHS", hotspot);
             button2.SetTag("HideTB", button4);
             button2.SetTag("HideHP", preview);
         }
     }
     Gumps.Desktop.Children.Add(background);
     button3.SetTag("Strength", Str);
     button3.SetTag("Dexterity", Dex);
     button3.SetTag("Intelligence", Int);
     button3.SetTag("vSkill1", vSkill1);
     button3.SetTag("vSkill2", vSkill2);
     button3.SetTag("vSkill3", vSkill3);
     button3.SetTag("iSkill1", iSkill1);
     button3.SetTag("iSkill2", iSkill2);
     button3.SetTag("iSkill3", iSkill3);
     button3.SetTag("Name", box);
     button3.SetTag("Gender", 0);
     Gumps.Desktop.Children.Add(button3);
 }
Esempio n. 15
0
 private static void StringQuery(PacketReader pvSrc)
 {
     GDragable dragable;
     GWrappedLabel label2;
     int num = pvSrc.ReadInt32();
     short num2 = pvSrc.ReadInt16();
     int fixedLength = pvSrc.ReadInt16();
     string text = pvSrc.ReadString(fixedLength);
     bool flag = pvSrc.ReadBoolean();
     byte num4 = pvSrc.ReadByte();
     int num5 = pvSrc.ReadInt32();
     int num6 = pvSrc.ReadInt16();
     string str2 = pvSrc.ReadString(num6);
     dragable = new GDragable(0x474, 0, 0) {
         CanClose = false,
         Modal = true,
         X = (Engine.ScreenWidth - dragable.Width) / 2,
         Y = (Engine.ScreenHeight - dragable.Height) / 2
     };
     GButton toAdd = new GButton(0x47b, 0x47d, 0x47c, 0x75, 190, new OnClick(Engine.StringQueryOkay_OnClick));
     GButton button2 = new GButton(0x478, 0x47a, 0x479, 0xcc, 190, flag ? new OnClick(Engine.StringQueryCancel_OnClick) : null);
     if (!flag)
     {
         button2.Enabled = false;
     }
     GImage image = new GImage(0x477, 60, 0x91);
     GWrappedLabel label = new GWrappedLabel(text, Engine.GetFont(2), Hues.Load(0x455), 60, 0x30, 0x110);
     label2 = new GWrappedLabel(str2, Engine.GetFont(2), Hues.Load(0x455), 60, 0x30, 0x110) {
         Y = image.Y - label2.Height
     };
     GTextBox box = new GTextBox(0, false, 0x44, 140, image.Width - 8, image.Height, "", Engine.GetFont(1), Hues.Load(0x455), Hues.Load(0x455), Hues.Load(0x455));
     box.Focus();
     if (num4 == 1)
     {
         box.MaxChars = num5;
     }
     toAdd.SetTag("Dialog", dragable);
     toAdd.SetTag("Serial", num);
     toAdd.SetTag("Type", num2);
     toAdd.SetTag("Text", box);
     button2.SetTag("Dialog", dragable);
     button2.SetTag("Serial", num);
     button2.SetTag("Type", num2);
     dragable.Children.Add(label);
     dragable.Children.Add(label2);
     dragable.Children.Add(image);
     dragable.Children.Add(box);
     dragable.Children.Add(button2);
     dragable.Children.Add(toAdd);
     dragable.m_CanDrag = true;
     Gumps.Desktop.Children.Add(dragable);
 }
Esempio n. 16
0
 private static bool Parse_TextBox(XmlTextReader xml, Gump Parent, string Name)
 {
     int gumpID = 0;
     bool hasBorder = false;
     int x = 0;
     int y = 0;
     int width = 0;
     int height = 0;
     string startText = "";
     char passChar = '\0';
     bool flag2 = false;
     Gump gumps = null;
     IFont defaultFont = Engine.DefaultFont;
     IHue defaultHue = Engine.DefaultHue;
     IHue hOver = Engine.DefaultHue;
     IHue hFocus = Engine.DefaultHue;
     bool isEmptyElement = xml.IsEmptyElement;
     while (xml.MoveToNextAttribute())
     {
         switch (xml.Name)
         {
             case "GumpID":
             {
                 gumpID = GetInt(xml.Value);
                 continue;
             }
             case "GumpIDi":
             {
                 gumpID = Convert.ToInt32(xml.Value);
                 continue;
             }
             case "GumpIDh":
             {
                 gumpID = Convert.ToInt32(xml.Value.Substring(2), 0x10);
                 continue;
             }
             case "Width":
             {
                 width = GetInt(xml.Value);
                 continue;
             }
             case "Widthi":
             {
                 width = Convert.ToInt32(xml.Value);
                 continue;
             }
             case "Widthh":
             {
                 width = Convert.ToInt32(xml.Value.Substring(2), 0x10);
                 continue;
             }
             case "Height":
             {
                 height = GetInt(xml.Value);
                 continue;
             }
             case "Heighti":
             {
                 height = Convert.ToInt32(xml.Value);
                 continue;
             }
             case "Heighth":
             {
                 height = Convert.ToInt32(xml.Value.Substring(2), 0x10);
                 continue;
             }
             case "X":
             {
                 x = GetInt(xml.Value);
                 continue;
             }
             case "Xi":
             {
                 x = Convert.ToInt32(xml.Value);
                 continue;
             }
             case "Xh":
             {
                 x = Convert.ToInt32(xml.Value.Substring(2), 0x10);
                 continue;
             }
             case "Y":
             {
                 y = GetInt(xml.Value);
                 continue;
             }
             case "Yi":
             {
                 y = Convert.ToInt32(xml.Value);
                 continue;
             }
             case "Yh":
             {
                 y = Convert.ToInt32(xml.Value.Substring(2), 0x10);
                 continue;
             }
             case "Border":
             {
                 hasBorder = GetBool(xml.Value);
                 continue;
             }
             case "Borderb":
             {
                 hasBorder = Convert.ToBoolean(xml.Value);
                 continue;
             }
             case "PassChar":
             {
                 passChar = GetString(xml.Value)[0];
                 flag2 = true;
                 continue;
             }
             case "PassChars":
             {
                 passChar = xml.Value[0];
                 flag2 = true;
                 continue;
             }
             case "Text":
             {
                 startText = GetString(xml.Value);
                 continue;
             }
             case "Texts":
             {
                 startText = xml.Value;
                 continue;
             }
             case "Font":
             {
                 defaultFont = GetFont(xml.Value);
                 continue;
             }
             case "Fonti":
             {
                 defaultFont = GetFonti(xml.Value);
                 continue;
             }
             case "Fonth":
             {
                 defaultFont = GetFonth(xml.Value);
                 continue;
             }
             case "RegularHue":
             {
                 defaultHue = GetHue(xml.Value);
                 continue;
             }
             case "RegularHuei":
             {
                 defaultHue = GetHuei(xml.Value);
                 continue;
             }
             case "RegularHueh":
             {
                 defaultHue = GetHueh(xml.Value);
                 continue;
             }
             case "OverHue":
             {
                 hOver = GetHue(xml.Value);
                 continue;
             }
             case "OverHuei":
             {
                 hOver = GetHuei(xml.Value);
                 continue;
             }
             case "OverHueh":
             {
                 hOver = GetHueh(xml.Value);
                 continue;
             }
             case "FocusHue":
             {
                 hFocus = GetHue(xml.Value);
                 continue;
             }
             case "FocusHuei":
             {
                 hFocus = GetHuei(xml.Value);
                 continue;
             }
             case "FocusHueh":
             {
                 hFocus = GetHueh(xml.Value);
                 continue;
             }
             case "EnterButton":
             {
                 gumps = GetGump(xml.Value);
                 continue;
             }
             case "EnterButtons":
             {
                 gumps = GetGumps(xml.Value);
                 continue;
             }
         }
         return false;
     }
     GTextBox toAdd = null;
     if (!flag2)
     {
         toAdd = new GTextBox(gumpID, hasBorder, x, y, width, height, startText, defaultFont, defaultHue, hOver, hFocus);
     }
     else
     {
         toAdd = new GTextBox(gumpID, hasBorder, x, y, width, height, startText, defaultFont, defaultHue, hOver, hFocus, passChar);
     }
     if (gumps.GetType() == typeof(GButton))
     {
         toAdd.EnterButton = (GButton) gumps;
     }
     Parent.Children.Add(toAdd);
     if (isEmptyElement)
     {
         return true;
     }
     while (xml.Read())
     {
         XmlNodeType nodeType = xml.NodeType;
         if (nodeType != XmlNodeType.Element)
         {
             if (nodeType != XmlNodeType.Comment)
             {
                 return (nodeType == XmlNodeType.EndElement);
             }
         }
         else if (!Parse_Element(xml, toAdd, Name))
         {
             return false;
         }
     }
     return false;
 }
Esempio n. 17
0
 public static void Destroy(Gump g)
 {
     if (g != null)
     {
         m_Invalidated = true;
         g.Children.Clear();
         if (g == m_Drag)
         {
             m_Drag = null;
         }
         if (g == m_Capture)
         {
             m_Capture = null;
         }
         if (g == m_Focus)
         {
             m_Focus = null;
         }
         if (g == m_Modal)
         {
             m_Modal = null;
         }
         if (g == m_LastDragOver)
         {
             m_LastDragOver = null;
         }
         if (g == m_StartDrag)
         {
             m_StartDrag = null;
         }
         if (g == m_LastOver)
         {
             m_LastOver = null;
         }
         if (g == m_TextFocus)
         {
             m_TextFocus = null;
         }
         if ((g.m_Restore && (g.GUID != null)) && (g.GUID.Length > 0))
         {
             m_ToRestore[g.GUID] = new Point(g.X, g.Y);
         }
         if (g.HasTag("Dispose"))
         {
             switch (((string) g.GetTag("Dispose")))
             {
                 case "Spellbook":
                 {
                     Item tag = (Item) g.GetTag("Container");
                     if (tag != null)
                     {
                         tag.OpenSB = false;
                     }
                     break;
                 }
                 case "Modal":
                     m_Modal = null;
                     break;
             }
         }
         g.m_Disposed = true;
         g.OnDispose();
         if (g.Parent != null)
         {
             g.Parent.Children.Remove(g);
         }
     }
 }
Esempio n. 18
0
 private static bool RecurseMouseDown(int X, int Y, Gump g, int mX, int mY, MouseButtons mb)
 {
     if (g.Visible && (g.m_NonRestrictivePicking || (((mX >= X) && (mX < (X + g.Width))) && ((mY >= Y) && (mY < (Y + g.Height))))))
     {
         Gump[] gumpArray = g.Children.ToArray();
         for (int i = gumpArray.Length - 1; i >= 0; i--)
         {
             Gump gump = gumpArray[i];
             if (RecurseMouseDown(X + gump.X, Y + gump.Y, gump, mX, mY, mb))
             {
                 return true;
             }
         }
         if (!g.m_NonRestrictivePicking || (((mX >= X) && (mX < (X + g.Width))) && ((mY >= Y) && (mY < (Y + g.Height)))))
         {
             if ((m_Modal == null) && g.HitTest(mX - X, mY - Y))
             {
                 if (m_TextFocus != null)
                 {
                     m_TextFocus.Unfocus();
                     m_TextFocus = null;
                 }
                 if (((m_Drag == null) && g.m_CanDrag) && (mb == MouseButtons.Left))
                 {
                     m_StartDrag = g;
                     m_StartDragPoint = new Point(mX, mY);
                     g.m_OffsetX = mX - X;
                     g.m_OffsetY = mY - Y;
                     if (g.m_QuickDrag)
                     {
                         g.m_IsDragging = true;
                         m_Drag = g;
                         g.OnDragStart();
                     }
                 }
                 g.OnMouseDown(mX - X, mY - Y, mb);
                 Focus = g;
                 if (g == m_Drag)
                 {
                     return !IsWorldAt(mX, mY, false);
                 }
                 return true;
             }
             if (((m_Modal != null) && g.IsChildOf(m_Modal)) && g.HitTest(mX - X, mY - Y))
             {
                 if (m_TextFocus != null)
                 {
                     m_TextFocus.Unfocus();
                     m_TextFocus = null;
                 }
                 if (((m_Drag == null) && g.m_CanDrag) && (mb == MouseButtons.Left))
                 {
                     m_StartDrag = g;
                     m_StartDragPoint = new Point(mX, mY);
                     g.m_OffsetX = mX - X;
                     g.m_OffsetY = mY - Y;
                     if (g.m_QuickDrag)
                     {
                         g.m_IsDragging = true;
                         g.OnDragStart();
                         m_Drag = g;
                     }
                 }
                 g.OnMouseDown(mX - X, mY - Y, mb);
                 Focus = g;
                 if (g == m_Drag)
                 {
                     return !IsWorldAt(mX, mY, false);
                 }
                 return true;
             }
         }
     }
     return false;
 }
Esempio n. 19
0
 private static bool RecurseDoubleClick(int X, int Y, Gump g, int mX, int mY)
 {
     if (g.Visible && (g.m_NonRestrictivePicking || (((mX >= X) && (mX < (X + g.Width))) && ((mY >= Y) && (mY < (Y + g.Height))))))
     {
         Gump[] gumpArray = g.Children.ToArray();
         for (int i = gumpArray.Length - 1; i >= 0; i--)
         {
             Gump gump = gumpArray[i];
             if (RecurseDoubleClick(X + gump.X, Y + gump.Y, gump, mX, mY))
             {
                 return true;
             }
         }
         if (!g.m_NonRestrictivePicking || (((mX >= X) && (mX < (X + g.Width))) && ((mY >= Y) && (mY < (Y + g.Height)))))
         {
             if ((m_Modal == null) && g.HitTest(mX - X, mY - Y))
             {
                 if (m_TextFocus != null)
                 {
                     m_TextFocus.Unfocus();
                     m_TextFocus = null;
                 }
                 g.OnDoubleClick(mX - X, mY - Y);
                 return true;
             }
             if (((m_Modal != null) && g.IsChildOf(m_Modal)) && g.HitTest(mX - X, mY - Y))
             {
                 if (m_TextFocus != null)
                 {
                     m_TextFocus.Unfocus();
                     m_TextFocus = null;
                 }
                 g.OnDoubleClick(mX - X, mY - Y);
                 return true;
             }
         }
     }
     return false;
 }
Esempio n. 20
0
 public void Dispose()
 {
     Stack stack = new Stack();
     stack.Push(m_Desktop);
     while (stack.Count > 0)
     {
         Gump gump = (Gump) stack.Pop();
         if (gump != null)
         {
             GumpList children = gump.Children;
             if (children != null)
             {
                 Gump[] gumpArray = children.ToArray();
                 for (int i = 0; i < gumpArray.Length; i++)
                 {
                     stack.Push(gumpArray[i]);
                 }
             }
             try
             {
                 gump.OnDispose();
                 continue;
             }
             catch (Exception exception)
             {
                 Debug.Trace("Exception in {0}.OnDispose()", gump);
                 Debug.Error(exception);
                 continue;
             }
         }
     }
     m_Desktop = null;
     this.m_Stream.Close();
     this.m_Stream = null;
     this.m_Verdata.Close();
     this.m_Verdata = null;
     this.m_Buffer = null;
     m_Drag = null;
     m_Capture = null;
     m_Focus = null;
     m_Modal = null;
     m_LastDragOver = null;
     m_StartDrag = null;
     m_LastOver = null;
     m_TextFocus = null;
     m_TipDelay = null;
     this.m_Index = null;
     if (this.m_Objects != null)
     {
         this.m_Objects.Clear();
         this.m_Objects = null;
     }
     if (m_ToRestore != null)
     {
         m_ToRestore.Clear();
         m_ToRestore = null;
     }
 }