예제 #1
0
        public static List <CustomSelectInfo> CreateSelectList(
            ChaListDefine.CategoryNo cateNo,
            ChaListDefine.KeyType limitKey = ChaListDefine.KeyType.Unknown)
        {
            ChaListControl chaListCtrl = Singleton <Character> .Instance.chaListCtrl;
            Dictionary <int, ListInfoBase> categoryInfo = chaListCtrl.GetCategoryInfo(cateNo);

            int[] array = categoryInfo.Keys.ToArray <int>();
            List <CustomSelectInfo> customSelectInfoList = new List <CustomSelectInfo>();

            for (int index = 0; index < categoryInfo.Count; ++index)
            {
                if (categoryInfo[array[index]].GetInfoInt(ChaListDefine.KeyType.Possess) != 99)
                {
                    bool flag = false;
                    if (chaListCtrl.CheckItemID(categoryInfo[array[index]].Category, categoryInfo[array[index]].Id) == (byte)1)
                    {
                        flag = true;
                    }
                    customSelectInfoList.Add(new CustomSelectInfo()
                    {
                        category    = categoryInfo[array[index]].Category,
                        id          = categoryInfo[array[index]].Id,
                        limitIndex  = limitKey != ChaListDefine.KeyType.Unknown ? categoryInfo[array[index]].GetInfoInt(limitKey) : -1,
                        name        = categoryInfo[array[index]].Name,
                        assetBundle = categoryInfo[array[index]].GetInfo(ChaListDefine.KeyType.ThumbAB),
                        assetName   = categoryInfo[array[index]].GetInfo(ChaListDefine.KeyType.ThumbTex),
                        newItem     = flag
                    });
                }
            }
            return(customSelectInfoList);
        }
        public static bool AddItemIDHook(int category, int id, byte flags, ChaListControl __instance)
        {
            int pid = ListLoader.CalculateGlobalID(category, id);

            byte result = __instance.CheckItemID(pid);

            if (result > 0)
            {
                __instance.AddItemID(pid, flags);
                return(false);
            }

            return(true);
        }
            internal static bool CheckItemIDHook(int category, int id, ref byte __result, ChaListControl __instance)
            {
                int pid = CalculateGlobalID(category, id);

                byte result = __instance.CheckItemID(pid);

                if (result > 0)
                {
                    __result = result;
                    return(false);
                }

                return(true);
            }
예제 #4
0
        public static bool CheckItemIDHook(int category, int id, ref byte __result, ChaListControl __instance)
        {
            int pid = ListLoader.CalculateGlobalID(category, id);

            byte result = __instance.CheckItemID(pid);

            if (result > 0)
            {
                //BepInLogger.Log($"CHECK {category} : {id} : {result}");
                __result = result;
                return(false);
            }

            return(true);
        }