public override void OnResponse(NetState sender, RelayInfo info) { if (m_Deed.Deleted || !m_Deed.IsChildOf(m_From.Backpack)) { return; } if (info.ButtonID == 2) // Combine { m_From.SendGump(new LargeBODGump(m_From, m_Deed)); m_Deed.BeginCombine(m_From); } else if (info.ButtonID == 3) // bank button { BODContext c = BulkOrderSystem.GetContext(m_From); if (c != null) { switch (c.PointsMode) { case PointsMode.Enabled: c.PointsMode = PointsMode.Disabled; break; case PointsMode.Disabled: c.PointsMode = PointsMode.Automatic; break; case PointsMode.Automatic: c.PointsMode = PointsMode.Enabled; break; } } m_From.SendGump(new LargeBODGump(m_From, m_Deed)); } else if (info.ButtonID == 4) // combine from container { m_From.BeginTarget(-1, false, Targeting.TargetFlags.None, (m, targeted) => { if (!m_Deed.Deleted && targeted is Container container) { List <SmallBOD> list = new List <SmallBOD>(); for (var index = 0; index < container.Items.Count; index++) { Item item = container.Items[index]; if (item is SmallBOD bod) { list.Add(bod); } } for (var index = 0; index < list.Count; index++) { SmallBOD item = list[index]; m_Deed.EndCombine(m_From, item); } list.Clear(); } }); } }
public override void OnResponse(NetState sender, RelayInfo info) { if (m_Deed.Deleted || !m_Deed.IsChildOf(m_From.Backpack)) { return; } if (info.ButtonID == 2) // Combine { m_From.SendGump(new LargeBODGump(m_From, m_Deed)); m_Deed.BeginCombine(m_From); } }
public override void OnResponse(NetState sender, RelayInfo info) { if (m_Deed.Deleted || !m_Deed.IsChildOf(m_From.Backpack)) { return; } if (info.ButtonID == 2) // Combine { m_From.SendGump(new LargeBODGump(m_From, m_Deed)); m_Deed.BeginCombine(m_From); } else if (info.ButtonID == 3) // bank button { BODContext c = BulkOrderSystem.GetContext(m_From); if (c != null) { switch (c.PointsMode) { case PointsMode.Enabled: c.PointsMode = PointsMode.Disabled; break; case PointsMode.Disabled: c.PointsMode = PointsMode.Automatic; break; case PointsMode.Automatic: c.PointsMode = PointsMode.Enabled; break; } } m_From.SendGump(new LargeBODGump(m_From, m_Deed)); } else if (info.ButtonID == 4) // combine from container { m_From.BeginTarget(-1, false, Server.Targeting.TargetFlags.None, (m, targeted) => { if (!m_Deed.Deleted && targeted is Container) { List <SmallBOD> list = ((Container)targeted).Items.OfType <SmallBOD>().ToList(); foreach (SmallBOD item in list) { m_Deed.EndCombine(m_From, item); } list.Clear(); } }); } }