public override void OnResponse(NetState sender, RelayInfo info) { if (info.ButtonID == 1) { if (Crate != null && Crate.IsChildOf(Player.Backpack)) { CityTradeSystem.CancelTradeOrder(Player, Crate); } } }
public override void OnClick() { if (Crate.IsChildOf(Player.Backpack) && !Crate.Deleted && Crate.Entry != null) { foreach (TradeEntry.TradeDetails detail in Crate.Entry.Details) { var list = new List <Item>(Player.Backpack.Items); foreach (var item in list.Where(i => i.Amount == 1 && Crate.TryAddItem(Player, i, false))) { Crate.DropItem(item); } } } }
public override void OnClick() { if (Crate.IsChildOf(Player.Backpack) && !Crate.Deleted && Crate.Entry != null) { foreach (TradeEntry.TradeDetails detail in Crate.Entry.Details) { Item[] items = Player.Backpack.FindItemsByType(detail.ItemType); foreach (Item item in items) { if (item.Amount == 1 && Crate.TryAddItem(Player, item, false)) { Crate.DropItem(item); } } } } }
public override void OnClick() { if (Crate.IsChildOf(Player.Backpack) && !Crate.Deleted && Crate.Entry != null) { for (var index = 0; index < Crate.Entry.Details.Count; index++) { var list = new List <Item>(Player.Backpack.Items); for (var i = 0; i < list.Count; i++) { var item = list[i]; if (item.Amount == 1 && Crate.TryAddItem(Player, item, false)) { Crate.DropItem(item); } } } } }