fix assets not being reloaded when mods implement IAssetEditor or IAssetLoader directly

This commit is contained in:
Jesse Plamondon-Willard 2017-10-13 23:13:06 -04:00
parent ff718d7993
commit f663ed3359
1 changed files with 7 additions and 0 deletions

View File

@ -774,6 +774,13 @@ namespace StardewModdingAPI
// add interceptors
if (metadata.Mod.Helper.Content is ContentHelper helper)
{
// ReSharper disable SuspiciousTypeConversion.Global
if (metadata.Mod is IAssetEditor editor)
helper.ObservableAssetEditors.Add(editor);
if (metadata.Mod is IAssetLoader loader)
helper.ObservableAssetLoaders.Add(loader);
// ReSharper restore SuspiciousTypeConversion.Global
this.ContentManager.Editors[metadata] = helper.ObservableAssetEditors;
this.ContentManager.Loaders[metadata] = helper.ObservableAssetLoaders;
}