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 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 static void HuePicker_OnHueSelect(int Hue, Gump Sender) { if ((Sender.HasTag("Dialog") && Sender.HasTag("Item Art")) && Sender.HasTag("ItemID")) { GItemArt art; Gump tag = (Gump) Sender.GetTag("Dialog"); Gump g = (Gump) Sender.GetTag("Item Art"); Gumps.Destroy(g); art = new GItemArt(0xb7, 3, (int) Sender.GetTag("ItemID"), Hues.GetItemHue((int) Sender.GetTag("ItemID"), Hue)) { X = art.X + (((0x3a - (art.Image.xMax - art.Image.xMin)) / 2) - art.Image.xMin), Y = art.Y + (((0x52 - (art.Image.yMax - art.Image.yMin)) / 2) - art.Image.yMin) }; tag.Children.Add(art); Sender.SetTag("Item Art", art); } }
private static void SelectHue(PacketReader pvSrc) { GItemArt art; int num = pvSrc.ReadInt32(); short num2 = pvSrc.ReadInt16(); short itemID = pvSrc.ReadInt16(); GAlphaBackground background = new GAlphaBackground(0, 0, 0xf4, 110) { m_NonRestrictivePicking = true }; background.Center(); art = new GItemArt(0xb7, 3, itemID) { X = art.X + (((0x3a - (art.Image.xMax - art.Image.xMin)) / 2) - art.Image.xMin), Y = art.Y + (((0x52 - (art.Image.yMax - art.Image.yMin)) / 2) - art.Image.yMin) }; background.Children.Add(art); GHuePicker toAdd = new GHuePicker(4, 4) { Brightness = 1 }; toAdd.SetTag("ItemID", (int) itemID); toAdd.SetTag("Item Art", art); toAdd.SetTag("Dialog", background); toAdd.OnHueSelect = new OnHueSelect(Engine.HuePicker_OnHueSelect); background.Children.Add(toAdd); background.Children.Add(new GSingleBorder(3, 3, 0xa2, 0x52)); background.Children.Add(new GSingleBorder(0xa4, 3, 0x11, 0x52)); GBrightnessBar bar = new GBrightnessBar(0xa5, 4, 15, 80, toAdd); background.Children.Add(bar); bar.Refresh(); GFlatButton button = new GFlatButton(0x7b, 0x57, 0x3a, 20, "Picker", new OnClick(Engine.HuePickerPicker_OnClick)); GFlatButton okay = new GFlatButton(0xb7, 0x57, 0x3a, 20, "Okay", new OnClick(Engine.HuePickerOk_OnClick)); okay.SetTag("Hue Picker", toAdd); okay.SetTag("Dialog", background); okay.SetTag("Serial", num); okay.SetTag("ItemID", itemID); okay.SetTag("Relay", num2); button.SetTag("Hue Picker", toAdd); button.SetTag("Brightness Bar", bar); background.Children.Add(new GQuickHues(toAdd, bar, okay)); background.Children.Add(button); background.Children.Add(okay); Gumps.Desktop.Children.Add(background); Engine.HuePicker_OnHueSelect(toAdd.Hue, toAdd); }