public static void SendGump(PlayerMobile pm) { List <ItemInsuranceInfo> list = new List <ItemInsuranceInfo>(); foreach (Item item in pm.GetEquippedItems()) { if (ItemInsuranceHelper.CanInsure(item)) { list.Add(new ItemInsuranceInfo(item)); } } if (pm.Backpack != null) { RecurseSelectItems(list, pm.Backpack); } if (list.Count > 0) { ItemInsuranceInfo[] col = list.ToArray(); pm.CloseGump <ItemInsuranceMenu>(); pm.SendGump(new ItemInsuranceMenu(pm, col)); } else { pm.SendLocalizedMessage(1114915, String.Empty, 53); // None of your current items meet the requirements for insurance. } }
private static void RecurseSelectItems(List <ItemInsuranceInfo> list, Container cont) { foreach (Item item in cont.Items) { if (item is Container && !(item is BaseQuiver)) { RecurseSelectItems(list, (Container)item); } else if (ItemInsuranceHelper.CanInsure(item)) { list.Add(new ItemInsuranceInfo(item)); } } }