public void Save() { var n = new JSONObject(); var h = n["Slots"].AsObject; foreach (var v in _instance.Slots) { var a = h[v.Key] = new JSONArray(); h[v.Key].AsArray.Add(v.Key, v.Value?[0] ?? string.Empty); h[v.Key].AsArray.Add(v.Key, v.Value?[1] ?? string.Empty); h[v.Key].AsArray.Add(v.Key, v.Value?[2] ?? string.Empty); } File.WriteAllText(GetModInfoPath(), n.ToString(JSONTextMode.Indent)); OnConfigSave?.Invoke(this, null); }
/// <summary> /// Writes the current configuration to the config file. Runs in parallel. /// </summary> public static void SaveStart(bool silent = false) { OnConfigSave?.Invoke(); ConfigIO.Instance.SaveStart(Current, silent); }
/// <summary> /// Writes the current configuration to the config file. Runs synchronously. /// </summary> public static void Save() { OnConfigSave?.Invoke(); ConfigIO.Instance.Save(Current); }