summaryrefslogtreecommitdiff
path: root/src/SMAPI
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-09-06 16:39:47 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-09-06 16:39:47 -0400
commita6274533090053e1c9ccc9ddf282cb672b0e3af5 (patch)
tree39933a5587253015dbfdaf8a02d25582fc9c5fe0 /src/SMAPI
parentd7209e438d926bad7ae027ac489937dd3b4d3f8c (diff)
downloadSMAPI-a6274533090053e1c9ccc9ddf282cb672b0e3af5.tar.gz
SMAPI-a6274533090053e1c9ccc9ddf282cb672b0e3af5.tar.bz2
SMAPI-a6274533090053e1c9ccc9ddf282cb672b0e3af5.zip
move title menu asset propagation into method
Diffstat (limited to 'src/SMAPI')
-rw-r--r--src/SMAPI/Metadata/CoreAssetPropagator.cs32
1 files changed, 21 insertions, 11 deletions
diff --git a/src/SMAPI/Metadata/CoreAssetPropagator.cs b/src/SMAPI/Metadata/CoreAssetPropagator.cs
index 41d10cd4..d7dd9fb9 100644
--- a/src/SMAPI/Metadata/CoreAssetPropagator.cs
+++ b/src/SMAPI/Metadata/CoreAssetPropagator.cs
@@ -452,17 +452,7 @@ namespace StardewModdingAPI.Metadata
return false;
case "minigames\\titlebuttons": // TitleMenu
- {
- if (Game1.activeClickableMenu is TitleMenu titleMenu)
- {
- Texture2D texture = content.Load<Texture2D>(key);
- titleMenu.titleButtonsTexture = texture;
- foreach (TemporaryAnimatedSprite bird in titleMenu.birds)
- bird.texture = texture;
- return true;
- }
- }
- return false;
+ return this.ReloadTitleButtons(content, key);
/****
** Content\TileSheets
@@ -569,6 +559,26 @@ namespace StardewModdingAPI.Metadata
/****
** Reload texture methods
****/
+ /// <summary>Reload buttons on the title screen.</summary>
+ /// <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>
+ private bool ReloadTitleButtons(LocalizedContentManager content, string key)
+ {
+ if (Game1.activeClickableMenu is TitleMenu titleMenu)
+ {
+ Texture2D texture = content.Load<Texture2D>(key);
+
+ titleMenu.titleButtonsTexture = texture;
+ foreach (TemporaryAnimatedSprite bird in titleMenu.birds)
+ bird.texture = texture;
+
+ return true;
+ }
+
+ return false;
+ }
+
/// <summary>Reload the sprites for matching pets or horses.</summary>
/// <typeparam name="TAnimal">The animal type.</typeparam>
/// <param name="content">The content manager through which to reload the asset.</param>