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 GBuyGump(int serial, BuyInfo[] info) : base(0x870, 15, 15) { base.m_GUID = string.Format("GBuyGump-{0}", serial); this.m_Serial = serial; this.m_Info = info; UnicodeFont uniFont = Engine.GetUniFont(3); IHue hue = Hues.Load(0x288); Array.Sort(info); int y = 0x42; for (int i = 0; i < info.Length; i++) { bool seperate = i != (info.Length - 1); BuyInfo si = info[i]; GBuyGump_InventoryItem toAdd = new GBuyGump_InventoryItem(this, si, y, seperate); base.m_Children.Add(toAdd); si.InventoryGump = toAdd; y += toAdd.Height; if (seperate) { y += 0x10; } } if (y > 230) { GVSlider slider = new GVSlider(0x828, 0xed, 0x51, 0x22, 0x5c, 0.0, 0.0, (double)(y - 230), 1.0) { OnValueChange = new OnValueChange(this.Slider_OnValueChange) }; base.m_Children.Add(slider); base.m_Children.Add(new GHotspot(0xed, 0x42, 0x22, 0x7a, slider)); } base.m_NonRestrictivePicking = true; this.m_OfferMenu = new GBuyGump_OfferMenu(this); base.m_Children.Add(this.m_OfferMenu); base.m_X = (Engine.ScreenWidth - (this.m_OfferMenu.X + this.m_OfferMenu.Width)) / 2; base.m_Y = (Engine.ScreenHeight - (this.m_OfferMenu.Y + this.m_OfferMenu.Height)) / 2; }
public GBuyGump(int serial, BuyInfo[] info) : base(0x870, 15, 15) { base.m_GUID = string.Format("GBuyGump-{0}", serial); this.m_Serial = serial; this.m_Info = info; UnicodeFont uniFont = Engine.GetUniFont(3); IHue hue = Hues.Load(0x288); Array.Sort(info); int y = 0x42; for (int i = 0; i < info.Length; i++) { bool seperate = i != (info.Length - 1); BuyInfo si = info[i]; GBuyGump_InventoryItem toAdd = new GBuyGump_InventoryItem(this, si, y, seperate); base.m_Children.Add(toAdd); si.InventoryGump = toAdd; y += toAdd.Height; if (seperate) { y += 0x10; } } if (y > 230) { GVSlider slider = new GVSlider(0x828, 0xed, 0x51, 0x22, 0x5c, 0.0, 0.0, (double) (y - 230), 1.0) { OnValueChange = new OnValueChange(this.Slider_OnValueChange) }; base.m_Children.Add(slider); base.m_Children.Add(new GHotspot(0xed, 0x42, 0x22, 0x7a, slider)); } base.m_NonRestrictivePicking = true; this.m_OfferMenu = new GBuyGump_OfferMenu(this); base.m_Children.Add(this.m_OfferMenu); base.m_X = (Engine.ScreenWidth - (this.m_OfferMenu.X + this.m_OfferMenu.Width)) / 2; base.m_Y = (Engine.ScreenHeight - (this.m_OfferMenu.Y + this.m_OfferMenu.Height)) / 2; }