diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2016-12-18 15:37:23 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2016-12-18 15:37:23 -0500 |
commit | 23988a3c33a7a1616c2d36a2c4b7e3a2d06f4216 (patch) | |
tree | 42b66e7aaac4cdb5fcb1723c2b21d2f2a92eb4cd /src/StardewModdingAPI/Mod.cs | |
parent | 487ae1dce92a410984a7c13bf0f30bdd0d878aea (diff) | |
download | SMAPI-23988a3c33a7a1616c2d36a2c4b7e3a2d06f4216.tar.gz SMAPI-23988a3c33a7a1616c2d36a2c4b7e3a2d06f4216.tar.bz2 SMAPI-23988a3c33a7a1616c2d36a2c4b7e3a2d06f4216.zip |
migrate manifest & version to interfaces with backwards compatibility (#197)
Diffstat (limited to 'src/StardewModdingAPI/Mod.cs')
-rw-r--r-- | src/StardewModdingAPI/Mod.cs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/StardewModdingAPI/Mod.cs b/src/StardewModdingAPI/Mod.cs index 21551771..f0f876fa 100644 --- a/src/StardewModdingAPI/Mod.cs +++ b/src/StardewModdingAPI/Mod.cs @@ -24,7 +24,18 @@ namespace StardewModdingAPI public IMonitor Monitor { get; internal set; } /// <summary>The mod's manifest.</summary> - public Manifest Manifest { get; internal set; } + [Obsolete("Use " + nameof(Mod) + "." + nameof(ModManifest))] + public Manifest Manifest + { + get + { + Program.DeprecationManager.Warn($"{nameof(Mod)}.{nameof(Manifest)}", "1.5", DeprecationLevel.Notice); + return (Manifest)this.ModManifest; + } + } + + /// <summary>The mod's manifest.</summary> + public IManifest ModManifest { get; internal set; } /// <summary>The full path to the mod's directory on the disk.</summary> [Obsolete("Use " + nameof(Mod.Helper) + "." + nameof(IModHelper.DirectoryPath) + " instead")] @@ -94,7 +105,7 @@ namespace StardewModdingAPI Program.DeprecationManager.Warn($"{nameof(Mod)}.{nameof(Mod.PerSaveConfigFolder)}", "1.0", DeprecationLevel.Notice); Program.DeprecationManager.MarkWarned($"{nameof(Mod)}.{nameof(Mod.PathOnDisk)}", "1.0"); // avoid redundant warnings - if (!this.Manifest.PerSaveConfigs) + if (!((Manifest)this.Manifest).PerSaveConfigs) { this.Monitor.Log("Tried to fetch the per-save config folder, but this mod isn't configured to use per-save config files.", LogLevel.Error); return ""; |