From 212e85489a456acca6889faff5da835cbb707080 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 25 Feb 2018 23:27:44 -0500 Subject: fix log parser not correctly parsing mod list if a mod has no author name --- docs/release-notes.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs/release-notes.md') diff --git a/docs/release-notes.md b/docs/release-notes.md index 0da5220b..16284211 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,4 +1,8 @@ # Release notes +## 2.6 (upcoming) +* For the [log parser][]: + * Fixed mod list not including all mods if at least one has no author name. + ## 2.5.2 * For modders: * Fixed issue where replacing an asset through `asset.AsImage()` or `asset.AsDictionary()` didn't take effect. -- cgit From c984d5ad51c80a9ede1613c2bbbf51279966dd8b Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 25 Feb 2018 23:33:07 -0500 Subject: fix log filtering some mods incorrectly --- docs/release-notes.md | 1 + src/SMAPI.Web/Views/LogParser/Index.cshtml | 12 ++++++------ src/SMAPI.Web/wwwroot/Content/js/log-parser.js | 6 ++++++ 3 files changed, 13 insertions(+), 6 deletions(-) (limited to 'docs/release-notes.md') diff --git a/docs/release-notes.md b/docs/release-notes.md index 16284211..74db0256 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -2,6 +2,7 @@ ## 2.6 (upcoming) * For the [log parser][]: * Fixed mod list not including all mods if at least one has no author name. + * Fixed some log entries being incorrectly filtered. ## 2.5.2 * For modders: diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml index d9125954..39557d50 100644 --- a/src/SMAPI.Web/Views/LogParser/Index.cshtml +++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml @@ -78,13 +78,13 @@ Installed mods: click any mod to filter - show all - hide all + show all + hide all @foreach (var mod in Model.ParsedLog.Mods.Where(p => p.ContentPackFor == null)) { - + @mod.Name @if (contentPacks != null && contentPacks.TryGetValue(mod.Name, out LogModInfo[] contentPackList)) @@ -127,9 +127,9 @@ @foreach (var message in Model.ParsedLog.Messages) { - string levelStr = @message.Level.ToString().ToLower(); + string levelStr = message.Level.ToString().ToLower(); - + @@ -137,7 +137,7 @@ if (message.Repeated > 0) { - + diff --git a/src/SMAPI.Web/wwwroot/Content/js/log-parser.js b/src/SMAPI.Web/wwwroot/Content/js/log-parser.js index 87a70391..38a75a80 100644 --- a/src/SMAPI.Web/wwwroot/Content/js/log-parser.js +++ b/src/SMAPI.Web/wwwroot/Content/js/log-parser.js @@ -62,6 +62,7 @@ smapi.logParser = function (data, sectionUrl) { updateModFilters(); }, + showAllMods: function () { for (var key in this.showMods) { if (this.showMods.hasOwnProperty(key)) { @@ -70,6 +71,7 @@ smapi.logParser = function (data, sectionUrl) { } updateModFilters(); }, + hideAllMods: function () { for (var key in this.showMods) { if (this.showMods.hasOwnProperty(key)) { @@ -77,6 +79,10 @@ smapi.logParser = function (data, sectionUrl) { } } updateModFilters(); + }, + + filtersAllow: function(modId, level) { + return this.showMods[modId] !== false && this.showLevels[level] !== false; } } }); -- cgit From 36a527956c5410fe5992bfc42fdc11adff9cd9db Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 3 Mar 2018 17:54:17 -0500 Subject: fix detected incompatibility errors not showing mod's update URL (#453) --- docs/release-notes.md | 3 +++ src/SMAPI/Program.cs | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'docs/release-notes.md') diff --git a/docs/release-notes.md b/docs/release-notes.md index 74db0256..190146fa 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,5 +1,8 @@ # Release notes ## 2.6 (upcoming) +* For players: + * Fixed some incompatible-mod errors not showing mod's update URL. + * For the [log parser][]: * Fixed mod list not including all mods if at least one has no author name. * Fixed some log entries being incorrectly filtered. diff --git a/src/SMAPI/Program.cs b/src/SMAPI/Program.cs index acab8c70..fec03d6f 100644 --- a/src/SMAPI/Program.cs +++ b/src/SMAPI/Program.cs @@ -388,7 +388,7 @@ namespace StardewModdingAPI mods = resolver.ProcessDependencies(mods, modDatabase).ToArray(); // load mods - this.LoadMods(mods, this.JsonHelper, this.ContentManager); + this.LoadMods(mods, this.JsonHelper, this.ContentManager, modDatabase); // check for updates this.CheckForUpdatesAsync(mods); @@ -670,7 +670,8 @@ namespace StardewModdingAPI /// The mods to load. /// The JSON helper with which to read mods' JSON files. /// The content manager to use for mod content. - private void LoadMods(IModMetadata[] mods, JsonHelper jsonHelper, SContentManager contentManager) + /// Handles access to SMAPI's internal mod metadata list. + private void LoadMods(IModMetadata[] mods, JsonHelper jsonHelper, SContentManager contentManager, ModDatabase modDatabase) { this.Monitor.Log("Loading mods...", LogLevel.Trace); @@ -744,9 +745,10 @@ namespace StardewModdingAPI { modAssembly = modAssemblyLoader.Load(metadata, assemblyPath, assumeCompatible: metadata.DataRecord?.Status == ModStatus.AssumeCompatible); } - catch (IncompatibleInstructionException ex) + catch (IncompatibleInstructionException) // details already in trace logs { - TrackSkip(metadata, "it's no longer compatible. Please check for a newer version of the mod."); + string url = modDatabase.GetModPageUrlFor(metadata.Manifest.UniqueID); + TrackSkip(metadata, $"it's no longer compatible. Please check for a newer version of the mod{(url != null ? $" at {url}" : "")}."); continue; } catch (SAssemblyLoadFailedException ex) -- cgit From c1b5f71aa93f89876148fe184558537c9335d9c0 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 3 Mar 2018 17:56:15 -0500 Subject: update release notes for backported changes --- docs/release-notes.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'docs/release-notes.md') diff --git a/docs/release-notes.md b/docs/release-notes.md index 190146fa..be6fdb27 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,7 +1,8 @@ # Release notes -## 2.6 (upcoming) +## 2.5.3 * For players: - * Fixed some incompatible-mod errors not showing mod's update URL. + * Fixed some incompatible-mod errors not showing the mod URL. + * Updated compatibility list. * For the [log parser][]: * Fixed mod list not including all mods if at least one has no author name. -- cgit From a290a2fa5229a1105942300c5ccd471a34915758 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 3 Mar 2018 22:18:44 -0500 Subject: mark Stardew Valley 1.3 incompatible in SMAPI 2.5.x to reduce confusion when it's released (#453) --- docs/release-notes.md | 3 +++ src/SMAPI/Constants.cs | 2 +- src/SMAPI/Program.cs | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'docs/release-notes.md') diff --git a/docs/release-notes.md b/docs/release-notes.md index be6fdb27..d20584af 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -8,6 +8,9 @@ * Fixed mod list not including all mods if at least one has no author name. * Fixed some log entries being incorrectly filtered. +* For SMAPI developers: + * Internal changes to support the upcoming Stardew Valley 1.3 update. + ## 2.5.2 * For modders: * Fixed issue where replacing an asset through `asset.AsImage()` or `asset.AsDictionary()` didn't take effect. diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index fe9fdf9b..c5e378e2 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -43,7 +43,7 @@ namespace StardewModdingAPI public static ISemanticVersion MinimumGameVersion { get; } = new SemanticVersion("1.2.30"); /// The maximum supported version of Stardew Valley. - public static ISemanticVersion MaximumGameVersion { get; } = null; + public static ISemanticVersion MaximumGameVersion { get; } = new SemanticVersion("1.2.33"); /// The path to the game folder. public static string ExecutionPath { get; } = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); diff --git a/src/SMAPI/Program.cs b/src/SMAPI/Program.cs index fec03d6f..22bceafd 100644 --- a/src/SMAPI/Program.cs +++ b/src/SMAPI/Program.cs @@ -177,7 +177,7 @@ namespace StardewModdingAPI } if (Constants.MaximumGameVersion != null && Constants.GameVersion.IsNewerThan(Constants.MaximumGameVersion)) { - this.Monitor.Log($"Oops! You're running Stardew Valley {Constants.GameVersion}, but this version of SMAPI is only compatible up to Stardew Valley {Constants.MaximumGameVersion}. Please check for a newer version of SMAPI.", LogLevel.Error); + this.Monitor.Log($"Oops! You're running Stardew Valley {Constants.GameVersion}, but this version of SMAPI is only compatible up to Stardew Valley {Constants.MaximumGameVersion}. Please check for a newer version of SMAPI: https://smapi.io.", LogLevel.Error); this.PressAnyKeyToExit(); return; } -- cgit From 19570f43129dbd3dbfa77a9c62e135a72528a68e Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 4 Mar 2018 01:07:55 -0500 Subject: simplify and always include default update URL, shorten no-longer-compatible skip messages --- docs/release-notes.md | 1 + src/SMAPI.Web/Startup.cs | 3 +- src/SMAPI/Framework/ModLoading/ModResolver.cs | 5 +- src/SMAPI/Program.cs | 5 +- src/SMAPI/StardewModdingAPI.config.json | 201 +++++++++----------------- 5 files changed, 77 insertions(+), 138 deletions(-) (limited to 'docs/release-notes.md') diff --git a/docs/release-notes.md b/docs/release-notes.md index d20584af..fb056e79 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -2,6 +2,7 @@ ## 2.5.3 * For players: * Fixed some incompatible-mod errors not showing the mod URL. + * Simplified default mod update URL, which is now always included for incompatible mods. * Updated compatibility list. * For the [log parser][]: diff --git a/src/SMAPI.Web/Startup.cs b/src/SMAPI.Web/Startup.cs index bc3e9f7b..93135239 100644 --- a/src/SMAPI.Web/Startup.cs +++ b/src/SMAPI.Web/Startup.cs @@ -147,7 +147,8 @@ namespace StardewModdingAPI.Web )); // shortcut redirects - redirects.Add(new RedirectToUrlRule("^/docs$", "https://stardewvalleywiki.com/Modding:Index")); + redirects.Add(new RedirectToUrlRule(@"^/compat\.?$", "https://stardewvalleywiki.com/Modding:SMAPI_compatibility")); + redirects.Add(new RedirectToUrlRule(@"^/docs\.?$", "https://stardewvalleywiki.com/Modding:Index")); // redirect legacy canimod.com URLs var wikiRedirects = new Dictionary diff --git a/src/SMAPI/Framework/ModLoading/ModResolver.cs b/src/SMAPI/Framework/ModLoading/ModResolver.cs index ba6dab1a..f878a1b9 100644 --- a/src/SMAPI/Framework/ModLoading/ModResolver.cs +++ b/src/SMAPI/Framework/ModLoading/ModResolver.cs @@ -98,7 +98,7 @@ namespace StardewModdingAPI.Framework.ModLoading case ModStatus.AssumeBroken: { // get reason - string reasonPhrase = mod.DataRecord.StatusReasonPhrase ?? "it's no longer compatible"; + string reasonPhrase = mod.DataRecord.StatusReasonPhrase ?? "it's outdated"; // get update URLs List updateUrls = new List(); @@ -111,6 +111,9 @@ namespace StardewModdingAPI.Framework.ModLoading if (mod.DataRecord.AlternativeUrl != null) updateUrls.Add(mod.DataRecord.AlternativeUrl); + // default update URL + updateUrls.Add("https://smapi.io/compat"); + // build error string error = $"{reasonPhrase}. Please check for a "; if (mod.DataRecord.StatusUpperVersion == null || mod.Manifest.Version.Equals(mod.DataRecord.StatusUpperVersion)) diff --git a/src/SMAPI/Program.cs b/src/SMAPI/Program.cs index 22bceafd..979f6328 100644 --- a/src/SMAPI/Program.cs +++ b/src/SMAPI/Program.cs @@ -747,8 +747,9 @@ namespace StardewModdingAPI } catch (IncompatibleInstructionException) // details already in trace logs { - string url = modDatabase.GetModPageUrlFor(metadata.Manifest.UniqueID); - TrackSkip(metadata, $"it's no longer compatible. Please check for a newer version of the mod{(url != null ? $" at {url}" : "")}."); + string[] updateUrls = new[] { modDatabase.GetModPageUrlFor(metadata.Manifest.UniqueID), "https://smapi.io/compat" }.Where(p => p != null).ToArray(); + + TrackSkip(metadata, $"it's outdated. Please check for a new version at {string.Join(" or ", updateUrls)}."); continue; } catch (SAssemblyLoadFailedException ex) diff --git a/src/SMAPI/StardewModdingAPI.config.json b/src/SMAPI/StardewModdingAPI.config.json index 101b9dac..437feea5 100644 --- a/src/SMAPI/StardewModdingAPI.config.json +++ b/src/SMAPI/StardewModdingAPI.config.json @@ -97,15 +97,13 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "ID": "AccessChestAnywhere", "MapLocalVersions": { "1.1-1078": "1.1" }, "Default | UpdateKey": "Nexus:257", - "~1.1 | Status": "AssumeBroken", - "~1.1 | AlternativeUrl": "https://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.1 | Status": "AssumeBroken" }, "AdjustArtisanPrices": { "ID": "1e36d4ca-c7ef-4dfb-9927-d27a6c3c8bdc", "Default | UpdateKey": "Chucklefish:3532", - "~0.1 | Status": "AssumeBroken", - "~0.1 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~0.1 | Status": "AssumeBroken" }, "Adjust Monster": { @@ -127,8 +125,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "AgingMod": { "ID": "skn.AgingMod", "Default | UpdateKey": "Nexus:1129", - "~1.0 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.0 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "All Crops All Seasons": { @@ -173,8 +170,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "A Tapper's Dream": { "ID": "ddde5195-8f85-4061-90cc-0d4fd5459358", "Default | UpdateKey": "Nexus:260", - "~1.4 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.4 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.4 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Auto Animal Doors": { @@ -247,16 +243,14 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "ID": "Kithio:BetterShippingBox", "MapLocalVersions": { "1.0.1": "1.0.2" }, "Default | UpdateKey": "Chucklefish:4302", - "~1.0.2 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.0.2 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0.2 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Better Sprinklers": { "ID": "Speeder.BetterSprinklers", "FormerIDs": "SPDSprinklersMod", // changed in 2.3 "Default | UpdateKey": "Nexus:41", - "~2.3.1-pathoschild-update | Status": "AssumeBroken", // broke in SDV 1.2 - "~2.3.1-pathoschild-update | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~2.3.1-pathoschild-update | Status": "AssumeBroken" // broke in SDV 1.2 }, "Billboard Anywhere": { @@ -269,8 +263,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "ID": "KathrynHazuka.BirthdayMail", "FormerIDs": "005e02dc-d900-425c-9c68-1ff55c5a295d", // changed in 1.2.3-pathoschild-update "Default | UpdateKey": "Nexus:276", - "~1.2.2 | Status": "AssumeBroken", // broke in SDV 1.2 - "~1.2.2 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.2.2 | Status": "AssumeBroken" // broke in SDV 1.2 }, "Breed Like Rabbits": { @@ -331,8 +324,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "ID": "Speeder.ChestLabel", "FormerIDs": "SPDChestLabel", // changed in 1.5.1-pathoschild-update "Default | UpdateKey": "Nexus:242", - "~1.6 | Status": "AssumeBroken", // broke in SDV 1.1 - "~1.6 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.6 | Status": "AssumeBroken" // broke in SDV 1.1 }, "Chest Pooling": { @@ -352,8 +344,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Choose Baby Gender": { "FormerIDs": "{EntryDll: 'ChooseBabyGender.dll'}", "Default | UpdateKey": "Nexus:590", - "~1.0.2 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.0.2 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0.2 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "CJB Automation": { @@ -398,8 +389,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Cold Weather Haley": { "ID": "LordXamon.ColdWeatherHaleyPRO", "Default | UpdateKey": "Nexus:1169", - "~1.0 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.0 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Colored Chests": { @@ -411,8 +401,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Combat with Farm Implements": { "ID": "SPDFarmingImplementsInCombat", "Default | UpdateKey": "Nexus:313", - "~1.0 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.0 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Community Bundle Item Tooltip": { @@ -434,8 +423,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Configurable Shipping Dates": { "ID": "ConfigurableShippingDates", "Default | UpdateKey": "Nexus:675", - "~1.1.1 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.1.1 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.1.1 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Cooking Skill": { @@ -515,8 +503,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Customizable Traveling Cart Days": { "ID": "TravelingCartYyeahdude", "Default | UpdateKey": "Nexus:567", - "~1.0 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.0 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Custom Linens": { @@ -566,8 +553,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Dynamic Checklist": { "ID": "gunnargolf.DynamicChecklist", "Default | UpdateKey": "Nexus:1145", // added in 1.0.1-pathoschild-update - "~1.0 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.0 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Dynamic Horses": { @@ -580,8 +566,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "ID": "DynamicMachines", "MapLocalVersions": { "1.1": "1.1.1" }, "Default | UpdateKey": "Nexus:374", - "~1.1.1 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.1.1 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.1.1 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Dynamic NPC Sprites": { @@ -597,16 +582,14 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Empty Hands": { "ID": "QuicksilverFox.EmptyHands", "Default | UpdateKey": "Nexus:1176", // added in 1.0.1-pathoschild-update - "~1.0 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.0 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Enemy Health Bars": { "ID": "Speeder.HealthBars", "FormerIDs": "SPDHealthBar", // changed in 1.7.1-pathoschild-update "Default | UpdateKey": "Nexus:193", - "~1.7 | Status": "AssumeBroken", // broke in SDV 1.2 - "~1.7 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.7 | Status": "AssumeBroken" // broke in SDV 1.2 }, "Entoarox Framework": { @@ -636,15 +619,13 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "ID": "Crystalmir.ExtendedFridge", "FormerIDs": "Mystra007ExtendedFridge", // changed in 1.0.1 "Default | UpdateKey": "Nexus:485", - "~1.0 | Status": "AssumeBroken", // broke in SDV 1.2 - "~1.0 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0 | Status": "AssumeBroken" // broke in SDV 1.2 }, "Extended Greenhouse": { "ID": "ExtendedGreenhouse", "Default | UpdateKey": "Chucklefish:4303", - "~1.0.2 | Status": "AssumeBroken", // broke in SDV 1.2 - "~1.0.2 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0.2 | Status": "AssumeBroken" // broke in SDV 1.2 }, "Extended Minecart": { @@ -667,35 +648,30 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Farm Automation: Barn Door Automation": { "FormerIDs": "{EntryDll: 'FarmAutomation.BarnDoorAutomation.dll'}", - "~1.0 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.0 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Farm Automation: Item Collector": { "FormerIDs": "{EntryDll: 'FarmAutomation.ItemCollector.dll'}", - "~1.0 | Status": "AssumeBroken", // broke in SDV 1.2 - "~1.0 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0 | Status": "AssumeBroken" // broke in SDV 1.2 }, "Farm Automation Unofficial: Item Collector": { "ID": "Maddy99.FarmAutomation.ItemCollector", - "~0.5 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~0.5 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~0.5 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Farm Expansion": { "ID": "Advize.FarmExpansion", "FormerIDs": "3888bdfd-73f6-4776-8bb7-8ad45aea1915 | AdvizeFarmExpansionMod-2-0 | AdvizeFarmExpansionMod-2-0-5", // changed in 2.0, 2.0.5, and 3.0 "Default | UpdateKey": "Nexus:130", - "~2.0.5 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~2.0.5 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~2.0.5 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Farm Resource Generator": { "FormerIDs": "{EntryDll: 'FarmResourceGenerator.dll'}", "Default | UpdateKey": "Nexus:647", - "~1.0.4 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.0.4 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0.4 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Fast Animations": { @@ -718,8 +694,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "ID": "KathrynHazuka.FasterRun", "FormerIDs": "{EntryDll: 'FasterRun.dll'}", // changed in 1.1.1-pathoschild-update "Default | UpdateKey": "Nexus:733", // added in 1.1.1-pathoschild-update - "~1.1 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.1 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.1 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Fishing Adjust": { @@ -741,8 +716,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "FormerIDs": "{EntryDll: 'FlorenceMod.dll'}", "MapLocalVersions": { "1.0.1": "1.1" }, "Default | UpdateKey": "Nexus:591", - "~1.1 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.1 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.1 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Flower Color Picker": { @@ -753,8 +727,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Forage at the Farm": { "ID": "ForageAtTheFarm", "Default | UpdateKey": "Nexus:673", - "~1.5.1 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.5.1 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.5.1 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Furniture Anywhere": { @@ -812,8 +785,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Happy Animals": { "ID": "HappyAnimals", - "~1.0.3 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.0.3 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0.3 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Happy Birthday (Omegasis)": { @@ -841,8 +813,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Harvest With Scythe": { "ID": "965169fd-e1ed-47d0-9f12-b104535fb4bc", "Default | UpdateKey": "Nexus:236", - "~1.0.6 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.0.6 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0.6 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Horse Whistle (icepuente)": { @@ -858,8 +829,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Hunger for Food (Tigerle)": { "ID": "HungerForFoodByTigerle", "Default | UpdateKey": "Nexus:810", - "~0.1.2 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~0.1.2 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~0.1.2 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Hunger Mod (skn)": { @@ -882,8 +852,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Instant Geode": { "ID": "InstantGeode", - "~1.12 | Status": "AssumeBroken", // broke in SDV 1.2 - "~1.12 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.12 | Status": "AssumeBroken" // broke in SDV 1.2 }, "Instant Grow Trees": { @@ -895,8 +864,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Interaction Helper": { "ID": "HammurabiInteractionHelper", "Default | UpdateKey": "Chucklefish:4640", // added in 1.0.4-pathoschild-update - "~1.0.3 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.0.3 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0.3 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Item Auto Stacker": { @@ -926,8 +894,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "ID": "BALANCEMOD_AntiExhaustion", "MapLocalVersions": { "0.0": "1.1" }, "Default | UpdateKey": "Nexus:637", - "~1.1 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.1 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.1 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Level Extender": { @@ -1005,8 +972,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Message Box [API]? (ChatMod)": { "ID": "Kithio:ChatMod", "Default | UpdateKey": "Chucklefish:4296", - "~1.0 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.0 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Mining at the Farm": { @@ -1040,8 +1006,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "More Artifact Spots": { "ID": "451", "Default | UpdateKey": "Nexus:451", - "~1.0.1 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.0.1 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0.1 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "More Map Layers": { @@ -1070,8 +1035,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "ID": "FileLoading", "MapLocalVersions": { "1.1": "1.12" }, "Default | UpdateKey": "Nexus:1094", - "~1.12 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.12 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.12 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Museum Rearranger": { @@ -1089,8 +1053,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "New Machines": { "ID": "F70D4FAB-0AB2-4B78-9F1B-AF2CA2236A59", "Default | UpdateKey": "Chucklefish:3683", - "~4.2.1343 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~4.2.1343 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~4.2.1343 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Night Owl": { @@ -1131,8 +1094,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "No Soil Decay": { "ID": "289dee03-5f38-4d8e-8ffc-e440198e8610", "Default | UpdateKey": "Nexus:237", - "~0.5 | Status": "AssumeBroken", // broke in SDV 1.2 and uses Assembly.GetExecutingAssembly().Location - "~0.5 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~0.5 | Status": "AssumeBroken" // broke in SDV 1.2 and uses Assembly.GetExecutingAssembly().Location }, "No Soil Decay Redux": { @@ -1150,8 +1112,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "NPC Speak": { "FormerIDs": "{EntryDll: 'NpcEcho.dll'}", "Default | UpdateKey": "Nexus:694", - "~1.0 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.0 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Object Time Left": { @@ -1188,8 +1149,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "PelicanTTS": { "ID": "Platonymous.PelicanTTS", "Default | UpdateKey": "Nexus:1079", // added in 1.6.1 - "~1.6 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.6 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.6 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Persia the Mermaid - Standalone Custom NPC": { @@ -1205,8 +1165,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Persival's BundleMod": { "FormerIDs": "{EntryDll: 'BundleMod.dll'}", "Default | UpdateKey": "Nexus:438", - "~1.0 | Status": "AssumeBroken", // broke in SDV 1.1 - "~1.0 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0 | Status": "AssumeBroken" // broke in SDV 1.1 }, "Plant on Grass": { @@ -1240,8 +1199,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "ID": "Mucchan.PrairieKingMadeEasy", "FormerIDs": "{EntryDll: 'PrairieKingMadeEasy.dll'}", // changed in 1.0.1 "Default | UpdateKey": "Chucklefish:3594", - "~1.0 | Status": "AssumeBroken", // broke in SDV 1.2 - "~1.0 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0 | Status": "AssumeBroken" // broke in SDV 1.2 }, "Quest Delay": { @@ -1251,8 +1209,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Rain Randomizer": { "FormerIDs": "{EntryDll: 'RainRandomizer.dll'}", - "~1.0.3 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.0.3 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0.3 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Recatch Legendary Fish": { @@ -1274,16 +1231,14 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "RelationshipsEnhanced": { "ID": "relationshipsenhanced", "Default | UpdateKey": "Chucklefish:4435", - "~1.0 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.0 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Relationship Status": { "ID": "relationshipstatus", "MapRemoteVersions": { "1.0.5": "1.0.4" }, // not updated in manifest "Default | UpdateKey": "Nexus:751", - "~1.0.5 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.0.5 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0.5 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Rented Tools": { @@ -1312,8 +1267,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Reusable Wallpapers and Floors (Wallpaper Retain)": { "ID": "dae1b553-2e39-43e7-8400-c7c5c836134b", "Default | UpdateKey": "Nexus:356", - "~1.5 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.5 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.5 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Ring of Fire": { @@ -1395,16 +1349,14 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Shed Notifications (BuildingsNotifications)": { "ID": "TheCroak.BuildingsNotifications", "Default | UpdateKey": "Nexus:620", - "~0.4.1 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~0.4.1 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~0.4.1 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Shenandoah Project": { "ID": "Shenandoah Project", "MapRemoteVersions": { "1.1.1": "1.1" }, // not updated in manifest "Default | UpdateKey": "Nexus:756", - "~1.1.1 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.1.1 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.1.1 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Ship Anywhere": { @@ -1415,8 +1367,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Shipment Tracker": { "ID": "7e474181-e1a0-40f9-9c11-d08a3dcefaf3", "Default | UpdateKey": "Nexus:321", - "~1.1 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.1 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.1 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Shop Expander": { @@ -1430,8 +1381,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "ID": "Igorious.Showcase", "MapLocalVersions": { "0.9-500": "0.9" }, "Default | UpdateKey": "Chucklefish:4487", - "~0.9 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~0.9 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~0.9 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Shroom Spotter": { @@ -1461,8 +1411,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "ID": "6266959802", "MapLocalVersions": { "0.0": "1.4" }, "Default | UpdateKey": "Nexus:366", - "~1.2.2 | Status": "AssumeBroken", // broke in SMAPI 1.9 (has multiple Mod instances) - "~1.2.2 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.2.2 | Status": "AssumeBroken" // broke in SMAPI 1.9 (has multiple Mod instances) }, "Skill Prestige": { @@ -1506,14 +1455,12 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "ID": "Speeder.SlowerFenceDecay", "FormerIDs": "SPDSlowFenceDecay", // changed in 0.5.2-pathoschild-update "Default | UpdateKey": "Nexus:252", - "~0.5.1 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~0.5.1 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~0.5.1 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Smart Mod": { "ID": "KuroBear.SmartMod", - "~2.2 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~2.2 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~2.2 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Solar Eclipse Event": { @@ -1542,15 +1489,13 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Sprinkles": { "ID": "Platonymous.Sprinkles", "Default | UpdateKey": "Chucklefish:4592", - "~1.1.3 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.1.3 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.1.3 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Sprint and Dash": { "ID": "SPDSprintAndDash", "Default | UpdateKey": "Chucklefish:3531", - "~1.0 | Status": "AssumeBroken", // broke in SDV 1.2 - "~1.0 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0 | Status": "AssumeBroken" // broke in SDV 1.2 }, "Sprint and Dash Redux": { @@ -1563,8 +1508,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "ID": "a10d3097-b073-4185-98ba-76b586cba00c", "MapLocalVersions": { "1.0": "2.1" }, // not updated in manifest "Default | UpdateKey": "GitHub:oliverpl/SprintingMod", - "~2.1 | Status": "AssumeBroken", // broke in SDV 1.2 - "~2.1 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~2.1 | Status": "AssumeBroken" // broke in SDV 1.2 }, "StackSplitX": { @@ -1576,8 +1520,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "StaminaRegen": { "FormerIDs": "{EntryDll: 'StaminaRegen.dll'}", - "~1.0.3 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.0.3 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0.3 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Stardew Config Menu": { @@ -1599,8 +1542,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Stardew Notification": { "ID": "stardewnotification", "Default | UpdateKey": "GitHub:monopandora/StardewNotification", - "~1.7 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.7 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.7 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Stardew Symphony": { @@ -1625,8 +1567,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "StashItemsToChest": { "ID": "BlueMod_StashItemsToChest", "Default | UpdateKey": "GitHub:lambui/StardewValleyMod_StashItemsToChest", - "~1.0.1 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.0.1 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0.1 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Stephan's Lots of Crops": { @@ -1650,8 +1591,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Super Greenhouse Warp Modifier": { "ID": "SuperGreenhouse", "Default | UpdateKey": "Chucklefish:4334", - "~1.0 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.0 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Swim Almost Anywhere / Swim Suit": { @@ -1661,8 +1601,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Tainted Cellar": { "FormerIDs": "{EntryDll: 'TaintedCellar.dll'}", - "~1.0 | Status": "AssumeBroken", // broke in SDV 1.1 or 1.11 - "~1.0 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0 | Status": "AssumeBroken" // broke in SDV 1.1 or 1.11 }, "Tapper Ready": { @@ -1678,8 +1617,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Teleporter": { "ID": "Teleporter", "Default | UpdateKey": "Chucklefish:4374", - "~1.0.2 | Status": "AssumeBroken", // broke in SDV 1.2 - "~1.0.2 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0.2 | Status": "AssumeBroken" // broke in SDV 1.2 }, "The Long Night": { @@ -1738,8 +1676,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "ID": "Demiacle.UiModSuite", "MapLocalVersions": { "0.5": "1.0" }, // not updated in manifest "Default | UpdateKey": "Nexus:1023", - "~1.0 | Status": "AssumeBroken", // broke in SDV 1.2 - "~1.0 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0 | Status": "AssumeBroken" // broke in SDV 1.2 }, "Variable Grass": { @@ -1754,15 +1691,13 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "WakeUp": { "FormerIDs": "{EntryDll: 'WakeUp.dll'}", - "~1.0.2 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.0.2 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0.2 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "Wallpaper Fix": { "FormerIDs": "{EntryDll: 'WallpaperFix.dll'}", "Default | UpdateKey": "Chucklefish:4211", - "~1.1 | Status": "AssumeBroken", // broke in SMAPI 2.0 - "~1.1 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.1 | Status": "AssumeBroken" // broke in SMAPI 2.0 }, "WarpAnimals": { @@ -1772,8 +1707,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Weather Controller": { "FormerIDs": "{EntryDll: 'WeatherController.dll'}", - "~1.0.2 | Status": "AssumeBroken", // broke in SDV 1.2 - "~1.0.2 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0.2 | Status": "AssumeBroken" // broke in SDV 1.2 }, "What Farm Cave / WhatAMush": { @@ -1788,8 +1722,7 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha "Wonderful Farm Life": { "FormerIDs": "{EntryDll: 'WonderfulFarmLife.dll'}", - "~1.0 | Status": "AssumeBroken", // broke in SDV 1.1 or 1.11 - "~1.0 | AlternativeUrl": "http://stardewvalleywiki.com/Modding:SMAPI_2.0" + "~1.0 | Status": "AssumeBroken" // broke in SDV 1.1 or 1.11 }, "XmlSerializerRetool": { -- cgit From ac6127c63e2978a5cf63ff4753991e5ab33db8c3 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 4 Mar 2018 13:37:42 -0500 Subject: fix log parser error when mod names are duplicated --- docs/release-notes.md | 1 + src/SMAPI.Web/Views/LogParser/Index.cshtml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/release-notes.md') diff --git a/docs/release-notes.md b/docs/release-notes.md index fb056e79..e1c262be 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -8,6 +8,7 @@ * For the [log parser][]: * Fixed mod list not including all mods if at least one has no author name. * Fixed some log entries being incorrectly filtered. + * Fixed error when mods have duplicate names. * For SMAPI developers: * Internal changes to support the upcoming Stardew Valley 1.3 update. diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml index f622ccc4..d2d8004e 100644 --- a/src/SMAPI.Web/Views/LogParser/Index.cshtml +++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml @@ -26,7 +26,7 @@ smapi.logParser({ logStarted: new Date(@Json.Serialize(Model.ParsedLog?.Timestamp)), showPopup: @Json.Serialize(Model.ParsedLog == null), - showMods: @Json.Serialize(Model.ParsedLog?.Mods?.ToDictionary(p => GetSlug(p.Name), p => true), new JsonSerializerSettings { Formatting = Formatting.None }), + showMods: @Json.Serialize(Model.ParsedLog?.Mods?.Select(p => GetSlug(p.Name)).Distinct().ToDictionary(slug => slug, slug => true), new JsonSerializerSettings { Formatting = Formatting.None }), showLevels: { trace: false, debug: false, -- cgit From 38ca63a8f60adfa17a9a13ba19fdda070a91aebf Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 4 Mar 2018 14:33:50 -0500 Subject: fix null reference when checking FormerIDs field against 'authour' field --- docs/release-notes.md | 3 ++- src/SMAPI/Framework/ModData/ModDatabase.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'docs/release-notes.md') diff --git a/docs/release-notes.md b/docs/release-notes.md index e1c262be..37d3c7aa 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,9 +1,10 @@ # Release notes ## 2.5.3 * For players: - * Fixed some incompatible-mod errors not showing the mod URL. * Simplified default mod update URL, which is now always included for incompatible mods. * Updated compatibility list. + * Fixed some incompatible-mod errors not showing the mod URL. + * Fixed rare crash with a specific combination of `manifest.json` fields and internal SMAPI mod data. * For the [log parser][]: * Fixed mod list not including all mods if at least one has no author name. diff --git a/src/SMAPI/Framework/ModData/ModDatabase.cs b/src/SMAPI/Framework/ModData/ModDatabase.cs index 332c5c48..3fd68440 100644 --- a/src/SMAPI/Framework/ModData/ModDatabase.cs +++ b/src/SMAPI/Framework/ModData/ModDatabase.cs @@ -157,7 +157,7 @@ namespace StardewModdingAPI.Framework.ModData && ( snapshot.Author == null || snapshot.Author.Equals(manifest.Author, StringComparison.InvariantCultureIgnoreCase) - || (manifest.ExtraFields.ContainsKey("Authour") && snapshot.Author.Equals(manifest.ExtraFields["Authour"].ToString(), StringComparison.InvariantCultureIgnoreCase)) + || (manifest.ExtraFields != null && manifest.ExtraFields.ContainsKey("Authour") && snapshot.Author.Equals(manifest.ExtraFields["Authour"].ToString(), StringComparison.InvariantCultureIgnoreCase)) ) && (snapshot.Name == null || snapshot.Name.Equals(manifest.Name, StringComparison.InvariantCultureIgnoreCase)); -- cgit From 90c8593ba9a0828a4d3f563c6f08fc90933cd2ff Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 4 Mar 2018 17:34:43 -0500 Subject: update SMAPI URL in user agent (#454) --- docs/release-notes.md | 1 + src/SMAPI.Web/appsettings.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/release-notes.md') diff --git a/docs/release-notes.md b/docs/release-notes.md index 37d3c7aa..93d07385 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -5,6 +5,7 @@ * Updated compatibility list. * Fixed some incompatible-mod errors not showing the mod URL. * Fixed rare crash with a specific combination of `manifest.json` fields and internal SMAPI mod data. + * Fixed update checks not working for Nexus Mods due to a change in their API. * For the [log parser][]: * Fixed mod list not including all mods if at least one has no author name. diff --git a/src/SMAPI.Web/appsettings.json b/src/SMAPI.Web/appsettings.json index 9758f4a7..3cf72ddb 100644 --- a/src/SMAPI.Web/appsettings.json +++ b/src/SMAPI.Web/appsettings.json @@ -18,7 +18,7 @@ "LogParserUrl": null // see top note }, "ApiClients": { - "UserAgent": "SMAPI/{0} (+https://github.com/Pathoschild/SMAPI)", + "UserAgent": "SMAPI/{0} (+https://smapi.io)", "ChucklefishBaseUrl": "https://community.playstarbound.com", "ChucklefishModPageUrlFormat": "resources/{0}", -- cgit From 99023f94871e1f9bad5ee5f5db0ff041a02e9ed5 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 4 Mar 2018 18:46:05 -0500 Subject: add support for mapping non-semantic remote mod versions --- docs/release-notes.md | 1 + src/SMAPI.Common/Models/ModSeachModel.cs | 7 ++++- src/SMAPI.Web/Controllers/ModsApiController.cs | 24 ++++++++++++----- src/SMAPI/Framework/ModData/ModDataRecord.cs | 11 +++++--- src/SMAPI/Framework/ModData/ParsedModDataRecord.cs | 2 +- src/SMAPI/Framework/WebApiClient.cs | 2 +- src/SMAPI/Program.cs | 31 +++++++++++----------- 7 files changed, 50 insertions(+), 28 deletions(-) (limited to 'docs/release-notes.md') diff --git a/docs/release-notes.md b/docs/release-notes.md index 93d07385..903eaf6f 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -6,6 +6,7 @@ * Fixed some incompatible-mod errors not showing the mod URL. * Fixed rare crash with a specific combination of `manifest.json` fields and internal SMAPI mod data. * Fixed update checks not working for Nexus Mods due to a change in their API. + * Fixed update checks failing for some older mods with non-standard versions. * For the [log parser][]: * Fixed mod list not including all mods if at least one has no author name. diff --git a/src/SMAPI.Common/Models/ModSeachModel.cs b/src/SMAPI.Common/Models/ModSeachModel.cs index 13b05d2d..3c33d0b6 100644 --- a/src/SMAPI.Common/Models/ModSeachModel.cs +++ b/src/SMAPI.Common/Models/ModSeachModel.cs @@ -12,6 +12,9 @@ namespace StardewModdingAPI.Common.Models /// The namespaced mod keys to search. public string[] ModKeys { get; set; } + /// Whether to allow non-semantic versions, instead of returning an error for those. + public bool AllowInvalidVersions { get; set; } + /********* ** Public methods @@ -24,9 +27,11 @@ namespace StardewModdingAPI.Common.Models /// Construct an instance. /// The namespaced mod keys to search. - public ModSearchModel(IEnumerable modKeys) + /// Whether to allow non-semantic versions, instead of returning an error for those. + public ModSearchModel(IEnumerable modKeys, bool allowInvalidVersions) { this.ModKeys = modKeys.ToArray(); + this.AllowInvalidVersions = allowInvalidVersions; } } } diff --git a/src/SMAPI.Web/Controllers/ModsApiController.cs b/src/SMAPI.Web/Controllers/ModsApiController.cs index dcb4ec52..abae7db7 100644 --- a/src/SMAPI.Web/Controllers/ModsApiController.cs +++ b/src/SMAPI.Web/Controllers/ModsApiController.cs @@ -64,14 +64,15 @@ namespace StardewModdingAPI.Web.Controllers /// Fetch version metadata for the given mods. /// The namespaced mod keys to search as a comma-delimited array. + /// Whether to allow non-semantic versions, instead of returning an error for those. [HttpGet] - public async Task> GetAsync(string modKeys) + public async Task> GetAsync(string modKeys, bool allowInvalidVersions = false) { string[] modKeysArray = modKeys?.Split(',').ToArray(); if (modKeysArray == null || !modKeysArray.Any()) return new Dictionary(); - return await this.PostAsync(new ModSearchModel(modKeysArray)); + return await this.PostAsync(new ModSearchModel(modKeysArray, allowInvalidVersions)); } /// Fetch version metadata for the given mods. @@ -79,7 +80,8 @@ namespace StardewModdingAPI.Web.Controllers [HttpPost] public async Task> PostAsync([FromBody] ModSearchModel search) { - // sort & filter keys + // parse model + bool allowInvalidVersions = search?.AllowInvalidVersions ?? false; string[] modKeys = (search?.ModKeys?.ToArray() ?? new string[0]) .Distinct(StringComparer.CurrentCultureIgnoreCase) .OrderBy(p => p, StringComparer.CurrentCultureIgnoreCase) @@ -106,12 +108,20 @@ namespace StardewModdingAPI.Web.Controllers // fetch mod info result[modKey] = await this.Cache.GetOrCreateAsync($"{repository.VendorKey}:{modID}".ToLower(), async entry => { - entry.AbsoluteExpiration = DateTimeOffset.UtcNow.AddMinutes(this.CacheMinutes); - + // fetch info ModInfoModel info = await repository.GetModInfoAsync(modID); - if (info.Error == null && (info.Version == null || !Regex.IsMatch(info.Version, this.VersionRegex, RegexOptions.CultureInvariant | RegexOptions.IgnoreCase))) - info = new ModInfoModel(info.Name, info.Version, info.Url, info.Version == null ? "Mod has no version number." : $"Mod has invalid semantic version '{info.Version}'."); + // validate + if (info.Error == null) + { + if (info.Version == null) + info = new ModInfoModel(info.Name, info.Version, info.Url, "Mod has no version number."); + if (!allowInvalidVersions && !Regex.IsMatch(info.Version, this.VersionRegex, RegexOptions.CultureInvariant | RegexOptions.IgnoreCase)) + info = new ModInfoModel(info.Name, info.Version, info.Url, $"Mod has invalid semantic version '{info.Version}'."); + } + + // cache & return + entry.AbsoluteExpiration = DateTimeOffset.UtcNow.AddMinutes(this.CacheMinutes); return info; }); } diff --git a/src/SMAPI/Framework/ModData/ModDataRecord.cs b/src/SMAPI/Framework/ModData/ModDataRecord.cs index 79a954f7..56275f53 100644 --- a/src/SMAPI/Framework/ModData/ModDataRecord.cs +++ b/src/SMAPI/Framework/ModData/ModDataRecord.cs @@ -106,10 +106,10 @@ namespace StardewModdingAPI.Framework.ModData /// Get a semantic local version for update checks. /// The remote version to normalise. - public string GetLocalVersionForUpdateChecks(string version) + public ISemanticVersion GetLocalVersionForUpdateChecks(ISemanticVersion version) { - return this.MapLocalVersions != null && this.MapLocalVersions.TryGetValue(version, out string newVersion) - ? newVersion + return this.MapLocalVersions != null && this.MapLocalVersions.TryGetValue(version.ToString(), out string newVersion) + ? new SemanticVersion(newVersion) : version; } @@ -117,6 +117,11 @@ namespace StardewModdingAPI.Framework.ModData /// The remote version to normalise. public string GetRemoteVersionForUpdateChecks(string version) { + // normalise version if possible + if (SemanticVersion.TryParse(version, out ISemanticVersion parsed)) + version = parsed.ToString(); + + // fetch remote version return this.MapRemoteVersions != null && this.MapRemoteVersions.TryGetValue(version, out string newVersion) ? newVersion : version; diff --git a/src/SMAPI/Framework/ModData/ParsedModDataRecord.cs b/src/SMAPI/Framework/ModData/ParsedModDataRecord.cs index 7f49790d..deb12bdc 100644 --- a/src/SMAPI/Framework/ModData/ParsedModDataRecord.cs +++ b/src/SMAPI/Framework/ModData/ParsedModDataRecord.cs @@ -33,7 +33,7 @@ namespace StardewModdingAPI.Framework.ModData *********/ /// Get a semantic local version for update checks. /// The remote version to normalise. - public string GetLocalVersionForUpdateChecks(string version) + public ISemanticVersion GetLocalVersionForUpdateChecks(ISemanticVersion version) { return this.DataRecord.GetLocalVersionForUpdateChecks(version); } diff --git a/src/SMAPI/Framework/WebApiClient.cs b/src/SMAPI/Framework/WebApiClient.cs index e78ac14b..7f0122cf 100644 --- a/src/SMAPI/Framework/WebApiClient.cs +++ b/src/SMAPI/Framework/WebApiClient.cs @@ -40,7 +40,7 @@ namespace StardewModdingAPI.Framework { return this.Post>( $"v{this.Version}/mods", - new ModSearchModel(modKeys) + new ModSearchModel(modKeys, allowInvalidVersions: true) ); } diff --git a/src/SMAPI/Program.cs b/src/SMAPI/Program.cs index 979f6328..1a1b9645 100644 --- a/src/SMAPI/Program.cs +++ b/src/SMAPI/Program.cs @@ -604,29 +604,30 @@ namespace StardewModdingAPI foreach (var result in results) { IModMetadata mod = result.Mod; - ModInfoModel info = result.Info; + ModInfoModel remoteInfo = result.Info; // handle error - if (info.Error != null) + if (remoteInfo.Error != null) { - this.Monitor.Log($" {mod.DisplayName} ({result.Key}): update error: {info.Error}", LogLevel.Trace); + this.Monitor.Log($" {mod.DisplayName} ({result.Key}): update error: {remoteInfo.Error}", LogLevel.Trace); continue; } - // track update - ISemanticVersion localVersion = mod.DataRecord != null - ? new SemanticVersion(mod.DataRecord.GetLocalVersionForUpdateChecks(mod.Manifest.Version.ToString())) - : mod.Manifest.Version; - ISemanticVersion latestVersion = new SemanticVersion(mod.DataRecord != null - ? mod.DataRecord.GetRemoteVersionForUpdateChecks(new SemanticVersion(info.Version).ToString()) - : info.Version - ); - bool isUpdate = latestVersion.IsNewerThan(localVersion); - this.VerboseLog($" {mod.DisplayName} ({result.Key}): {(isUpdate ? $"{mod.Manifest.Version}{(!localVersion.Equals(mod.Manifest.Version) ? $" [{localVersion}]" : "")} => {info.Version}{(!latestVersion.Equals(new SemanticVersion(info.Version)) ? $" [{latestVersion}]" : "")}" : "okay")}."); + // normalise versions + ISemanticVersion localVersion = mod.DataRecord?.GetLocalVersionForUpdateChecks(mod.Manifest.Version) ?? mod.Manifest.Version; + if (!SemanticVersion.TryParse(mod.DataRecord?.GetRemoteVersionForUpdateChecks(remoteInfo.Version) ?? remoteInfo.Version, out ISemanticVersion remoteVersion)) + { + this.Monitor.Log($" {mod.DisplayName} ({result.Key}): update error: Mod has invalid version {remoteInfo.Version}", LogLevel.Trace); + continue; + } + + // compare versions + bool isUpdate = remoteVersion.IsNewerThan(localVersion); + this.VerboseLog($" {mod.DisplayName} ({result.Key}): {(isUpdate ? $"{mod.Manifest.Version}{(!localVersion.Equals(mod.Manifest.Version) ? $" [{localVersion}]" : "")} => {remoteInfo.Version}{(!remoteVersion.Equals(new SemanticVersion(remoteInfo.Version)) ? $" [{remoteVersion}]" : "")}" : "okay")}."); if (isUpdate) { - if (!updatesByMod.TryGetValue(mod, out ModInfoModel other) || latestVersion.IsNewerThan(other.Version)) - updatesByMod[mod] = info; + if (!updatesByMod.TryGetValue(mod, out ModInfoModel other) || remoteVersion.IsNewerThan(other.Version)) + updatesByMod[mod] = remoteInfo; } } -- cgit From 6bde91060c81908a34aa2b182fd72383097229da Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 4 Mar 2018 21:27:56 -0500 Subject: polish release notes --- docs/release-notes.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'docs/release-notes.md') diff --git a/docs/release-notes.md b/docs/release-notes.md index 903eaf6f..5cac1ed8 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,17 +1,17 @@ # Release notes ## 2.5.3 * For players: - * Simplified default mod update URL, which is now always included for incompatible mods. - * Updated compatibility list. + * Simplified and improved skipped-incompatible-mod messages. * Fixed some incompatible-mod errors not showing the mod URL. - * Fixed rare crash with a specific combination of `manifest.json` fields and internal SMAPI mod data. - * Fixed update checks not working for Nexus Mods due to a change in their API. + * Fixed rare crash with some combinations of manifest fields and internal mod data. + * Fixed update checks failing for Nexus Mods due to a change in their API. * Fixed update checks failing for some older mods with non-standard versions. + * Updated compatibility list and added update checks for more mods. * For the [log parser][]: - * Fixed mod list not including all mods if at least one has no author name. - * Fixed some log entries being incorrectly filtered. - * Fixed error when mods have duplicate names. + * Fixed incorrect filtering in some cases. + * Fixed error if mods have duplicate names. + * Fixed parse bugs if a mod has no author name. * For SMAPI developers: * Internal changes to support the upcoming Stardew Valley 1.3 update. -- cgit From 41715cefcde3c838bb079cb37aac5a3b2dcb1004 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 11 Mar 2018 19:09:08 -0400 Subject: add initial compatibility with Stardew Valley 1.3 (#453) --- build/common.targets | 4 + docs/release-notes.md | 4 + src/SMAPI.ModBuildConfig/build/smapi.targets | 4 + src/SMAPI.ModBuildConfig/package.nuspec | 5 +- .../Framework/Commands/Player/AddCommand.cs | 4 + .../Framework/Commands/Player/SetColorCommand.cs | 10 +- .../Framework/Commands/Player/SetNameCommand.cs | 6 +- .../Commands/World/DownMineLevelCommand.cs | 6 +- .../Commands/World/SetMineLevelCommand.cs | 6 +- .../Framework/ItemRepository.cs | 83 ++- src/SMAPI/Constants.cs | 28 +- src/SMAPI/Events/EventArgsInventoryChanged.cs | 12 +- .../Events/EventArgsLocationObjectsChanged.cs | 18 +- src/SMAPI/Framework/GameVersion.cs | 4 +- src/SMAPI/Framework/SContentManager.cs | 69 ++- src/SMAPI/Framework/SGame.cs | 631 ++++++++++++++++++++- src/SMAPI/Metadata/CoreAssets.cs | 38 +- src/SMAPI/Program.cs | 1 + 18 files changed, 881 insertions(+), 52 deletions(-) (limited to 'docs/release-notes.md') diff --git a/build/common.targets b/build/common.targets index aa11344e..6773dbe4 100644 --- a/build/common.targets +++ b/build/common.targets @@ -38,6 +38,10 @@ False + + $(GamePath)\Netcode.dll + False + $(GamePath)\Stardew Valley.exe False diff --git a/docs/release-notes.md b/docs/release-notes.md index 5cac1ed8..05a95fc1 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,4 +1,8 @@ # Release notes +## 2.6 alpha +* For players: + * Updated for Stardew Valley 1.3 (multiplayer update); no longer compatible with earlier versions. + ## 2.5.3 * For players: * Simplified and improved skipped-incompatible-mod messages. diff --git a/src/SMAPI.ModBuildConfig/build/smapi.targets b/src/SMAPI.ModBuildConfig/build/smapi.targets index 83f0dcbd..7e8bbfc3 100644 --- a/src/SMAPI.ModBuildConfig/build/smapi.targets +++ b/src/SMAPI.ModBuildConfig/build/smapi.targets @@ -67,6 +67,10 @@ false + + $(GamePath)\Netcode.dll + False + $(GamePath)\Stardew Valley.exe false diff --git a/src/SMAPI.ModBuildConfig/package.nuspec b/src/SMAPI.ModBuildConfig/package.nuspec index 91f38a29..8393ab61 100644 --- a/src/SMAPI.ModBuildConfig/package.nuspec +++ b/src/SMAPI.ModBuildConfig/package.nuspec @@ -2,7 +2,7 @@ Pathoschild.Stardew.ModBuildConfig - 2.0.2 + 2.0.3-alpha20180307 Build package for SMAPI mods Pathoschild Pathoschild @@ -26,6 +26,9 @@ 2.0.2: - Fixed compatibility issue on Linux. + + 2.0.3: + - Added support for Stardew Valley 1.3. diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/AddCommand.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/AddCommand.cs index 14a519fb..a6f42b98 100644 --- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/AddCommand.cs +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/AddCommand.cs @@ -54,7 +54,11 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.Player // apply quality if (match.Item is Object obj) +#if STARDEW_VALLEY_1_3 + obj.Quality = quality; +#else obj.quality = quality; +#endif else if (match.Item is Tool tool) tool.UpgradeLevel = quality; diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/SetColorCommand.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/SetColorCommand.cs index 5d098593..aa4fd105 100644 --- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/SetColorCommand.cs +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/SetColorCommand.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using StardewValley; namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.Player @@ -36,7 +36,11 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.Player switch (target) { case "hair": +#if STARDEW_VALLEY_1_3 + Game1.player.hairstyleColor.Value = color; +#else Game1.player.hairstyleColor = color; +#endif monitor.Log("OK, your hair color is updated.", LogLevel.Info); break; @@ -46,7 +50,11 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.Player break; case "pants": +#if STARDEW_VALLEY_1_3 + Game1.player.pantsColor.Value = color; +#else Game1.player.pantsColor = color; +#endif monitor.Log("OK, your pants color is updated.", LogLevel.Info); break; } diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/SetNameCommand.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/SetNameCommand.cs index 5b1225e8..71e17f71 100644 --- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/SetNameCommand.cs +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/SetNameCommand.cs @@ -1,4 +1,4 @@ -using StardewValley; +using StardewValley; namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.Player { @@ -39,7 +39,11 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.Player case "farm": if (!string.IsNullOrWhiteSpace(name)) { +#if STARDEW_VALLEY_1_3 + Game1.player.farmName.Value = args[1]; +#else Game1.player.farmName = args[1]; +#endif monitor.Log($"OK, your farm's name is now {Game1.player.farmName}.", LogLevel.Info); } else diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/DownMineLevelCommand.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/DownMineLevelCommand.cs index da117006..c83c3b07 100644 --- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/DownMineLevelCommand.cs +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/DownMineLevelCommand.cs @@ -1,4 +1,4 @@ -using StardewValley; +using StardewValley; using StardewValley.Locations; namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.World @@ -21,7 +21,11 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.World { int level = (Game1.currentLocation as MineShaft)?.mineLevel ?? 0; monitor.Log($"OK, warping you to mine level {level + 1}.", LogLevel.Info); +#if STARDEW_VALLEY_1_3 + Game1.enterMine(level + 1); +#else Game1.enterMine(false, level + 1, ""); +#endif } } } diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/SetMineLevelCommand.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/SetMineLevelCommand.cs index 1024b7b6..5947af1a 100644 --- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/SetMineLevelCommand.cs +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/SetMineLevelCommand.cs @@ -1,4 +1,4 @@ -using System; +using System; using StardewValley; namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.World @@ -26,7 +26,11 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.World // handle level = Math.Max(1, level); monitor.Log($"OK, warping you to mine level {level}.", LogLevel.Info); +#if STARDEW_VALLEY_1_3 + Game1.enterMine(level); +#else Game1.enterMine(true, level, ""); +#endif } } } diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs index b5fe9f2f..9c0981c4 100644 --- a/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Microsoft.Xna.Framework; using StardewModdingAPI.Mods.ConsoleCommands.Framework.ItemData; using StardewValley; @@ -95,39 +95,90 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework // fruit products if (item.category == SObject.FruitsCategory) { - yield return new SearchableItem(ItemType.Object, this.CustomIDOffset + id, new SObject(348, 1) + // wine +#if STARDEW_VALLEY_1_3 + SObject wine = + new SObject(348, 1) + { + Name = $"{item.Name} Wine", + Price = item.price * 3 + }; + wine.preserve.Value = SObject.PreserveType.Wine; + wine.preservedParentSheetIndex.Value = item.parentSheetIndex; +#else + SObject wine = new SObject(348, 1) { name = $"{item.Name} Wine", price = item.price * 3, preserve = SObject.PreserveType.Wine, preservedParentSheetIndex = item.parentSheetIndex - }); - yield return new SearchableItem(ItemType.Object, this.CustomIDOffset * 2 + id, new SObject(344, 1) + }; +#endif + yield return new SearchableItem(ItemType.Object, this.CustomIDOffset + id, wine); + + // jelly +#if STARDEW_VALLEY_1_3 + SObject jelly = new SObject(344, 1) + { + Name = $"{item.Name} Jelly", + Price = 50 + item.Price * 2 + }; + jelly.preserve.Value = SObject.PreserveType.Jelly; + jelly.preservedParentSheetIndex.Value = item.parentSheetIndex; +#else + SObject jelly = new SObject(344, 1) { name = $"{item.Name} Jelly", price = 50 + item.Price * 2, preserve = SObject.PreserveType.Jelly, preservedParentSheetIndex = item.parentSheetIndex - }); + }; +#endif + yield return new SearchableItem(ItemType.Object, this.CustomIDOffset * 2 + id, jelly); } // vegetable products else if (item.category == SObject.VegetableCategory) { - yield return new SearchableItem(ItemType.Object, this.CustomIDOffset * 3 + id, new SObject(350, 1) + // juice +#if STARDEW_VALLEY_1_3 + SObject juice = new SObject(350, 1) + { + Name = $"{item.Name} Juice", + Price = (int)(item.price * 2.25d) + }; + juice.preserve.Value = SObject.PreserveType.Juice; + juice.preservedParentSheetIndex.Value = item.parentSheetIndex; +#else + SObject juice = new SObject(350, 1) { name = $"{item.Name} Juice", price = (int)(item.price * 2.25d), preserve = SObject.PreserveType.Juice, preservedParentSheetIndex = item.parentSheetIndex - }); - yield return new SearchableItem(ItemType.Object, this.CustomIDOffset * 4 + id, new SObject(342, 1) + }; +#endif + yield return new SearchableItem(ItemType.Object, this.CustomIDOffset * 3 + id, juice); + + // pickled +#if STARDEW_VALLEY_1_3 + SObject pickled = new SObject(342, 1) + { + Name = $"Pickled {item.Name}", + Price = 50 + item.Price * 2 + }; + pickled.preserve.Value = SObject.PreserveType.Pickle; + pickled.preservedParentSheetIndex.Value = item.parentSheetIndex; +#else + SObject pickled = new SObject(342, 1) { name = $"Pickled {item.Name}", price = 50 + item.Price * 2, preserve = SObject.PreserveType.Pickle, preservedParentSheetIndex = item.parentSheetIndex - }); + }; +#endif + yield return new SearchableItem(ItemType.Object, this.CustomIDOffset * 4 + id, pickled); } // flower honey @@ -160,6 +211,19 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework // yield honey if (type != null) { +#if STARDEW_VALLEY_1_3 + SObject honey = new SObject(Vector2.Zero, 340, item.Name + " Honey", false, true, false, false) + { + Name = "Wild Honey" + }; + honey.honeyType.Value = type; + + if (type != SObject.HoneyType.Wild) + { + honey.Name = $"{item.Name} Honey"; + honey.Price += item.Price * 2; + } +#else SObject honey = new SObject(Vector2.Zero, 340, item.Name + " Honey", false, true, false, false) { name = "Wild Honey", @@ -170,6 +234,7 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework honey.name = $"{item.Name} Honey"; honey.price += item.price * 2; } +#endif yield return new SearchableItem(ItemType.Object, this.CustomIDOffset * 5 + id, honey); } } diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index 5b2f6e6e..011762fb 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -37,13 +37,28 @@ namespace StardewModdingAPI ** Public ****/ /// SMAPI's current semantic version. - public static ISemanticVersion ApiVersion { get; } = new SemanticVersion("2.5.3"); + public static ISemanticVersion ApiVersion { get; } = +#if STARDEW_VALLEY_1_3 + new SemanticVersion($"2.6-alpha.{DateTime.UtcNow:yyyyMMddHHmm}"); +#else + new SemanticVersion($"2.5.3"); +#endif /// The minimum supported version of Stardew Valley. - public static ISemanticVersion MinimumGameVersion { get; } = new SemanticVersion("1.2.30"); + public static ISemanticVersion MinimumGameVersion { get; } = +#if STARDEW_VALLEY_1_3 + new GameVersion("1.3.0.2"); +#else + new SemanticVersion("1.2.33"); +#endif /// The maximum supported version of Stardew Valley. - public static ISemanticVersion MaximumGameVersion { get; } = new SemanticVersion("1.2.33"); + public static ISemanticVersion MaximumGameVersion { get; } = +#if STARDEW_VALLEY_1_3 + null; +#else + new SemanticVersion("1.2.33"); +#endif /// The path to the game folder. public static string ExecutionPath { get; } = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); @@ -169,7 +184,12 @@ namespace StardewModdingAPI /// Get the name of a save directory for the current player. private static string GetSaveFolderName() { - string prefix = new string(Game1.player.name.Where(char.IsLetterOrDigit).ToArray()); + string prefix = +#if STARDEW_VALLEY_1_3 + new string(Game1.player.name.Value.Where(char.IsLetterOrDigit).ToArray()); +#else + new string(Game1.player.name.Where(char.IsLetterOrDigit).ToArray()); +#endif return $"{prefix}_{Game1.uniqueIDForThisGame}"; } diff --git a/src/SMAPI/Events/EventArgsInventoryChanged.cs b/src/SMAPI/Events/EventArgsInventoryChanged.cs index 1ee02842..b85ae9db 100644 --- a/src/SMAPI/Events/EventArgsInventoryChanged.cs +++ b/src/SMAPI/Events/EventArgsInventoryChanged.cs @@ -12,7 +12,11 @@ namespace StardewModdingAPI.Events ** Accessors *********/ /// The player's inventory. +#if STARDEW_VALLEY_1_3 + public IList Inventory { get; } +#else public List Inventory { get; } +#endif /// The added items. public List Added { get; } @@ -30,7 +34,13 @@ namespace StardewModdingAPI.Events /// Construct an instance. /// The player's inventory. /// The inventory changes. - public EventArgsInventoryChanged(List inventory, List changedItems) + public EventArgsInventoryChanged( +#if STARDEW_VALLEY_1_3 + IList inventory, +#else + List inventory, +#endif + List changedItems) { this.Inventory = inventory; this.Added = changedItems.Where(n => n.ChangeType == ChangeType.Added).ToList(); diff --git a/src/SMAPI/Events/EventArgsLocationObjectsChanged.cs b/src/SMAPI/Events/EventArgsLocationObjectsChanged.cs index 058999e9..de3c31ea 100644 --- a/src/SMAPI/Events/EventArgsLocationObjectsChanged.cs +++ b/src/SMAPI/Events/EventArgsLocationObjectsChanged.cs @@ -1,6 +1,10 @@ -using System; +using System; using Microsoft.Xna.Framework; +#if STARDEW_VALLEY_1_3 +using Netcode; +#else using StardewValley; +#endif using Object = StardewValley.Object; namespace StardewModdingAPI.Events @@ -12,7 +16,11 @@ namespace StardewModdingAPI.Events ** Accessors *********/ /// The current list of objects in the current location. +#if STARDEW_VALLEY_1_3 + public IDictionary> NewObjects { get; } +#else public SerializableDictionary NewObjects { get; } +#endif /********* @@ -20,7 +28,13 @@ namespace StardewModdingAPI.Events *********/ /// Construct an instance. /// The current list of objects in the current location. - public EventArgsLocationObjectsChanged(SerializableDictionary newObjects) + public EventArgsLocationObjectsChanged( +#if STARDEW_VALLEY_1_3 + IDictionary> newObjects +#else + SerializableDictionary newObjects +#endif + ) { this.NewObjects = newObjects; } diff --git a/src/SMAPI/Framework/GameVersion.cs b/src/SMAPI/Framework/GameVersion.cs index 1884afe9..c347ffba 100644 --- a/src/SMAPI/Framework/GameVersion.cs +++ b/src/SMAPI/Framework/GameVersion.cs @@ -23,7 +23,9 @@ namespace StardewModdingAPI.Framework ["1.07"] = "1.0.7", ["1.07a"] = "1.0.8-prerelease1", ["1.08"] = "1.0.8", - ["1.11"] = "1.1.1" + ["1.11"] = "1.1.1", + ["1.3.0.1"] = "1.13-alpha.1", + ["1.3.0.2"] = "1.13-alpha.2" }; diff --git a/src/SMAPI/Framework/SContentManager.cs b/src/SMAPI/Framework/SContentManager.cs index fa51bd53..29c6c684 100644 --- a/src/SMAPI/Framework/SContentManager.cs +++ b/src/SMAPI/Framework/SContentManager.cs @@ -41,11 +41,11 @@ namespace StardewModdingAPI.Framework /// The underlying asset cache. private readonly ContentCache Cache; - /// The private method which generates the locale portion of an asset name. - private readonly IReflectedMethod GetKeyLocale; + /// The locale codes used in asset keys indexed by enum value. + private readonly IDictionary Locales; - /// The language codes used in asset keys. - private readonly IDictionary KeyLocales; + /// The language enum values indexed by locale code. + private readonly IDictionary LanguageCodes; /// Provides metadata for core game assets. private readonly CoreAssets CoreAssets; @@ -95,12 +95,12 @@ namespace StardewModdingAPI.Framework // init this.Monitor = monitor ?? throw new ArgumentNullException(nameof(monitor)); this.Cache = new ContentCache(this, reflection); - this.GetKeyLocale = reflection.GetMethod(this, "languageCode"); this.ModContentPrefix = this.GetAssetNameFromFilePath(Constants.ModPath); // get asset data - this.CoreAssets = new CoreAssets(this.NormaliseAssetName); - this.KeyLocales = this.GetKeyLocales(reflection); + this.CoreAssets = new CoreAssets(this.NormaliseAssetName, reflection); + this.Locales = this.GetKeyLocales(reflection); + this.LanguageCodes = this.Locales.ToDictionary(p => p.Value, p => p.Key, StringComparer.InvariantCultureIgnoreCase); } /**** @@ -153,7 +153,7 @@ namespace StardewModdingAPI.Framework /// Get the current content locale. public string GetLocale() { - return this.GetKeyLocale.Invoke(); + return this.Locales[this.GetCurrentLanguage()]; } /// Get whether the content manager has already loaded and cached the given asset. @@ -398,29 +398,48 @@ namespace StardewModdingAPI.Framework /// Get the locale codes (like ja-JP) used in asset keys. /// Simplifies access to private game code. - private IDictionary GetKeyLocales(Reflector reflection) + private IDictionary GetKeyLocales(Reflector reflection) { - // get the private code field directly to avoid changed-code logic +#if !STARDEW_VALLEY_1_3 IReflectedField codeField = reflection.GetField(typeof(LocalizedContentManager), "_currentLangCode"); - - // remember previous settings LanguageCode previousCode = codeField.GetValue(); +#endif string previousOverride = this.LanguageCodeOverride; - // create locale => code map - IDictionary map = new Dictionary(StringComparer.InvariantCultureIgnoreCase); - this.LanguageCodeOverride = null; - foreach (LanguageCode code in Enum.GetValues(typeof(LanguageCode))) + try { - codeField.SetValue(code); - map[this.GetKeyLocale.Invoke()] = code; - } + // temporarily disable language override + this.LanguageCodeOverride = null; + + // create locale => code map + IReflectedMethod languageCodeString = reflection +#if STARDEW_VALLEY_1_3 + .GetMethod(this, "languageCodeString"); +#else + .GetMethod(this, "languageCode"); +#endif + IDictionary map = new Dictionary(); + foreach (LanguageCode code in Enum.GetValues(typeof(LanguageCode))) + { +#if STARDEW_VALLEY_1_3 + map[code] = languageCodeString.Invoke(code); +#else + codeField.SetValue(code); + map[code] = languageCodeString.Invoke(); +#endif + } - // restore previous settings - codeField.SetValue(previousCode); - this.LanguageCodeOverride = previousOverride; + return map; + } + finally + { + // restore previous settings + this.LanguageCodeOverride = previousOverride; +#if !STARDEW_VALLEY_1_3 + codeField.SetValue(previousCode); +#endif - return map; + } } /// Get the asset name from a cache key. @@ -444,7 +463,7 @@ namespace StardewModdingAPI.Framework if (lastSepIndex >= 0) { string suffix = cacheKey.Substring(lastSepIndex + 1, cacheKey.Length - lastSepIndex - 1); - if (this.KeyLocales.ContainsKey(suffix)) + if (this.LanguageCodes.ContainsKey(suffix)) { assetName = cacheKey.Substring(0, lastSepIndex); localeCode = cacheKey.Substring(lastSepIndex + 1, cacheKey.Length - lastSepIndex - 1); @@ -466,7 +485,7 @@ namespace StardewModdingAPI.Framework private bool IsNormalisedKeyLoaded(string normalisedAssetName) { return this.Cache.ContainsKey(normalisedAssetName) - || this.Cache.ContainsKey($"{normalisedAssetName}.{this.GetKeyLocale.Invoke()}"); // translated asset + || this.Cache.ContainsKey($"{normalisedAssetName}.{this.Locales[this.GetCurrentLanguage()]}"); // translated asset } /// Track that a content manager loaded an asset. diff --git a/src/SMAPI/Framework/SGame.cs b/src/SMAPI/Framework/SGame.cs index 5c45edca..acb3e794 100644 --- a/src/SMAPI/Framework/SGame.cs +++ b/src/SMAPI/Framework/SGame.cs @@ -9,6 +9,9 @@ using System.Threading.Tasks; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; +#if STARDEW_VALLEY_1_3 +using Netcode; +#endif using StardewModdingAPI.Events; using StardewModdingAPI.Framework.Events; using StardewModdingAPI.Framework.Input; @@ -20,7 +23,9 @@ using StardewValley.Locations; using StardewValley.Menus; using StardewValley.Tools; using xTile.Dimensions; +#if !STARDEW_VALLEY_1_3 using xTile.Layers; + #endif namespace StardewModdingAPI.Framework { @@ -145,6 +150,9 @@ namespace StardewModdingAPI.Framework private readonly Action drawFarmBuildings = () => SGame.Reflection.GetMethod(SGame.Instance, nameof(drawFarmBuildings)).Invoke(); private readonly Action drawHUD = () => SGame.Reflection.GetMethod(SGame.Instance, nameof(drawHUD)).Invoke(); private readonly Action drawDialogueBox = () => SGame.Reflection.GetMethod(SGame.Instance, nameof(drawDialogueBox)).Invoke(); +#if STARDEW_VALLEY_1_3 + private readonly Action drawOverlays = spriteBatch => SGame.Reflection.GetMethod(SGame.Instance, nameof(SGame.drawOverlays)).Invoke(spriteBatch); +#endif private readonly Action renderScreenBuffer = () => SGame.Reflection.GetMethod(SGame.Instance, nameof(renderScreenBuffer)).Invoke(); // ReSharper restore ArrangeStaticMemberQualifier, ArrangeThisQualifier, InconsistentNaming @@ -488,6 +496,7 @@ namespace StardewModdingAPI.Framework if (Context.IsWorldReady) { // raise current location changed + // ReSharper disable once PossibleUnintendedReferenceComparison if (Game1.currentLocation != this.PreviousGameLocation) { if (this.VerboseLogging) @@ -523,7 +532,13 @@ namespace StardewModdingAPI.Framework // raise current location's object list changed if (this.GetHash(Game1.currentLocation.objects) != this.PreviousLocationObjects) - this.Events.Location_LocationObjectsChanged.Raise(new EventArgsLocationObjectsChanged(Game1.currentLocation.objects)); + this.Events.Location_LocationObjectsChanged.Raise(new EventArgsLocationObjectsChanged( +#if STARDEW_VALLEY_1_3 + Game1.currentLocation.objects.FieldDict +#else + Game1.currentLocation.objects +#endif + )); // raise time changed if (Game1.timeOfDay != this.PreviousTime) @@ -650,6 +665,619 @@ namespace StardewModdingAPI.Framework [SuppressMessage("ReSharper", "RedundantCast", Justification = "copied from game code as-is")] [SuppressMessage("ReSharper", "RedundantExplicitNullableCreation", Justification = "copied from game code as-is")] [SuppressMessage("ReSharper", "RedundantTypeArgumentsOfMethod", Justification = "copied from game code as-is")] +#if STARDEW_VALLEY_1_3 + private void DrawImpl(GameTime gameTime) + { + if (Game1.debugMode) + { + if (SGame._fpsStopwatch.IsRunning) + { + float totalSeconds = (float)SGame._fpsStopwatch.Elapsed.TotalSeconds; + SGame._fpsList.Add(totalSeconds); + while (SGame._fpsList.Count >= 120) + SGame._fpsList.RemoveAt(0); + float num = 0.0f; + foreach (float fps in SGame._fpsList) + num += fps; + SGame._fps = (float)(1.0 / ((double)num / (double)SGame._fpsList.Count)); + } + SGame._fpsStopwatch.Restart(); + } + else + { + if (SGame._fpsStopwatch.IsRunning) + SGame._fpsStopwatch.Reset(); + SGame._fps = 0.0f; + SGame._fpsList.Clear(); + } + if (SGame._newDayTask != null) + { + this.GraphicsDevice.Clear(this.bgColor); + //base.Draw(gameTime); + } + else + { + if ((double)Game1.options.zoomLevel != 1.0) + this.GraphicsDevice.SetRenderTarget(this.screenWrapper); + if (this.IsSaving) + { + this.GraphicsDevice.Clear(this.bgColor); + IClickableMenu activeClickableMenu = Game1.activeClickableMenu; + if (activeClickableMenu != null) + { + Game1.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null); + try + { + this.Events.Graphics_OnPreRenderGuiEvent.Raise(); + activeClickableMenu.draw(Game1.spriteBatch); + this.Events.Graphics_OnPostRenderGuiEvent.Raise(); + } + catch (Exception ex) + { + this.Monitor.Log($"The {activeClickableMenu.GetType().FullName} menu crashed while drawing itself during save. SMAPI will force it to exit to avoid crashing the game.\n{ex.GetLogSummary()}", LogLevel.Error); + activeClickableMenu.exitThisMenu(); + } + this.RaisePostRender(); + Game1.spriteBatch.End(); + } + //base.Draw(gameTime); + this.renderScreenBuffer(); + } + else + { + this.GraphicsDevice.Clear(this.bgColor); + if (Game1.activeClickableMenu != null && Game1.options.showMenuBackground && Game1.activeClickableMenu.showWithoutTransparencyIfOptionIsSet()) + { + Game1.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null); + try + { + Game1.activeClickableMenu.drawBackground(Game1.spriteBatch); + this.Events.Graphics_OnPreRenderGuiEvent.Raise(); + Game1.activeClickableMenu.draw(Game1.spriteBatch); + this.Events.Graphics_OnPostRenderGuiEvent.Raise(); + } + catch (Exception ex) + { + this.Monitor.Log($"The {Game1.activeClickableMenu.GetType().FullName} menu crashed while drawing itself. SMAPI will force it to exit to avoid crashing the game.\n{ex.GetLogSummary()}", LogLevel.Error); + Game1.activeClickableMenu.exitThisMenu(); + } + this.RaisePostRender(); + Game1.spriteBatch.End(); + if ((double)Game1.options.zoomLevel != 1.0) + { + this.GraphicsDevice.SetRenderTarget((RenderTarget2D)null); + this.GraphicsDevice.Clear(this.bgColor); + Game1.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.Default, RasterizerState.CullNone); + Game1.spriteBatch.Draw((Texture2D)this.screenWrapper, Vector2.Zero, new Microsoft.Xna.Framework.Rectangle?(this.screenWrapper.Bounds), Color.White, 0.0f, Vector2.Zero, Game1.options.zoomLevel, SpriteEffects.None, 1f); + Game1.spriteBatch.End(); + } + this.drawOverlays(Game1.spriteBatch); + } + else if ((int)Game1.gameMode == 11) + { + Game1.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null); + Game1.spriteBatch.DrawString(Game1.dialogueFont, Game1.content.LoadString("Strings\\StringsFromCSFiles:Game1.cs.3685"), new Vector2(16f, 16f), Color.HotPink); + Game1.spriteBatch.DrawString(Game1.dialogueFont, Game1.content.LoadString("Strings\\StringsFromCSFiles:Game1.cs.3686"), new Vector2(16f, 32f), new Color(0, (int)byte.MaxValue, 0)); + Game1.spriteBatch.DrawString(Game1.dialogueFont, Game1.parseText(Game1.errorMessage, Game1.dialogueFont, Game1.graphics.GraphicsDevice.Viewport.Width), new Vector2(16f, 48f), Color.White); + this.RaisePostRender(); + Game1.spriteBatch.End(); + } + else if (Game1.currentMinigame != null) + { + Game1.currentMinigame.draw(Game1.spriteBatch); + if (Game1.globalFade && !Game1.menuUp && (!Game1.nameSelectUp || Game1.messagePause)) + { + Game1.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null); + Game1.spriteBatch.Draw(Game1.fadeToBlackRect, Game1.graphics.GraphicsDevice.Viewport.Bounds, Color.Black * ((int)Game1.gameMode == 0 ? 1f - Game1.fadeToBlackAlpha : Game1.fadeToBlackAlpha)); + Game1.spriteBatch.End(); + } + this.RaisePostRender(needsNewBatch: true); + if ((double)Game1.options.zoomLevel != 1.0) + { + this.GraphicsDevice.SetRenderTarget((RenderTarget2D)null); + this.GraphicsDevice.Clear(this.bgColor); + Game1.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.Default, RasterizerState.CullNone); + Game1.spriteBatch.Draw((Texture2D)this.screenWrapper, Vector2.Zero, new Microsoft.Xna.Framework.Rectangle?(this.screenWrapper.Bounds), Color.White, 0.0f, Vector2.Zero, Game1.options.zoomLevel, SpriteEffects.None, 1f); + Game1.spriteBatch.End(); + } + this.drawOverlays(Game1.spriteBatch); + } + else if (Game1.showingEndOfNightStuff) + { + Game1.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null); + if (Game1.activeClickableMenu != null) + { + try + { + this.Events.Graphics_OnPreRenderGuiEvent.Raise(); + Game1.activeClickableMenu.draw(Game1.spriteBatch); + this.Events.Graphics_OnPostRenderGuiEvent.Raise(); + } + catch (Exception ex) + { + this.Monitor.Log($"The {Game1.activeClickableMenu.GetType().FullName} menu crashed while drawing itself during end-of-night-stuff. SMAPI will force it to exit to avoid crashing the game.\n{ex.GetLogSummary()}", LogLevel.Error); + Game1.activeClickableMenu.exitThisMenu(); + } + } + this.RaisePostRender(); + Game1.spriteBatch.End(); + if ((double)Game1.options.zoomLevel != 1.0) + { + this.GraphicsDevice.SetRenderTarget((RenderTarget2D)null); + this.GraphicsDevice.Clear(this.bgColor); + Game1.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.Default, RasterizerState.CullNone); + Game1.spriteBatch.Draw((Texture2D)this.screenWrapper, Vector2.Zero, new Microsoft.Xna.Framework.Rectangle?(this.screenWrapper.Bounds), Color.White, 0.0f, Vector2.Zero, Game1.options.zoomLevel, SpriteEffects.None, 1f); + Game1.spriteBatch.End(); + } + this.drawOverlays(Game1.spriteBatch); + } + else + { + int num1; + switch (Game1.gameMode) + { + case 3: + num1 = Game1.currentLocation == null ? 1 : 0; + break; + case 6: + num1 = 1; + break; + default: + num1 = 0; + break; + } + if (num1 != 0) + { + Game1.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null); + string str1 = ""; + for (int index = 0; (double)index < gameTime.TotalGameTime.TotalMilliseconds % 999.0 / 333.0; ++index) + str1 += "."; + string str2 = Game1.content.LoadString("Strings\\StringsFromCSFiles:Game1.cs.3688"); + string s = str2 + str1; + string str3 = str2 + "... "; + int widthOfString = SpriteText.getWidthOfString(str3); + int height = 64; + int x = 64; + int y = Game1.graphics.GraphicsDevice.Viewport.TitleSafeArea.Bottom - height; + SpriteText.drawString(Game1.spriteBatch, s, x, y, 999999, widthOfString, height, 1f, 0.88f, false, 0, str3, -1); + Game1.spriteBatch.End(); + if ((double)Game1.options.zoomLevel != 1.0) + { + this.GraphicsDevice.SetRenderTarget((RenderTarget2D)null); + this.GraphicsDevice.Clear(this.bgColor); + Game1.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.Default, RasterizerState.CullNone); + Game1.spriteBatch.Draw((Texture2D)this.screenWrapper, Vector2.Zero, new Microsoft.Xna.Framework.Rectangle?(this.screenWrapper.Bounds), Color.White, 0.0f, Vector2.Zero, Game1.options.zoomLevel, SpriteEffects.None, 1f); + Game1.spriteBatch.End(); + } + this.drawOverlays(Game1.spriteBatch); + } + else + { + Viewport viewport1; + if ((int)Game1.gameMode == 0) + { + Game1.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null); + } + else + { + Microsoft.Xna.Framework.Rectangle bounds; + if (Game1.drawLighting) + { + this.GraphicsDevice.SetRenderTarget(Game1.lightmap); + this.GraphicsDevice.Clear(Color.White * 0.0f); + Game1.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null); + Game1.spriteBatch.Draw(Game1.staminaRect, Game1.lightmap.Bounds, Game1.currentLocation.Name.StartsWith("UndergroundMine") ? Game1.mine.getLightingColor(gameTime) : (Game1.ambientLight.Equals(Color.White) || Game1.isRaining && (bool)((NetFieldBase)Game1.currentLocation.isOutdoors) ? Game1.outdoorLight : Game1.ambientLight)); + for (int index = 0; index < Game1.currentLightSources.Count; ++index) + { + if (Utility.isOnScreen((Vector2)((NetFieldBase)Game1.currentLightSources.ElementAt(index).position), (int)((double)(float)((NetFieldBase)Game1.currentLightSources.ElementAt(index).radius) * 64.0 * 4.0))) + { + SpriteBatch spriteBatch = Game1.spriteBatch; + Texture2D lightTexture = Game1.currentLightSources.ElementAt(index).lightTexture; + Vector2 position = Game1.GlobalToLocal(Game1.viewport, (Vector2)((NetFieldBase)Game1.currentLightSources.ElementAt(index).position)) / (float)(Game1.options.lightingQuality / 2); + Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(Game1.currentLightSources.ElementAt(index).lightTexture.Bounds); + Color color = (Color)((NetFieldBase)Game1.currentLightSources.ElementAt(index).color); + double num2 = 0.0; + bounds = Game1.currentLightSources.ElementAt(index).lightTexture.Bounds; + double x = (double)bounds.Center.X; + bounds = Game1.currentLightSources.ElementAt(index).lightTexture.Bounds; + double y = (double)bounds.Center.Y; + Vector2 origin = new Vector2((float)x, (float)y); + double num3 = (double)(float)((NetFieldBase)Game1.currentLightSources.ElementAt(index).radius) / (double)(Game1.options.lightingQuality / 2); + int num4 = 0; + double num5 = 0.899999976158142; + spriteBatch.Draw(lightTexture, position, sourceRectangle, color, (float)num2, origin, (float)num3, (SpriteEffects)num4, (float)num5); + } + } + Game1.spriteBatch.End(); + this.GraphicsDevice.SetRenderTarget((double)Game1.options.zoomLevel == 1.0 ? (RenderTarget2D)null : this.screenWrapper); + } + if (Game1.bloomDay && Game1.bloom != null) + Game1.bloom.BeginDraw(); + this.GraphicsDevice.Clear(this.bgColor); + Game1.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null); + this.Events.Graphics_OnPreRenderEvent.Raise(); + if (Game1.background != null) + Game1.background.draw(Game1.spriteBatch); + Game1.mapDisplayDevice.BeginScene(Game1.spriteBatch); + Game1.currentLocation.Map.GetLayer("Back").Draw(Game1.mapDisplayDevice, Game1.viewport, Location.Origin, false, 4); + Game1.currentLocation.drawWater(Game1.spriteBatch); + if (Game1.CurrentEvent == null) + { + foreach (NPC character in Game1.currentLocation.characters) + { + if (!(bool)((NetFieldBase)character.swimming) && !character.HideShadow && !character.IsInvisible && !Game1.currentLocation.shouldShadowBeDrawnAboveBuildingsLayer(character.getTileLocation())) + { + SpriteBatch spriteBatch = Game1.spriteBatch; + Texture2D shadowTexture = Game1.shadowTexture; + Vector2 local = Game1.GlobalToLocal(Game1.viewport, character.Position + new Vector2((float)(character.Sprite.SpriteWidth * 4) / 2f, (float)(character.GetBoundingBox().Height + (character.IsMonster ? 0 : 12)))); + Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(Game1.shadowTexture.Bounds); + Color white = Color.White; + double num2 = 0.0; + bounds = Game1.shadowTexture.Bounds; + double x = (double)bounds.Center.X; + bounds = Game1.shadowTexture.Bounds; + double y = (double)bounds.Center.Y; + Vector2 origin = new Vector2((float)x, (float)y); + double num3 = (4.0 + (double)character.yJumpOffset / 40.0) * (double)(float)((NetFieldBase)character.scale); + int num4 = 0; + double num5 = (double)Math.Max(0.0f, (float)character.getStandingY() / 10000f) - 9.99999997475243E-07; + spriteBatch.Draw(shadowTexture, local, sourceRectangle, white, (float)num2, origin, (float)num3, (SpriteEffects)num4, (float)num5); + } + } + } + else + { + foreach (NPC actor in Game1.CurrentEvent.actors) + { + if (!(bool)((NetFieldBase)actor.swimming) && !actor.HideShadow && !Game1.currentLocation.shouldShadowBeDrawnAboveBuildingsLayer(actor.getTileLocation())) + { + SpriteBatch spriteBatch = Game1.spriteBatch; + Texture2D shadowTexture = Game1.shadowTexture; + Vector2 local = Game1.GlobalToLocal(Game1.viewport, actor.Position + new Vector2((float)(actor.Sprite.SpriteWidth * 4) / 2f, (float)(actor.GetBoundingBox().Height + (actor.IsMonster ? 0 : (actor.Sprite.SpriteHeight <= 16 ? -4 : 12))))); + Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(Game1.shadowTexture.Bounds); + Color white = Color.White; + double num2 = 0.0; + bounds = Game1.shadowTexture.Bounds; + double x = (double)bounds.Center.X; + bounds = Game1.shadowTexture.Bounds; + double y = (double)bounds.Center.Y; + Vector2 origin = new Vector2((float)x, (float)y); + double num3 = (4.0 + (double)actor.yJumpOffset / 40.0) * (double)(float)((NetFieldBase)actor.scale); + int num4 = 0; + double num5 = (double)Math.Max(0.0f, (float)actor.getStandingY() / 10000f) - 9.99999997475243E-07; + spriteBatch.Draw(shadowTexture, local, sourceRectangle, white, (float)num2, origin, (float)num3, (SpriteEffects)num4, (float)num5); + } + } + } + Game1.currentLocation.Map.GetLayer("Buildings").Draw(Game1.mapDisplayDevice, Game1.viewport, Location.Origin, false, 4); + Game1.mapDisplayDevice.EndScene(); + Game1.spriteBatch.End(); + Game1.spriteBatch.Begin(SpriteSortMode.FrontToBack, BlendState.AlphaBlend, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null); + if (Game1.CurrentEvent == null) + { + foreach (NPC character in Game1.currentLocation.characters) + { + if (!(bool)((NetFieldBase)character.swimming) && !character.HideShadow && Game1.currentLocation.shouldShadowBeDrawnAboveBuildingsLayer(character.getTileLocation())) + Game1.spriteBatch.Draw(Game1.shadowTexture, Game1.GlobalToLocal(Game1.viewport, character.Position + new Vector2((float)(character.Sprite.SpriteWidth * 4) / 2f, (float)(character.GetBoundingBox().Height + (character.IsMonster ? 0 : 12)))), new Microsoft.Xna.Framework.Rectangle?(Game1.shadowTexture.Bounds), Color.White, 0.0f, new Vector2((float)Game1.shadowTexture.Bounds.Center.X, (float)Game1.shadowTexture.Bounds.Center.Y), (float)(4.0 + (double)character.yJumpOffset / 40.0) * (float)((NetFieldBase)character.scale), SpriteEffects.None, Math.Max(0.0f, (float)character.getStandingY() / 10000f) - 1E-06f); + } + } + else + { + foreach (NPC actor in Game1.CurrentEvent.actors) + { + if (!(bool)((NetFieldBase)actor.swimming) && !actor.HideShadow && Game1.currentLocation.shouldShadowBeDrawnAboveBuildingsLayer(actor.getTileLocation())) + Game1.spriteBatch.Draw(Game1.shadowTexture, Game1.GlobalToLocal(Game1.viewport, actor.Position + new Vector2((float)(actor.Sprite.SpriteWidth * 4) / 2f, (float)(actor.GetBoundingBox().Height + (actor.IsMonster ? 0 : 12)))), new Microsoft.Xna.Framework.Rectangle?(Game1.shadowTexture.Bounds), Color.White, 0.0f, new Vector2((float)Game1.shadowTexture.Bounds.Center.X, (float)Game1.shadowTexture.Bounds.Center.Y), (float)(4.0 + (double)actor.yJumpOffset / 40.0) * (float)((NetFieldBase)actor.scale), SpriteEffects.None, Math.Max(0.0f, (float)actor.getStandingY() / 10000f) - 1E-06f); + } + } + if ((Game1.eventUp || Game1.killScreen) && (!Game1.killScreen && Game1.currentLocation.currentEvent != null)) + Game1.currentLocation.currentEvent.draw(Game1.spriteBatch); + if (Game1.player.currentUpgrade != null && Game1.player.currentUpgrade.daysLeftTillUpgradeDone <= 3 && Game1.currentLocation.Name.Equals("Farm")) + Game1.spriteBatch.Draw(Game1.player.currentUpgrade.workerTexture, Game1.GlobalToLocal(Game1.viewport, Game1.player.currentUpgrade.positionOfCarpenter), new Microsoft.Xna.Framework.Rectangle?(Game1.player.currentUpgrade.getSourceRectangle()), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, (float)(((double)Game1.player.currentUpgrade.positionOfCarpenter.Y + 48.0) / 10000.0)); + Game1.currentLocation.draw(Game1.spriteBatch); + if (!Game1.eventUp || Game1.currentLocation.currentEvent == null || Game1.currentLocation.currentEvent.messageToScreen == null) + ; + if (Game1.player.ActiveObject == null && ((Game1.player.UsingTool || Game1.pickingTool) && Game1.player.CurrentTool != null && (!Game1.player.CurrentTool.Name.Equals("Seeds") || Game1.pickingTool))) + Game1.drawTool(Game1.player); + if (Game1.currentLocation.Name.Equals("Farm")) + this.drawFarmBuildings(); + if (Game1.tvStation >= 0) + Game1.spriteBatch.Draw(Game1.tvStationTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2(400f, 160f)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(Game1.tvStation * 24, 0, 24, 15)), Color.White, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 1E-08f); + if (Game1.panMode) + { + Game1.spriteBatch.Draw(Game1.fadeToBlackRect, new Microsoft.Xna.Framework.Rectangle((int)Math.Floor((double)(Game1.getOldMouseX() + Game1.viewport.X) / 64.0) * 64 - Game1.viewport.X, (int)Math.Floor((double)(Game1.getOldMouseY() + Game1.viewport.Y) / 64.0) * 64 - Game1.viewport.Y, 64, 64), Color.Lime * 0.75f); + foreach (Warp warp in (NetList>)Game1.currentLocation.warps) + Game1.spriteBatch.Draw(Game1.fadeToBlackRect, new Microsoft.Xna.Framework.Rectangle(warp.X * 64 - Game1.viewport.X, warp.Y * 64 - Game1.viewport.Y, 64, 64), Color.Red * 0.75f); + } + Game1.mapDisplayDevice.BeginScene(Game1.spriteBatch); + Game1.currentLocation.Map.GetLayer("Front").Draw(Game1.mapDisplayDevice, Game1.viewport, Location.Origin, false, 4); + Game1.mapDisplayDevice.EndScene(); + Game1.currentLocation.drawAboveFrontLayer(Game1.spriteBatch); + Game1.spriteBatch.End(); + Game1.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null); + if (Game1.displayFarmer && Game1.player.ActiveObject != null && ((bool)((NetFieldBase)Game1.player.ActiveObject.bigCraftable) && this.checkBigCraftableBoundariesForFrontLayer()) && Game1.currentLocation.Map.GetLayer("Front").PickTile(new Location(Game1.player.getStandingX(), Game1.player.getStandingY()), Game1.viewport.Size) == null) + Game1.drawPlayerHeldObject(Game1.player); + else if (Game1.displayFarmer && Game1.player.ActiveObject != null && (Game1.currentLocation.Map.GetLayer("Front").PickTile(new Location((int)Game1.player.Position.X, (int)Game1.player.Position.Y - 38), Game1.viewport.Size) != null && !Game1.currentLocation.Map.GetLayer("Front").PickTile(new Location((int)Game1.player.Position.X, (int)Game1.player.Position.Y - 38), Game1.viewport.Size).TileIndexProperties.ContainsKey("FrontAlways") || Game1.currentLocation.Map.GetLayer("Front").PickTile(new Location(Game1.player.GetBoundingBox().Right, (int)Game1.player.Position.Y - 38), Game1.viewport.Size) != null && !Game1.currentLocation.Map.GetLayer("Front").PickTile(new Location(Game1.player.GetBoundingBox().Right, (int)Game1.player.Position.Y - 38), Game1.viewport.Size).TileIndexProperties.ContainsKey("FrontAlways"))) + Game1.drawPlayerHeldObject(Game1.player); + if ((Game1.player.UsingTool || Game1.pickingTool) && Game1.player.CurrentTool != null && ((!Game1.player.CurrentTool.Name.Equals("Seeds") || Game1.pickingTool) && Game1.currentLocation.Map.GetLayer("Front").PickTile(new Location(Game1.player.getStandingX(), (int)Game1.player.Position.Y - 38), Game1.viewport.Size) != null) && Game1.currentLocation.Map.GetLayer("Front").PickTile(new Location(Game1.player.getStandingX(), Game1.player.getStandingY()), Game1.viewport.Size) == null) + Game1.drawTool(Game1.player); + if (Game1.currentLocation.Map.GetLayer("AlwaysFront") != null) + { + Game1.mapDisplayDevice.BeginScene(Game1.spriteBatch); + Game1.currentLocation.Map.GetLayer("AlwaysFront").Draw(Game1.mapDisplayDevice, Game1.viewport, Location.Origin, false, 4); + Game1.mapDisplayDevice.EndScene(); + } + if ((double)Game1.toolHold > 400.0 && Game1.player.CurrentTool.UpgradeLevel >= 1 && Game1.player.canReleaseTool) + { + Color color = Color.White; + switch ((int)((double)Game1.toolHold / 600.0) + 2) + { + case 1: + color = Tool.copperColor; + break; + case 2: + color = Tool.steelColor; + break; + case 3: + color = Tool.goldColor; + break; + case 4: + color = Tool.iridiumColor; + break; + } + Game1.spriteBatch.Draw(Game1.littleEffect, new Microsoft.Xna.Framework.Rectangle((int)Game1.player.getLocalPosition(Game1.viewport).X - 2, (int)Game1.player.getLocalPosition(Game1.viewport).Y - (Game1.player.CurrentTool.Name.Equals("Watering Can") ? 0 : 64) - 2, (int)((double)Game1.toolHold % 600.0 * 0.0799999982118607) + 4, 12), Color.Black); + Game1.spriteBatch.Draw(Game1.littleEffect, new Microsoft.Xna.Framework.Rectangle((int)Game1.player.getLocalPosition(Game1.viewport).X, (int)Game1.player.getLocalPosition(Game1.viewport).Y - (Game1.player.CurrentTool.Name.Equals("Watering Can") ? 0 : 64), (int)((double)Game1.toolHold % 600.0 * 0.0799999982118607), 8), color); + } + if (Game1.isDebrisWeather && Game1.currentLocation.IsOutdoors && (!(bool)((NetFieldBase)Game1.currentLocation.ignoreDebrisWeather) && !Game1.currentLocation.Name.Equals("Desert")) && Game1.viewport.X > -10) + { + foreach (WeatherDebris weatherDebris in Game1.debrisWeather) + weatherDebris.draw(Game1.spriteBatch); + } + if (Game1.farmEvent != null) + Game1.farmEvent.draw(Game1.spriteBatch); + if ((double)Game1.currentLocation.LightLevel > 0.0 && Game1.timeOfDay < 2000) + Game1.spriteBatch.Draw(Game1.fadeToBlackRect, Game1.graphics.GraphicsDevice.Viewport.Bounds, Color.Black * Game1.currentLocation.LightLevel); + if (Game1.screenGlow) + Game1.spriteBatch.Draw(Game1.fadeToBlackRect, Game1.graphics.GraphicsDevice.Viewport.Bounds, Game1.screenGlowColor * Game1.screenGlowAlpha); + Game1.currentLocation.drawAboveAlwaysFrontLayer(Game1.spriteBatch); + if (Game1.player.CurrentTool != null && Game1.player.CurrentTool is FishingRod && ((Game1.player.CurrentTool as FishingRod).isTimingCast || (double)(Game1.player.CurrentTool as FishingRod).castingChosenCountdown > 0.0 || (Game1.player.CurrentTool as FishingRod).fishCaught || (Game1.player.CurrentTool as FishingRod).showingTreasure)) + Game1.player.CurrentTool.draw(Game1.spriteBatch); + if (Game1.isRaining && Game1.currentLocation.IsOutdoors && (!Game1.currentLocation.Name.Equals("Desert") && !(Game1.currentLocation is Summit)) && (!Game1.eventUp || Game1.currentLocation.isTileOnMap(new Vector2((float)(Game1.viewport.X / 64), (float)(Game1.viewport.Y / 64))))) + { + for (int index = 0; index < Game1.rainDrops.Length; ++index) + Game1.spriteBatch.Draw(Game1.rainTexture, Game1.rainDrops[index].position, new Microsoft.Xna.Framework.Rectangle?(Game1.getSourceRectForStandardTileSheet(Game1.rainTexture, Game1.rainDrops[index].frame, -1, -1)), Color.White); + } + Game1.spriteBatch.End(); + //base.Draw(gameTime); + Game1.spriteBatch.Begin(SpriteSortMode.FrontToBack, BlendState.AlphaBlend, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null); + if (Game1.eventUp && Game1.currentLocation.currentEvent != null) + { + foreach (NPC actor in Game1.currentLocation.currentEvent.actors) + { + if (actor.isEmoting) + { + Vector2 localPosition = actor.getLocalPosition(Game1.viewport); + localPosition.Y -= 140f; + if (actor.Age == 2) + localPosition.Y += 32f; + else if (actor.Gender == 1) + localPosition.Y += 10f; + Game1.spriteBatch.Draw(Game1.emoteSpriteSheet, localPosition, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(actor.CurrentEmoteIndex * 16 % Game1.emoteSpriteSheet.Width, actor.CurrentEmoteIndex * 16 / Game1.emoteSpriteSheet.Width * 16, 16, 16)), Color.White, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, (float)actor.getStandingY() / 10000f); + } + } + } + Game1.spriteBatch.End(); + if (Game1.drawLighting) + { + Game1.spriteBatch.Begin(SpriteSortMode.Deferred, this.lightingBlend, SamplerState.LinearClamp, (DepthStencilState)null, (RasterizerState)null); + Game1.spriteBatch.Draw((Texture2D)Game1.lightmap, Vector2.Zero, new Microsoft.Xna.Framework.Rectangle?(Game1.lightmap.Bounds), Color.White, 0.0f, Vector2.Zero, (float)(Game1.options.lightingQuality / 2), SpriteEffects.None, 1f); + if (Game1.isRaining && (bool)((NetFieldBase)Game1.currentLocation.isOutdoors) && !(Game1.currentLocation is Desert)) + Game1.spriteBatch.Draw(Game1.staminaRect, Game1.graphics.GraphicsDevice.Viewport.Bounds, Color.OrangeRed * 0.45f); + Game1.spriteBatch.End(); + } + Game1.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null); + if (Game1.drawGrid) + { + int num2 = -Game1.viewport.X % 64; + float num3 = (float)(-Game1.viewport.Y % 64); + int num4 = num2; + while (true) + { + int num5 = num4; + viewport1 = Game1.graphics.GraphicsDevice.Viewport; + int width1 = viewport1.Width; + if (num5 < width1) + { + SpriteBatch spriteBatch = Game1.spriteBatch; + Texture2D staminaRect = Game1.staminaRect; + int x = num4; + int y = (int)num3; + int width2 = 1; + viewport1 = Game1.graphics.GraphicsDevice.Viewport; + int height = viewport1.Height; + Microsoft.Xna.Framework.Rectangle destinationRectangle = new Microsoft.Xna.Framework.Rectangle(x, y, width2, height); + Color color = Color.Red * 0.5f; + spriteBatch.Draw(staminaRect, destinationRectangle, color); + num4 += 64; + } + else + break; + } + float num6 = num3; + while (true) + { + double num5 = (double)num6; + viewport1 = Game1.graphics.GraphicsDevice.Viewport; + double height1 = (double)viewport1.Height; + if (num5 < height1) + { + SpriteBatch spriteBatch = Game1.spriteBatch; + Texture2D staminaRect = Game1.staminaRect; + int x = num2; + int y = (int)num6; + viewport1 = Game1.graphics.GraphicsDevice.Viewport; + int width = viewport1.Width; + int height2 = 1; + Microsoft.Xna.Framework.Rectangle destinationRectangle = new Microsoft.Xna.Framework.Rectangle(x, y, width, height2); + Color color = Color.Red * 0.5f; + spriteBatch.Draw(staminaRect, destinationRectangle, color); + num6 += 64f; + } + else + break; + } + } + if ((uint)Game1.currentBillboard > 0U) + this.drawBillboard(); + if ((Game1.displayHUD || Game1.eventUp) && (Game1.currentBillboard == 0 && (int)Game1.gameMode == 3) && (!Game1.freezeControls && !Game1.panMode) && !Game1.HostPaused) + { + this.Events.Graphics_OnPreRenderHudEvent.Raise(); + this.drawHUD(); + this.Events.Graphics_OnPostRenderHudEvent.Raise(); + } + else if (Game1.activeClickableMenu == null && Game1.farmEvent == null) + Game1.spriteBatch.Draw(Game1.mouseCursors, new Vector2((float)Game1.getOldMouseX(), (float)Game1.getOldMouseY()), new Microsoft.Xna.Framework.Rectangle?(Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 0, 16, 16)), Color.White, 0.0f, Vector2.Zero, (float)(4.0 + (double)Game1.dialogueButtonScale / 150.0), SpriteEffects.None, 1f); + if (Game1.hudMessages.Count > 0 && (!Game1.eventUp || Game1.isFestival())) + { + for (int i = Game1.hudMessages.Count - 1; i >= 0; --i) + Game1.hudMessages[i].draw(Game1.spriteBatch, i); + } + } + if (Game1.farmEvent != null) + Game1.farmEvent.draw(Game1.spriteBatch); + if (Game1.dialogueUp && !Game1.nameSelectUp && !Game1.messagePause && (Game1.activeClickableMenu == null || !(Game1.activeClickableMenu is DialogueBox))) + this.drawDialogueBox(); + if (Game1.progressBar) + { + SpriteBatch spriteBatch1 = Game1.spriteBatch; + Texture2D fadeToBlackRect = Game1.fadeToBlackRect; + viewport1 = Game1.graphics.GraphicsDevice.Viewport; + int x1 = (viewport1.TitleSafeArea.Width - Game1.dialogueWidth) / 2; + viewport1 = Game1.graphics.GraphicsDevice.Viewport; + Microsoft.Xna.Framework.Rectangle titleSafeArea = viewport1.TitleSafeArea; + int y1 = titleSafeArea.Bottom - 128; + int dialogueWidth = Game1.dialogueWidth; + int height1 = 32; + Microsoft.Xna.Framework.Rectangle destinationRectangle1 = new Microsoft.Xna.Framework.Rectangle(x1, y1, dialogueWidth, height1); + Color lightGray = Color.LightGray; + spriteBatch1.Draw(fadeToBlackRect, destinationRectangle1, lightGray); + SpriteBatch spriteBatch2 = Game1.spriteBatch; + Texture2D staminaRect = Game1.staminaRect; + viewport1 = Game1.graphics.GraphicsDevice.Viewport; + int x2 = (viewport1.TitleSafeArea.Width - Game1.dialogueWidth) / 2; + viewport1 = Game1.graphics.GraphicsDevice.Viewport; + titleSafeArea = viewport1.TitleSafeArea; + int y2 = titleSafeArea.Bottom - 128; + int width = (int)((double)Game1.pauseAccumulator / (double)Game1.pauseTime * (double)Game1.dialogueWidth); + int height2 = 32; + Microsoft.Xna.Framework.Rectangle destinationRectangle2 = new Microsoft.Xna.Framework.Rectangle(x2, y2, width, height2); + Color dimGray = Color.DimGray; + spriteBatch2.Draw(staminaRect, destinationRectangle2, dimGray); + } + if (Game1.eventUp && (Game1.currentLocation != null && Game1.currentLocation.currentEvent != null)) + Game1.currentLocation.currentEvent.drawAfterMap(Game1.spriteBatch); + if (Game1.isRaining && (Game1.currentLocation != null && (bool)((NetFieldBase)Game1.currentLocation.isOutdoors) && !(Game1.currentLocation is Desert))) + { + SpriteBatch spriteBatch = Game1.spriteBatch; + Texture2D staminaRect = Game1.staminaRect; + viewport1 = Game1.graphics.GraphicsDevice.Viewport; + Microsoft.Xna.Framework.Rectangle bounds = viewport1.Bounds; + Color color = Color.Blue * 0.2f; + spriteBatch.Draw(staminaRect, bounds, color); + } + if ((Game1.fadeToBlack || Game1.globalFade) && !Game1.menuUp && (!Game1.nameSelectUp || Game1.messagePause)) + { + SpriteBatch spriteBatch = Game1.spriteBatch; + Texture2D fadeToBlackRect = Game1.fadeToBlackRect; + viewport1 = Game1.graphics.GraphicsDevice.Viewport; + Microsoft.Xna.Framework.Rectangle bounds = viewport1.Bounds; + Color color = Color.Black * ((int)Game1.gameMode == 0 ? 1f - Game1.fadeToBlackAlpha : Game1.fadeToBlackAlpha); + spriteBatch.Draw(fadeToBlackRect, bounds, color); + } + else if ((double)Game1.flashAlpha > 0.0) + { + if (Game1.options.screenFlash) + { + SpriteBatch spriteBatch = Game1.spriteBatch; + Texture2D fadeToBlackRect = Game1.fadeToBlackRect; + viewport1 = Game1.graphics.GraphicsDevice.Viewport; + Microsoft.Xna.Framework.Rectangle bounds = viewport1.Bounds; + Color color = Color.White * Math.Min(1f, Game1.flashAlpha); + spriteBatch.Draw(fadeToBlackRect, bounds, color); + } + Game1.flashAlpha -= 0.1f; + } + if ((Game1.messagePause || Game1.globalFade) && Game1.dialogueUp) + this.drawDialogueBox(); + foreach (TemporaryAnimatedSprite overlayTempSprite in Game1.screenOverlayTempSprites) + overlayTempSprite.draw(Game1.spriteBatch, true, 0, 0, 1f); + if (Game1.debugMode) + { + SpriteBatch spriteBatch = Game1.spriteBatch; + SpriteFont smallFont = Game1.smallFont; + object[] objArray = new object[10]; + int index = 0; + string str; + if (!Game1.panMode) + str = "player: " + (object)(Game1.player.getStandingX() / 64) + ", " + (object)(Game1.player.getStandingY() / 64); + else + str = ((Game1.getOldMouseX() + Game1.viewport.X) / 64).ToString() + "," + (object)((Game1.getOldMouseY() + Game1.viewport.Y) / 64); + objArray[index] = (object)str; + objArray[1] = (object)" mouseTransparency: "; + objArray[2] = (object)Game1.mouseCursorTransparency; + objArray[3] = (object)" mousePosition: "; + objArray[4] = (object)Game1.getMouseX(); + objArray[5] = (object)","; + objArray[6] = (object)Game1.getMouseY(); + objArray[7] = (object)Environment.NewLine; + objArray[8] = (object)"debugOutput: "; + objArray[9] = (object)Game1.debugOutput; + string text = string.Concat(objArray); + Viewport viewport2 = this.GraphicsDevice.Viewport; + double x = (double)viewport2.TitleSafeArea.X; + viewport2 = this.GraphicsDevice.Viewport; + double y = (double)viewport2.TitleSafeArea.Y; + Vector2 position = new Vector2((float)x, (float)y); + Color red = Color.Red; + double num2 = 0.0; + Vector2 zero = Vector2.Zero; + double num3 = 1.0; + int num4 = 0; + double num5 = 0.99999988079071; + spriteBatch.DrawString(smallFont, text, position, red, (float)num2, zero, (float)num3, (SpriteEffects)num4, (float)num5); + } + if (Game1.showKeyHelp) + Game1.spriteBatch.DrawString(Game1.smallFont, Game1.keyHelpString, new Vector2(64f, (float)(Game1.viewport.Height - 64 - (Game1.dialogueUp ? 192 + (Game1.isQuestion ? Game1.questionChoices.Count * 64 : 0) : 0)) - Game1.smallFont.MeasureString(Game1.keyHelpString).Y), Color.LightGray, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.9999999f); + if (Game1.activeClickableMenu != null) + { + try + { + this.Events.Graphics_OnPreRenderGuiEvent.Raise(); + Game1.activeClickableMenu.draw(Game1.spriteBatch); + this.Events.Graphics_OnPostRenderGuiEvent.Raise(); + } + catch (Exception ex) + { + this.Monitor.Log($"The {Game1.activeClickableMenu.GetType().FullName} menu crashed while drawing itself. SMAPI will force it to exit to avoid crashing the game.\n{ex.GetLogSummary()}", LogLevel.Error); + Game1.activeClickableMenu.exitThisMenu(); + } + } + else if (Game1.farmEvent != null) + Game1.farmEvent.drawAboveEverything(Game1.spriteBatch); + if (Game1.HostPaused) + { + string s = Game1.content.LoadString("Strings\\StringsFromCSFiles:DayTimeMoneyBox.cs.10378"); + SpriteText.drawStringWithScrollBackground(Game1.spriteBatch, s, 96, 32, "", 1f, -1); + } + this.RaisePostRender(); + Game1.spriteBatch.End(); + this.drawOverlays(Game1.spriteBatch); + this.renderScreenBuffer(); + } + } + } + } + } +#else private void DrawImpl(GameTime gameTime) { if (Game1.debugMode) @@ -1301,6 +1929,7 @@ namespace StardewModdingAPI.Framework } } } +#endif /**** ** Methods diff --git a/src/SMAPI/Metadata/CoreAssets.cs b/src/SMAPI/Metadata/CoreAssets.cs index 5a98da4b..c027df25 100644 --- a/src/SMAPI/Metadata/CoreAssets.cs +++ b/src/SMAPI/Metadata/CoreAssets.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework.Graphics; using StardewModdingAPI.Framework; +using StardewModdingAPI.Framework.Reflection; using StardewValley; using StardewValley.BellsAndWhistles; using StardewValley.Buildings; @@ -31,7 +32,8 @@ namespace StardewModdingAPI.Metadata *********/ /// Initialise the core asset data. /// Normalises an asset key to match the cache key. - public CoreAssets(Func getNormalisedPath) + /// Simplifies access to private code. + public CoreAssets(Func getNormalisedPath, Reflector reflection) { this.GetNormalisedPath = getNormalisedPath; this.SingletonSetters = @@ -82,6 +84,25 @@ namespace StardewModdingAPI.Metadata // from Game1.ResetToolSpriteSheet ["TileSheets\\tools"] = (content, key) => Game1.ResetToolSpriteSheet(), +#if STARDEW_VALLEY_1_3 + // from Bush + ["TileSheets\\bushes"] = (content, key) => reflection.GetField>(typeof(Bush), "texture").SetValue(new Lazy(() => content.Load(key))), + + // from Farm + ["Buildings\\houses"] = (content, key) => reflection.GetField(typeof(Farm), nameof(Farm.houseTextures)).SetValue(content.Load(key)), + + // from Farmer + ["Characters\\Farmer\\farmer_base"] = (content, key) => + { + if (Game1.player != null && Game1.player.isMale) + Game1.player.FarmerRenderer = new FarmerRenderer(key); + }, + ["Characters\\Farmer\\farmer_girl_base"] = (content, key) => + { + if (Game1.player != null && !Game1.player.isMale) + Game1.player.FarmerRenderer = new FarmerRenderer(key); + }, +#else // from Bush ["TileSheets\\bushes"] = (content, key) => Bush.texture = content.Load(key), @@ -107,6 +128,7 @@ namespace StardewModdingAPI.Metadata if (Game1.player != null && !Game1.player.isMale) Game1.player.FarmerRenderer = new FarmerRenderer(content.Load(key)); }, +#endif // from Flooring ["TerrainFeatures\\Flooring"] = (content, key) => Flooring.floorsTexture = content.Load(key), @@ -144,9 +166,15 @@ namespace StardewModdingAPI.Metadata Building[] buildings = this.GetAllBuildings().Where(p => key == this.GetNormalisedPath($"Buildings\\{p.buildingType}")).ToArray(); if (buildings.Any()) { +#if STARDEW_VALLEY_1_3 + foreach (Building building in buildings) + building.texture = new Lazy(() => content.Load(key)); +#else Texture2D texture = content.Load(key); foreach (Building building in buildings) building.texture = texture; +#endif + return true; } return false; @@ -162,9 +190,11 @@ namespace StardewModdingAPI.Metadata /// Get all player-constructed buildings in the world. private IEnumerable GetAllBuildings() { - return Game1.locations - .OfType() - .SelectMany(p => p.buildings); + foreach (BuildableGameLocation location in Game1.locations.OfType()) + { + foreach (Building building in location.buildings) + yield return building; + } } } } diff --git a/src/SMAPI/Program.cs b/src/SMAPI/Program.cs index 1a1b9645..9c00e581 100644 --- a/src/SMAPI/Program.cs +++ b/src/SMAPI/Program.cs @@ -247,6 +247,7 @@ namespace StardewModdingAPI try { this.IsGameRunning = true; + StardewValley.Program.releaseBuild = true; // game's debug logic interferes with SMAPI opening the game window this.GameInstance.Run(); } catch (Exception ex) -- cgit From 6db91f832998ab07e7a937c25b32f1151a0274bc Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 11 Mar 2018 19:10:27 -0400 Subject: drop support for some deprecated APIs in the Stardew Valley 1.3 branch (#453) --- docs/release-notes.md | 3 +++ src/SMAPI/Events/EventArgsInput.cs | 2 ++ src/SMAPI/Framework/ModHelpers/ReflectionHelper.cs | 3 ++- src/SMAPI/Framework/Reflection/ReflectedField.cs | 5 ++++- src/SMAPI/Framework/Reflection/ReflectedMethod.cs | 5 ++++- src/SMAPI/Framework/Reflection/ReflectedProperty.cs | 5 ++++- src/SMAPI/IPrivateField.cs | 2 ++ src/SMAPI/IPrivateMethod.cs | 2 ++ src/SMAPI/IPrivateProperty.cs | 2 ++ src/SMAPI/IReflectionHelper.cs | 2 ++ 10 files changed, 27 insertions(+), 4 deletions(-) (limited to 'docs/release-notes.md') diff --git a/docs/release-notes.md b/docs/release-notes.md index 05a95fc1..2d71da7f 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -3,6 +3,9 @@ * For players: * Updated for Stardew Valley 1.3 (multiplayer update); no longer compatible with earlier versions. +* For modders: + * Dropped support for some deprecated APIs. + ## 2.5.3 * For players: * Simplified and improved skipped-incompatible-mod messages. diff --git a/src/SMAPI/Events/EventArgsInput.cs b/src/SMAPI/Events/EventArgsInput.cs index a5325b76..75b9b8cd 100644 --- a/src/SMAPI/Events/EventArgsInput.cs +++ b/src/SMAPI/Events/EventArgsInput.cs @@ -18,9 +18,11 @@ namespace StardewModdingAPI.Events /// The current cursor position. public ICursorPosition Cursor { get; } +#if !STARDEW_VALLEY_1_3 /// Whether the input is considered a 'click' by the game for enabling action. [Obsolete("Use " + nameof(EventArgsInput.IsActionButton) + " or " + nameof(EventArgsInput.IsUseToolButton) + " instead")] // deprecated in SMAPI 2.1 public bool IsClick => this.IsActionButton; +#endif /// Whether the input should trigger actions on the affected tile. public bool IsActionButton { get; } diff --git a/src/SMAPI/Framework/ModHelpers/ReflectionHelper.cs b/src/SMAPI/Framework/ModHelpers/ReflectionHelper.cs index 81453003..e5bf47f6 100644 --- a/src/SMAPI/Framework/ModHelpers/ReflectionHelper.cs +++ b/src/SMAPI/Framework/ModHelpers/ReflectionHelper.cs @@ -107,7 +107,7 @@ namespace StardewModdingAPI.Framework.ModHelpers ); } - +#if !STARDEW_VALLEY_1_3 /**** ** Obsolete ****/ @@ -221,6 +221,7 @@ namespace StardewModdingAPI.Framework.ModHelpers this.DeprecationManager.Warn($"{nameof(IReflectionHelper)}.GetPrivate*", "2.3", DeprecationLevel.Notice); return (IPrivateMethod)this.GetMethod(type, name, required); } +#endif /********* diff --git a/src/SMAPI/Framework/Reflection/ReflectedField.cs b/src/SMAPI/Framework/Reflection/ReflectedField.cs index ad1557bb..fb420dc5 100644 --- a/src/SMAPI/Framework/Reflection/ReflectedField.cs +++ b/src/SMAPI/Framework/Reflection/ReflectedField.cs @@ -5,7 +5,10 @@ namespace StardewModdingAPI.Framework.Reflection { /// A field obtained through reflection. /// The field value type. - internal class ReflectedField : IPrivateField, IReflectedField + internal class ReflectedField : IReflectedField +#if !STARDEW_VALLEY_1_3 + , IPrivateField +#endif { /********* ** Properties diff --git a/src/SMAPI/Framework/Reflection/ReflectedMethod.cs b/src/SMAPI/Framework/Reflection/ReflectedMethod.cs index 376de869..803bc316 100644 --- a/src/SMAPI/Framework/Reflection/ReflectedMethod.cs +++ b/src/SMAPI/Framework/Reflection/ReflectedMethod.cs @@ -4,7 +4,10 @@ using System.Reflection; namespace StardewModdingAPI.Framework.Reflection { /// A method obtained through reflection. - internal class ReflectedMethod : IPrivateMethod, IReflectedMethod + internal class ReflectedMethod : IReflectedMethod +#if !STARDEW_VALLEY_1_3 + , IPrivateMethod +#endif { /********* ** Properties diff --git a/src/SMAPI/Framework/Reflection/ReflectedProperty.cs b/src/SMAPI/Framework/Reflection/ReflectedProperty.cs index d6c964c1..4f9d4e19 100644 --- a/src/SMAPI/Framework/Reflection/ReflectedProperty.cs +++ b/src/SMAPI/Framework/Reflection/ReflectedProperty.cs @@ -5,7 +5,10 @@ namespace StardewModdingAPI.Framework.Reflection { /// A property obtained through reflection. /// The property value type. - internal class ReflectedProperty : IPrivateProperty, IReflectedProperty + internal class ReflectedProperty : IReflectedProperty +#if !STARDEW_VALLEY_1_3 + , IPrivateProperty +#endif { /********* ** Properties diff --git a/src/SMAPI/IPrivateField.cs b/src/SMAPI/IPrivateField.cs index 512bfdab..42bf7d2e 100644 --- a/src/SMAPI/IPrivateField.cs +++ b/src/SMAPI/IPrivateField.cs @@ -1,3 +1,4 @@ +#if !STARDEW_VALLEY_1_3 using System; using System.Reflection; @@ -26,3 +27,4 @@ namespace StardewModdingAPI void SetValue(TValue value); } } +#endif diff --git a/src/SMAPI/IPrivateMethod.cs b/src/SMAPI/IPrivateMethod.cs index b2fdaaeb..c24db602 100644 --- a/src/SMAPI/IPrivateMethod.cs +++ b/src/SMAPI/IPrivateMethod.cs @@ -1,3 +1,4 @@ +#if !STARDEW_VALLEY_1_3 using System; using System.Reflection; @@ -27,3 +28,4 @@ namespace StardewModdingAPI void Invoke(params object[] arguments); } } +#endif diff --git a/src/SMAPI/IPrivateProperty.cs b/src/SMAPI/IPrivateProperty.cs index a24495dd..a1b21a69 100644 --- a/src/SMAPI/IPrivateProperty.cs +++ b/src/SMAPI/IPrivateProperty.cs @@ -1,3 +1,4 @@ +#if !STARDEW_VALLEY_1_3 using System; using System.Reflection; @@ -26,3 +27,4 @@ namespace StardewModdingAPI void SetValue(TValue value); } } +#endif diff --git a/src/SMAPI/IReflectionHelper.cs b/src/SMAPI/IReflectionHelper.cs index fcebae42..60441471 100644 --- a/src/SMAPI/IReflectionHelper.cs +++ b/src/SMAPI/IReflectionHelper.cs @@ -48,6 +48,7 @@ namespace StardewModdingAPI /// Whether to throw an exception if the field is not found. IReflectedMethod GetMethod(Type type, string name, bool required = true); +#if !STARDEW_VALLEY_1_3 /***** ** Obsolete *****/ @@ -114,5 +115,6 @@ namespace StardewModdingAPI /// Whether to throw an exception if the private field is not found. [Obsolete("Use " + nameof(IReflectionHelper) + "." + nameof(IReflectionHelper.GetMethod) + " instead")] IPrivateMethod GetPrivateMethod(Type type, string name, bool required = true); +#endif } } -- cgit From de17f87d87f5964483e2abbae8169beff19a89f8 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 11 Mar 2018 20:31:19 -0400 Subject: fix some title menu assets not being editable (#453, #413) --- docs/release-notes.md | 1 + src/SMAPI/Metadata/CoreAssets.cs | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) (limited to 'docs/release-notes.md') diff --git a/docs/release-notes.md b/docs/release-notes.md index 2d71da7f..7297fb59 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -5,6 +5,7 @@ * For modders: * Dropped support for some deprecated APIs. + * Fixed some assets not being editable. ## 2.5.3 * For players: diff --git a/src/SMAPI/Metadata/CoreAssets.cs b/src/SMAPI/Metadata/CoreAssets.cs index 378117a8..87629682 100644 --- a/src/SMAPI/Metadata/CoreAssets.cs +++ b/src/SMAPI/Metadata/CoreAssets.cs @@ -7,6 +7,7 @@ using StardewValley; using StardewValley.BellsAndWhistles; using StardewValley.Buildings; using StardewValley.Locations; +using StardewValley.Menus; using StardewValley.Objects; using StardewValley.Projectiles; using StardewValley.TerrainFeatures; @@ -140,6 +141,26 @@ namespace StardewModdingAPI.Metadata ["TerrainFeatures\\hoeDirtDark"] = (content, key) => HoeDirt.darkTexture = content.Load(key), ["TerrainFeatures\\hoeDirtSnow"] = (content, key) => HoeDirt.snowTexture = content.Load(key), + // from TitleMenu + ["Minigames\\Clouds"] = (content, key) => + { + if (Game1.activeClickableMenu is TitleMenu) + reflection.GetField(Game1.activeClickableMenu, "cloudsTexture").SetValue(content.Load(key)); + }, + ["Minigames\\TitleButtons"] = (content, key) => + { + if (Game1.activeClickableMenu is TitleMenu titleMenu) + { + reflection.GetField(titleMenu, "titleButtonsTexture").SetValue(content.Load(key)); + foreach (TemporaryAnimatedSprite bird in reflection.GetField>(titleMenu, "birds").GetValue()) +#if STARDEW_VALLEY_1_3 + bird.texture = content.Load(key); +#else + bird.Texture = content.Load(key); +#endif + } + }, + // from Wallpaper ["Maps\\walls_and_floors"] = (content, key) => Wallpaper.wallpaperTexture = content.Load(key) } -- cgit From f0e1a46f0fa52b4365c8ccb64c7fe4784002257b Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 11 Mar 2018 21:07:45 -0400 Subject: fix error when content pack needs a mod that couldn't be loaded --- docs/release-notes.md | 1 + src/SMAPI/Program.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/release-notes.md') diff --git a/docs/release-notes.md b/docs/release-notes.md index 7297fb59..1e32eb8d 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -14,6 +14,7 @@ * Fixed rare crash with some combinations of manifest fields and internal mod data. * Fixed update checks failing for Nexus Mods due to a change in their API. * Fixed update checks failing for some older mods with non-standard versions. + * Fixed error when a content pack needs a mod that couldn't be loaded. * Updated compatibility list and added update checks for more mods. * For the [log parser][]: diff --git a/src/SMAPI/Program.cs b/src/SMAPI/Program.cs index e713add5..4bd40710 100644 --- a/src/SMAPI/Program.cs +++ b/src/SMAPI/Program.cs @@ -854,7 +854,7 @@ namespace StardewModdingAPI // log loaded content packs if (loadedContentPacks.Any()) { - string GetModDisplayName(string id) => loadedMods.First(p => id != null && id.Equals(p.Manifest?.UniqueID, StringComparison.InvariantCultureIgnoreCase))?.DisplayName; + string GetModDisplayName(string id) => loadedMods.FirstOrDefault(p => id != null && id.Equals(p.Manifest?.UniqueID, StringComparison.InvariantCultureIgnoreCase))?.DisplayName; this.Monitor.Log($"Loaded {loadedContentPacks.Length} content packs:", LogLevel.Info); foreach (IModMetadata metadata in loadedContentPacks.OrderBy(p => p.DisplayName)) -- cgit From 327b6949d2bb20895048857c6227bf5887df2795 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 11 Mar 2018 21:17:17 -0400 Subject: add missing release note (#456) --- docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs/release-notes.md') diff --git a/docs/release-notes.md b/docs/release-notes.md index 1e32eb8d..2301f865 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -15,6 +15,7 @@ * Fixed update checks failing for Nexus Mods due to a change in their API. * Fixed update checks failing for some older mods with non-standard versions. * Fixed error when a content pack needs a mod that couldn't be loaded. + * Fixed Linux ["magic number is wrong" errors](https://github.com/mono/mono/issues/6752) by changing default terminal order. * Updated compatibility list and added update checks for more mods. * For the [log parser][]: -- cgit From 76445dc3589265ba259070300120e96a17957e50 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 13 Mar 2018 19:47:30 -0400 Subject: simplify release notes --- docs/release-notes.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'docs/release-notes.md') diff --git a/docs/release-notes.md b/docs/release-notes.md index 2301f865..fdc06c87 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -9,8 +9,7 @@ ## 2.5.3 * For players: - * Simplified and improved skipped-incompatible-mod messages. - * Fixed some incompatible-mod errors not showing the mod URL. + * Simplified and improved skipped-mod messages. * Fixed rare crash with some combinations of manifest fields and internal mod data. * Fixed update checks failing for Nexus Mods due to a change in their API. * Fixed update checks failing for some older mods with non-standard versions. -- cgit
@message.Time @message.Level.ToString().ToUpper() @message.Mod
repeats [@message.Repeated] times.