// load the XML settings public static RUVoiceSettings LoadXML() { if (File.Exists(Main.pathMod + Main.xmlSettingsFile)) { return(XmlOperation.Deserialize <RUVoiceSettings>(Main.pathMod + Main.xmlSettingsFile)); } else { RUVoiceSettings myRUVoiceSettings = new RUVoiceSettings(); XmlOperation.Serialize(myRUVoiceSettings, Main.pathMod + Main.xmlSettingsFile); return(myRUVoiceSettings); } }
// On off Mod public static bool OnToggle(UnityModManager.ModEntry modEntry, bool value) { enabled = value; Main.pathWWW = Main.pathMod.Replace("\\", "//"); Main.PathAudioWWW = Main.pathAudio.Replace("\\", "//"); Main.ruVoiceSettings = Main.LoadXML(); Main.LoadTextDB(); Main.LoadPitchDB(); return(true); // If true, the mod will switch the state. If not, the state will not change. }