summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/SMAPI.Installer/InteractiveInstaller.cs4
-rw-r--r--src/SMAPI.Internal/ConsoleWriting/ColorfulConsoleWriter.cs16
-rw-r--r--src/SMAPI.Internal/ConsoleWriting/IConsoleWriter.cs11
-rw-r--r--src/SMAPI.Internal/ConsoleWriting/MonitorColorScheme.cs5
-rw-r--r--src/SMAPI.Internal/SMAPI.Internal.projitems1
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/SetDayCommand.cs2
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/SetSeasonCommand.cs2
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/SetYearCommand.cs2
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/manifest.json4
-rw-r--r--src/SMAPI.Mods.SaveBackup/manifest.json4
-rw-r--r--src/SMAPI.Tests/Core/ModResolverTests.cs2
-rw-r--r--src/SMAPI.Tests/Utilities/SDateTests.cs91
-rw-r--r--src/SMAPI.Web/Program.cs1
-rw-r--r--src/SMAPI.Web/wwwroot/SMAPI.metadata.json2
-rw-r--r--src/SMAPI.Web/wwwroot/schemas/content-patcher.json72
-rw-r--r--src/SMAPI.sln6
-rw-r--r--src/SMAPI/Constants.cs2
-rw-r--r--src/SMAPI/Framework/Content/AssetDataForMap.cs186
-rw-r--r--src/SMAPI/Framework/Content/AssetDataForObject.cs8
-rw-r--r--src/SMAPI/Framework/ContentCoordinator.cs27
-rw-r--r--src/SMAPI/Framework/ModHelpers/ContentHelper.cs14
-rw-r--r--src/SMAPI/Framework/Monitor.cs4
-rw-r--r--src/SMAPI/Framework/Patching/PatchHelper.cs34
-rw-r--r--src/SMAPI/Framework/SCore.cs3
-rw-r--r--src/SMAPI/IAssetData.cs6
-rw-r--r--src/SMAPI/IAssetDataForMap.cs18
-rw-r--r--src/SMAPI/IContentHelper.cs6
-rw-r--r--src/SMAPI/Metadata/CoreAssetPropagator.cs9
-rw-r--r--src/SMAPI/Patches/DialogueErrorPatch.cs9
-rw-r--r--src/SMAPI/Patches/EventErrorPatch.cs9
-rw-r--r--src/SMAPI/Patches/ObjectErrorPatch.cs39
-rw-r--r--src/SMAPI/Patches/ScheduleErrorPatch.cs9
-rw-r--r--src/SMAPI/Program.cs4
-rw-r--r--src/SMAPI/SMAPI.config.json1
-rw-r--r--src/SMAPI/Utilities/SDate.cs63
-rw-r--r--src/SMAPI/i18n/de.json9
-rw-r--r--src/SMAPI/i18n/default.json8
-rw-r--r--src/SMAPI/i18n/es.json8
-rw-r--r--src/SMAPI/i18n/fr.json8
-rw-r--r--src/SMAPI/i18n/hu.json8
-rw-r--r--src/SMAPI/i18n/it.json8
-rw-r--r--src/SMAPI/i18n/ja.json8
-rw-r--r--src/SMAPI/i18n/ko.json9
-rw-r--r--src/SMAPI/i18n/pt.json8
-rw-r--r--src/SMAPI/i18n/ru.json8
-rw-r--r--src/SMAPI/i18n/tr.json8
-rw-r--r--src/SMAPI/i18n/zh.json8
47 files changed, 712 insertions, 62 deletions
diff --git a/src/SMAPI.Installer/InteractiveInstaller.cs b/src/SMAPI.Installer/InteractiveInstaller.cs
index 2d58baf0..5b0c6e1f 100644
--- a/src/SMAPI.Installer/InteractiveInstaller.cs
+++ b/src/SMAPI.Installer/InteractiveInstaller.cs
@@ -88,8 +88,8 @@ namespace StardewModdingApi.Installer
yield return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "StardewValley", "ErrorLogs"); // remove old log files
}
- /// <summary>Handles writing color-coded text to the console.</summary>
- private ColorfulConsoleWriter ConsoleWriter;
+ /// <summary>Handles writing text to the console.</summary>
+ private IConsoleWriter ConsoleWriter;
/*********
diff --git a/src/SMAPI.Internal/ConsoleWriting/ColorfulConsoleWriter.cs b/src/SMAPI.Internal/ConsoleWriting/ColorfulConsoleWriter.cs
index aefda9b6..b5bd4600 100644
--- a/src/SMAPI.Internal/ConsoleWriting/ColorfulConsoleWriter.cs
+++ b/src/SMAPI.Internal/ConsoleWriting/ColorfulConsoleWriter.cs
@@ -4,8 +4,8 @@ using StardewModdingAPI.Toolkit.Utilities;
namespace StardewModdingAPI.Internal.ConsoleWriting
{
- /// <summary>Provides a wrapper for writing color-coded text to the console.</summary>
- internal class ColorfulConsoleWriter
+ /// <summary>Writes color-coded text to the console.</summary>
+ internal class ColorfulConsoleWriter : IConsoleWriter
{
/*********
** Fields
@@ -30,8 +30,16 @@ namespace StardewModdingAPI.Internal.ConsoleWriting
/// <param name="colorConfig">The colors to use for text written to the SMAPI console.</param>
public ColorfulConsoleWriter(Platform platform, ColorSchemeConfig colorConfig)
{
- this.SupportsColor = this.TestColorSupport();
- this.Colors = this.GetConsoleColorScheme(platform, colorConfig);
+ if (colorConfig.UseScheme == MonitorColorScheme.None)
+ {
+ this.SupportsColor = false;
+ this.Colors = null;
+ }
+ else
+ {
+ this.SupportsColor = this.TestColorSupport();
+ this.Colors = this.GetConsoleColorScheme(platform, colorConfig);
+ }
}
/// <summary>Write a message line to the log.</summary>
diff --git a/src/SMAPI.Internal/ConsoleWriting/IConsoleWriter.cs b/src/SMAPI.Internal/ConsoleWriting/IConsoleWriter.cs
new file mode 100644
index 00000000..fbcf161c
--- /dev/null
+++ b/src/SMAPI.Internal/ConsoleWriting/IConsoleWriter.cs
@@ -0,0 +1,11 @@
+namespace StardewModdingAPI.Internal.ConsoleWriting
+{
+ /// <summary>Writes text to the console.</summary>
+ internal interface IConsoleWriter
+ {
+ /// <summary>Write a message line to the log.</summary>
+ /// <param name="message">The message to log.</param>
+ /// <param name="level">The log level.</param>
+ void WriteLine(string message, ConsoleLogLevel level);
+ }
+}
diff --git a/src/SMAPI.Internal/ConsoleWriting/MonitorColorScheme.cs b/src/SMAPI.Internal/ConsoleWriting/MonitorColorScheme.cs
index bccb56d7..994ea6a5 100644
--- a/src/SMAPI.Internal/ConsoleWriting/MonitorColorScheme.cs
+++ b/src/SMAPI.Internal/ConsoleWriting/MonitorColorScheme.cs
@@ -10,6 +10,9 @@ namespace StardewModdingAPI.Internal.ConsoleWriting
DarkBackground,
/// <summary>Use darker text colors that look better on a white or light background.</summary>
- LightBackground
+ LightBackground,
+
+ /// <summary>Disable console color.</summary>
+ None
}
}
diff --git a/src/SMAPI.Internal/SMAPI.Internal.projitems b/src/SMAPI.Internal/SMAPI.Internal.projitems
index 7fcebc94..0d583a6d 100644
--- a/src/SMAPI.Internal/SMAPI.Internal.projitems
+++ b/src/SMAPI.Internal/SMAPI.Internal.projitems
@@ -12,6 +12,7 @@
<Compile Include="$(MSBuildThisFileDirectory)ConsoleWriting\ColorfulConsoleWriter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ConsoleWriting\ColorSchemeConfig.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ConsoleWriting\ConsoleLogLevel.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)ConsoleWriting\IConsoleWriter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ConsoleWriting\MonitorColorScheme.cs" />
</ItemGroup>
</Project> \ No newline at end of file
diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/SetDayCommand.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/SetDayCommand.cs
index 8d6bd759..23c266ea 100644
--- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/SetDayCommand.cs
+++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/SetDayCommand.cs
@@ -1,4 +1,5 @@
using System.Linq;
+using StardewModdingAPI.Utilities;
using StardewValley;
namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.World
@@ -32,6 +33,7 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.World
// handle
Game1.dayOfMonth = day;
+ Game1.stats.DaysPlayed = (uint)SDate.Now().DaysSinceStart;
monitor.Log($"OK, the date is now {Game1.currentSeason} {Game1.dayOfMonth}.", LogLevel.Info);
}
}
diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/SetSeasonCommand.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/SetSeasonCommand.cs
index 0615afe7..676369fe 100644
--- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/SetSeasonCommand.cs
+++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/SetSeasonCommand.cs
@@ -1,4 +1,5 @@
using System.Linq;
+using StardewModdingAPI.Utilities;
using StardewValley;
namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.World
@@ -40,6 +41,7 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.World
// handle
Game1.currentSeason = season.ToLower();
Game1.setGraphicsForSeason();
+ Game1.stats.DaysPlayed = (uint)SDate.Now().DaysSinceStart;
monitor.Log($"OK, the date is now {Game1.currentSeason} {Game1.dayOfMonth}.", LogLevel.Info);
}
}
diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/SetYearCommand.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/SetYearCommand.cs
index 66abd6dc..648830c1 100644
--- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/SetYearCommand.cs
+++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/SetYearCommand.cs
@@ -1,4 +1,5 @@
using System.Linq;
+using StardewModdingAPI.Utilities;
using StardewValley;
namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.World
@@ -32,6 +33,7 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.World
// handle
Game1.year = year;
+ Game1.stats.DaysPlayed = (uint)SDate.Now().DaysSinceStart;
monitor.Log($"OK, the year is now {Game1.year}.", LogLevel.Info);
}
}
diff --git a/src/SMAPI.Mods.ConsoleCommands/manifest.json b/src/SMAPI.Mods.ConsoleCommands/manifest.json
index a55d168f..908d4f65 100644
--- a/src/SMAPI.Mods.ConsoleCommands/manifest.json
+++ b/src/SMAPI.Mods.ConsoleCommands/manifest.json
@@ -1,9 +1,9 @@
{
"Name": "Console Commands",
"Author": "SMAPI",
- "Version": "3.4.1",
+ "Version": "3.5.0",
"Description": "Adds SMAPI console commands that let you manipulate the game.",
"UniqueID": "SMAPI.ConsoleCommands",
"EntryDll": "ConsoleCommands.dll",
- "MinimumApiVersion": "3.4.1"
+ "MinimumApiVersion": "3.5.0"
}
diff --git a/src/SMAPI.Mods.SaveBackup/manifest.json b/src/SMAPI.Mods.SaveBackup/manifest.json
index 5bf35b5c..cd42459e 100644
--- a/src/SMAPI.Mods.SaveBackup/manifest.json
+++ b/src/SMAPI.Mods.SaveBackup/manifest.json
@@ -1,9 +1,9 @@
{
"Name": "Save Backup",
"Author": "SMAPI",
- "Version": "3.4.1",
+ "Version": "3.5.0",
"Description": "Automatically backs up all your saves once per day into its folder.",
"UniqueID": "SMAPI.SaveBackup",
"EntryDll": "SaveBackup.dll",
- "MinimumApiVersion": "3.4.1"
+ "MinimumApiVersion": "3.5.0"
}
diff --git a/src/SMAPI.Tests/Core/ModResolverTests.cs b/src/SMAPI.Tests/Core/ModResolverTests.cs
index a9c88c60..45b3673b 100644
--- a/src/SMAPI.Tests/Core/ModResolverTests.cs
+++ b/src/SMAPI.Tests/Core/ModResolverTests.cs
@@ -73,7 +73,7 @@ namespace SMAPI.Tests.Core
[nameof(IManifest.Description)] = Sample.String(),
[nameof(IManifest.UniqueID)] = $"{Sample.String()}.{Sample.String()}",
[nameof(IManifest.EntryDll)] = $"{Sample.String()}.dll",
- [nameof(IManifest.MinimumApiVersion)] = $"{Sample.Int()}.{Sample.Int()}-{Sample.String()}",
+ [nameof(IManifest.MinimumApiVersion)] = $"{Sample.Int()}.{Sample.Int()}.{Sample.Int()}-{Sample.String()}",
[nameof(IManifest.Dependencies)] = new[] { originalDependency },
["ExtraString"] = Sample.String(),
["ExtraInt"] = Sample.Int()
diff --git a/src/SMAPI.Tests/Utilities/SDateTests.cs b/src/SMAPI.Tests/Utilities/SDateTests.cs
index d25a101a..0461952e 100644
--- a/src/SMAPI.Tests/Utilities/SDateTests.cs
+++ b/src/SMAPI.Tests/Utilities/SDateTests.cs
@@ -5,6 +5,7 @@ using System.Linq;
using System.Text.RegularExpressions;
using NUnit.Framework;
using StardewModdingAPI.Utilities;
+using StardewValley;
namespace SMAPI.Tests.Utilities
{
@@ -82,6 +83,62 @@ namespace SMAPI.Tests.Utilities
}
/****
+ ** FromDaysSinceStart
+ ****/
+ [Test(Description = "Assert that FromDaysSinceStart returns the expected date.")]
+ [TestCase(1, ExpectedResult = "01 spring Y1")]
+ [TestCase(2, ExpectedResult = "02 spring Y1")]
+ [TestCase(28, ExpectedResult = "28 spring Y1")]
+ [TestCase(29, ExpectedResult = "01 summer Y1")]
+ [TestCase(141, ExpectedResult = "01 summer Y2")]
+ public string FromDaysSinceStart(int daysSinceStart)
+ {
+ // act
+ return SDate.FromDaysSinceStart(daysSinceStart).ToString();
+ }
+
+ [Test(Description = "Assert that FromDaysSinceStart throws an exception if the number of days is invalid.")]
+ [TestCase(-1)] // day < 0
+ [TestCase(0)] // day == 0
+ [SuppressMessage("ReSharper", "AssignmentIsFullyDiscarded", Justification = "Deliberate for unit test.")]
+ public void FromDaysSinceStart_RejectsInvalidValues(int daysSinceStart)
+ {
+ // act & assert
+ Assert.Throws<ArgumentException>(() => _ = SDate.FromDaysSinceStart(daysSinceStart), "Passing the invalid number of days didn't throw the expected exception.");
+ }
+
+ /****
+ ** From
+ ****/
+ [Test(Description = "Assert that SDate.From constructs the correct instance for a given date.")]
+ [TestCase(0, ExpectedResult = "01 spring Y1")]
+ [TestCase(1, ExpectedResult = "02 spring Y1")]
+ [TestCase(27, ExpectedResult = "28 spring Y1")]
+ [TestCase(28, ExpectedResult = "01 summer Y1")]
+ [TestCase(140, ExpectedResult = "01 summer Y2")]
+ public string From_WorldDate(int totalDays)
+ {
+ return SDate.From(new WorldDate { TotalDays = totalDays }).ToString();
+ }
+
+
+ /****
+ ** SeasonIndex
+ ****/
+ [Test(Description = "Assert the numeric index of the season.")]
+ [TestCase("01 spring Y1", ExpectedResult = 0)]
+ [TestCase("02 summer Y1", ExpectedResult = 1)]
+ [TestCase("28 fall Y1", ExpectedResult = 2)]
+ [TestCase("01 winter Y1", ExpectedResult = 3)]
+ [TestCase("01 winter Y2", ExpectedResult = 3)]
+ public int SeasonIndex(string dateStr)
+ {
+ // act
+ return this.GetDate(dateStr).SeasonIndex;
+ }
+
+
+ /****
** DayOfWeek
****/
[Test(Description = "Assert the day of week.")]
@@ -119,6 +176,7 @@ namespace SMAPI.Tests.Utilities
return this.GetDate(dateStr).DayOfWeek;
}
+
/****
** DaysSinceStart
****/
@@ -134,6 +192,7 @@ namespace SMAPI.Tests.Utilities
return this.GetDate(dateStr).DaysSinceStart;
}
+
/****
** ToString
****/
@@ -147,6 +206,7 @@ namespace SMAPI.Tests.Utilities
return this.GetDate(dateStr).ToString();
}
+
/****
** AddDays
****/
@@ -166,6 +226,18 @@ namespace SMAPI.Tests.Utilities
return this.GetDate(dateStr).AddDays(addDays).ToString();
}
+ [Test(Description = "Assert that AddDays throws an exception if the number of days is invalid.")]
+ [TestCase("01 spring Y1", -1)]
+ [TestCase("01 summer Y1", -29)]
+ [TestCase("01 spring Y2", -113)]
+ [SuppressMessage("ReSharper", "AssignmentIsFullyDiscarded", Justification = "Deliberate for unit test.")]
+ public void AddDays_RejectsInvalidValues(string dateStr, int addDays)
+ {
+ // act & assert
+ Assert.Throws<ArithmeticException>(() => _ = this.GetDate(dateStr).AddDays(addDays), "Passing the invalid number of days didn't throw the expected exception.");
+ }
+
+
/****
** GetHashCode
****/
@@ -194,6 +266,25 @@ namespace SMAPI.Tests.Utilities
}
}
+
+ /****
+ ** ToWorldDate
+ ****/
+ [Test(Description = "Assert that the WorldDate operator returns the corresponding WorldDate.")]
+ [TestCase("01 spring Y1", ExpectedResult = 0)]
+ [TestCase("02 spring Y1", ExpectedResult = 1)]
+ [TestCase("28 spring Y1", ExpectedResult = 27)]
+ [TestCase("01 summer Y1", ExpectedResult = 28)]
+ [TestCase("01 summer Y2", ExpectedResult = 140)]
+ public int ToWorldDate(string dateStr)
+ {
+ return this.GetDate(dateStr).ToWorldDate().TotalDays;
+ }
+
+
+ /****
+ ** Operators
+ ****/
[Test(Description = "Assert that the == operator returns the expected values. We only need a few test cases, since it's based on GetHashCode which is tested more thoroughly.")]
[TestCase(Dates.Now, null, ExpectedResult = false)]
[TestCase(Dates.Now, Dates.PrevDay, ExpectedResult = false)]
diff --git a/src/SMAPI.Web/Program.cs b/src/SMAPI.Web/Program.cs
index 5d13cdf3..70082160 100644
--- a/src/SMAPI.Web/Program.cs
+++ b/src/SMAPI.Web/Program.cs
@@ -18,6 +18,7 @@ namespace StardewModdingAPI.Web
.CreateDefaultBuilder(args)
.CaptureStartupErrors(true)
.UseSetting("detailedErrors", "true")
+ .UseKestrel().UseIISIntegration() // must be used together; fixes intermittent errors on Azure: https://stackoverflow.com/a/38312175/262123
.UseStartup<Startup>()
.Build()
.Run();
diff --git a/src/SMAPI.Web/wwwroot/SMAPI.metadata.json b/src/SMAPI.Web/wwwroot/SMAPI.metadata.json
index 3101fdf1..179ef42a 100644
--- a/src/SMAPI.Web/wwwroot/SMAPI.metadata.json
+++ b/src/SMAPI.Web/wwwroot/SMAPI.metadata.json
@@ -155,7 +155,7 @@
*********/
"Auto Quality Patch": {
"ID": "SilentOak.AutoQualityPatch",
- "~2.1.3-unofficial.7 | Status": "AssumeBroken" // runtime errors
+ "~2.1.3-unofficial.7-mizzion | Status": "AssumeBroken" // runtime errors
},
"Fix Dice": {
diff --git a/src/SMAPI.Web/wwwroot/schemas/content-patcher.json b/src/SMAPI.Web/wwwroot/schemas/content-patcher.json
index e6cd4e65..f627ab95 100644
--- a/src/SMAPI.Web/wwwroot/schemas/content-patcher.json
+++ b/src/SMAPI.Web/wwwroot/schemas/content-patcher.json
@@ -11,9 +11,9 @@
"title": "Format version",
"description": "The format version. You should always use the latest version to enable the latest features and avoid obsolete behavior.",
"type": "string",
- "const": "1.11.0",
+ "const": "1.13.0",
"@errorMessages": {
- "const": "Incorrect value '@value'. This should be set to the latest format version, currently '1.11.0'."
+ "const": "Incorrect value '@value'. This should be set to the latest format version, currently '1.13.0'."
}
},
"ConfigSchema": {
@@ -268,6 +268,48 @@
"type": "string"
}
},
+ "MapTiles": {
+ "title": "Map tiles",
+ "description": "The individual map tiles to add, edit, or remove.",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "Layer": {
+ "description": "The map layer name to change.",
+ "type": "string"
+ },
+ "Position": {
+ "description": "The tile coordinates to change. You can use the Debug Mode mod to see tile coordinates in-game.",
+ "$ref": "#/definitions/Position"
+ },
+ "SetTilesheet": {
+ "title": "Set tilesheet",
+ "description": "Sets the tilesheet ID for the tile index.",
+ "type": "string"
+ },
+ "SetIndex": {
+ "title": "Set tile index",
+ "description": "Sets the tile index in the tilesheet.",
+ "type": [ "string", "number" ]
+ },
+ "SetProperties": {
+ "title": "Set tile properties",
+ "description": "The properties to set or remove. This is merged into the existing tile properties, if any. To remove a property, set its value to `null` (not \"null\" in quotes).",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "Remove": {
+ "description": "Whether to remove the current tile and all its properties on that layer. If combined with the other fields, a new tile is created from the other fields as if the tile didn't previously exist.",
+ "type": "boolean"
+ }
+ },
+
+ "required": [ "Layer", "Position" ]
+ }
+ },
"When": {
"title": "When",
"description": "Only apply the patch if the given conditions match.",
@@ -335,7 +377,7 @@
}
},
"propertyNames": {
- "enum": [ "Action", "Target", "LogName", "Enabled", "When", "FromFile", "FromArea", "ToArea", "MapProperties" ]
+ "enum": [ "Action", "Target", "LogName", "Enabled", "When", "FromFile", "FromArea", "ToArea", "MapProperties", "MapTiles" ]
}
}
}
@@ -361,17 +403,37 @@
"type": [ "boolean", "string" ]
}
},
+ "Position": {
+ "type": "object",
+ "properties": {
+ "X": {
+ "title": "X position",
+ "description": "The X position, measured in pixels for a texture or tiles for a map. This can contain tokens.",
+ "type": [ "integer", "string" ],
+ "minimum:": 0
+ },
+ "Y": {
+ "title": "Y position",
+ "description": "The Y position, measured in pixels for a texture or tiles for a map. This can contain tokens.",
+ "type": [ "integer", "string" ],
+ "minimum:": 0
+ }
+ },
+
+ "required": [ "X", "Y" ],
+ "additionalProperties": false
+ },
"Rectangle": {
"type": "object",
"properties": {
"X": {
- "title": "X-Coordinate",
+ "title": "X position",
"description": "The X position of the area's top-left corner, measured in pixels for a texture or tiles for a map. This can contain tokens.",
"type": [ "integer", "string" ],
"minimum:": 0
},
"Y": {
- "title": "Y-Coordinate",
+ "title": "Y position",
"description": "The Y position of the area's top-left corner, measured in pixels for a texture or tiles for a map. This can contain tokens.",
"type": [ "integer", "string" ],
"minimum:": 0
diff --git a/src/SMAPI.sln b/src/SMAPI.sln
index 62eaa777..f9c537c4 100644
--- a/src/SMAPI.sln
+++ b/src/SMAPI.sln
@@ -81,7 +81,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SMAPI.Web.LegacyRedirects",
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
+ SMAPI.Internal\SMAPI.Internal.projitems*{0634ea4c-3b8f-42db-aea6-ca9e4ef6e92f}*SharedItemsImports = 5
+ SMAPI.Internal\SMAPI.Internal.projitems*{0a9bb24f-15ff-4c26-b1a2-81f7ae316518}*SharedItemsImports = 5
+ SMAPI.Internal\SMAPI.Internal.projitems*{1b3821e6-d030-402c-b3a1-7ca45c2800ea}*SharedItemsImports = 5
+ SMAPI.Internal\SMAPI.Internal.projitems*{80efd92f-728f-41e0-8a5b-9f6f49a91899}*SharedItemsImports = 5
SMAPI.Internal\SMAPI.Internal.projitems*{85208f8d-6fd1-4531-be05-7142490f59fe}*SharedItemsImports = 13
+ SMAPI.Internal\SMAPI.Internal.projitems*{cd53ad6f-97f4-4872-a212-50c2a0fd3601}*SharedItemsImports = 5
+ SMAPI.Internal\SMAPI.Internal.projitems*{e6da2198-7686-4f1d-b312-4a4dc70884c0}*SharedItemsImports = 5
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs
index 128e23bd..a898fccd 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.4.1");
+ public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion("3.5.0");
/// <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/Content/AssetDataForMap.cs b/src/SMAPI/Framework/Content/AssetDataForMap.cs
new file mode 100644
index 00000000..f66013ba
--- /dev/null
+++ b/src/SMAPI/Framework/Content/AssetDataForMap.cs
@@ -0,0 +1,186 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.Xna.Framework;
+using StardewModdingAPI.Toolkit.Utilities;
+using xTile;
+using xTile.Layers;
+using xTile.Tiles;
+
+namespace StardewModdingAPI.Framework.Content
+{
+ /// <summary>Encapsulates access and changes to image content being read from a data file.</summary>
+ internal class AssetDataForMap : AssetData<Map>, IAssetDataForMap
+ {
+ /*********
+ ** Public methods
+ *********/
+ /// <summary>Construct an instance.</summary>
+ /// <param name="locale">The content's locale code, if the content is localized.</param>
+ /// <param name="assetName">The normalized asset name being read.</param>
+ /// <param name="data">The content data being read.</param>
+ /// <param name="getNormalizedPath">Normalizes an asset key to match the cache key.</param>
+ /// <param name="onDataReplaced">A callback to invoke when the data is replaced (if any).</param>
+ public AssetDataForMap(string locale, string assetName, Map data, Func<string, string> getNormalizedPath, Action<Map> onDataReplaced)
+ : base(locale, assetName, data, getNormalizedPath, onDataReplaced) { }