public BuyGump(BuyInfo info) : base(false, info.Info) { if (info.Active) { m_WasActive = true; info.Deactivate(); } m_Info = info; AddLabel(230, 360, 0, "Commodity:"); AddLabel(300, 360, 0, info.Info.Name); AddLabel(230, 380, 0, "Price:"); AddTextEntry(300, 380, 1202, 20, 0, 1, info.Price.ToString()); AddButton(420, 380, 4029, 248, 1, GumpButtonType.Reply, 0); AddLabel(230, 400, 0, "Quantity:"); AddTextEntry(300, 400, 100, 20, 0, 2, info.Quantity.ToString()); AddButton(420, 400, 4029, 4030, 2, GumpButtonType.Reply, 0); int acq = 0; foreach (SellInfo si in info.Info.SellInfoList) if (si.Price <= info.Price) acq += si.Quantity; acq = Math.Min(info.Quantity, acq); AddLabel(230, 420, 0, "Immediate acquisitions: " + 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); }
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 VerifyActionGump(BuyInfo info) : base(true) { m_Info = info; Closable = false; Disposable = false; AddBackground(0, 0, 500, 350, 2600); AddBackground(125, 15, 250, 76, 9250); 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, "Warning!<br>Canceling this offer will remove it from the exchange board, the incurred costs will not be returned", false, false); AddButton(92, 294, 247, 248, 0, GumpButtonType.Reply, 0); AddButton(338, 292, 241, 242, 1, GumpButtonType.Reply, 0); }