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.

49 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. var val = v.Value;
  19. if (val.Regenerate)
  20. c.Store(val = new SelfConfig { Regenerate = false });
  21. StandardLogger.Configure(val);
  22. });
  23. _loaderConfig = value;
  24. }
  25. }
  26. public static Ref<SelfConfig> SelfConfigRef;
  27. public static void Set()
  28. {
  29. LoaderConfig = Config.GetProviderFor(Path.Combine("UserData", IPA_Name), "toml", "json");
  30. }
  31. internal const string IPA_Name = "Beat Saber IPA - Builtin manifest support";
  32. internal const string IPA_Version = "3.12.0";
  33. public bool Regenerate = true;
  34. public class DebugObject
  35. {
  36. public bool ShowCallSource = false;
  37. public bool ShowDebug = false;
  38. }
  39. public DebugObject Debug = new DebugObject();
  40. }
  41. }