public MannequinStatsGump(Mannequin mann, Item item, int page) : base(100, 100) { _Mannequin = mann; _Item = item; AddPage(0); AddBackground(0, 0, 604, 820, 0x6DB); AddAlphaRegion(5, 5, 594, 810); AddHtmlLocalized(10, 10, 584, 18, 1114513, "#1159279", 0x43F7, false, false); // <DIV ALIGN=CENTER>~1_TOKEN~</DIV> List <ValuedProperty> lm; List <ItemPropDefinition> CompareItem = null; List <Item> list; if (_Item != null) { Item sameItem = null; for (var index = 0; index < _Mannequin.Items.Count; index++) { var x = _Mannequin.Items[index]; if (_Mannequin.LayerValidation(x, item)) { sameItem = x; break; } } _SameItem = sameItem; if (_SameItem != null) { CompareItem = new List <ItemPropDefinition> { new ItemPropDefinition(_Item, _SameItem) }; list = new List <Item>(); for (var index = 0; index < _Mannequin.Items.Count; index++) { var x = _Mannequin.Items[index]; if (x != _SameItem) { list.Add(x); } } list.Add(_Item); } else { list = new List <Item>(); for (var index = 0; index < _Mannequin.Items.Count; index++) { var mannequinItem = _Mannequin.Items[index]; list.Add(mannequinItem); } list.Add(_Item); } } else { list = _Mannequin.Items; } lm = Mannequin.GetProperty(list); AddHtmlLocalized(479, 10, 75, 18, 1114514, "#1158215", 0x42FF, false, false); // <DIV ALIGN=RIGHT>~1_TOKEN~</DIV> if (page > 0) { AddButton(554, 10, 0x15E3, 0x15E7, 1000, GumpButtonType.Reply, 0); // Next Page Button } else { AddButton(554, 10, 0x15E1, 0x15E5, 1001, GumpButtonType.Reply, 0); // Previous Page Button } int y = 0; LabelDefinition[] pages = page > 0 ? Page2 : Page1; for (var index = 0; index < pages.ToList().Count; index++) { var x = pages.ToList()[index]; y += 28; if (lm.Any(l => l.Catalog == x.Catalog)) { AddHtmlLocalized(10, y, 150, 18, x.TitleLabel, 0x6A05, false, false); AddImageTiled(10, y + 18, 584, 5, 0x6DC); y += 32; List <ValuedProperty> cataloglist = lm.Where(i => i.Catalog == x.Catalog).OrderBy(ii => ii.Order).ToList(); int columncount = x.ColumnLeftCount == 0 ? (int)Math.Ceiling(cataloglist.Count / (decimal)2) : x.ColumnLeftCount; for (int i = 0; i < cataloglist.Count; i++) { int label = cataloglist[i].LabelNumber; if (i < columncount) { AddHtmlLocalized(45, y, 200, 18, label, 0x560A, false, false); AddSpriteImage(10, y - 5, 0x9D3B, cataloglist[i].SpriteW, cataloglist[i].SpriteH, 30, 30); AddTooltip(cataloglist[i].Description); if (cataloglist[i].LabelNumber == 1159280) // Medable Armor { if (cataloglist[i].Matches(list)) { AddHtmlLocalized(195, y, 100, 18, 1046362, 0x42FF, false, false); // Yes } else { AddHtmlLocalized(195, y, 100, 18, 1046363, 0x42FF, false, false); // No } } else { AddHtml(195, y, 100, 18, Color(cataloglist[i].Value, GetItemValue(CompareItem, label), cataloglist[i].Cap), false, false); } } else { if (i == columncount) { y -= i * 30; } AddHtmlLocalized(342, y, 200, 18, label, 0x560A, false, false); AddSpriteImage(307, y - 5, 0x9D3B, cataloglist[i].SpriteW, cataloglist[i].SpriteH, 30, 30); AddTooltip(cataloglist[i].Description); if (!cataloglist[i].IsBoolen) { AddHtml(492, y, 100, 18, Color(cataloglist[i].Value, GetItemValue(CompareItem, label), cataloglist[i].Cap), false, false); } } y += 30; } y += 3; } } }
public MannequinCompareGump(Mannequin mann, Item item) : base(100, 100) { Item matches = null; for (var index = 0; index < mann.Items.Count; index++) { var x = mann.Items[index]; if (mann.LayerValidation(x, item)) { matches = x; break; } } _SameItem = matches; if (_SameItem == null) { return; } AddPage(0); AddBackground(0, 0, 560, 720, 0x6DB); AddImageTiled(270, 5, 6, 710, 0x6DE); AddHtmlLocalized(5, 5, 270, 18, 1114513, "#1159291", 0x42FF, false, false); // <DIV ALIGN=CENTER>~1_TOKEN~</DIV> AddAlphaRegion(5, 5, 550, 710); AddHtmlLocalized(0, 23, 270, 18, 1114513, string.Format("#{0}", _SameItem.LabelNumber), 0x7FFF, false, false); // <DIV ALIGN=CENTER>~1_TOKEN~</DIV> AddImageTiled(4, 80, 550, 5, 0x6DC); List <ValuedProperty> EquipmentItem = Mannequin.FindItemProperty(_SameItem); int si = 0; for (int i = 0; i < EquipmentItem.Count; i++) { if (EquipmentItem[i].LabelNumber == 1159280) // Medable Armor - not appear { continue; } if (EquipmentItem[i].IsSpriteGraph) { AddSpriteImage(5 + 35 * si, 41, 0x9D3B, EquipmentItem[i].SpriteW, EquipmentItem[i].SpriteH, 30, 30); AddTooltip(EquipmentItem[i].LabelNumber); si++; } else { AddHtmlLocalized(45, 94 + 18 * i, 140, 18, EquipmentItem[i].LabelNumber, EquipmentItem[i].Hue, false, false); AddTooltip(EquipmentItem[i].Description); if (!EquipmentItem[i].IsBoolen) { AddHtml(190, 94 + 18 * i, 100, 18, Color(EquipmentItem[i].Value, EquipmentItem[i].Cap), false, false); } } } AddHtmlLocalized(270, 23, 270, 18, 1114513, string.Format("#{0}", item.LabelNumber), 0x7FFF, false, false); // <DIV ALIGN=CENTER>~1_TOKEN~</DIV> List <ValuedProperty> SelectItem = Mannequin.FindItemProperty(item); si = 0; for (int i = 0; i < SelectItem.Count; i++) { if (SelectItem[i].LabelNumber == 1159280) // Medable Armor - not appear { continue; } if (SelectItem[i].IsSpriteGraph) { AddSpriteImage(275 + 35 * si, 41, 0x9D3B, SelectItem[i].SpriteW, SelectItem[i].SpriteH, 30, 30); AddTooltip(SelectItem[i].LabelNumber); si++; } else { AddHtmlLocalized(315, 94 + 18 * i, 140, 18, SelectItem[i].LabelNumber, SelectItem[i].Hue, false, false); AddTooltip(SelectItem[i].Description); if (!SelectItem[i].IsBoolen) { double ev = 0; for (var index = 0; index < EquipmentItem.Count; index++) { var a1 = EquipmentItem[index]; if (a1.LabelNumber == SelectItem[i].LabelNumber) { ev = EquipmentItem.Find(a => a.LabelNumber == SelectItem[i].LabelNumber).Value; break; } } AddHtml(460, 94 + 18 * i, 100, 18, Color(SelectItem[i].Value, SelectItem[i].Cap, ev), false, false); } } } }