public OrderManagementGump(MarketEntry entry) : base(0, 0) { _entry = entry; AddPage(1); AddBackground(10, 10, 500, 430, 9250); AddLabel(170, 20, LabelHue, "Personal Market Management"); AddItem(445, 30, 6226); AddItem(431, 53, 3826); AddItem(446, 62, 3820); AddItem(422, 45, 3822); if (entry == null) { AddLabel(225, 40, LabelHue, "New Order"); } else { AddLabel(215, 40, LabelHue, "Order Update"); } AddLabel(25, 80, LabelHue, "Item cost:"); int[] cost = new int[] { 0, 0, 0 }; if (entry != null) { cost = Curr.Compress(entry.Cost, 0, 0); } AddImageTiled(30, 100, 80, 20, 3004); AddTextEntry(30, 100, 80, 20, 0, 1, Convert.ToString(cost[0])); AddLabel(115, 100, LabelHue, "copper"); AddImageTiled(30, 125, 80, 20, 3004); AddTextEntry(30, 125, 80, 20, 0, 2, Convert.ToString(cost[1])); AddLabel(115, 125, LabelHue, "silver"); AddImageTiled(30, 150, 80, 20, 3004); AddTextEntry(30, 150, 80, 20, 0, 3, Convert.ToString(cost[2])); AddLabel(115, 150, LabelHue, "gold"); AddLabel(275, 80, LabelHue, "Category:"); AddRadio(310, 100, 9020, 9021, (entry == null ? false : entry.Category == Category.Armor), 1); AddLabel(335, 100, LabelHue, "Armor"); AddRadio(310, 125, 9020, 9021, (entry == null ? false : entry.Category == Category.Clothing), 2); AddLabel(335, 125, LabelHue, "Clothing"); AddRadio(310, 150, 9020, 9021, (entry == null ? true : entry.Category == Category.Misc), 3); AddLabel(335, 150, LabelHue, "Miscellaneous"); AddRadio(310, 175, 9020, 9021, (entry == null ? false : entry.Category == Category.Resources), 4); AddLabel(335, 175, LabelHue, "Resources (commodities)"); AddRadio(310, 200, 9020, 9021, (entry == null ? false : entry.Category == Category.SkillItems), 5); AddLabel(335, 200, LabelHue, "Skill Items (training aid)"); AddRadio(310, 225, 9020, 9021, (entry == null ? false : entry.Category == Category.Weaponry), 6); AddLabel(335, 225, LabelHue, "Weaponry"); AddLabel(25, 225, LabelHue, "Description:"); AddImageTiled(25, 250, 355, 175, 3004); AddTextEntry(25, 250, 355, 175, 0, 4, (entry == null ? "" : entry.Description)); AddButton(420, 265, 4023, 4025, GetButtonId(1, 1), GumpButtonType.Reply, 0); AddLabel(395, 285, LabelHue, "Submit Order"); AddButton(420, 335, 4017, 4019, GetButtonId(1, 2), GumpButtonType.Reply, 0); AddLabel(395, 355, LabelHue, "Cancel Order"); }
private string GetDescription(MarketEntry entry) { StringBuilder sb = new StringBuilder(); sb.AppendLine(String.Format("Seller: {0}", (entry.Seller == null ? "(private)" : entry.Seller.RawName))); int[] cost = Curr.Compress(entry.Cost, 0, 0); sb.AppendLine(String.Format("Total cost: {0} copper, {1} silver, {2} gold", cost[0], cost[1], cost[2])); sb.AppendLine(String.Format("Seller's description: {0}", entry.Description)); sb.AppendLine(); sb.Append("<center>---------------</center>"); sb.Append(String.Format("<center>{0} Details</center>", (entry.ObjectSerial.IsItem ? "Item" : "Mobile"))); IEntity entity = World.FindEntity(entry.ObjectSerial); if (entity is Item) { Item item = (Item)entity; sb.AppendLine("Name: " + item.Name); if (item.Amount > 1) { sb.AppendLine("Quantity: " + item.Amount); } if (item is BaseWeapon) { BaseWeapon weap = (BaseWeapon)item; if (weap.Crafter != null) { sb.AppendLine("Crafted by: " + weap.Crafter.RawName); } sb.AppendLine("Quality: " + weap.Quality); if (weap.Identified) { sb.AppendLine("Durability: " + weap.DurabilityLevel); sb.AppendLine("Accuracy level: " + weap.AccuracyLevel); sb.AppendLine("Damage level: " + weap.DamageLevel); if (weap.Slayer != SlayerName.None) { SlayerEntry se = SlayerGroup.GetEntryByName(weap.Slayer); if (se != null) { sb.AppendLine("Slayer enhancement: " + se.Title); } } if (weap.Slayer2 != SlayerName.None) { SlayerEntry se = SlayerGroup.GetEntryByName(weap.Slayer2); if (se != null) { sb.AppendLine("Slayer enhancement: " + se.Title); } } } else { sb.AppendLine("<i>Unidentified</i>"); } } } else if (entity is Mobile) { Mobile mob = (Mobile)entity; sb.AppendLine("Name: " + mob.Name); if (mob is BaseCreature) { BaseCreature bc = (BaseCreature)mob; sb.AppendLine("Creature type: " + Util.SplitString(bc.GetType().ToString())); sb.AppendLine("Minimum Taming required: " + bc.MinTameSkill.ToString("F2")); sb.AppendLine("Follower Slots required: " + bc.ControlSlots); } } return(sb.ToString()); }