public VerifyActionGump(SellInfo info) : base(true) { m_Info = info; Closable = false; Disposable = false; int seizure = Math.Max((int)(m_Info.Quantity * Config.SellGoodsSeizure), 1); AddBackground(0, 0, 500, 350, 2600); AddBackground(125, 22, 250, 83, 2600); AddHtml(0, 32, 500, 18, Center("West Britain Exchange"), false, false); AddHtml(0, 53, 500, 18, Center("Selling"), false, false); AddBackground(75, 150, 350, 100, 3000); AddHtml(80, 155, 340, 90, String.Format("Warning!<br>Canceling this offer will result in the removal of {0} units of your goods.", seizure), false, false); AddButton(92, 294, 247, 248, 0, GumpButtonType.Reply, 0); AddButton(338, 292, 241, 242, 1, GumpButtonType.Reply, 0); }
public void Deserialize(GenericReader reader) { int version = reader.ReadInt(); //Category set by the collections this belongs to LastExchangeTime = reader.ReadDateTime(); LastPrice = reader.ReadDouble(); LastQuantity = reader.ReadInt(); AveragePrice = reader.ReadDouble(); HighestDayQuantity = reader.ReadLong(); HighestDayPrice = reader.ReadDouble(); LowestDayPrice = reader.ReadDouble(); HighestPrice = reader.ReadDouble(); LowestPrice = reader.ReadDouble(); TotalQuantity = reader.ReadLong(); int count = reader.ReadInt(); for (int i = 0; i < count; i++) { ExchangeDay ed = new ExchangeDay(reader); ExchangeDayList.Add(ed); if (i == count - 1) CurrentDay = ed; } count = reader.ReadInt(); for (int i = 0; i < count; i++) { BuyInfo bi = new BuyInfo(reader); BuyInfoList.Add(bi); bi.Info = this; } count = reader.ReadInt(); for (int i = 0; i < count; i++) { SellInfo si= new SellInfo(reader); SellInfoList.Add(si); si.Info = this; } m_SalesInfo1 = CustomSaving.DeserializeStringArray(reader); m_SalesInfo2 = CustomSaving.DeserializeStringArray(reader); }
public SellGump(SellInfo info) : base(true, info.Info) { m_Info = info; AddLabel(230, 360, 0, "Commodity:"); AddLabel(300, 360, 0, info.Info.Name); AddLabel(230, 380, 0, "Price:"); AddTextEntry(300, 380, 120, 20, 0, 1, info.Price.ToString()); AddButton(420, 380, 4029, 4030, 1, GumpButtonType.Reply, 0); AddLabel(230, 400, 0, "Quantity:"); AddLabel(300, 400, 0, info.Quantity.ToString()); int acq = 0; foreach (BuyInfo bi in info.Info.BuyInfoList) if (bi.Price >= info.Price) acq += bi.Quantity; acq = Math.Min(info.Quantity, acq); AddLabel(230, 420, 0, "Immediate sales: " + acq.ToString()); AddLabel(260, 440, 0, "Commit"); AddButton(230, 440, 4011, 4012, 5, GumpButtonType.Reply, 0); AddLabel(360, 440, 0, info.Active ? "Remove" : "Cancel"); AddButton(330, 440, info.Active ? 4017 : 4020, info.Active ? 4018 : 4021, 0, GumpButtonType.Reply, 0); }