diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-02-22 17:55:00 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-02-22 17:55:00 -0500 |
commit | f98f61e6d891c43adae4494b84705dee369829f7 (patch) | |
tree | be1e23cc4c5d4885f33d46337b87b9cc185271b4 /src/SMAPI | |
parent | 66079f2253a0c81bb33c1fee848a6cd2222d43d9 (diff) | |
parent | f9ffde9a3482b0d66bd6e30b41e890cb38b53af6 (diff) | |
download | SMAPI-f98f61e6d891c43adae4494b84705dee369829f7.tar.gz SMAPI-f98f61e6d891c43adae4494b84705dee369829f7.tar.bz2 SMAPI-f98f61e6d891c43adae4494b84705dee369829f7.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI')
-rw-r--r-- | src/SMAPI/Constants.cs | 2 | ||||
-rw-r--r-- | src/SMAPI/Framework/ContentManagers/ModContentManager.cs | 15 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index 670dc494..e71b21b1 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -20,7 +20,7 @@ namespace StardewModdingAPI ** Public ****/ /// <summary>SMAPI's current semantic version.</summary> - public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion("3.3.0"); + public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion("3.3.1"); /// <summary>The minimum supported version of Stardew Valley.</summary> public static ISemanticVersion MinimumGameVersion { get; } = new GameVersion("1.4.1"); diff --git a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs index 7d274eb7..4ffe3acd 100644 --- a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs +++ b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs @@ -367,14 +367,23 @@ namespace StardewModdingAPI.Framework.ContentManagers } // get from game assets + // Map tilesheet keys shouldn't include the "Maps/" prefix (the game will add it automatically) or ".png" extension. { - string contentKey = Path.Combine("Maps", relativePath); - if (contentKey.EndsWith(".png")) + string contentKey = relativePath; + foreach (char separator in PathUtilities.PossiblePathSeparators) + { + if (contentKey.StartsWith($"Maps{separator}")) + { + contentKey = contentKey.Substring(5); + break; + } + } + if (contentKey.EndsWith(".png", StringComparison.InvariantCultureIgnoreCase)) contentKey = contentKey.Substring(0, contentKey.Length - 4); try { - this.GameContentManager.Load<Texture2D>(contentKey, this.Language, useCache: true); // no need to bypass cache here, since we're not storing the asset + this.GameContentManager.Load<Texture2D>(Path.Combine("Maps", contentKey), this.Language, useCache: true); // no need to bypass cache here, since we're not storing the asset assetName = contentKey; return true; } |