public static void Patch() { QCreatures.Load(); var harmony = HarmonyInstance.Create("qcreatureconfig.mod"); harmony.PatchAll(Assembly.GetExecutingAssembly()); }
public static void Load() { if (!File.Exists(Environment.CurrentDirectory + @"\QMods\QCreatureConfig\creatures.json")) { return; } var json = File.ReadAllText(Environment.CurrentDirectory + @"\QMods\QCreatureConfig\creatures.json"); var creatures = JsonConvert.DeserializeObject <QCreatures>(json); Creatures = creatures; }
public static void Save(QCreatures creatures) { var json = JsonConvert.SerializeObject(creatures); File.WriteAllText(Environment.CurrentDirectory + @"\QMods\QCreatureConfig\creatures.json", json); }