public GSellGump_InventoryItem(GSellGump owner, SellInfo si, int y, bool seperate) : base(32, y, 195, 0) { this.m_Owner = owner; this.m_yBase = y; this.m_Info = si; IFont font = (IFont)Engine.GetUniFont(3); IHue hue = Hues.Load(648); this.m_Image = new GItemArt(0, 0, si.ItemID, si.Hue); this.m_Description = (GLabel) new GWrappedLabel(string.Format("{0} at {1} gp", (object)si.Name, (object)si.Price), font, hue, 58, 0, 105); this.m_Available = new GLabel(si.Amount.ToString(), font, hue, 195, 0); this.m_Height = this.m_Image.Image.yMax - this.m_Image.Image.yMin + 1; int num1 = this.m_Description.Image.yMax - this.m_Description.Image.yMin + 1; if (num1 > this.m_Height) { this.m_Height = num1; } int num2 = this.m_Available.Image.yMax - this.m_Available.Image.yMin + 1; if (num2 > this.m_Height) { this.m_Height = num2; } this.m_Image.X += (56 - (this.m_Image.Image.xMax - this.m_Image.Image.xMin + 1)) / 2; this.m_Image.Y += (this.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 += (this.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 += (this.m_Height - (this.m_Available.Image.yMax - this.m_Available.Image.yMin + 1)) / 2; this.m_Available.Y -= this.m_Available.Image.yMin; this.m_Children.Add((Gump)this.m_Image); this.m_Children.Add((Gump)this.m_Description); this.m_Children.Add((Gump)this.m_Available); this.m_xAvailable = si.Amount; if (seperate) { this.m_Separator = new GImage[11]; this.m_Children.Add((Gump)(this.m_Separator[0] = new GImage(57, 0, this.m_Height))); for (int index = 0; index < 9; ++index) { this.m_Children.Add((Gump)(this.m_Separator[index + 1] = new GImage(58, 30 + index * 16, this.m_Height))); } this.m_Children.Add((Gump)(this.m_Separator[10] = new GImage(59, 165, this.m_Height))); } else { this.m_Separator = new GImage[0]; } if (!Engine.ServerFeatures.AOS) { return; } this.Tooltip = (ITooltip) new ItemTooltip(si.Item); }
public GSellGump_AmountButton(GSellGump owner, SellInfo info, int offset, int gumpID, int x) : base(gumpID, x, 0) { this.m_Owner = owner; this.m_Info = info; this.m_InitialOffset = offset; this.m_Offset = (double)offset; this.m_Last = -1234.56; }
public void Clear() { for (int index = 0; index < this.m_Info.Length; ++index) { SellInfo sellInfo = this.m_Info[index]; if (sellInfo.ToSell > 0) { sellInfo.ToSell = 0; sellInfo.InventoryGump.Available = sellInfo.Amount; Gumps.Destroy((Gump)sellInfo.OfferedGump); sellInfo.OfferedGump = (GSellGump_OfferedItem)null; } } }
public PSellItems(int serial, SellInfo[] info) : base((byte)159) { ArrayList dataStore = Engine.GetDataStore(); for (int index = 0; index < info.Length; ++index) { if (info[index].ToSell > 0) { dataStore.Add((object)info[index]); } } this.m_Stream.Write(serial); this.m_Stream.Write((ushort)dataStore.Count); for (int index = 0; index < dataStore.Count; ++index) { SellInfo sellInfo = (SellInfo)dataStore[index]; this.m_Stream.Write(sellInfo.Item.Serial); this.m_Stream.Write((ushort)sellInfo.ToSell); } Engine.ReleaseDataStore(dataStore); }
public GSellGump(int serial, SellInfo[] info) : base(2162, 15, 15) { this.m_GUID = string.Format("GSellGump-{0}", (object)serial); this.m_Serial = serial; this.m_Info = info; Engine.GetUniFont(3); Hues.Load(648); Array.Sort <SellInfo>(info); int y = 66; for (int index = 0; index < info.Length; ++index) { bool seperate = index != info.Length - 1; SellInfo si = info[index]; GSellGump_InventoryItem gumpInventoryItem = new GSellGump_InventoryItem(this, si, y, seperate); this.m_Children.Add((Gump)gumpInventoryItem); si.InventoryGump = gumpInventoryItem; y += gumpInventoryItem.Height; if (seperate) { y += 16; } } if (y > 230) { GVSlider gvSlider = new GVSlider(2088, 237, 81, 34, 92, 0.0, 0.0, (double)(y - 230), 1.0); gvSlider.OnValueChange = new OnValueChange(this.Slider_OnValueChange); this.m_Children.Add((Gump)gvSlider); this.m_Children.Add((Gump) new GHotspot(237, 66, 34, 122, (Gump)gvSlider)); } this.m_NonRestrictivePicking = true; this.m_OfferMenu = new GSellGump_OfferMenu(this); this.m_Children.Add((Gump)this.m_OfferMenu); this.m_X = (Engine.ScreenWidth - (this.m_OfferMenu.X + this.m_OfferMenu.Width)) / 2; this.m_Y = (Engine.ScreenHeight - (this.m_OfferMenu.Y + this.m_OfferMenu.Height)) / 2; }
int IComparable.CompareTo(object x) { if (x == null) { return(1); } SellInfo sellInfo = x as SellInfo; if (sellInfo == null) { throw new ArgumentException(); } int num = Map.GetQuality(this.m_Item.ID).CompareTo(Map.GetQuality(sellInfo.m_Item.ID)); if (num == 0) { num = this.m_Item.ID.CompareTo(sellInfo.m_Item.ID); if (num == 0) { num = this.m_Item.Serial.CompareTo(sellInfo.m_Item.Serial); } } return(num); }