summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/SCore.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework/SCore.cs')
-rw-r--r--src/SMAPI/Framework/SCore.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs
index f9f84206..e9bc9a2b 100644
--- a/src/SMAPI/Framework/SCore.cs
+++ b/src/SMAPI/Framework/SCore.cs
@@ -1106,6 +1106,14 @@ namespace StardewModdingAPI.Framework
this.EventManager.DayEnding.RaiseEmpty();
}
+ /// <summary>A callback invoked after assets have been invalidated from the content cache.</summary>
+ /// <param name="assetNames">The invalidated asset names.</param>
+ private void OnAssetsInvalidated(IEnumerable<IAssetName> assetNames)
+ {
+ if (this.EventManager.AssetsInvalidated.HasListeners())
+ this.EventManager.AssetsInvalidated.Raise(new AssetsInvalidatedEventArgs(assetNames));
+ }
+
/// <summary>Get the load/edit operations to apply to an asset by querying registered <see cref="IContentEvents.AssetRequested"/> event handlers.</summary>
/// <param name="asset">The asset info being requested.</param>
private IList<AssetOperationGroup> RequestAssetOperations(IAssetInfo asset)
@@ -1175,6 +1183,7 @@ namespace StardewModdingAPI.Framework
reflection: this.Reflection,
jsonHelper: this.Toolkit.JsonHelper,
onLoadingFirstAsset: this.InitializeBeforeFirstAssetLoaded,
+ onAssetsInvalidated: this.OnAssetsInvalidated,
aggressiveMemoryOptimizations: this.Settings.AggressiveMemoryOptimizations,
requestAssetOperations: this.RequestAssetOperations
);