From a4938fc4653ad386e9ac88c2e6a0d95347b3f6f7 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 25 Aug 2020 23:13:55 -0400 Subject: tweak locale init so it doesn't depend on the game's internal load order --- src/SMAPI/Framework/SCore.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index a6067867..99a809ad 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -257,15 +257,13 @@ namespace StardewModdingAPI.Framework multiplayer: multiplayer, exitGameImmediately: this.ExitGameImmediately ); + StardewValley.Program.gamePtr = this.Game; // hook game events this.Game.OnGameContentLoaded += this.OnLoadContent; this.Game.OnGameUpdating += this.OnGameUpdating; this.Game.OnGameExiting += this.OnGameExiting; - this.Translator.SetLocale(this.ContentCore.GetLocale(), this.ContentCore.Language); - StardewValley.Program.gamePtr = this.Game; - // apply game patches new GamePatcher(this.Monitor).Apply( new EventErrorPatch(this.LogManager.MonitorForGame), @@ -1074,6 +1072,9 @@ namespace StardewModdingAPI.Framework if (this.ContentCore == null) { this.ContentCore = new ContentCoordinator(serviceProvider, rootDirectory, Thread.CurrentThread.CurrentUICulture, this.Monitor, this.Reflection, this.Toolkit.JsonHelper, this.InitializeBeforeFirstAssetLoaded); + if (this.ContentCore.Language != this.Translator.LocaleEnum) + this.Translator.SetLocale(this.ContentCore.GetLocale(), this.ContentCore.Language); + this.NextContentManagerIsMain = true; return this.ContentCore.CreateGameContentManager("Game1._temporaryContent"); } -- cgit