diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-03-23 01:06:11 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-03-23 01:06:11 -0400 |
commit | 584725bb8e554e314843315facca1fd15868bee4 (patch) | |
tree | fdb4ecc4a9f190e7e4018fc3334ad8a4bec53e6d /src/SMAPI/Events/IContentEvents.cs | |
parent | b07d2340a9a6da22ee0fd95f2c6ccca3939cb7ab (diff) | |
download | SMAPI-584725bb8e554e314843315facca1fd15868bee4.tar.gz SMAPI-584725bb8e554e314843315facca1fd15868bee4.tar.bz2 SMAPI-584725bb8e554e314843315facca1fd15868bee4.zip |
add initial AssetRequested content event (#766)
Diffstat (limited to 'src/SMAPI/Events/IContentEvents.cs')
-rw-r--r-- | src/SMAPI/Events/IContentEvents.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/SMAPI/Events/IContentEvents.cs b/src/SMAPI/Events/IContentEvents.cs new file mode 100644 index 00000000..feaf9c0a --- /dev/null +++ b/src/SMAPI/Events/IContentEvents.cs @@ -0,0 +1,17 @@ +using System; +using StardewValley; + +namespace StardewModdingAPI.Events +{ + /// <summary>Events related to assets loaded from the content pipeline (including data, maps, and textures).</summary> + public interface IContentEvents + { + /// <summary>Raised when an asset is being requested from the content pipeline.</summary> + /// <remarks> + /// The asset isn't necessarily being loaded yet (e.g. the game may be checking if it exists). Mods can register the changes they want to apply using methods on the <paramref name="e"/> parameter. These will be applied when the asset is actually loaded. + /// + /// If the asset is requested multiple times in the same tick (e.g. once to check if it exists and once to load it), SMAPI might only raise the event once and reuse the cached result. + /// </remarks> + event EventHandler<AssetRequestedEventArgs> AssetRequested; + } +} |