public GBuyGump_OfferMenu(GBuyGump owner) : base(0x871, 170, 0xd6) { string str; this.m_Owner = owner; Mobile player = World.Player; if (((player != null) && ((str = player.Name) != null)) && ((str = str.Trim()).Length > 0)) { this.m_Signature = new GLabel(str, Engine.GetFont(5), Hues.Load(0x455), 0x48, 0xc2); this.m_Signature.Visible = false; base.m_Children.Add(this.m_Signature); } base.m_Children.Add(new GLabel((player != null) ? player.Gold.ToString() : "0", Engine.GetFont(6), Hues.Default, 0xbc, 0xa7)); this.m_Total = new GLabel("0", Engine.GetFont(6), Hues.Default, 0x44, 0xa7); this.m_Accept = new GBuyAccept(owner); this.m_Clear = new GBuyClear(owner); base.m_Children.Add(this.m_Total); base.m_Children.Add(this.m_Accept); base.m_Children.Add(this.m_Clear); base.m_CanDrag = true; base.m_QuickDrag = true; GVSlider toAdd = new GVSlider(0x828, 0xed, 0x51, 0x22, 0x3a, 0.0, 0.0, 50.0, 1.0); this.m_Slider = toAdd; base.m_Children.Add(toAdd); base.m_Children.Add(new GHotspot(0xed, 0x42, 0x22, 0x54, toAdd)); }
private void UpdateLabel(bool forceUpdate, IHue hue) { string text = this.m_String; if (this.m_PassChar != '\0') { text = new string(this.m_PassChar, text.Length); } if (this.m_Focus && this.ShowCaret) { text = text + "_"; } if ((this.m_Text != null) && !forceUpdate) { this.m_Text.Text = text; this.m_Text.Hue = hue; } else { if (this.m_Text != null) { Gumps.Destroy(this.m_Text); } if (this.m_MaxChars >= 0) { this.m_Text = new GWrappedLabel(text, this.m_Font, this.m_HNormal, 0, 0, this.m_Width); this.m_Text.Scissor(0, 0, this.m_Width, this.m_Height); } else { this.m_Text = new GLabel(text, this.m_Font, this.m_HNormal, 0, 0); } } }
public GServerEntry(Server server, IFont font, IHue hue, int x, int y, int width, int selectedBorderColor, int selectedFillColor, float selectedFillAlpha) : base(x, y) { this.m_yBase = y; this.m_SelectedBorderColor = selectedBorderColor; this.m_SelectedFillColor = selectedFillColor; this.m_SelectedFillAlpha = selectedFillAlpha; this.m_Server = server; this.m_Name = new GLabel(server.Name, font, hue, 4, 4); this.m_Name.X -= this.m_Name.Image.xMin; base.m_Children.Add(this.m_Name); this.m_PercentFull = new GLabel(string.Format("{0}% full", server.PercentFull), font, hue, width - 5, 4); this.m_PercentFull.X -= this.m_PercentFull.Image.xMax; base.m_Children.Add(this.m_PercentFull); int num = (this.m_Name.Image.yMax - this.m_Name.Image.yMin) + 1; this.m_Height = num; num = (this.m_PercentFull.Image.yMax - this.m_PercentFull.Image.yMin) + 1; if (num > this.m_Height) { this.m_Height = num; } this.m_Height += 8; this.m_Name.Y = ((this.m_Height - ((this.m_Name.Image.yMax - this.m_Name.Image.yMin) + 1)) / 2) - this.m_Name.Image.yMin; this.m_PercentFull.Y = ((this.m_Height - ((this.m_PercentFull.Image.yMax - this.m_PercentFull.Image.yMin) + 1)) / 2) - this.m_PercentFull.Image.yMin; this.m_Width = width; }
public GSkillGump(Skill skill, int y, int width, bool showReal) : base(4, y) { this.m_yBase = y; this.m_Skill = skill; if (skill.Action) { this.m_Name = new GUsableSkillName(skill); } else { this.m_Name = new GLabel(skill.Name, Engine.GetUniFont(1), Hues.Bright, 20, 0); } this.m_Name.X -= this.m_Name.Image.xMin; this.m_Name.Y -= this.m_Name.Image.yMin; this.m_Width = width; this.m_Height = this.m_Name.Image.yMax - this.m_Name.Image.yMin; base.m_Children.Add(this.m_Name); float num = showReal ? this.m_Skill.Real : this.m_Skill.Value; this.m_Value = new GLabel(num.ToString("F1"), Engine.GetUniFont(1), Hues.Bright, 0, 0); this.m_Value.X = (this.m_Width - 0x18) - this.m_Value.Image.xMax; this.m_Value.Y -= this.m_Value.Image.yMin; if ((this.m_Value.Image.yMax - this.m_Value.Image.yMin) > this.m_Height) { this.m_Height = this.m_Value.Image.yMax - this.m_Value.Image.yMin; } base.m_Children.Add(this.m_Value); this.m_Lock = new GThreeToggle(Engine.m_SkillUp, Engine.m_SkillDown, Engine.m_SkillLocked, (int)this.m_Skill.Lock, this.m_Width - 4, 0); this.m_Lock.OnStateChange = new OnStateChange(this.Lock_OnStateChange); this.UpdateLock(); base.m_Children.Add(this.m_Lock); }
public GSkillGump(Skill skill, int y, int width, bool showReal) : base(4, y) { this.m_yBase = y; this.m_Skill = skill; if (skill.Action) { this.m_Name = new GUsableSkillName(skill); } else { this.m_Name = new GLabel(skill.Name, Engine.GetUniFont(1), Hues.Bright, 20, 0); } this.m_Name.X -= this.m_Name.Image.xMin; this.m_Name.Y -= this.m_Name.Image.yMin; this.m_Width = width; this.m_Height = this.m_Name.Image.yMax - this.m_Name.Image.yMin; base.m_Children.Add(this.m_Name); float num = showReal ? this.m_Skill.Real : this.m_Skill.Value; this.m_Value = new GLabel(num.ToString("F1"), Engine.GetUniFont(1), Hues.Bright, 0, 0); this.m_Value.X = (this.m_Width - 0x18) - this.m_Value.Image.xMax; this.m_Value.Y -= this.m_Value.Image.yMin; if ((this.m_Value.Image.yMax - this.m_Value.Image.yMin) > this.m_Height) { this.m_Height = this.m_Value.Image.yMax - this.m_Value.Image.yMin; } base.m_Children.Add(this.m_Value); this.m_Lock = new GThreeToggle(Engine.m_SkillUp, Engine.m_SkillDown, Engine.m_SkillLocked, (int) this.m_Skill.Lock, this.m_Width - 4, 0); this.m_Lock.OnStateChange = new OnStateChange(this.Lock_OnStateChange); this.UpdateLock(); base.m_Children.Add(this.m_Lock); }
private GNetwork() : base(Engine.ScreenWidth - 200, 0, 200, 400) { m_pcBytesIn = 0; m_pcBytesOut = 0; this.m_Start = Environment.TickCount; IFont uniFont = Engine.GetUniFont(1); IHue bright = Hues.Bright; GLabel toAdd = new GLabel("Network Statistics", uniFont, bright, 0, 0); base.m_Children.Add(toAdd); toAdd.Center(); toAdd.Y = 3; int y = (toAdd.Y + toAdd.Height) + 3; m_Ping = new GLabel("<-> Ping:", uniFont, bright, 3, y); base.m_Children.Add(m_Ping); y += m_Ping.Height + 3; m_OutSpeed = new GLabel("--> Kbps:", uniFont, bright, 3, y); base.m_Children.Add(m_OutSpeed); base.m_Children.Add(m_OutTotal = new GLabel("", uniFont, bright, 3, y)); y += m_OutSpeed.Height + 3; m_InSpeed = new GLabel("<-- Kbps:", uniFont, bright, 3, y); base.m_Children.Add(m_InSpeed); base.m_Children.Add(m_InTotal = new GLabel("", uniFont, bright, 3, y)); y += m_InSpeed.Height + 3; GPacketStats stats = new GPacketStats { Y = y }; base.m_Children.Add(stats); y += stats.Height + 3; base.m_Height = y; }
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); }
public GSellGump_InventoryItem(GSellGump owner, SellInfo si, int y, bool seperate) : base(0x20, y, 0xc3, 0) { this.m_Owner = owner; this.m_yBase = y; this.m_Info = si; IFont uniFont = Engine.GetUniFont(3); IHue hue = Hues.Load(0x288); this.m_Image = new GItemArt(0, 0, si.ItemID, si.Hue); this.m_Description = new GWrappedLabel(string.Format("{0} at {1} gp", si.Name, si.Price), uniFont, hue, 0x3a, 0, 0x69); this.m_Available = new GLabel(si.Amount.ToString(), uniFont, hue, 0xc3, 0); int num = (this.m_Image.Image.yMax - this.m_Image.Image.yMin) + 1; base.m_Height = num; num = (this.m_Description.Image.yMax - this.m_Description.Image.yMin) + 1; if (num > base.m_Height) { base.m_Height = num; } num = (this.m_Available.Image.yMax - this.m_Available.Image.yMin) + 1; if (num > base.m_Height) { base.m_Height = num; } this.m_Image.X += (0x38 - ((this.m_Image.Image.xMax - this.m_Image.Image.xMin) + 1)) / 2; this.m_Image.Y += (base.m_Height - ((this.m_Image.Image.yMax - this.m_Image.Image.yMin) + 1)) / 2; this.m_Image.X -= this.m_Image.Image.xMin; this.m_Image.Y -= this.m_Image.Image.yMin; this.m_Description.X -= this.m_Description.Image.xMin; this.m_Description.Y += (base.m_Height - ((this.m_Description.Image.yMax - this.m_Description.Image.yMin) + 1)) / 2; this.m_Description.Y -= this.m_Description.Image.yMin; this.m_Available.X -= this.m_Available.Image.xMax + 1; this.m_Available.Y += (base.m_Height - ((this.m_Available.Image.yMax - this.m_Available.Image.yMin) + 1)) / 2; this.m_Available.Y -= this.m_Available.Image.yMin; base.m_Children.Add(this.m_Image); base.m_Children.Add(this.m_Description); base.m_Children.Add(this.m_Available); this.m_xAvailable = si.Amount; if (seperate) { GImage image; this.m_Separator = new GImage[11]; this.m_Separator[0] = image = new GImage(0x39, 0, base.m_Height); base.m_Children.Add(image); for (int i = 0; i < 9; i++) { this.m_Separator[i + 1] = image = new GImage(0x3a, 30 + (i * 0x10), base.m_Height); base.m_Children.Add(image); } this.m_Separator[10] = image = new GImage(0x3b, 0xa5, base.m_Height); base.m_Children.Add(image); } else { this.m_Separator = new GImage[0]; } if (Engine.Features.AOS) { base.Tooltip = new ItemTooltip(si.Item); } }
public GItemList(int serial, int menuID, string question, AnswerEntry[] answers) : base(0x910, 0x19, 0x19) { this.m_xLast = -1234; this.m_yLast = -1234; this.m_Serial = serial; this.m_MenuID = menuID; this.m_EntryLabel = new GLabel("", Engine.GetFont(1), Hues.Load(0x75f), 0x27, 0x6a); base.m_Children.Add(this.m_EntryLabel); GLabel toAdd = new GLabel(question, Engine.GetFont(1), Hues.Load(0x75f), 0x27, 0x13); toAdd.Scissor(0, 0, 0xda, 11); base.m_Children.Add(toAdd); int x = 0x25; for (int i = 0; i < answers.Length; i++) { GItemListEntry entry = new GItemListEntry(x, answers[i], this); base.m_Children.Add(entry); x += entry.Width; } x -= 0x25; if (x >= 0xde) { this.m_xOffsetCap = -(x - 0xde); this.m_Left = new GItemListScroller(0x17, this, 150); this.m_Right = new GItemListScroller(0x105, this, -150); base.m_Children.Add(this.m_Left); base.m_Children.Add(this.m_Right); } }
public MiddleDeathEffect() : base(0, 1f, 1f, 1f) { this.m_Label = new GLabel("You are dead.", Engine.GetFont(3), Hues.Default, 0, 0); this.m_Label.Center(); Gumps.Desktop.Children.Add(this.m_Label); }
public void UpdateColors() { switch (this.m_State) { case ButtonState.Inactive: base.FillColor = this.m_InactiveColor.ToArgb() & 0xffffff; break; case ButtonState.Active: base.FillColor = this.m_ActiveColor.ToArgb() & 0xffffff; break; case ButtonState.Pressed: base.FillColor = this.m_PressedColor.ToArgb() & 0xffffff; break; } GLabel label = null; if (base.m_Children.Count > 0) { label = base.m_Children[0] as GLabel; } if (label != null) { label.Hue = new Hues.HFill(this.m_ForeColor.ToArgb() & 0xffffff); } }
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); }
public GWindowsButton(string text, int x, int y, int width, int height) : base(x, y) { this.m_ImageColor = -1; this.m_Width = width; this.m_Height = height; this.m_Enabled = true; this.m_CaptionLabel = new GLabel(text, Engine.GetUniFont(2), GumpHues.ControlText, 5, 5); base.m_Children.Add(this.m_CaptionLabel); this.m_CaptionLabel.Center(); }
public GAttributeCurMax(int x, int y, int w, int h, int c, int m, IFont font, IHue hue) : base(x, y, w, h) { this.m_Current = c; this.m_Maximum = m; this.m_GCurrent = new GWrappedLabel(this.m_Current.ToString(), font, hue, 0, 0, w * 2); this.m_GMaximum = new GWrappedLabel(this.m_Maximum.ToString(), font, hue, 0, 11, w * 2); base.m_Children.Add(this.m_GCurrent); base.m_Children.Add(this.m_GMaximum); this.Update(); }
public GPartyHealthBar(Mobile m, int x, int y) : base(x, y) { base.m_CanDrag = true; base.m_QuickDrag = true; base.m_CanDrop = true; this.m_Mobile = m; this.m_Name = new GLabel("", Engine.GetUniFont(0), m.Visible ? Hues.GetNotoriety(m.Notoriety) : Hues.Grayscale, 4, 4); this.SetName(m.Name); base.m_Children.Add(this.m_Name); }
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); }
public GItemCounter(ItemIDValidator v) : base(0, 0, 100, 20) { this.m_Validator = v; this.m_Image = new GItemArt(3, 3, v.List[0]); this.m_Label = new GLabel("", Engine.DefaultFont, Hues.Bright, 0, 0); this.m_Image.X -= this.m_Image.Image.xMin; this.m_Image.Y -= this.m_Image.Image.yMin; base.m_Children.Add(this.m_Image); base.m_Children.Add(this.m_Label); this.m_LastAmount = -2147483648; }
public void SetHue(IHue hue) { GLabel label = null; if (base.m_Children.Count > 0) { label = base.m_Children[0] as GLabel; } if (label != null) { label.Hue = hue; } }
public GBuyGump_OfferedItem(GBuyGump owner, BuyInfo bi) : base(0x20, 0x43, 0xc4, 0) { this.m_OfferMenu = owner.OfferMenu; IFont uniFont = Engine.GetUniFont(3); IHue hue = Hues.Load(0x288); this.m_xAmount = bi.ToBuy; this.m_Amount = new GLabel(bi.ToBuy.ToString(), uniFont, hue, 0, 0); this.m_Description = new GWrappedLabel(string.Format("{0} at {1} gp", bi.Name, bi.Price), uniFont, hue, 0x29, 0, 0x69); this.m_More = new GBuyGump_AmountButton(owner, bi, 5, 0x37, 0x9b); this.m_Less = new GBuyGump_AmountButton(owner, bi, -5, 0x38, 0xad); int height = (this.m_Amount.Image.yMax - this.m_Amount.Image.yMin) + 1; base.m_Height = height; height = (this.m_Description.Image.yMax - this.m_Description.Image.yMin) + 1; if (height > base.m_Height) { base.m_Height = height; } height = this.m_More.Height; if (height > base.m_Height) { base.m_Height = height; } height = this.m_Less.Height; if (height > base.m_Height) { base.m_Height = height; } this.m_Amount.X -= this.m_Amount.Image.xMin; this.m_Amount.Y = (base.m_Height - ((this.m_Amount.Image.yMax - this.m_Amount.Image.yMin) + 1)) / 2; this.m_Description.X -= this.m_Description.Image.xMin; this.m_Description.Y = (base.m_Height - ((this.m_Description.Image.yMax - this.m_Description.Image.yMin) + 1)) / 2; if (this.m_Amount.Y > this.m_Description.Y) { this.m_Amount.Y = this.m_Description.Y; } this.m_Amount.Y -= this.m_Amount.Image.yMin; this.m_Description.Y -= this.m_Description.Image.yMin; this.m_More.Y = (base.m_Height - this.m_More.Height) / 2; this.m_Less.Y = (base.m_Height - this.m_Less.Height) / 2; base.m_Children.Add(this.m_Amount); base.m_Children.Add(this.m_Description); base.m_Children.Add(this.m_More); base.m_Children.Add(this.m_Less); this.Clipper = this.m_OfferMenu.ContentClipper; if (Engine.Features.AOS) { base.Tooltip = new ItemTooltip(bi.Item); } }
public GSystemButton(int x, int y, int width, int height, Color backColor, Color foreColor, string text, IFont font) : base(x, y, width, height) { this.m_InactiveColor = backColor; this.m_ActiveColor = ControlPaint.Dark(backColor, -this.Darkness); this.m_PressedColor = ControlPaint.Light(backColor); this.m_ForeColor = foreColor; base.m_CanDrag = false; GLabel toAdd = new GLabel(text, font, Hues.Default, 0, 0); base.m_Children.Add(toAdd); toAdd.Center(); base.FillAlpha = 1f; this.UpdateColors(); }
public GSellGump_OfferedItem(GSellGump owner, SellInfo si) : base(0x20, 0x43, 0xc4, 0) { this.m_OfferMenu = owner.OfferMenu; IFont uniFont = Engine.GetUniFont(3); IHue hue = Hues.Load(0x288); this.m_xAmount = si.ToSell; this.m_Amount = new GLabel(si.ToSell.ToString(), uniFont, hue, 0, 0); this.m_Description = new GWrappedLabel(string.Format("{0} at {1} gp", si.Name, si.Price), uniFont, hue, 0x29, 0, 0x69); this.m_More = new GSellGump_AmountButton(owner, si, 5, 0x37, 0x9b); this.m_Less = new GSellGump_AmountButton(owner, si, -5, 0x38, 0xad); int height = (this.m_Amount.Image.yMax - this.m_Amount.Image.yMin) + 1; base.m_Height = height; height = (this.m_Description.Image.yMax - this.m_Description.Image.yMin) + 1; if (height > base.m_Height) { base.m_Height = height; } height = this.m_More.Height; if (height > base.m_Height) { base.m_Height = height; } height = this.m_Less.Height; if (height > base.m_Height) { base.m_Height = height; } this.m_Amount.X -= this.m_Amount.Image.xMin; this.m_Amount.Y = (base.m_Height - ((this.m_Amount.Image.yMax - this.m_Amount.Image.yMin) + 1)) / 2; this.m_Description.X -= this.m_Description.Image.xMin; this.m_Description.Y = (base.m_Height - ((this.m_Description.Image.yMax - this.m_Description.Image.yMin) + 1)) / 2; if (this.m_Amount.Y > this.m_Description.Y) { this.m_Amount.Y = this.m_Description.Y; } this.m_Amount.Y -= this.m_Amount.Image.yMin; this.m_Description.Y -= this.m_Description.Image.yMin; this.m_More.Y = (base.m_Height - this.m_More.Height) / 2; this.m_Less.Y = (base.m_Height - this.m_Less.Height) / 2; base.m_Children.Add(this.m_Amount); base.m_Children.Add(this.m_Description); base.m_Children.Add(this.m_More); base.m_Children.Add(this.m_Less); this.Clipper = this.m_OfferMenu.ContentClipper; if (Engine.Features.AOS) { base.Tooltip = new ItemTooltip(si.Item); } }
private GTextBox AddTextBox(string name, int index, string initialText, char pc) { GLabel label; int y = (30 + (index * 0x19)) - 0x16; label = new GLabel(name, Engine.GetUniFont(2), GumpHues.ControlText, 0, 0) { X = (10 - label.Image.xMin) - 4, Y = (y + ((0x16 - ((label.Image.yMax - label.Image.yMin) + 1)) / 2)) - label.Image.yMin }; base.Client.Children.Add(label); IHue windowText = GumpHues.WindowText; GWindowsTextBox toAdd = new GWindowsTextBox(0x38, y, 200, 0x16, initialText, Engine.GetUniFont(2), windowText, windowText, windowText, pc); base.Client.Children.Add(toAdd); return toAdd.TextBox; }
public GHealthBar(Mobile m, int X, int Y) : base(m.Player ? (m.Flags[MobileFlag.Warmode] ? 0x807 : 0x803) : 0x804, X, Y) { this.m_xName = ""; this.m_Mobile = m; base.m_CanDrop = true; base.m_QuickDrag = false; this.m_Player = m.Player; if (!this.m_Player) { base.Hue = Hues.GetNotoriety(m.Notoriety); } if (Engine.Features.AOS) { base.Tooltip = new MobileTooltip(m); } if (this.m_Player) { this.m_HP = new GImageClip(this.GetHealthGumpID(m.Flags), 0x22, 12, m.HPCur, m.HPMax); this.m_Mana = new GImageClip(0x806, 0x22, 0x19, m.ManaCur, m.ManaMax); this.m_Stam = new GImageClip(0x806, 0x22, 0x26, m.StamCur, m.StamMax); base.m_Children.Add(new GImage(0x805, 0x22, 12)); base.m_Children.Add(new GImage(0x805, 0x22, 0x19)); base.m_Children.Add(new GImage(0x805, 0x22, 0x26)); base.m_Children.Add(this.m_HP); base.m_Children.Add(this.m_Mana); base.m_Children.Add(this.m_Stam); this.m_xHPCur = m.HPCur; this.m_xHPMax = m.HPMax; this.m_xStamCur = m.StamCur; this.m_xStamMax = m.StamMax; this.m_xManaCur = m.ManaCur; this.m_xManaMax = m.ManaMax; this.m_xFlags = m.Flags.Clone(); } else { this.m_Name = new GLabel(m.Name, Engine.GetFont(1), Hues.Load(0x455), 0x10, 0); this.m_Name.Y = 11 + ((0x18 - this.m_Name.Height) / 2); this.m_Name.Scissor(0, 0, 0x7a, this.m_Name.Height); this.m_HP = new GImageClip(this.GetHealthGumpID(m.Flags), 0x22, 0x26, m.HPCur, m.HPMax); base.m_Children.Add(new GImage(0x805, 0x22, 0x26)); base.m_Children.Add(this.m_Name); base.m_Children.Add(this.m_HP); this.m_xName = m.Name; this.m_xHPCur = m.HPCur; this.m_xHPMax = m.HPMax; this.m_xFlags = m.Flags.Clone(); } }
public GQuestionMenuEntry(int x, int y, int xWidth, AnswerEntry a) : base(x, y) { this.m_yBase = y; this.m_Answer = a; this.m_Radio = new GRadioButton(210, 0xd3, false, 0, 0); this.m_Label = new GWrappedLabel(a.Text, Engine.GetFont(1), Hues.Load(0x455), this.m_Radio.Width + 4, 5, (xWidth - this.m_Radio.Width) - 4); this.m_Width = xWidth; this.m_Height = this.m_Radio.Height; if ((this.m_Label.Y + this.m_Label.Height) > this.m_Height) { this.m_Height = this.m_Label.Y + this.m_Label.Height; } base.m_Children.Add(this.m_Radio); base.m_Children.Add(this.m_Label); }
public GMenuItem(string text) : base(0, 50, 120, 0x18) { this.m_Text = text; this.m_DefaultColor = Color.FromArgb(0xc0, 0xc0, 0xc0); this.m_OverColor = Color.FromArgb(0x20, 0x40, 0x80); this.m_ExpandedColor = Color.FromArgb(0x20, 0x40, 0x80); base.FillAlpha = 0.25f; base.m_CanDrag = false; GLabel toAdd = new GLabel(text, Engine.DefaultFont, Hues.Load(0x481), 0, 0); base.m_Children.Add(toAdd); toAdd.Center(); toAdd.X = 4 - toAdd.Image.xMin; base.m_NonRestrictivePicking = true; }
public GQuickHues(GHuePicker Picker, GBrightnessBar Brightness, GFlatButton Okay) : base(3, 0x57, 0x76, 20) { this.m_CompactHeight = 20; this.m_ExpandedHeight = Engine.GameHeight / 2; this.m_Picker = Picker; this.m_Brightness = Brightness; this.m_Okay = Okay; base.m_CanDrag = false; this.m_Timer = new Timer(new OnTick(this.Roll_OnTick), 0); GLabel toAdd = new GLabel("Quick Hues", Engine.GetUniFont(0), Hues.Default, 2, 2); this.Height = 20; this.m_CompactHeight = base.m_Height; base.m_Children.Add(toAdd); toAdd.Center(); QuickHues.Load(); int count = QuickHues.Entries.Count; int num2 = 0x16; Clipper clipper = new Clipper(base.m_X + 1, base.m_Y + 1, base.m_Width - 2, base.m_Height - 2); GTextButton button = new GTextButton("Create new..", Engine.GetUniFont(0), Hues.Default, Hues.Load(0x35), 2, 2, new OnClick(this.Add_OnClick)); base.m_Children.Add(button); button.Center(); button.Y = num2; button.Scissor(clipper); num2 += button.Height; OnClick onClick = new OnClick(this.Entry_OnClick); OnHighlight highlight = new OnHighlight(this.Entry_OnHighlight); for (int i = 0; i < count; i++) { QuickHueEntry entry = (QuickHueEntry)QuickHues.Entries[i]; GTextButton button2 = new GTextButton(entry.Name, Engine.GetUniFont(0), Hues.Load(0x58), Hues.Load(0x35), 2, 2, onClick); base.m_Children.Add(button2); button2.Center(); button2.Y = num2; button2.Scissor(clipper); button2.SetTag("HueID", entry.Hue); button2.SetTag("Index", i); num2 += button2.Height; button2.OnHighlight = highlight; button2.Tooltip = new Tooltip(string.Format("0x{0:X}", entry.Hue)); } num2 += 2; this.m_ExpandedHeight = num2; }
public GWindowsForm(int x, int y, int width, int height) : base(x, y) { base.m_CanDrag = true; base.m_QuickDrag = true; this.m_Width = width; this.m_Height = height; this.m_CaptionLabel = new GLabel("Form", Engine.GetUniFont(1), Hues.Default, 7, 3); base.m_Children.Add(this.m_CaptionLabel); this.m_Client = new GEmpty(0, 0, 0, 0); base.m_Children.Add(this.m_Client); this.m_CloseButton = new GWindowsButton("", 0, 0, 0x10, 14); this.m_CloseButton.ImageColor = 0; this.m_CloseButton.Image = Engine.m_FormX; this.m_CloseButton.Clicked += new EventHandler(this.CloseButton_Clicked); base.m_Children.Add(this.m_CloseButton); this.ResizeClient(); }
private GTextBox AddTextBox(string name, int index, char pc) { GLabel label; int y = (30 + (index * 0x19)) - 0x16; label = new GLabel(name, Engine.GetUniFont(2), GumpHues.ControlText, 0, 0) { X = (10 - label.Image.xMin) - 4, Y = (y + ((0x16 - ((label.Image.yMax - label.Image.yMin) + 1)) / 2)) - label.Image.yMin }; base.Client.Children.Add(label); IHue windowText = GumpHues.WindowText; GWindowsTextBox toAdd = new GWindowsTextBox(0x38, y, 200, 0x16, "", Engine.GetUniFont(2), windowText, windowText, windowText, pc); base.Client.Children.Add(toAdd); return(toAdd.TextBox); }
public GQuickHues(GHuePicker Picker, GBrightnessBar Brightness, GFlatButton Okay) : base(3, 0x57, 0x76, 20) { this.m_CompactHeight = 20; this.m_ExpandedHeight = Engine.GameHeight / 2; this.m_Picker = Picker; this.m_Brightness = Brightness; this.m_Okay = Okay; base.m_CanDrag = false; this.m_Timer = new Timer(new OnTick(this.Roll_OnTick), 0); GLabel toAdd = new GLabel("Quick Hues", Engine.GetUniFont(0), Hues.Default, 2, 2); this.Height = 20; this.m_CompactHeight = base.m_Height; base.m_Children.Add(toAdd); toAdd.Center(); QuickHues.Load(); int count = QuickHues.Entries.Count; int num2 = 0x16; Clipper clipper = new Clipper(base.m_X + 1, base.m_Y + 1, base.m_Width - 2, base.m_Height - 2); GTextButton button = new GTextButton("Create new..", Engine.GetUniFont(0), Hues.Default, Hues.Load(0x35), 2, 2, new OnClick(this.Add_OnClick)); base.m_Children.Add(button); button.Center(); button.Y = num2; button.Scissor(clipper); num2 += button.Height; OnClick onClick = new OnClick(this.Entry_OnClick); OnHighlight highlight = new OnHighlight(this.Entry_OnHighlight); for (int i = 0; i < count; i++) { QuickHueEntry entry = (QuickHueEntry) QuickHues.Entries[i]; GTextButton button2 = new GTextButton(entry.Name, Engine.GetUniFont(0), Hues.Load(0x58), Hues.Load(0x35), 2, 2, onClick); base.m_Children.Add(button2); button2.Center(); button2.Y = num2; button2.Scissor(clipper); button2.SetTag("HueID", entry.Hue); button2.SetTag("Index", i); num2 += button2.Height; button2.OnHighlight = highlight; button2.Tooltip = new Tooltip(string.Format("0x{0:X}", entry.Hue)); } num2 += 2; this.m_ExpandedHeight = num2; }
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; }
public GCombatGump() : base(0x2b02, 50, 50) { AbilityInfo[] abilities = AbilityInfo.Abilities; AbilityInfo active = AbilityInfo.Active; AbilityInfo primary = AbilityInfo.Primary; AbilityInfo secondary = AbilityInfo.Secondary; IFont uniFont = Engine.GetUniFont(1); OnClick onClick = new OnClick(this.Name_OnClick); GLabel toAdd = new GLabel("INDEX", Engine.GetFont(6), Hues.Default, 100, 4); base.m_Children.Add(toAdd); toAdd = new GLabel("INDEX", Engine.GetFont(6), Hues.Default, 0x106, 4); base.m_Children.Add(toAdd); for (int i = 0; i < abilities.Length; i++) { AbilityInfo a = abilities[i]; IHue hueFor = GetHueFor(a); toAdd = new GTextButton(Localization.GetString(a.Name), uniFont, hueFor, hueFor, 0x38 + ((i / 9) * 0xa2), 0x26 + ((i % 9) * 15), onClick); a.NameLabel = (GTextButton)toAdd; toAdd.SetTag("Ability", a); toAdd.Tooltip = new Tooltip(Localization.GetString(a.Tooltip), true, 240); toAdd.Tooltip.Delay = 0.25f; base.m_Children.Add(toAdd); } this.m_PrimaryIcon = new GAbilityIcon(true, true, primary.Icon, 0xda, 0x69); this.m_PrimaryIcon.Tooltip = new Tooltip(Localization.GetString(primary.Name), true); this.m_PrimaryIcon.Tooltip.Delay = 0.25f; this.m_PrimaryIcon.Hue = (primary == AbilityInfo.Active) ? Hues.Load(0x8026) : Hues.Default; base.m_Children.Add(this.m_PrimaryIcon); toAdd = new GLabel("Primary", Engine.GetFont(6), Hues.Default, 0x10c, 0x69); base.m_Children.Add(toAdd); toAdd = new GLabel("Ability Icon", Engine.GetFont(6), Hues.Default, 0x10c, 0x77); base.m_Children.Add(toAdd); this.m_SecondaryIcon = new GAbilityIcon(true, false, secondary.Icon, 0xda, 150); this.m_SecondaryIcon.Tooltip = new Tooltip(Localization.GetString(secondary.Name), true); this.m_SecondaryIcon.Tooltip.Delay = 0.25f; this.m_SecondaryIcon.Hue = (secondary == AbilityInfo.Active) ? Hues.Load(0x8026) : Hues.Default; base.m_Children.Add(this.m_SecondaryIcon); toAdd = new GLabel("Secondary", Engine.GetFont(6), Hues.Default, 0x10c, 150); base.m_Children.Add(toAdd); toAdd = new GLabel("Ability Icon", Engine.GetFont(6), Hues.Default, 0x10c, 0xa4); base.m_Children.Add(toAdd); }
public GCombatGump() : base(0x2b02, 50, 50) { AbilityInfo[] abilities = AbilityInfo.Abilities; AbilityInfo active = AbilityInfo.Active; AbilityInfo primary = AbilityInfo.Primary; AbilityInfo secondary = AbilityInfo.Secondary; IFont uniFont = Engine.GetUniFont(1); OnClick onClick = new OnClick(this.Name_OnClick); GLabel toAdd = new GLabel("INDEX", Engine.GetFont(6), Hues.Default, 100, 4); base.m_Children.Add(toAdd); toAdd = new GLabel("INDEX", Engine.GetFont(6), Hues.Default, 0x106, 4); base.m_Children.Add(toAdd); for (int i = 0; i < abilities.Length; i++) { AbilityInfo a = abilities[i]; IHue hueFor = GetHueFor(a); toAdd = new GTextButton(Localization.GetString(a.Name), uniFont, hueFor, hueFor, 0x38 + ((i / 9) * 0xa2), 0x26 + ((i % 9) * 15), onClick); a.NameLabel = (GTextButton) toAdd; toAdd.SetTag("Ability", a); toAdd.Tooltip = new Tooltip(Localization.GetString(a.Tooltip), true, 240); toAdd.Tooltip.Delay = 0.25f; base.m_Children.Add(toAdd); } this.m_PrimaryIcon = new GAbilityIcon(true, true, primary.Icon, 0xda, 0x69); this.m_PrimaryIcon.Tooltip = new Tooltip(Localization.GetString(primary.Name), true); this.m_PrimaryIcon.Tooltip.Delay = 0.25f; this.m_PrimaryIcon.Hue = (primary == AbilityInfo.Active) ? Hues.Load(0x8026) : Hues.Default; base.m_Children.Add(this.m_PrimaryIcon); toAdd = new GLabel("Primary", Engine.GetFont(6), Hues.Default, 0x10c, 0x69); base.m_Children.Add(toAdd); toAdd = new GLabel("Ability Icon", Engine.GetFont(6), Hues.Default, 0x10c, 0x77); base.m_Children.Add(toAdd); this.m_SecondaryIcon = new GAbilityIcon(true, false, secondary.Icon, 0xda, 150); this.m_SecondaryIcon.Tooltip = new Tooltip(Localization.GetString(secondary.Name), true); this.m_SecondaryIcon.Tooltip.Delay = 0.25f; this.m_SecondaryIcon.Hue = (secondary == AbilityInfo.Active) ? Hues.Load(0x8026) : Hues.Default; base.m_Children.Add(this.m_SecondaryIcon); toAdd = new GLabel("Secondary", Engine.GetFont(6), Hues.Default, 0x10c, 150); base.m_Children.Add(toAdd); toAdd = new GLabel("Ability Icon", Engine.GetFont(6), Hues.Default, 0x10c, 0xa4); base.m_Children.Add(toAdd); }
public GUpdateScroll(string text) : base(0x13c2, 100, 100, 40, 30, true) { GLabel toAdd = new GLabel("Updates", Engine.DefaultFont, Hues.Load(0x1f0), base.OffsetX, base.OffsetY); GBackground background = new GBackground(0xbbc, 100, 100, base.OffsetX, (toAdd.Y + toAdd.Height) + 4, true); GWrappedLabel label2 = new GWrappedLabel(text, Engine.GetFont(1), Hues.Load(0x455), background.OffsetX + 2, background.OffsetY + 2, 250); background.Width = ((background.Width - background.UseWidth) + label2.Width) + 6; background.Height = ((background.Height - background.UseHeight) + label2.Height) + 2; background.Children.Add(label2); this.Width = (this.Width - base.UseWidth) + background.Width; this.Height = (((this.Height - base.UseHeight) + toAdd.Height) + 4) + background.Height; toAdd.X += (base.UseWidth - toAdd.Width) / 2; base.m_CanDrag = true; base.m_QuickDrag = true; base.CanClose = true; background.SetMouseOverride(this); base.m_Children.Add(toAdd); base.m_Children.Add(background); }
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; }
public GSkills() : base(50, 50, 250, 0x7d) { base.m_Children.Add(new GVResizer(this)); base.m_Children.Add(new GHResizer(this)); base.m_Children.Add(new GLResizer(this)); base.m_Children.Add(new GTResizer(this)); base.m_Children.Add(new GHVResizer(this)); base.m_Children.Add(new GLTResizer(this)); base.m_Children.Add(new GHTResizer(this)); base.m_Children.Add(new GLVResizer(this)); this.m_ShowReal = false; this.m_Total = new GLabel(string.Format("Total: {0:F1}", this.GetTotalSkillCount()), Engine.GetUniFont(1), Hues.Bright, 0, 0); base.m_Children.Add(this.m_Total); this.m_ValueType = new GTextButton("Used Values", Engine.GetUniFont(1), Hues.Bright, Hues.Load(0x35), 0, 0, new OnClick(this.ValueType_OnClick)); this.m_ValueType.X = 4 - this.m_ValueType.Image.xMin; base.m_Children.Add(this.m_ValueType); this.m_SkillList = new GSkillList(this); base.m_Children.Add(this.m_SkillList); this.Width = 250; this.Height = 0x7d; }
private GContextMenu(object owner, PopupEntry[] list) : base(100, 100) { this.m_VertexPool = VertexConstructor.Create(); this.m_Owner = owner; base.m_GUID = "MobilePopup"; int num = 0; int num2 = 0; int length = list.Length; IFont uniFont = Engine.GetUniFont(3); IHue bright = Hues.Bright; IHue focusHue = Hues.Load(0x35); IHue hue = Hues.Default; OnClick onClick = new OnClick(this.Entry_OnClick); for (int i = 0; i < length; i++) { PopupEntry entry = list[i]; GLabel toAdd = null; if (entry.Flags == 1) { toAdd = new GLabel(entry.Text, uniFont, hue, 7, 7 + num2); } else { toAdd = new GTextButton(entry.Text, uniFont, bright, focusHue, 7, 7 + num2, onClick); toAdd.SetTag("EntryID", entry.EntryID); } toAdd.X -= toAdd.Image.xMin; toAdd.Y -= toAdd.Image.yMin; num2 += (toAdd.Image.yMax - toAdd.Image.yMin) + 4; if (((toAdd.Image.xMax - toAdd.Image.xMin) + 1) > num) { num = (toAdd.Image.xMax - toAdd.Image.xMin) + 1; } base.m_Children.Add(toAdd); } num2 -= 3; this.m_Width = num + 14; this.m_Height = num2 + 14; }
public override void UpdateGump(Gump g) { g.Children.Clear(); Table2DInfoNode active = base.Inputs[0].Active as Table2DInfoNode; if (active == null) { GLabel toAdd = new GLabel("Select a spell type from the list above.", Engine.GetUniFont(1), GumpHues.WindowText, 0, 0); g.Children.Add(toAdd); } else { int num = 0; for (int i = 0; i < active.Descriptors.Length; i++) { TableGump gump = new TableGump(active.Descriptors[i]) { Y = num }; num += gump.Height + 10; g.Children.Add(gump); } } }
public GSkillList(GSkills owner) : base(4, 4, 250, 50) { this.m_Owner = owner; base.m_CanDrag = false; Skills skills = Engine.Skills; this.m_SkillGumps = new GSkillGump[0x100]; int y = 4; for (int i = 0; i < skills.Groups.Length; i++) { GLabel label; SkillGroup group = skills.Groups[i]; label = new GLabel(group.Name, Engine.GetUniFont(1), Hues.Bright, 4, y) { X = label.X - label.Image.xMin, Y = label.Y - label.Image.yMin }; label.SetTag("yBase", label.Y); base.m_Children.Add(label); y += 4 + (label.Image.yMax - label.Image.yMin); for (int j = 0; j < group.Skills.Count; j++) { Skill skill = (Skill)group.Skills[j]; GSkillGump toAdd = new GSkillGump(skill, y, base.m_Width - 20, this.m_Owner.ShowReal); this.m_SkillGumps[skill.ID] = toAdd; base.m_Children.Add(toAdd); y += 4 + toAdd.Height; } } this.m_SliderBorder = new GSingleBorder(0, 0, 0x10, 100); base.m_Children.Add(this.m_SliderBorder); this.m_Slider = new GAlphaVSlider(0, 6, 0x10, 100, 0.0, 0.0, (double)(y + 1), 1.0); this.m_Slider.SetTag("Max", y + 1); this.m_Slider.OnValueChange = (OnValueChange)Delegate.Combine(this.m_Slider.OnValueChange, new OnValueChange(this.Slider_OnValueChange)); base.m_Children.Add(this.m_Slider); this.m_Hotspot = new GHotspot(0, 0, 0x10, 100, this.m_Slider); base.m_Children.Add(this.m_Hotspot); }
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); } }
public GPacketStats() : base(3, 3, 0xc2, 0xc2) { this.m_xLast = -12345; this.m_yLast = -12345; m_Labels = new GLabel[0x100]; m_Values = new GLabel[0x100]; IFont uniFont = Engine.GetUniFont(1); IHue bright = Hues.Bright; int y = 3; for (int i = 0; i < 0x100; i++) { if (PacketHandlers.m_Handlers[i] != null) { PacketHandler handler = PacketHandlers.m_Handlers[i]; m_Labels[i] = new GLabel(handler.Name, uniFont, bright, 3, y); m_Labels[i].SetTag("BaseY", y); base.m_Children.Add(m_Labels[i]); m_Values[i] = new GLabel(handler.Count.ToString(), uniFont, bright, 3, y); m_Values[i].SetTag("BaseY", y); m_Values[i].X = 0xaf - m_Values[i].Width; base.m_Children.Add(m_Values[i]); y += m_Labels[i].Height + 3; } } this.m_Slider = new GAlphaVSlider(0xb3, 6, 0x10, 0xb7, 0.0, 0.0, (double)(y - 0xc0), 1.0); this.m_Slider.OnValueChange = (OnValueChange)Delegate.Combine(this.m_Slider.OnValueChange, new OnValueChange(this.Slider_OnValueChange)); this.m_Slider.ScrollOffset = 15.0; base.m_Children.Add(this.m_Slider); GHotspot toAdd = new GHotspot(0xb2, 1, 0x10, 0xc0, this.m_Slider) { NormalHit = false }; base.m_Children.Add(toAdd); this.m_Event = new OnPacketHandle(this.OnRecv); Network.OnPacketHandle = (OnPacketHandle)Delegate.Combine(Network.OnPacketHandle, this.m_Event); }
private void Place(int x, int y, string text, IHue hue) { int num; int num2; int num3; int num4; this.GetCellDetails(x, y, out num, out num2, out num3, out num4); GLabel toAdd = new GLabel(text, Engine.GetUniFont(((x > 0) && (y > 0)) ? 2 : 1), hue, num + (num3 / 2), num2 + (num4 / 2)); if ((x == 0) || (this.m_ColWidth == 8)) { toAdd.X -= ((toAdd.Image.xMax - toAdd.Image.xMin) + 1) / 2; } else { toAdd.X -= (num3 / 2) - 5; } toAdd.X -= toAdd.Image.xMin; toAdd.Y -= (toAdd.Image.yMax - toAdd.Image.yMin) / 2; toAdd.Y -= toAdd.Image.yMin; base.m_Children.Add(toAdd); }
public GSkillList(GSkills owner) : base(4, 4, 250, 50) { this.m_Owner = owner; base.m_CanDrag = false; Skills skills = Engine.Skills; this.m_SkillGumps = new GSkillGump[0x100]; int y = 4; for (int i = 0; i < skills.Groups.Length; i++) { GLabel label; SkillGroup group = skills.Groups[i]; label = new GLabel(group.Name, Engine.GetUniFont(1), Hues.Bright, 4, y) { X = label.X - label.Image.xMin, Y = label.Y - label.Image.yMin }; label.SetTag("yBase", label.Y); base.m_Children.Add(label); y += 4 + (label.Image.yMax - label.Image.yMin); for (int j = 0; j < group.Skills.Count; j++) { Skill skill = (Skill) group.Skills[j]; GSkillGump toAdd = new GSkillGump(skill, y, base.m_Width - 20, this.m_Owner.ShowReal); this.m_SkillGumps[skill.ID] = toAdd; base.m_Children.Add(toAdd); y += 4 + toAdd.Height; } } this.m_SliderBorder = new GSingleBorder(0, 0, 0x10, 100); base.m_Children.Add(this.m_SliderBorder); this.m_Slider = new GAlphaVSlider(0, 6, 0x10, 100, 0.0, 0.0, (double) (y + 1), 1.0); this.m_Slider.SetTag("Max", y + 1); this.m_Slider.OnValueChange = (OnValueChange) Delegate.Combine(this.m_Slider.OnValueChange, new OnValueChange(this.Slider_OnValueChange)); base.m_Children.Add(this.m_Slider); this.m_Hotspot = new GHotspot(0, 0, 0x10, 100, this.m_Slider); base.m_Children.Add(this.m_Hotspot); }
public GCategoryPanel(object obj, string category, ArrayList entries) : base(0, 0, 0x117, 0x16) { base.FillColor = GumpColors.Control; base.BorderColor = GumpColors.ControlDarkDark; base.FillAlpha = 1f; base.ShouldHitTest = false; base.m_NonRestrictivePicking = true; this.m_Label = new GLabel(category, Engine.GetUniFont(1), GumpHues.ControlText, 0, 0); this.m_Label.X = 5 - this.m_Label.Image.xMin; this.m_Label.Y = ((0x16 - ((this.m_Label.Image.yMax - this.m_Label.Image.yMin) + 1)) / 2) - this.m_Label.Image.yMin; base.m_Children.Add(this.m_Label); entries.Sort(); this.m_Entries = new GPropertyEntry[entries.Count]; int num = 0x15; for (int i = 0; i < entries.Count; i++) { this.m_Entries[i] = new GPropertyEntry(obj, (ObjectEditorEntry) entries[i]); this.m_Entries[i].Y = num; num += 0x15; base.m_Children.Add(this.m_Entries[i]); } this.Height = num + 1; }