From 77629a528a2f93a2977a1bf63e2e18faaaffaaaf Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 13 Mar 2021 23:51:55 -0500 Subject: disable aggressive memory optimizations by default --- src/SMAPI/SMAPI.config.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/SMAPI/SMAPI.config.json b/src/SMAPI/SMAPI.config.json index a9e6f389..034eceed 100644 --- a/src/SMAPI/SMAPI.config.json +++ b/src/SMAPI/SMAPI.config.json @@ -41,9 +41,10 @@ copy all the settings, or you may cause bugs due to overridden changes in future /** * Whether to enable more aggressive memory optimizations. - * You can try disabling this if you get ObjectDisposedException errors. + * If you get frequent 'OutOfMemoryException' errors, you can try enabling this to reduce their + * frequency. This may cause crashes for farmhands in multiplayer. */ - "AggressiveMemoryOptimizations": true, + "AggressiveMemoryOptimizations": false, /** * Whether to add a section to the 'mod issues' list for mods which directly use potentially -- cgit From 04388fe7e3b721358de25d64607d47d5f6113eda Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 14 Mar 2021 04:43:28 -0400 Subject: fix some assets not reapplied correctly when playing in non-English and returning to title --- src/SMAPI/Framework/ContentCoordinator.cs | 37 ++++++++++++++++------ .../ContentManagers/BaseContentManager.cs | 3 -- .../ContentManagers/GameContentManager.cs | 25 --------------- .../Framework/ContentManagers/IContentManager.cs | 4 --- src/SMAPI/Framework/ModHelpers/ContentHelper.cs | 2 +- 5 files changed, 29 insertions(+), 42 deletions(-) (limited to 'src') diff --git a/src/SMAPI/Framework/ContentCoordinator.cs b/src/SMAPI/Framework/ContentCoordinator.cs index 32195fff..6d2ff441 100644 --- a/src/SMAPI/Framework/ContentCoordinator.cs +++ b/src/SMAPI/Framework/ContentCoordinator.cs @@ -207,11 +207,30 @@ namespace StardewModdingAPI.Framework /// This is called after the player returns to the title screen, but before runs. public void OnReturningToTitleScreen() { - this.ContentManagerLock.InReadLock(() => - { - foreach (IContentManager contentManager in this.ContentManagers) - contentManager.OnReturningToTitleScreen(); - }); + // The game clears LocalizedContentManager.localizedAssetNames after returning to the title screen. That + // causes an inconsistency in the SMAPI asset cache, which leads to an edge case where assets already + // provided by mods via IAssetLoader when playing in non-English are ignored. + // + // For example, let's say a mod provides the 'Data\mail' asset through IAssetLoader when playing in + // Portuguese. Here's the normal load process after it's loaded: + // 1. The game requests Data\mail. + // 2. SMAPI sees that it's already cached, and calls LoadRaw to bypass asset interception. + // 3. LoadRaw sees that there's a localized key mapping, and gets the mapped key. + // 4. In this case "Data\mail" is mapped to "Data\mail" since it was loaded by a mod, so it loads that + // asset. + // + // When the game clears localizedAssetNames, that process goes wrong in step 4: + // 3. LoadRaw sees that there's no localized key mapping *and* the locale is non-English, so it attempts + // to load from the localized key format. + // 4. In this case that's 'Data\mail.pt-BR', so it successfully loads that asset. + // 5. Since we've bypassed asset interception at this point, it's loaded directly from the base content + // manager without mod changes. + // + // To avoid issues, we just remove affected assets from the cache here so they'll be reloaded normally. + // Note that we *must* propagate changes here, otherwise when mods invalidate the cache later to reapply + // their changes, the assets won't be found in the cache so no changes will be propagated. + if (LocalizedContentManager.CurrentLanguageCode != LocalizedContentManager.LanguageCode.en) + this.InvalidateCache((contentManager, key, type) => contentManager is GameContentManager); } /// Get whether this asset is mapped to a mod folder. @@ -275,7 +294,7 @@ namespace StardewModdingAPI.Framework public IEnumerable InvalidateCache(Func predicate, bool dispose = false) { string locale = this.GetLocale(); - return this.InvalidateCache((assetName, type) => + return this.InvalidateCache((contentManager, assetName, type) => { IAssetInfo info = new AssetInfo(locale, assetName, type, this.MainContentManager.AssertAndNormalizeAssetName); return predicate(info); @@ -286,7 +305,7 @@ namespace StardewModdingAPI.Framework /// Matches the asset keys to invalidate. /// Whether to dispose invalidated assets. This should only be true when they're being invalidated as part of a dispose, to avoid crashing the game. /// Returns the invalidated asset names. - public IEnumerable InvalidateCache(Func predicate, bool dispose = false) + public IEnumerable InvalidateCache(Func predicate, bool dispose = false) { // invalidate cache & track removed assets IDictionary removedAssets = new Dictionary(StringComparer.OrdinalIgnoreCase); @@ -295,7 +314,7 @@ namespace StardewModdingAPI.Framework // cached assets foreach (IContentManager contentManager in this.ContentManagers) { - foreach (var entry in contentManager.InvalidateCache(predicate, dispose)) + foreach (var entry in contentManager.InvalidateCache((key, type) => predicate(contentManager, key, type), dispose)) { if (!removedAssets.ContainsKey(entry.Key)) removedAssets[entry.Key] = entry.Value.GetType(); @@ -313,7 +332,7 @@ namespace StardewModdingAPI.Framework // get map path string mapPath = this.MainContentManager.AssertAndNormalizeAssetName(location.mapPath.Value); - if (!removedAssets.ContainsKey(mapPath) && predicate(mapPath, typeof(Map))) + if (!removedAssets.ContainsKey(mapPath) && predicate(this.MainContentManager, mapPath, typeof(Map))) removedAssets[mapPath] = typeof(Map); } } diff --git a/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs b/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs index 1a64dab8..7244a534 100644 --- a/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs +++ b/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs @@ -121,9 +121,6 @@ namespace StardewModdingAPI.Framework.ContentManagers /// public virtual void OnLocaleChanged() { } - /// - public virtual void OnReturningToTitleScreen() { } - /// [Pure] public string NormalizePathSeparators(string path) diff --git a/src/SMAPI/Framework/ContentManagers/GameContentManager.cs b/src/SMAPI/Framework/ContentManagers/GameContentManager.cs index 8e78faba..80a9937a 100644 --- a/src/SMAPI/Framework/ContentManagers/GameContentManager.cs +++ b/src/SMAPI/Framework/ContentManagers/GameContentManager.cs @@ -136,31 +136,6 @@ namespace StardewModdingAPI.Framework.ContentManagers this.Monitor.Log($"Invalidated {invalidated.Length} asset names: {string.Join(", ", invalidated)} for locale change."); } - /// - public override void OnReturningToTitleScreen() - { - // The game clears LocalizedContentManager.localizedAssetNames after returning to the title screen. That - // causes an inconsistency in the SMAPI asset cache, which leads to an edge case where assets already - // provided by mods via IAssetLoader when playing in non-English are ignored. - // - // For example, let's say a mod provides the 'Data\mail' asset through IAssetLoader when playing in - // Portuguese. Here's the normal load process after it's loaded: - // 1. The game requests Data\mail. - // 2. SMAPI sees that it's already cached, and calls LoadRaw to bypass asset interception. - // 3. LoadRaw sees that there's a localized key mapping, and gets the mapped key. - // 4. In this case "Data\mail" is mapped to "Data\mail" since it was loaded by a mod, so it loads that - // asset. - // - // When the game clears localizedAssetNames, that process goes wrong in step 4: - // 3. LoadRaw sees that there's no localized key mapping *and* the locale is non-English, so it attempts - // to load from the localized key format. - // 4. In this case that's 'Data\mail.pt-BR', so it successfully loads that asset. - // 5. Since we've bypassed asset interception at this point, it's loaded directly from the base content - // manager without mod changes. - if (LocalizedContentManager.CurrentLanguageCode != LocalizedContentManager.LanguageCode.en) - this.InvalidateCache((_, _) => true); - } - /// public override LocalizedContentManager CreateTemporary() { diff --git a/src/SMAPI/Framework/ContentManagers/IContentManager.cs b/src/SMAPI/Framework/ContentManagers/IContentManager.cs index 1e222472..d7963305 100644 --- a/src/SMAPI/Framework/ContentManagers/IContentManager.cs +++ b/src/SMAPI/Framework/ContentManagers/IContentManager.cs @@ -69,9 +69,5 @@ namespace StardewModdingAPI.Framework.ContentManagers /// Perform any cleanup needed when the locale changes. void OnLocaleChanged(); - - /// Clean up when the player is returning to the title screen. - /// This is called after the player returns to the title screen, but before runs. - void OnReturningToTitleScreen(); } } diff --git a/src/SMAPI/Framework/ModHelpers/ContentHelper.cs b/src/SMAPI/Framework/ModHelpers/ContentHelper.cs index 5fd8f5e9..bfca2264 100644 --- a/src/SMAPI/Framework/ModHelpers/ContentHelper.cs +++ b/src/SMAPI/Framework/ModHelpers/ContentHelper.cs @@ -136,7 +136,7 @@ namespace StardewModdingAPI.Framework.ModHelpers public bool InvalidateCache() { this.Monitor.Log($"Requested cache invalidation for all assets of type {typeof(T)}. This is an expensive operation and should be avoided if possible.", LogLevel.Trace); - return this.ContentCore.InvalidateCache((key, type) => typeof(T).IsAssignableFrom(type)).Any(); + return this.ContentCore.InvalidateCache((contentManager, key, type) => typeof(T).IsAssignableFrom(type)).Any(); } /// -- cgit From 6805c90e2cdac734341b692298670b0beb50faa6 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 14 Mar 2021 14:17:09 -0400 Subject: add asset propagation for interior door sprites --- src/SMAPI/Metadata/CoreAssetPropagator.cs | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src') diff --git a/src/SMAPI/Metadata/CoreAssetPropagator.cs b/src/SMAPI/Metadata/CoreAssetPropagator.cs index 8b591bc1..ae56dc9c 100644 --- a/src/SMAPI/Metadata/CoreAssetPropagator.cs +++ b/src/SMAPI/Metadata/CoreAssetPropagator.cs @@ -366,6 +366,8 @@ namespace StardewModdingAPI.Metadata foreach (ClickableTextureComponent button in new[] { menu.questButton, menu.zoomInButton, menu.zoomOutButton }) button.texture = Game1.mouseCursors; } + + this.ReloadDoorSprites(content, key); return true; case "loosesprites\\cursors2": // Game1.LoadContent @@ -739,6 +741,36 @@ namespace StardewModdingAPI.Metadata return critters.Length; } + /// Reload the sprites for interior doors. + /// The content manager through which to reload the asset. + /// The asset key to reload. + /// Returns whether any doors were affected. + private bool ReloadDoorSprites(LocalizedContentManager content, string key) + { + Lazy texture = new Lazy(() => content.Load(key)); + + foreach (GameLocation location in this.GetLocations()) + { + IEnumerable doors = location.interiorDoors?.Doors; + if (doors == null) + continue; + + foreach (InteriorDoor door in doors) + { + if (door?.Sprite == null) + continue; + + string textureName = this.NormalizeAssetNameIgnoringEmpty(this.Reflection.GetField(door.Sprite, "textureName").GetValue()); + if (textureName != key) + continue; + + door.Sprite.texture = texture.Value; + } + } + + return texture.IsValueCreated; + } + /// Reload the data for matching farm animals. /// Returns whether any farm animals were affected. /// Derived from the constructor. -- cgit From 749f0321f01b2f2ad865f31ab6f447c5a590fdd0 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 16 Mar 2021 18:56:56 -0400 Subject: avoid asset propagation into the world if it's unloaded Propagating changes into world locations has no effect at this point (since they'll just be recreated when a save is loaded), and can noticeably impact performance. --- src/SMAPI/Context.cs | 3 + src/SMAPI/Framework/ContentCoordinator.cs | 13 +++- src/SMAPI/Metadata/CoreAssetPropagator.cs | 117 +++++++++++++++++------------- 3 files changed, 79 insertions(+), 54 deletions(-) (limited to 'src') diff --git a/src/SMAPI/Context.cs b/src/SMAPI/Context.cs index b1b33cd6..5f70d0f7 100644 --- a/src/SMAPI/Context.cs +++ b/src/SMAPI/Context.cs @@ -38,6 +38,9 @@ namespace StardewModdingAPI set => Context.LoadStageForScreen.Value = value; } + /// Whether the in-game world is completely unloaded and not in the process of being loaded. The world may still exist in memory at this point, but should be ignored. + internal static bool IsWorldFullyUnloaded => Context.LoadStage == LoadStage.ReturningToTitle || Context.LoadStage == LoadStage.None; + /********* ** Accessors diff --git a/src/SMAPI/Framework/ContentCoordinator.cs b/src/SMAPI/Framework/ContentCoordinator.cs index 6d2ff441..5d4855ef 100644 --- a/src/SMAPI/Framework/ContentCoordinator.cs +++ b/src/SMAPI/Framework/ContentCoordinator.cs @@ -341,11 +341,16 @@ namespace StardewModdingAPI.Framework // reload core game assets if (removedAssets.Any()) { - IDictionary propagated = this.CoreAssets.Propagate(removedAssets.ToDictionary(p => p.Key, p => p.Value)); // use an intercepted content manager - this.Monitor.Log($"Invalidated {removedAssets.Count} asset names ({string.Join(", ", removedAssets.Keys.OrderBy(p => p, StringComparer.OrdinalIgnoreCase))}); propagated {propagated.Count(p => p.Value)} core assets.", LogLevel.Trace); + IDictionary propagated = this.CoreAssets.Propagate(removedAssets.ToDictionary(p => p.Key, p => p.Value), ignoreWorld: Context.IsWorldFullyUnloaded); + + string[] invalidatedKeys = removedAssets.Keys.ToArray(); + string[] propagatedKeys = propagated.Where(p => p.Value).Select(p => p.Key).ToArray(); + + string FormatKeyList(IEnumerable keys) => string.Join(", ", keys.OrderBy(p => p, StringComparer.OrdinalIgnoreCase)); + this.Monitor.Log($"Invalidated {invalidatedKeys.Length} asset names ({FormatKeyList(invalidatedKeys)}); propagated {propagatedKeys.Length} core assets ({FormatKeyList(propagatedKeys)})."); } else - this.Monitor.Log("Invalidated 0 cache entries.", LogLevel.Trace); + this.Monitor.Log("Invalidated 0 cache entries."); return removedAssets.Keys; } @@ -391,7 +396,7 @@ namespace StardewModdingAPI.Framework return; this.IsDisposed = true; - this.Monitor.Log("Disposing the content coordinator. Content managers will no longer be usable after this point.", LogLevel.Trace); + this.Monitor.Log("Disposing the content coordinator. Content managers will no longer be usable after this point."); foreach (IContentManager contentManager in this.ContentManagers) contentManager.Dispose(); this.ContentManagers.Clear(); diff --git a/src/SMAPI/Metadata/CoreAssetPropagator.cs b/src/SMAPI/Metadata/CoreAssetPropagator.cs index ae56dc9c..debbaffd 100644 --- a/src/SMAPI/Metadata/CoreAssetPropagator.cs +++ b/src/SMAPI/Metadata/CoreAssetPropagator.cs @@ -79,8 +79,9 @@ namespace StardewModdingAPI.Metadata /// Reload one of the game's core assets (if applicable). /// The asset keys and types to reload. + /// Whether the in-game world is fully unloaded (e.g. on the title screen), so there's no need to propagate changes into the world. /// Returns a lookup of asset names to whether they've been propagated. - public IDictionary Propagate(IDictionary assets) + public IDictionary Propagate(IDictionary assets, bool ignoreWorld) { // group into optimized lists var buckets = assets.GroupBy(p => @@ -101,16 +102,18 @@ namespace StardewModdingAPI.Metadata switch (bucket.Key) { case AssetBucket.Sprite: - this.ReloadNpcSprites(bucket.Select(p => p.Key), propagated); + if (!ignoreWorld) + this.ReloadNpcSprites(bucket.Select(p => p.Key), propagated); break; case AssetBucket.Portrait: - this.ReloadNpcPortraits(bucket.Select(p => p.Key), propagated); + if (!ignoreWorld) + this.ReloadNpcPortraits(bucket.Select(p => p.Key), propagated); break; default: foreach (var entry in bucket) - propagated[entry.Key] = this.PropagateOther(entry.Key, entry.Value); + propagated[entry.Key] = this.PropagateOther(entry.Key, entry.Value, ignoreWorld); break; } } @@ -124,9 +127,10 @@ namespace StardewModdingAPI.Metadata /// Reload one of the game's core assets (if applicable). /// The asset key to reload. /// The asset type to reload. + /// Whether the in-game world is fully unloaded (e.g. on the title screen), so there's no need to propagate changes into the world. /// Returns whether an asset was loaded. The return value may be true or false, or a non-null value for true. [SuppressMessage("ReSharper", "StringLiteralTypo", Justification = "These deliberately match the asset names.")] - private bool PropagateOther(string key, Type type) + private bool PropagateOther(string key, Type type, bool ignoreWorld) { var content = this.MainContentManager; key = this.AssertAndNormalizeAssetName(key); @@ -136,7 +140,7 @@ namespace StardewModdingAPI.Metadata ** We only need to do this for the current location, since tilesheets are reloaded when you enter a location. ** Just in case, we should still propagate by key even if a tilesheet is matched. ****/ - if (Game1.currentLocation?.map?.TileSheets != null) + if (!ignoreWorld && Game1.currentLocation?.map?.TileSheets != null) { foreach (TileSheet tilesheet in Game1.currentLocation.map.TileSheets) { @@ -151,14 +155,19 @@ namespace StardewModdingAPI.Metadata if (type == typeof(Map)) { bool anyChanged = false; - foreach (GameLocation location in this.GetLocations()) + + if (!ignoreWorld) { - if (!string.IsNullOrWhiteSpace(location.mapPath.Value) && this.NormalizeAssetNameIgnoringEmpty(location.mapPath.Value) == key) + foreach (GameLocation location in this.GetLocations()) { - this.ReloadMap(location); - anyChanged = true; + if (!string.IsNullOrWhiteSpace(location.mapPath.Value) && this.NormalizeAssetNameIgnoringEmpty(location.mapPath.Value) == key) + { + this.ReloadMap(location); + anyChanged = true; + } } } + return anyChanged; } @@ -172,7 +181,7 @@ namespace StardewModdingAPI.Metadata ** Animals ****/ case "animals\\horse": - return this.ReloadPetOrHorseSprites(content, key); + return !ignoreWorld && this.ReloadPetOrHorseSprites(content, key); /**** ** Buildings @@ -197,7 +206,7 @@ namespace StardewModdingAPI.Metadata case "characters\\farmer\\farmer_base_bald": case "characters\\farmer\\farmer_girl_base": case "characters\\farmer\\farmer_girl_base_bald": - return this.ReloadPlayerSprites(key); + return !ignoreWorld && this.ReloadPlayerSprites(key); case "characters\\farmer\\hairstyles": // Game1.LoadContent FarmerRenderer.hairStylesTexture = this.LoadAndDisposeIfNeeded(FarmerRenderer.hairStylesTexture, key); @@ -270,7 +279,7 @@ namespace StardewModdingAPI.Metadata return true; case "data\\farmanimals": // FarmAnimal constructor - return this.ReloadFarmAnimalData(); + return !ignoreWorld && this.ReloadFarmAnimalData(); case "data\\hairdata": // Farmer.GetHairStyleMetadataFile return this.ReloadHairData(); @@ -288,7 +297,7 @@ namespace StardewModdingAPI.Metadata return true; case "data\\npcdispositions": // NPC constructor - return this.ReloadNpcDispositions(content, key); + return !ignoreWorld && this.ReloadNpcDispositions(content, key); case "data\\npcgifttastes": // Game1.LoadContent Game1.NPCGiftTastes = content.Load>(key); @@ -367,7 +376,8 @@ namespace StardewModdingAPI.Metadata button.texture = Game1.mouseCursors; } - this.ReloadDoorSprites(content, key); + if (!ignoreWorld) + this.ReloadDoorSprites(content, key); return true; case "loosesprites\\cursors2": // Game1.LoadContent @@ -395,7 +405,7 @@ namespace StardewModdingAPI.Metadata return true; case "loosesprites\\suspensionbridge": // SuspensionBridge constructor - return this.ReloadSuspensionBridges(content, key); + return !ignoreWorld && this.ReloadSuspensionBridges(content, key); /**** ** Content\Maps @@ -454,14 +464,14 @@ namespace StardewModdingAPI.Metadata return true; case "tilesheets\\chairtiles": // Game1.LoadContent - return this.ReloadChairTiles(content, key); + return this.ReloadChairTiles(content, key, ignoreWorld); case "tilesheets\\craftables": // Game1.LoadContent Game1.bigCraftableSpriteSheet = content.Load(key); return true; case "tilesheets\\critters": // Critter constructor - return this.ReloadCritterTextures(content, key) > 0; + return !ignoreWorld && this.ReloadCritterTextures(content, key) > 0; case "tilesheets\\crops": // Game1.LoadContent Game1.cropSpriteSheet = content.Load(key); @@ -515,7 +525,7 @@ namespace StardewModdingAPI.Metadata return true; case "terrainfeatures\\grass": // from Grass - return this.ReloadGrassTextures(content, key); + return !ignoreWorld && this.ReloadGrassTextures(content, key); case "terrainfeatures\\hoedirt": // from HoeDirt HoeDirt.lightTexture = content.Load(key); @@ -530,52 +540,55 @@ namespace StardewModdingAPI.Metadata return true; case "terrainfeatures\\mushroom_tree": // from Tree - return this.ReloadTreeTextures(content, key, Tree.mushroomTree); + return !ignoreWorld && this.ReloadTreeTextures(content, key, Tree.mushroomTree); case "terrainfeatures\\tree_palm": // from Tree - return this.ReloadTreeTextures(content, key, Tree.palmTree); + return !ignoreWorld && this.ReloadTreeTextures(content, key, Tree.palmTree); case "terrainfeatures\\tree1_fall": // from Tree case "terrainfeatures\\tree1_spring": // from Tree case "terrainfeatures\\tree1_summer": // from Tree case "terrainfeatures\\tree1_winter": // from Tree - return this.ReloadTreeTextures(content, key, Tree.bushyTree); + return !ignoreWorld && this.ReloadTreeTextures(content, key, Tree.bushyTree); case "terrainfeatures\\tree2_fall": // from Tree case "terrainfeatures\\tree2_spring": // from Tree case "terrainfeatures\\tree2_summer": // from Tree case "terrainfeatures\\tree2_winter": // from Tree - return this.ReloadTreeTextures(content, key, Tree.leafyTree); + return !ignoreWorld && this.ReloadTreeTextures(content, key, Tree.leafyTree); case "terrainfeatures\\tree3_fall": // from Tree case "terrainfeatures\\tree3_spring": // from Tree case "terrainfeatures\\tree3_winter": // from Tree - return this.ReloadTreeTextures(content, key, Tree.pineTree); + return !ignoreWorld && this.ReloadTreeTextures(content, key, Tree.pineTree); } /**** ** Dynamic assets ****/ - // dynamic textures - if (this.KeyStartsWith(key, "animals\\cat")) - return this.ReloadPetOrHorseSprites(content, key); - if (this.KeyStartsWith(key, "animals\\dog")) - return this.ReloadPetOrHorseSprites(content, key); - if (this.IsInFolder(key, "Animals")) - return this.ReloadFarmAnimalSprites(content, key); - - if (this.IsInFolder(key, "Buildings")) - return this.ReloadBuildings(content, key); - - if (this.KeyStartsWith(key, "LooseSprites\\Fence")) - return this.ReloadFenceTextures(key); - - // dynamic data - if (this.IsInFolder(key, "Characters\\Dialogue")) - return this.ReloadNpcDialogue(key); - - if (this.IsInFolder(key, "Characters\\schedules")) - return this.ReloadNpcSchedules(key); + if (!ignoreWorld) + { + // dynamic textures + if (this.KeyStartsWith(key, "animals\\cat")) + return this.ReloadPetOrHorseSprites(content, key); + if (this.KeyStartsWith(key, "animals\\dog")) + return this.ReloadPetOrHorseSprites(content, key); + if (this.IsInFolder(key, "Animals")) + return this.ReloadFarmAnimalSprites(content, key); + + if (this.IsInFolder(key, "Buildings")) + return this.ReloadBuildings(content, key); + + if (this.KeyStartsWith(key, "LooseSprites\\Fence")) + return this.ReloadFenceTextures(key); + + // dynamic data + if (this.IsInFolder(key, "Characters\\Dialogue")) + return this.ReloadNpcDialogue(key); + + if (this.IsInFolder(key, "Characters\\schedules")) + return this.ReloadNpcSchedules(key); + } return false; } @@ -695,19 +708,23 @@ namespace StardewModdingAPI.Metadata /// Reload map seat textures. /// The content manager through which to reload the asset. /// The asset key to reload. + /// Whether the in-game world is fully unloaded (e.g. on the title screen), so there's no need to propagate changes into the world. /// Returns whether any textures were reloaded. - private bool ReloadChairTiles(LocalizedContentManager content, string key) + private bool ReloadChairTiles(LocalizedContentManager content, string key, bool ignoreWorld) { MapSeat.mapChairTexture = content.Load(key); - foreach (var location in this.GetLocations()) + if (!ignoreWorld) { - foreach (MapSeat seat in location.mapSeats.Where(p => p != null)) + foreach (var location in this.GetLocations()) { - string curKey = this.NormalizeAssetNameIgnoringEmpty(seat._loadedTextureFile); + foreach (MapSeat seat in location.mapSeats.Where(p => p != null)) + { + string curKey = this.NormalizeAssetNameIgnoringEmpty(seat._loadedTextureFile); - if (curKey == null || key.Equals(curKey, StringComparison.OrdinalIgnoreCase)) - seat.overlayTexture = MapSeat.mapChairTexture; + if (curKey == null || key.Equals(curKey, StringComparison.OrdinalIgnoreCase)) + seat.overlayTexture = MapSeat.mapChairTexture; + } } } -- cgit From bb88e42f54c274db3c382eecb54b541dd2599163 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 16 Mar 2021 19:20:37 -0400 Subject: add console command to regenerate bundles --- .../Framework/Commands/Other/RegenerateBundles.cs | 66 ++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/RegenerateBundles.cs (limited to 'src') diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/RegenerateBundles.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/RegenerateBundles.cs new file mode 100644 index 00000000..d28abd13 --- /dev/null +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/RegenerateBundles.cs @@ -0,0 +1,66 @@ +using System; +using System.Linq; +using StardewValley; + +namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.Other +{ + /// A command which regenerates the game's bundles. + internal class RegenerateBundlesCommand : ConsoleCommand + { + /********* + ** Public methods + *********/ + /// Construct an instance. + public RegenerateBundlesCommand() + : base("regenerate_bundles", $"Regenerate the game's community center bundle data. WARNING: this will reset all bundle progress, and may have unintended effects if you've already completed bundles. DO NOT USE THIS unless you're absolutely sure.\n\nUsage: regenerate_bundles confirm [] [ignore_seed]\nRegenerate all bundles for this save. If the is set to '{string.Join("' or '", Enum.GetNames(typeof(Game1.BundleType)))}', change the bundle type for the save. If an 'ignore_seed' option is included, remixed bundles are re-randomized without using the predetermined save seed.\n\nExample: regenerate_bundles remixed confirm") { } + + /// Handle the command. + /// Writes messages to the console and log file. + /// The command name. + /// The command arguments. + public override void Handle(IMonitor monitor, string command, ArgumentParser args) + { + // get flags + var bundleType = Game1.bundleType; + bool confirmed = false; + bool useSeed = true; + foreach (string arg in args) + { + if (arg.Equals("confirm", StringComparison.OrdinalIgnoreCase)) + confirmed = true; + else if (arg.Equals("ignore_seed", StringComparison.OrdinalIgnoreCase)) + useSeed = false; + else if (Enum.TryParse(arg, ignoreCase: true, out Game1.BundleType type)) + bundleType = type; + else + { + monitor.Log($"Invalid option '{arg}'. Type 'help {command}' for usage.", LogLevel.Error); + return; + } + } + + // require confirmation + if (!confirmed) + { + monitor.Log($"WARNING: this may have unintended consequences (type 'help {command}' for details). Are you sure?", LogLevel.Warn); + + string[] newArgs = args.Concat(new[] { "confirm" }).ToArray(); + monitor.Log($"To confirm, enter this command: '{command} {string.Join(" ", newArgs)}'.", LogLevel.Info); + return; + } + + // need a loaded save + if (!Context.IsWorldReady) + { + monitor.Log("You need to load a save to use this command.", LogLevel.Error); + return; + } + + // regenerate bundles + Game1.bundleType = bundleType; + Game1.GenerateBundles(bundleType, use_seed: useSeed); + monitor.Log("Regenerated bundles and reset bundle progress.", LogLevel.Info); + monitor.Log("This may have unintended effects if you've already completed any bundles. If you're not sure, exit your game without saving to cancel.", LogLevel.Warn); + } + } +} -- cgit From c39b2b17663f79da92f3d0abe8c01ea73187cbab Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 19 Mar 2021 20:16:13 -0400 Subject: update NPC pathfinding cache when map warps change --- src/SMAPI/Framework/ContentCoordinator.cs | 31 ++++++++++++++++++++----- src/SMAPI/Framework/SCore.cs | 1 + src/SMAPI/Metadata/CoreAssetPropagator.cs | 38 ++++++++++++++++++++++++------- 3 files changed, 56 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/SMAPI/Framework/ContentCoordinator.cs b/src/SMAPI/Framework/ContentCoordinator.cs index 5d4855ef..2920e670 100644 --- a/src/SMAPI/Framework/ContentCoordinator.cs +++ b/src/SMAPI/Framework/ContentCoordinator.cs @@ -4,6 +4,7 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Linq; +using System.Text; using System.Threading; using Microsoft.Xna.Framework.Content; using StardewModdingAPI.Framework.Content; @@ -341,13 +342,31 @@ namespace StardewModdingAPI.Framework // reload core game assets if (removedAssets.Any()) { - IDictionary propagated = this.CoreAssets.Propagate(removedAssets.ToDictionary(p => p.Key, p => p.Value), ignoreWorld: Context.IsWorldFullyUnloaded); - - string[] invalidatedKeys = removedAssets.Keys.ToArray(); - string[] propagatedKeys = propagated.Where(p => p.Value).Select(p => p.Key).ToArray(); + // propagate changes to the game + this.CoreAssets.Propagate( + assets: removedAssets.ToDictionary(p => p.Key, p => p.Value), + ignoreWorld: Context.IsWorldFullyUnloaded, + out IDictionary propagated, + out bool updatedNpcWarps + ); - string FormatKeyList(IEnumerable keys) => string.Join(", ", keys.OrderBy(p => p, StringComparer.OrdinalIgnoreCase)); - this.Monitor.Log($"Invalidated {invalidatedKeys.Length} asset names ({FormatKeyList(invalidatedKeys)}); propagated {propagatedKeys.Length} core assets ({FormatKeyList(propagatedKeys)})."); + // log summary + StringBuilder report = new StringBuilder(); + { + string[] invalidatedKeys = removedAssets.Keys.ToArray(); + string[] propagatedKeys = propagated.Where(p => p.Value).Select(p => p.Key).ToArray(); + + string FormatKeyList(IEnumerable keys) => string.Join(", ", keys.OrderBy(p => p, StringComparer.OrdinalIgnoreCase)); + + report.AppendLine($"Invalidated {invalidatedKeys.Length} asset names ({FormatKeyList(invalidatedKeys)})."); + report.AppendLine(propagated.Count > 0 + ? $"Propagated {propagatedKeys.Length} core assets ({FormatKeyList(propagatedKeys)})." + : "Propagated 0 core assets." + ); + if (updatedNpcWarps) + report.AppendLine("Updated NPC pathfinding cache."); + } + this.Monitor.Log(report.ToString().TrimEnd()); } else this.Monitor.Log("Invalidated 0 cache entries."); diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index 5df4b61b..e98dc04c 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -482,6 +482,7 @@ namespace StardewModdingAPI.Framework + ")" ) ) + + "." ); // reload affected assets diff --git a/src/SMAPI/Metadata/CoreAssetPropagator.cs b/src/SMAPI/Metadata/CoreAssetPropagator.cs index debbaffd..52da3946 100644 --- a/src/SMAPI/Metadata/CoreAssetPropagator.cs +++ b/src/SMAPI/Metadata/CoreAssetPropagator.cs @@ -80,8 +80,9 @@ namespace StardewModdingAPI.Metadata /// Reload one of the game's core assets (if applicable). /// The asset keys and types to reload. /// Whether the in-game world is fully unloaded (e.g. on the title screen), so there's no need to propagate changes into the world. - /// Returns a lookup of asset names to whether they've been propagated. - public IDictionary Propagate(IDictionary assets, bool ignoreWorld) + /// A lookup of asset names to whether they've been propagated. + /// Whether the NPC pathfinding cache was reloaded. + public void Propagate(IDictionary assets, bool ignoreWorld, out IDictionary propagatedAssets, out bool updatedNpcWarps) { // group into optimized lists var buckets = assets.GroupBy(p => @@ -96,28 +97,36 @@ namespace StardewModdingAPI.Metadata }); // reload assets - IDictionary propagated = assets.ToDictionary(p => p.Key, _ => false, StringComparer.OrdinalIgnoreCase); + propagatedAssets = assets.ToDictionary(p => p.Key, _ => false, StringComparer.OrdinalIgnoreCase); + updatedNpcWarps = false; foreach (var bucket in buckets) { switch (bucket.Key) { case AssetBucket.Sprite: if (!ignoreWorld) - this.ReloadNpcSprites(bucket.Select(p => p.Key), propagated); + this.ReloadNpcSprites(bucket.Select(p => p.Key), propagatedAssets); break; case AssetBucket.Portrait: if (!ignoreWorld) - this.ReloadNpcPortraits(bucket.Select(p => p.Key), propagated); + this.ReloadNpcPortraits(bucket.Select(p => p.Key), propagatedAssets); break; default: foreach (var entry in bucket) - propagated[entry.Key] = this.PropagateOther(entry.Key, entry.Value, ignoreWorld); + { + bool changed = this.PropagateOther(entry.Key, entry.Value, ignoreWorld, out bool curChangedMapWarps); + propagatedAssets[entry.Key] = changed; + updatedNpcWarps = updatedNpcWarps || curChangedMapWarps; + } break; } } - return propagated; + + // reload NPC pathfinding cache if any map changed + if (updatedNpcWarps) + NPC.populateRoutesFromLocationToLocationList(); } @@ -128,12 +137,14 @@ namespace StardewModdingAPI.Metadata /// The asset key to reload. /// The asset type to reload. /// Whether the in-game world is fully unloaded (e.g. on the title screen), so there's no need to propagate changes into the world. + /// Whether any map warps were changed as part of this propagation. /// Returns whether an asset was loaded. The return value may be true or false, or a non-null value for true. [SuppressMessage("ReSharper", "StringLiteralTypo", Justification = "These deliberately match the asset names.")] - private bool PropagateOther(string key, Type type, bool ignoreWorld) + private bool PropagateOther(string key, Type type, bool ignoreWorld, out bool changedWarps) { var content = this.MainContentManager; key = this.AssertAndNormalizeAssetName(key); + changedWarps = false; /**** ** Special case: current map tilesheet @@ -162,7 +173,18 @@ namespace StardewModdingAPI.Metadata { if (!string.IsNullOrWhiteSpace(location.mapPath.Value) && this.NormalizeAssetNameIgnoringEmpty(location.mapPath.Value) == key) { + static ISet GetWarpSet(GameLocation location) + { + return new HashSet( + location.warps.Select(p => $"{p.X} {p.Y} {p.TargetName} {p.TargetX} {p.TargetY}") + ); + } + + var oldWarps = GetWarpSet(location); this.ReloadMap(location); + var newWarps = GetWarpSet(location); + + changedWarps = changedWarps || oldWarps.Count != newWarps.Count || oldWarps.Any(p => !newWarps.Contains(p)); anyChanged = true; } } -- cgit From c070e34c2f18a18d03dbe9f86f5d17491215b6e2 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 21 Mar 2021 00:44:42 -0400 Subject: fix double-localization issue in regenerated bundles --- .../Framework/Commands/Other/RegenerateBundles.cs | 33 ++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/RegenerateBundles.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/RegenerateBundles.cs index d28abd13..9beedb96 100644 --- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/RegenerateBundles.cs +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Other/RegenerateBundles.cs @@ -1,6 +1,10 @@ using System; +using System.Collections.Generic; using System.Linq; +using System.Reflection; +using Netcode; using StardewValley; +using StardewValley.Network; namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.Other { @@ -56,9 +60,34 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.Other return; } + // get private fields + IWorldState state = Game1.netWorldState.Value; + var bundleData = state.GetType().GetField("_bundleData", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance)?.GetValue(state) as IDictionary + ?? throw new InvalidOperationException("Can't access '_bundleData' field on world state."); + var netBundleData = state.GetType().GetField("netBundleData", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance)?.GetValue(state) as NetStringDictionary + ?? throw new InvalidOperationException("Can't access 'netBundleData' field on world state."); + + // clear bundle data + state.BundleData.Clear(); + state.Bundles.Clear(); + state.BundleRewards.Clear(); + bundleData.Clear(); + netBundleData.Clear(); + // regenerate bundles - Game1.bundleType = bundleType; - Game1.GenerateBundles(bundleType, use_seed: useSeed); + var locale = LocalizedContentManager.CurrentLanguageCode; + try + { + LocalizedContentManager.CurrentLanguageCode = LocalizedContentManager.LanguageCode.en; // the base bundle data needs to be unlocalized (the game will add localized names later) + + Game1.bundleType = bundleType; + Game1.GenerateBundles(bundleType, use_seed: useSeed); + } + finally + { + LocalizedContentManager.CurrentLanguageCode = locale; + } + monitor.Log("Regenerated bundles and reset bundle progress.", LogLevel.Info); monitor.Log("This may have unintended effects if you've already completed any bundles. If you're not sure, exit your game without saving to cancel.", LogLevel.Warn); } -- cgit From d61bb78b2add425eb385931d36ab4b54e115d870 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 21 Mar 2021 15:18:30 -0400 Subject: simplify creating keybind list for single key --- src/SMAPI/Utilities/KeybindList.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/SMAPI/Utilities/KeybindList.cs b/src/SMAPI/Utilities/KeybindList.cs index 1845285a..28cae240 100644 --- a/src/SMAPI/Utilities/KeybindList.cs +++ b/src/SMAPI/Utilities/KeybindList.cs @@ -30,6 +30,11 @@ namespace StardewModdingAPI.Utilities this.IsBound = this.Keybinds.Any(); } + /// Construct an instance. + /// A single-key binding. + public KeybindList(SButton singleKey) + : this(new Keybind(singleKey)) { } + /// Parse a keybind list from a string, and throw an exception if it's not valid. /// The keybind string. See remarks on for format details. /// The format is invalid. -- cgit From fdfb060795a0cca62bc98df97c28160160f4317a Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 17 Mar 2021 20:36:31 -0400 Subject: remove unused code (#767) --- src/SMAPI.Tests/SMAPI.Tests.csproj | 2 -- src/SMAPI.Toolkit/Framework/LowLevelEnvironmentUtility.cs | 7 ------- src/SMAPI.Toolkit/Utilities/EnvironmentUtility.cs | 7 ------- src/SMAPI.Web/SMAPI.Web.csproj | 2 -- 4 files changed, 18 deletions(-) (limited to 'src') diff --git a/src/SMAPI.Tests/SMAPI.Tests.csproj b/src/SMAPI.Tests/SMAPI.Tests.csproj index 51fe32bf..00623b83 100644 --- a/src/SMAPI.Tests/SMAPI.Tests.csproj +++ b/src/SMAPI.Tests/SMAPI.Tests.csproj @@ -1,5 +1,4 @@  - SMAPI.Tests SMAPI.Tests @@ -33,5 +32,4 @@ - diff --git a/src/SMAPI.Toolkit/Framework/LowLevelEnvironmentUtility.cs b/src/SMAPI.Toolkit/Framework/LowLevelEnvironmentUtility.cs index b01d8b21..e635725c 100644 --- a/src/SMAPI.Toolkit/Framework/LowLevelEnvironmentUtility.cs +++ b/src/SMAPI.Toolkit/Framework/LowLevelEnvironmentUtility.cs @@ -89,13 +89,6 @@ namespace StardewModdingAPI.Toolkit.Framework : "StardewValley.exe"; } - /// Get whether the platform uses Mono. - /// The current platform. - public static bool IsMono(string platform) - { - return platform == nameof(Platform.Linux) || platform == nameof(Platform.Mac); - } - /********* ** Private methods diff --git a/src/SMAPI.Toolkit/Utilities/EnvironmentUtility.cs b/src/SMAPI.Toolkit/Utilities/EnvironmentUtility.cs index 4ef578f7..62bd13cd 100644 --- a/src/SMAPI.Toolkit/Utilities/EnvironmentUtility.cs +++ b/src/SMAPI.Toolkit/Utilities/EnvironmentUtility.cs @@ -46,12 +46,5 @@ namespace StardewModdingAPI.Toolkit.Utilities { return LowLevelEnvironmentUtility.GetExecutableName(platform.ToString()); } - - /// Get whether the platform uses Mono. - /// The current platform. - public static bool IsMono(this Platform platform) - { - return LowLevelEnvironmentUtility.IsMono(platform.ToString()); - } } } diff --git a/src/SMAPI.Web/SMAPI.Web.csproj b/src/SMAPI.Web/SMAPI.Web.csproj index 6f9f50f0..6cf8207f 100644 --- a/src/SMAPI.Web/SMAPI.Web.csproj +++ b/src/SMAPI.Web/SMAPI.Web.csproj @@ -1,5 +1,4 @@  - SMAPI.Web StardewModdingAPI.Web @@ -47,5 +46,4 @@ - -- cgit From 73321eceb96f263f10857667d7b3726a5098e770 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 17 Mar 2021 20:36:31 -0400 Subject: split compile flag into separate Windows + XNA flags (#767) --- src/SMAPI.ModBuildConfig/build/smapi.targets | 26 ++++++++++++++-------- .../SMAPI.Mods.ConsoleCommands.csproj | 15 ++++++++----- .../Patches/SpriteBatchValidationPatches.cs | 4 ++-- .../SMAPI.Mods.ErrorHandler.csproj | 15 ++++++++----- .../SMAPI.Mods.SaveBackup.csproj | 3 ++- src/SMAPI.Tests/SMAPI.Tests.csproj | 4 ++-- src/SMAPI.Toolkit/SMAPI.Toolkit.csproj | 2 ++ src/SMAPI.Web/SMAPI.Web.csproj | 4 ++-- src/SMAPI/Framework/InternalExtensions.cs | 2 +- src/SMAPI/Framework/SCore.cs | 4 ++-- src/SMAPI/SMAPI.csproj | 17 ++++++++------ 11 files changed, 58 insertions(+), 38 deletions(-) (limited to 'src') diff --git a/src/SMAPI.ModBuildConfig/build/smapi.targets b/src/SMAPI.ModBuildConfig/build/smapi.targets index 65544b12..76a1536c 100644 --- a/src/SMAPI.ModBuildConfig/build/smapi.targets +++ b/src/SMAPI.ModBuildConfig/build/smapi.targets @@ -47,19 +47,27 @@ - + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - + - - - @@ -41,5 +45,4 @@ - diff --git a/src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchValidationPatches.cs b/src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchValidationPatches.cs index 95e4f5ef..f605b2ce 100644 --- a/src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchValidationPatches.cs +++ b/src/SMAPI.Mods.ErrorHandler/Patches/SpriteBatchValidationPatches.cs @@ -27,7 +27,7 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches #endif { harmony.Patch( -#if SMAPI_FOR_WINDOWS +#if SMAPI_FOR_XNA original: AccessTools.Method(typeof(SpriteBatch), "InternalDraw"), #else original: AccessTools.Method(typeof(SpriteBatch), "CheckValid", new[] { typeof(Texture2D) }), @@ -40,7 +40,7 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches /********* ** Private methods *********/ -#if SMAPI_FOR_WINDOWS +#if SMAPI_FOR_XNA /// The method to call instead of . /// The texture to validate. #else diff --git a/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj b/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj index 5c0cf952..e5ce8f5e 100644 --- a/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj +++ b/src/SMAPI.Mods.ErrorHandler/SMAPI.Mods.ErrorHandler.csproj @@ -7,6 +7,8 @@ x86 + + @@ -16,19 +18,21 @@ + + + + + + - - + - - - @@ -42,5 +46,4 @@ - diff --git a/src/SMAPI.Mods.SaveBackup/SMAPI.Mods.SaveBackup.csproj b/src/SMAPI.Mods.SaveBackup/SMAPI.Mods.SaveBackup.csproj index 98a3f0cc..a30c2c1d 100644 --- a/src/SMAPI.Mods.SaveBackup/SMAPI.Mods.SaveBackup.csproj +++ b/src/SMAPI.Mods.SaveBackup/SMAPI.Mods.SaveBackup.csproj @@ -7,6 +7,8 @@ x86 + + @@ -20,5 +22,4 @@ - diff --git a/src/SMAPI.Tests/SMAPI.Tests.csproj b/src/SMAPI.Tests/SMAPI.Tests.csproj index 00623b83..f08b69ed 100644 --- a/src/SMAPI.Tests/SMAPI.Tests.csproj +++ b/src/SMAPI.Tests/SMAPI.Tests.csproj @@ -8,6 +8,8 @@ x86 + + @@ -30,6 +32,4 @@ - - diff --git a/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj b/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj index 3fc9de58..986a5f04 100644 --- a/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj +++ b/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj @@ -7,6 +7,8 @@ x86 + + diff --git a/src/SMAPI.Web/SMAPI.Web.csproj b/src/SMAPI.Web/SMAPI.Web.csproj index 6cf8207f..ce5ffdbd 100644 --- a/src/SMAPI.Web/SMAPI.Web.csproj +++ b/src/SMAPI.Web/SMAPI.Web.csproj @@ -6,6 +6,8 @@ latest +