fix asset propagation for title menu buttons

This commit is contained in:
Jesse Plamondon-Willard 2020-09-06 16:40:32 -04:00
parent a627453309
commit 0b21357e37
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
2 changed files with 7 additions and 0 deletions

View File

@ -24,6 +24,7 @@
* For modders:
* Added `PathUtilities` to simplify working with file/asset names.
* You can now read/write `SDate` values to JSON (e.g. for `config.json`, network mod messages, etc).
* Fixed asset propagation not updating title menu buttons immediately on Linux/Mac.
* For the web UI:
* Updated the JSON validator/schema for Content Patcher 1.16 and 1.17.

View File

@ -563,6 +563,7 @@ namespace StardewModdingAPI.Metadata
/// <param name="content">The content manager through which to reload the asset.</param>
/// <param name="key">The asset key to reload.</param>
/// <returns>Returns whether any textures were reloaded.</returns>
/// <remarks>Derived from the <see cref="TitleMenu"/> constructor and <see cref="TitleMenu.setUpIcons"/>.</remarks>
private bool ReloadTitleButtons(LocalizedContentManager content, string key)
{
if (Game1.activeClickableMenu is TitleMenu titleMenu)
@ -570,6 +571,11 @@ namespace StardewModdingAPI.Metadata
Texture2D texture = content.Load<Texture2D>(key);
titleMenu.titleButtonsTexture = texture;
titleMenu.backButton.texture = texture;
titleMenu.aboutButton.texture = texture;
titleMenu.languageButton.texture = texture;
foreach (ClickableTextureComponent button in titleMenu.buttons)
button.texture = titleMenu.titleButtonsTexture;
foreach (TemporaryAnimatedSprite bird in titleMenu.birds)
bird.texture = texture;