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.

42 lines
1.0 KiB

  1. using IPA.Config;
  2. using IPA.Utilities;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace IPA.Loader
  9. {
  10. internal class DisabledConfig
  11. {
  12. private static IConfigProvider _provider;
  13. public static IConfigProvider Provider
  14. {
  15. get => _provider;
  16. set
  17. {
  18. _provider?.RemoveLinks();
  19. value.Load();
  20. Ref = value.MakeLink<DisabledConfig>((c, v) =>
  21. {
  22. if (v.Value.Reset)
  23. c.Store(v.Value = new DisabledConfig { Reset = false });
  24. });
  25. _provider = value;
  26. }
  27. }
  28. public static Ref<DisabledConfig> Ref;
  29. public static void Load()
  30. {
  31. Provider = Config.Config.GetProviderFor("Disabled Mods", "json");
  32. }
  33. public bool Reset = true;
  34. public HashSet<string> DisabledModIds = new HashSet<string>();
  35. }
  36. }