summaryrefslogtreecommitdiff
path: root/src/SMAPI
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-05-02 18:34:26 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-05-02 18:34:26 -0400
commiteef6a9c2e8d124ad0856a8b351f9cae68e54f6eb (patch)
tree60eb576087e0c3f73c358e0e8d18087a15bb50fe /src/SMAPI
parent0f27d6f4c18812d90e51b10c05bfa1a69953c721 (diff)
downloadSMAPI-eef6a9c2e8d124ad0856a8b351f9cae68e54f6eb.tar.gz
SMAPI-eef6a9c2e8d124ad0856a8b351f9cae68e54f6eb.tar.bz2
SMAPI-eef6a9c2e8d124ad0856a8b351f9cae68e54f6eb.zip
add support for dot-ignoring local map tilesheet files (#732)
Diffstat (limited to 'src/SMAPI')
-rw-r--r--src/SMAPI/Framework/ContentManagers/ModContentManager.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs
index 0cd431e8..f32e3be6 100644
--- a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs
+++ b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs
@@ -317,6 +317,15 @@ namespace StardewModdingAPI.Framework.ContentManagers
return true;
}
+ // special case: local filenames starting with a dot should be ignored
+ // For example, this lets mod authors have a '.spring_town.png' file in their map folder so it can be
+ // opened in Tiled, while still mapping it to the vanilla 'Maps/spring_town' asset at runtime.
+ {
+ string filename = Path.GetFileName(relativePath);
+ if (filename.StartsWith("."))
+ relativePath = Path.Combine(Path.GetDirectoryName(relativePath) ?? "", filename.TrimStart('.'));
+ }
+
// get relative to map file
{
string localKey = Path.Combine(modRelativeMapFolder, relativePath);