diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-03-03 20:57:52 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-03-03 20:57:52 -0500 |
commit | 4991a25d4633e146ead43872277d67685cb2e23b (patch) | |
tree | a214bf40d8fd2f228bff69e2b2a6b75a161f999f /src/StardewModdingAPI/Events/ContentEvents.cs | |
parent | c3c6fa1187987d0aff50a714e64b3b3ea3820ef0 (diff) | |
download | SMAPI-4991a25d4633e146ead43872277d67685cb2e23b.tar.gz SMAPI-4991a25d4633e146ead43872277d67685cb2e23b.tar.bz2 SMAPI-4991a25d4633e146ead43872277d67685cb2e23b.zip |
add content language changed event (#243)
Diffstat (limited to 'src/StardewModdingAPI/Events/ContentEvents.cs')
-rw-r--r-- | src/StardewModdingAPI/Events/ContentEvents.cs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/StardewModdingAPI/Events/ContentEvents.cs b/src/StardewModdingAPI/Events/ContentEvents.cs index cc07f242..558fc070 100644 --- a/src/StardewModdingAPI/Events/ContentEvents.cs +++ b/src/StardewModdingAPI/Events/ContentEvents.cs @@ -24,6 +24,9 @@ namespace StardewModdingAPI.Events /********* ** Events *********/ + /// <summary>Raised after the content language changes.</summary> + public static event EventHandler<EventArgsValueChanged<string>> AfterLocaleChanged; + /// <summary>Raised when an XNB file is being read into the cache. Mods can change the data here before it's cached.</summary> public static event EventHandler<IContentEventHelper> AssetLoading; @@ -40,6 +43,15 @@ namespace StardewModdingAPI.Events ContentEvents.Monitor = monitor; } + /// <summary>Raise an <see cref="AfterLocaleChanged"/> event.</summary> + /// <param name="monitor">Encapsulates monitoring and logging.</param> + /// <param name="oldLocale">The previous locale.</param> + /// <param name="newLocale">The current locale.</param> + internal static void InvokeAfterLocaleChanged(IMonitor monitor, string oldLocale, string newLocale) + { + monitor.SafelyRaiseGenericEvent($"{nameof(ContentEvents)}.{nameof(ContentEvents.AfterLocaleChanged)}", ContentEvents.AfterLocaleChanged?.GetInvocationList(), null, new EventArgsValueChanged<string>(oldLocale, newLocale)); + } + /// <summary>Raise an <see cref="AssetLoading"/> event.</summary> /// <param name="monitor">Encapsulates monitoring and logging.</param> /// <param name="contentHelper">Encapsulates access and changes to content being read from a data file.</param> |