From c23f70d602eacbed405a39797e40ee9e89537cf4 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 1 Mar 2017 20:09:51 -0500 Subject: update content manager code for SDV 1.2.11 (#173) --- src/StardewModdingAPI/Framework/SGame.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/StardewModdingAPI/Framework/SGame.cs b/src/StardewModdingAPI/Framework/SGame.cs index aab44b59..675dc0c2 100644 --- a/src/StardewModdingAPI/Framework/SGame.cs +++ b/src/StardewModdingAPI/Framework/SGame.cs @@ -285,17 +285,18 @@ namespace StardewModdingAPI.Framework GameEvents.InvokeInitialize(this.Monitor); } + /// Constructor a content manager to read XNB files. + /// The service provider to use to locate services. + /// The root directory to search for content. + protected override LocalizedContentManager CreateContentManager(IServiceProvider serviceProvider, string rootDirectory) + { + return new SContentManager(this.Content.ServiceProvider, this.Content.RootDirectory, this.Monitor); + } + /// The method called before XNA or MonoGame loads or reloads graphics resources. protected override void LoadContent() { - // override content manager - LocalizedContentManager contentManager = Game1.content; - Game1.content = new SContentManager(this.Content.ServiceProvider, this.Content.RootDirectory, this.Monitor); - - // defer to game logic base.LoadContent(); - - // raise load content event GameEvents.InvokeLoadContent(this.Monitor); } -- cgit