diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-07-21 22:05:47 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-09-14 18:54:01 -0400 |
commit | 4b9ba35a194ac711d7c36943fc7277ce2a33b141 (patch) | |
tree | 92b1ebd78450a4ff57c17142cad860bf36f2477a | |
parent | dc1c9bf036ad61cbddd3390bbc2044b5f3ebd5aa (diff) | |
download | SMAPI-4b9ba35a194ac711d7c36943fc7277ce2a33b141.tar.gz SMAPI-4b9ba35a194ac711d7c36943fc7277ce2a33b141.tar.bz2 SMAPI-4b9ba35a194ac711d7c36943fc7277ce2a33b141.zip |
apply tilesheet fixes to XNB map files too
-rw-r--r-- | docs/release-notes.md | 1 | ||||
-rw-r--r-- | src/SMAPI/Framework/ContentManagers/ModContentManager.cs | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md index 58114dde..abc08e16 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -40,6 +40,7 @@ These changes have not been released yet. * The installer now recognises custom game paths stored in `stardewvalley.targets`, if any. * Trace logs for a broken mod now list all detected issues (instead of the first one). * Trace logs when loading mods are now more clear. + * Fixed custom maps loaded from `.xnb` files not having their tilesheet paths automatically adjusted. * Fixed custom maps loaded from the mod folder with tilesheets in a subfolder not working crossplatform. All tilesheet paths are now normalised for the OS automatically. * Removed all deprecated APIs. * Removed the `Monitor.ExitGameImmediately` method. diff --git a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs index de05e92d..d6eb28c8 100644 --- a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs +++ b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs @@ -118,7 +118,13 @@ namespace StardewModdingAPI.Framework.ContentManagers // XNB file case ".xnb": { - return this.RawLoad<T>(assetName, useCache: false); + T data = this.RawLoad<T>(assetName, useCache: false); + if (data is Map map) + { + this.FixCustomTilesheetPaths(map, relativeMapPath: assetName); + this.NormaliseTilesheetPaths(map); + } + return data; } // unpacked data |