static void SortInventory(InventoryWindowInfo inventoryWindowInfo, bool removeUnavailable = true) { if (removeUnavailable) { inventoryWindowInfo.Sort.RemoveAll(props => { return(props.ConditionStatus != PropsInfo.PropsConditionStatus.AllPass); }); } inventoryWindowInfo.Sort.Sort((a, b) => a.Item.PropsCategory.CompareTo(b.Item.PropsCategory)); }
public static bool ModExt_PropsCanUse3(InventoryWindowInfo inventoryWindowInfo) { SortInventory(inventoryWindowInfo); return(true); }
public static bool GiftInvertoryPatch_propsFilterAndSort(ref CtrlGiftInvertoryWindow __instance, ref InventoryWindowInfo inventoryWindowInfo) { if (giftFilter.Value) { List <PropsInfo> sort = inventoryWindowInfo.Sort; CharacterMapping mapping = inventoryWindowInfo.Mapping; List <PropsInfo> canAddExpGiftlist = new List <PropsInfo>(); for (int index = 0; index < sort.Count; index++) { Props item = sort[index].Item; if (item.PropsEffect != null) { for (int i = 0; i < item.PropsEffect.Count; i++) { PropsEffect propsEffect = item.PropsEffect[i]; if (propsEffect is PropsFavorable) { PropsFavorable propsFavorable = propsEffect as PropsFavorable; if (mapping != null && mapping.InfoId != null && !mapping.InfoId.Equals(string.Empty)) { if (propsFavorable.Npcid == mapping.InfoId) { canAddExpGiftlist.Add(sort[index]); break; } } } } } } sort.Clear(); sort.AddRange(canAddExpGiftlist.ToArray()); canAddExpGiftlist.Clear(); GiftSortByCategory(sort, mapping.Id); GiftSortByNumber(sort, mapping.Id); } return(true); }
public static bool BattleInvertoryPatch2_propsFilterAndSort(ref CtrlInventoryWindow __instance, ref InventoryWindowInfo inventoryWindowInfo) { List <PropsInfo> sort = inventoryWindowInfo.Sort; Debug.LogError(string.Format("CtrlInventoryWindow, Index: {0}", 1)); EquipSortByCategory(sort); Debug.LogError(string.Format("CtrlInventoryWindow, Index: {0}", 2)); EquipSortByAttack(sort); Debug.LogError(string.Format("CtrlInventoryWindow, Index: {0}", 3)); return(true); }