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);
        }
Ejemplo n.º 2
0
        public static void LoadListInfoAllPostHook(ChaListControl __instance)
        {
            string listPath = Path.Combine(ResourceRedirector.EmulatedDir, @"list\characustom");

            if (Directory.Exists(listPath))
            {
                foreach (string csvPath in Directory.GetFiles(listPath, "*.csv", SearchOption.AllDirectories))
                {
                    ListLoader.LoadCSV(File.OpenRead(csvPath));
                }
            }

            ListLoader.LoadAllLists(__instance);
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
0
        public static void LoadListInfoAllPostHook(ChaListControl __instance)
        {
            string listPath = Path.Combine(ResourceRedirector.EmulatedDir, @"list\characustom");

            //BepInLogger.Log($"List directory exists? {Directory.Exists(listPath).ToString()}");

            if (Directory.Exists(listPath))
            {
                foreach (string csvPath in Directory.GetFiles(listPath, "*.csv", SearchOption.AllDirectories))
                {
                    //BepInLogger.Log($"Attempting load of: {csvPath}");

                    var chaListData = ListLoader.LoadCSV(File.OpenRead(csvPath));
                    ListLoader.ExternalDataList.Add(chaListData);

                    //BepInLogger.Log($"Finished load of: {csvPath}");
                }
            }

            ListLoader.LoadAllLists(__instance);
        }