Skip to content

Commit

Permalink
Merge branch 'develop' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
Pathoschild committed Feb 22, 2020
2 parents 66079f2 + f9ffde9 commit f98f61e
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 11 deletions.
5 changes: 5 additions & 0 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
← [README](README.md)

# Release notes
## 3.3.1
Released 22 February 2020 for Stardew Valley 1.4.1 or later.

* Fixed errors with custom spouse room mods in SMAPI 3.3.

## 3.3
Released 22 February 2020 for Stardew Valley 1.4.1 or later.

Expand Down
4 changes: 2 additions & 2 deletions src/SMAPI.Mods.ConsoleCommands/manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"Name": "Console Commands",
"Author": "SMAPI",
"Version": "3.3.0",
"Version": "3.3.1",
"Description": "Adds SMAPI console commands that let you manipulate the game.",
"UniqueID": "SMAPI.ConsoleCommands",
"EntryDll": "ConsoleCommands.dll",
"MinimumApiVersion": "3.3.0"
"MinimumApiVersion": "3.3.1"
}
4 changes: 2 additions & 2 deletions src/SMAPI.Mods.SaveBackup/manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"Name": "Save Backup",
"Author": "SMAPI",
"Version": "3.3.0",
"Version": "3.3.1",
"Description": "Automatically backs up all your saves once per day into its folder.",
"UniqueID": "SMAPI.SaveBackup",
"EntryDll": "SaveBackup.dll",
"MinimumApiVersion": "3.3.0"
"MinimumApiVersion": "3.3.1"
}
6 changes: 3 additions & 3 deletions src/SMAPI.Toolkit/Utilities/PathUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ namespace StardewModdingAPI.Toolkit.Utilities
public static class PathUtilities
{
/*********
** Fields
** Accessors
*********/
/// <summary>The possible directory separator characters in a file path.</summary>
private static readonly char[] PossiblePathSeparators = new[] { '/', '\\', Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }.Distinct().ToArray();
public static readonly char[] PossiblePathSeparators = new[] { '/', '\\', Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }.Distinct().ToArray();

/// <summary>The preferred directory separator character in an asset key.</summary>
private static readonly string PreferredPathSeparator = Path.DirectorySeparatorChar.ToString();
public static readonly string PreferredPathSeparator = Path.DirectorySeparatorChar.ToString();


/*********
Expand Down
2 changes: 1 addition & 1 deletion src/SMAPI/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static class Constants
** 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");
Expand Down
15 changes: 12 additions & 3 deletions src/SMAPI/Framework/ContentManagers/ModContentManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,23 @@ private bool TryGetTilesheetAssetName(string modRelativeMapFolder, string origin
}

// 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;
}
Expand Down

0 comments on commit f98f61e

Please sign in to comment.