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.

48 lines
1.3 KiB

  1. using IPA.Logging;
  2. using IPA.Utilities;
  3. using System.IO;
  4. namespace IPA.Config
  5. {
  6. internal class SelfConfig
  7. {
  8. private static IConfigProvider _loaderConfig;
  9. public static IConfigProvider LoaderConfig
  10. {
  11. get => _loaderConfig;
  12. set
  13. {
  14. _loaderConfig?.RemoveLinks();
  15. value.Load();
  16. SelfConfigRef = value.MakeLink<SelfConfig>((c, v) =>
  17. {
  18. if (v.Value.Regenerate)
  19. c.Store(v.Value = new SelfConfig { Regenerate = false });
  20. StandardLogger.Configure(v.Value);
  21. });
  22. _loaderConfig = value;
  23. }
  24. }
  25. public static Ref<SelfConfig> SelfConfigRef;
  26. public static void Set()
  27. {
  28. LoaderConfig = Config.GetProviderFor(Path.Combine("UserData", IPA_Name), "json");
  29. }
  30. internal const string IPA_Name = "Beat Saber IPA";
  31. internal const string IPA_Version = "3.12.0";
  32. public bool Regenerate = true;
  33. public class DebugObject
  34. {
  35. public bool ShowCallSource = false;
  36. public bool ShowDebug = false;
  37. }
  38. public DebugObject Debug = new DebugObject();
  39. }
  40. }