public GIdleWarning() : base(0xa2c, 100, 100, 0, 0, true) { base.m_CanDrag = true; base.m_QuickDrag = true; GWrappedLabel toAdd = new GWrappedLabel("You have been idle for too long. If you do not do anything in the next minute, you will be logged out.", Engine.GetFont(2), Hues.Load(0x455), base.OffsetX, base.OffsetY - 12, 0x113); base.m_Children.Add(toAdd); GButtonNew new2 = new GButtonNew(0x481, 0, (toAdd.Y + toAdd.Height) + 4); new2.Clicked += new EventHandler(this.Check_Clicked); base.m_Children.Add(new2); this.Width = (this.Width - base.UseWidth) + toAdd.Width; this.Height = ((this.Height - base.UseHeight) + toAdd.Height) - 12; new2.X = base.OffsetX + ((base.UseWidth - new2.Width) / 2); this.Center(); }
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; }
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; }
public GQuestionMenu(int serial, int menuID, string question, AnswerEntry[] answers) : base(0x23f4, Engine.ScreenWidth / 2, 100, 50, 50, true) { base.m_CanDrag = true; base.m_QuickDrag = true; this.m_Serial = serial; this.m_MenuID = menuID; GWrappedLabel toAdd = new GWrappedLabel(question, Engine.GetFont(1), Hues.Load(0x455), base.OffsetX + 4, base.OffsetY + 4, base.UseWidth - 8); base.m_Children.Add(toAdd); this.m_Entries = new GQuestionMenuEntry[answers.Length]; GBackground background = new GQuestionBackground(this.m_Entries, base.UseWidth - 8, ((base.UseHeight - 8) - toAdd.Height) - 4, base.OffsetX + 4, (toAdd.Y + toAdd.Height) + 4); background.SetMouseOverride(this); int offsetX = background.OffsetX; int offsetY = background.OffsetY; int useWidth = background.UseWidth; for (int i = 0; i < answers.Length; i++) { GQuestionMenuEntry entry = new GQuestionMenuEntry(offsetX, offsetY, useWidth, answers[i]); background.Children.Add(entry); entry.Radio.ParentOverride = background; this.m_Entries[i] = entry; offsetY += entry.Height + 4; } background.Height = ((offsetY - 4) - background.OffsetY) + (background.Height - background.UseHeight); this.Height = (((((this.Height - base.UseHeight) + 4) + toAdd.Height) + 4) + background.Height) + 4; int num5 = (int)(Engine.ScreenHeight * 0.75); if (this.Height > num5) { this.Height = num5; background.Height = ((base.UseHeight - 8) - toAdd.Height) - 4; } offsetY -= 4; offsetY -= background.OffsetY; if (offsetY > background.UseHeight) { int num6 = offsetY; background.Width += 0x13; this.Width += 0x13; offsetX = (background.OffsetX + background.UseWidth) - 15; offsetY = background.OffsetY; background.Children.Add(new GImage(0x101, offsetX, offsetY)); background.Children.Add(new GImage(0xff, offsetX, (offsetY + background.UseHeight) - 0x20)); for (int j = offsetY + 30; (j + 0x20) < background.UseHeight; j += 30) { background.Children.Add(new GImage(0x100, offsetX, j)); } this.m_Slider = new GVSlider(0xfe, offsetX + 1, (offsetY + 1) + 12, 13, (background.UseHeight - 2) - 0x18, 0.0, 0.0, (double)(num6 - background.UseHeight), 1.0); this.m_Slider.OnValueChange = new OnValueChange(this.OnScroll); this.m_Slider.ScrollOffset = 20.0; background.Children.Add(this.m_Slider); background.Children.Add(new GHotspot(offsetX, offsetY, 15, background.UseHeight, this.m_Slider)); } GButtonNew new2 = new GButtonNew(0xf3, 0xf2, 0xf1, 0, (background.Y + background.Height) + 4); GButtonNew new3 = new GButtonNew(0xf9, 0xf7, 0xf8, 0, new2.Y); new2.Clicked += new EventHandler(this.Cancel_Clicked); new3.Clicked += new EventHandler(this.Okay_Clicked); new2.X = ((base.OffsetX + base.UseWidth) - 4) - new2.Width; new3.X = (new2.X - 4) - new3.Width; base.m_Children.Add(new2); base.m_Children.Add(new3); this.Height += 4 + new2.Height; base.m_Children.Add(background); this.Center(); }
public GQuestionMenu(int serial, int menuID, string question, AnswerEntry[] answers) : base(0x23f4, Engine.ScreenWidth / 2, 100, 50, 50, true) { base.m_CanDrag = true; base.m_QuickDrag = true; this.m_Serial = serial; this.m_MenuID = menuID; GWrappedLabel toAdd = new GWrappedLabel(question, Engine.GetFont(1), Hues.Load(0x455), base.OffsetX + 4, base.OffsetY + 4, base.UseWidth - 8); base.m_Children.Add(toAdd); this.m_Entries = new GQuestionMenuEntry[answers.Length]; GBackground background = new GQuestionBackground(this.m_Entries, base.UseWidth - 8, ((base.UseHeight - 8) - toAdd.Height) - 4, base.OffsetX + 4, (toAdd.Y + toAdd.Height) + 4); background.SetMouseOverride(this); int offsetX = background.OffsetX; int offsetY = background.OffsetY; int useWidth = background.UseWidth; for (int i = 0; i < answers.Length; i++) { GQuestionMenuEntry entry = new GQuestionMenuEntry(offsetX, offsetY, useWidth, answers[i]); background.Children.Add(entry); entry.Radio.ParentOverride = background; this.m_Entries[i] = entry; offsetY += entry.Height + 4; } background.Height = ((offsetY - 4) - background.OffsetY) + (background.Height - background.UseHeight); this.Height = (((((this.Height - base.UseHeight) + 4) + toAdd.Height) + 4) + background.Height) + 4; int num5 = (int) (Engine.ScreenHeight * 0.75); if (this.Height > num5) { this.Height = num5; background.Height = ((base.UseHeight - 8) - toAdd.Height) - 4; } offsetY -= 4; offsetY -= background.OffsetY; if (offsetY > background.UseHeight) { int num6 = offsetY; background.Width += 0x13; this.Width += 0x13; offsetX = (background.OffsetX + background.UseWidth) - 15; offsetY = background.OffsetY; background.Children.Add(new GImage(0x101, offsetX, offsetY)); background.Children.Add(new GImage(0xff, offsetX, (offsetY + background.UseHeight) - 0x20)); for (int j = offsetY + 30; (j + 0x20) < background.UseHeight; j += 30) { background.Children.Add(new GImage(0x100, offsetX, j)); } this.m_Slider = new GVSlider(0xfe, offsetX + 1, (offsetY + 1) + 12, 13, (background.UseHeight - 2) - 0x18, 0.0, 0.0, (double) (num6 - background.UseHeight), 1.0); this.m_Slider.OnValueChange = new OnValueChange(this.OnScroll); this.m_Slider.ScrollOffset = 20.0; background.Children.Add(this.m_Slider); background.Children.Add(new GHotspot(offsetX, offsetY, 15, background.UseHeight, this.m_Slider)); } GButtonNew new2 = new GButtonNew(0xf3, 0xf2, 0xf1, 0, (background.Y + background.Height) + 4); GButtonNew new3 = new GButtonNew(0xf9, 0xf7, 0xf8, 0, new2.Y); new2.Clicked += new EventHandler(this.Cancel_Clicked); new3.Clicked += new EventHandler(this.Okay_Clicked); new2.X = ((base.OffsetX + base.UseWidth) - 4) - new2.Width; new3.X = (new2.X - 4) - new3.Width; base.m_Children.Add(new2); base.m_Children.Add(new3); this.Height += 4 + new2.Height; base.m_Children.Add(background); this.Center(); }