summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/Events
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-03-26 19:08:25 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-03-26 19:08:25 -0400
commit03efea26676464933513383eb1c841f1ca5db34d (patch)
tree6f9845ddca8ebae2d510affadfac025a30b321d6 /src/SMAPI/Framework/Events
parenteebd8d54dc068cff2b5127a4b8f03d0b54b89542 (diff)
downloadSMAPI-03efea26676464933513383eb1c841f1ca5db34d.tar.gz
SMAPI-03efea26676464933513383eb1c841f1ca5db34d.tar.bz2
SMAPI-03efea26676464933513383eb1c841f1ca5db34d.zip
add LocaleChanged 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 bcfd7dd7..41540047 100644
--- a/src/SMAPI/Framework/Events/EventManager.cs
+++ b/src/SMAPI/Framework/Events/EventManager.cs
@@ -20,6 +20,9 @@ namespace StardewModdingAPI.Framework.Events
/// <inheritdoc cref="IContentEvents.AssetReady" />
public readonly ManagedEvent<AssetReadyEventArgs> AssetReady;
+ /// <inheritdoc cref="IContentEvents.LocaleChanged" />
+ public readonly ManagedEvent<LocaleChangedEventArgs> LocaleChanged;
+
/****
** Display
@@ -204,6 +207,7 @@ namespace StardewModdingAPI.Framework.Events
this.AssetRequested = ManageEventOf<AssetRequestedEventArgs>(nameof(IModEvents.Content), nameof(IContentEvents.AssetRequested));
this.AssetsInvalidated = ManageEventOf<AssetsInvalidatedEventArgs>(nameof(IModEvents.Content), nameof(IContentEvents.AssetsInvalidated));
this.AssetReady = ManageEventOf<AssetReadyEventArgs>(nameof(IModEvents.Content), nameof(IContentEvents.AssetReady));
+ this.LocaleChanged = ManageEventOf<LocaleChangedEventArgs>(nameof(IModEvents.Content), nameof(IContentEvents.LocaleChanged));
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 cb242e99..beb96031 100644
--- a/src/SMAPI/Framework/Events/ModContentEvents.cs
+++ b/src/SMAPI/Framework/Events/ModContentEvents.cs
@@ -30,6 +30,13 @@ namespace StardewModdingAPI.Framework.Events
remove => this.EventManager.AssetReady.Remove(value);
}
+ /// <inheritdoc />
+ public event EventHandler<LocaleChangedEventArgs> LocaleChanged
+ {
+ add => this.EventManager.LocaleChanged.Add(value, this.Mod);
+ remove => this.EventManager.LocaleChanged.Remove(value);
+ }
+
/*********
** Public methods