public static void SaveConfig(string path, IConfigProvider provider) { if (!CheckPath(ref path)) { return; } var directory = FileManagerSecure.GetDirectoryName(path); if (!FileManagerSecure.DirectoryExists(directory)) { FileManagerSecure.CreateDirectory(directory); } var config = new JSONClass(); provider.StoreConfig(config); Controller.SaveJSON(config, path, () => SuperController.LogMessage($"Saved config! \"{path}\""), null, null); }
public static void LoadConfig(string path, IConfigProvider provider) { if (!CheckPath(ref path)) { return; } var directory = FileManagerSecure.GetDirectoryName(path); if (!FileManagerSecure.DirectoryExists(directory)) { return; } var config = Controller.LoadJSON(path); provider.RestoreConfig(config); SuperController.LogMessage($"Loaded config! \"{path}\""); }