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.

65 lines
2.4 KiB

  1. using IPA.JsonConverters;
  2. using IPA.Utilities;
  3. using Newtonsoft.Json;
  4. using SemVer;
  5. using System;
  6. using System.Collections.Generic;
  7. using AlmostVersionConverter = IPA.JsonConverters.AlmostVersionConverter;
  8. using Version = SemVer.Version;
  9. namespace IPA.Loader
  10. {
  11. internal class PluginManifest
  12. {
  13. [JsonProperty("name", Required = Required.Always)]
  14. public string Name;
  15. [JsonProperty("id", Required = Required.AllowNull)]
  16. public string Id;
  17. [JsonProperty("description", Required = Required.Always), JsonConverter(typeof(MultilineStringConverter))]
  18. public string Description;
  19. [JsonProperty("version", Required = Required.Always), JsonConverter(typeof(SemverVersionConverter))]
  20. public Version Version;
  21. [JsonProperty("gameVersion", Required = Required.Always), JsonConverter(typeof(AlmostVersionConverter))]
  22. public AlmostVersion GameVersion;
  23. [JsonProperty("author", Required = Required.Always)]
  24. public string Author;
  25. [JsonProperty("dependsOn", Required = Required.DisallowNull, ItemConverterType = typeof(SemverRangeConverter))]
  26. public Dictionary<string, Range> Dependencies = new Dictionary<string, Range>();
  27. [JsonProperty("conflictsWith", Required = Required.DisallowNull, ItemConverterType = typeof(SemverRangeConverter))]
  28. public Dictionary<string, Range> Conflicts = new Dictionary<string, Range>();
  29. [JsonProperty("features", Required = Required.DisallowNull)]
  30. public string[] Features = Array.Empty<string>();
  31. [JsonProperty("loadBefore", Required = Required.DisallowNull)]
  32. public string[] LoadBefore = Array.Empty<string>();
  33. [JsonProperty("loadAfter", Required = Required.DisallowNull)]
  34. public string[] LoadAfter = Array.Empty<string>();
  35. [JsonProperty("icon", Required = Required.DisallowNull)]
  36. public string IconPath = null;
  37. [Serializable]
  38. public class LinksObject
  39. {
  40. [JsonProperty("project-home", Required = Required.DisallowNull)]
  41. public Uri ProjectHome = null;
  42. [JsonProperty("project-source", Required = Required.DisallowNull)]
  43. public Uri ProjectSource = null;
  44. [JsonProperty("donate", Required = Required.DisallowNull)]
  45. public Uri Donate = null;
  46. }
  47. [JsonProperty("links", Required = Required.DisallowNull)]
  48. public LinksObject Links = null;
  49. }
  50. }