Example #1
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);
        }
Example #2
0
        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)
            {
                //BepInLogger.Log($"ADD {category} : {id} : {result}");
                __instance.AddItemID(pid, flags);
                return(false);
            }

            return(true);
        }