summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-01-18 18:52:31 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-01-18 18:52:31 -0500
commit9fb6d67417ee3f2db0754b135786e052ae308683 (patch)
treecc86435a5eb0731386d81470655a887b126c0be1 /src
parent47df90f67cab0f1903f0214fed4795c8bd181fe0 (diff)
downloadSMAPI-9fb6d67417ee3f2db0754b135786e052ae308683.tar.gz
SMAPI-9fb6d67417ee3f2db0754b135786e052ae308683.tar.bz2
SMAPI-9fb6d67417ee3f2db0754b135786e052ae308683.zip
add asset propagation for Strings\StringsFromCSFiles
Diffstat (limited to 'src')
-rw-r--r--src/SMAPI/Metadata/CoreAssetPropagator.cs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/SMAPI/Metadata/CoreAssetPropagator.cs b/src/SMAPI/Metadata/CoreAssetPropagator.cs
index 72130e05..24b578ad 100644
--- a/src/SMAPI/Metadata/CoreAssetPropagator.cs
+++ b/src/SMAPI/Metadata/CoreAssetPropagator.cs
@@ -409,6 +409,12 @@ namespace StardewModdingAPI.Metadata
return this.ReloadTitleButtons(content, key);
/****
+ ** Content\Strings
+ ****/
+ case "strings\\stringsfromcsfiles":
+ return this.ReloadStringsFromCsFiles(content);
+
+ /****
** Content\TileSheets
****/
case "tilesheets\\animations": // Game1.LoadContent
@@ -1028,6 +1034,27 @@ namespace StardewModdingAPI.Metadata
return true;
}
+ /// <summary>Reload cached translations from the <c>Strings\StringsFromCSFiles</c> asset.</summary>
+ /// <param name="content">The content manager through which to reload the asset.</param>
+ /// <returns>Returns whether any data was reloaded.</returns>
+ /// <remarks>Derived from the <see cref="Game1.TranslateFields"/>.</remarks>
+ private bool ReloadStringsFromCsFiles(LocalizedContentManager content)
+ {
+ Game1.samBandName = content.LoadString("Strings\\StringsFromCSFiles:Game1.cs.2156");
+ Game1.elliottBookName = content.LoadString("Strings\\StringsFromCSFiles:Game1.cs.2157");
+
+ string[] dayNames = this.Reflection.GetField<string[]>(typeof(Game1), "_shortDayDisplayName").GetValue();
+ dayNames[0] = content.LoadString("Strings\\StringsFromCSFiles:Game1.cs.3042");
+ dayNames[1] = content.LoadString("Strings\\StringsFromCSFiles:Game1.cs.3043");
+ dayNames[2] = content.LoadString("Strings\\StringsFromCSFiles:Game1.cs.3044");
+ dayNames[3] = content.LoadString("Strings\\StringsFromCSFiles:Game1.cs.3045");
+ dayNames[4] = content.LoadString("Strings\\StringsFromCSFiles:Game1.cs.3046");
+ dayNames[5] = content.LoadString("Strings\\StringsFromCSFiles:Game1.cs.3047");
+ dayNames[6] = content.LoadString("Strings\\StringsFromCSFiles:Game1.cs.3048");
+
+ return true;
+ }
+
/****
** Helpers
****/