Techblox Mod Manager / Launcher
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
637B

  1. using System.IO;
  2. using Newtonsoft.Json;
  3. namespace TBMM
  4. {
  5. public class Configuration
  6. {
  7. public string GamePath { get; set; }
  8. public AutoPatchingState AutoPatch { get; set; } = AutoPatchingState.Unspecified;
  9. public static Configuration Load()
  10. {
  11. if (File.Exists("configuration.json"))
  12. return JsonConvert.DeserializeObject<Configuration>(File.ReadAllText("configuration.json"));
  13. return new Configuration();
  14. }
  15. public void Save()
  16. {
  17. File.WriteAllText("configuration.json", JsonConvert.SerializeObject(this));
  18. }
  19. }
  20. }