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.

47 lines
1.2 KiB

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