summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/Events
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-03-24 22:55:55 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-03-24 22:55:55 -0400
commit2b0ce2bb4d6690b7d00da0a243855db9bffffbf0 (patch)
tree43c944e0af70ec8bcf628fd6f13f04f01826d869 /src/SMAPI/Framework/Events
parent6a43e6dfad0f4d3a17ea20ef391fe760135f1c24 (diff)
downloadSMAPI-2b0ce2bb4d6690b7d00da0a243855db9bffffbf0.tar.gz
SMAPI-2b0ce2bb4d6690b7d00da0a243855db9bffffbf0.tar.bz2
SMAPI-2b0ce2bb4d6690b7d00da0a243855db9bffffbf0.zip
add AssetInvalidated content event (#766)
Diffstat (limited to 'src/SMAPI/Framework/Events')
-rw-r--r--src/SMAPI/Framework/Events/EventManager.cs4
-rw-r--r--src/SMAPI/Framework/Events/ModContentEvents.cs7
2 files changed, 11 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/Events/EventManager.cs b/src/SMAPI/Framework/Events/EventManager.cs
index 8142f00e..96582380 100644
--- a/src/SMAPI/Framework/Events/EventManager.cs
+++ b/src/SMAPI/Framework/Events/EventManager.cs
@@ -16,6 +16,9 @@ namespace StardewModdingAPI.Framework.Events
/// <inheritdoc cref="IContentEvents.AssetRequested" />
public readonly ManagedEvent<AssetRequestedEventArgs> AssetRequested;
+ /// <inheritdoc cref="IContentEvents.AssetsInvalidated" />
+ public readonly ManagedEvent<AssetsInvalidatedEventArgs> AssetsInvalidated;
+
/****
** Display
@@ -198,6 +201,7 @@ namespace StardewModdingAPI.Framework.Events
// init events
this.AssetRequested = ManageEventOf<AssetRequestedEventArgs>(nameof(IModEvents.Content), nameof(IContentEvents.AssetRequested));
+ this.AssetsInvalidated = ManageEventOf<AssetsInvalidatedEventArgs>(nameof(IModEvents.Content), nameof(IContentEvents.AssetsInvalidated));
this.MenuChanged = ManageEventOf<MenuChangedEventArgs>(nameof(IModEvents.Display), nameof(IDisplayEvents.MenuChanged));
this.Rendering = ManageEventOf<RenderingEventArgs>(nameof(IModEvents.Display), nameof(IDisplayEvents.Rendering), isPerformanceCritical: true);
diff --git a/src/SMAPI/Framework/Events/ModContentEvents.cs b/src/SMAPI/Framework/Events/ModContentEvents.cs
index b4d4279c..4d0cfb97 100644
--- a/src/SMAPI/Framework/Events/ModContentEvents.cs
+++ b/src/SMAPI/Framework/Events/ModContentEvents.cs
@@ -16,6 +16,13 @@ namespace StardewModdingAPI.Framework.Events
remove => this.EventManager.AssetRequested.Remove(value);
}
+ /// <inheritdoc />
+ public event EventHandler<AssetsInvalidatedEventArgs> AssetsInvalidated
+ {
+ add => this.EventManager.AssetsInvalidated.Add(value, this.Mod);
+ remove => this.EventManager.AssetsInvalidated.Remove(value);
+ }
+
/*********
** Public methods