diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-03-11 20:31:19 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-03-11 20:31:19 -0400 |
commit | de17f87d87f5964483e2abbae8169beff19a89f8 (patch) | |
tree | 4c9387c9337193fa70d1e6675a1d8962884680bf | |
parent | 588d4d94fa63198fec2a7b861ecea17cf2085cee (diff) | |
download | SMAPI-de17f87d87f5964483e2abbae8169beff19a89f8.tar.gz SMAPI-de17f87d87f5964483e2abbae8169beff19a89f8.tar.bz2 SMAPI-de17f87d87f5964483e2abbae8169beff19a89f8.zip |
fix some title menu assets not being editable (#453, #413)
-rw-r--r-- | docs/release-notes.md | 1 | ||||
-rw-r--r-- | src/SMAPI/Metadata/CoreAssets.cs | 21 |
2 files changed, 22 insertions, 0 deletions
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<Texture2D>(key), ["TerrainFeatures\\hoeDirtSnow"] = (content, key) => HoeDirt.snowTexture = content.Load<Texture2D>(key), + // from TitleMenu + ["Minigames\\Clouds"] = (content, key) => + { + if (Game1.activeClickableMenu is TitleMenu) + reflection.GetField<Texture2D>(Game1.activeClickableMenu, "cloudsTexture").SetValue(content.Load<Texture2D>(key)); + }, + ["Minigames\\TitleButtons"] = (content, key) => + { + if (Game1.activeClickableMenu is TitleMenu titleMenu) + { + reflection.GetField<Texture2D>(titleMenu, "titleButtonsTexture").SetValue(content.Load<Texture2D>(key)); + foreach (TemporaryAnimatedSprite bird in reflection.GetField<List<TemporaryAnimatedSprite>>(titleMenu, "birds").GetValue()) +#if STARDEW_VALLEY_1_3 + bird.texture = content.Load<Texture2D>(key); +#else + bird.Texture = content.Load<Texture2D>(key); +#endif + } + }, + // from Wallpaper ["Maps\\walls_and_floors"] = (content, key) => Wallpaper.wallpaperTexture = content.Load<Texture2D>(key) } |