diff options
Diffstat (limited to 'src/StardewModdingAPI/Events/GraphicsEvents.cs')
-rw-r--r-- | src/StardewModdingAPI/Events/GraphicsEvents.cs | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/src/StardewModdingAPI/Events/GraphicsEvents.cs b/src/StardewModdingAPI/Events/GraphicsEvents.cs index fe38c1bb..a6112807 100644 --- a/src/StardewModdingAPI/Events/GraphicsEvents.cs +++ b/src/StardewModdingAPI/Events/GraphicsEvents.cs @@ -12,57 +12,57 @@ namespace StardewModdingAPI.Events ** Generic events ****/ /// <summary>Raised after the game window is resized.</summary> - public static event EventHandler Resize = delegate { }; + public static event EventHandler Resize; /// <summary>Raised when drawing debug information to the screen (when <see cref="StardewModdingAPI.Inheritance.SGame.Debug"/> is true). This is called after the sprite batch is begun. If you just want to add debug info, use <see cref="StardewModdingAPI.Inheritance.SGame.DebugMessageQueue" /> in your update loop.</summary> - public static event EventHandler DrawDebug = delegate { }; + public static event EventHandler DrawDebug; /// <summary>Obsolete.</summary> [Obsolete("Use the other Pre/Post render events instead.")] - public static event EventHandler DrawTick = delegate { }; + public static event EventHandler DrawTick; /// <summary>Obsolete.</summary> [Obsolete("Use the other Pre/Post render events instead. All of them will automatically be drawn into the render target if needed.")] - public static event EventHandler DrawInRenderTargetTick = delegate { }; + public static event EventHandler DrawInRenderTargetTick; /**** ** Main render events ****/ /// <summary>Raised before drawing everything to the screen during a draw loop.</summary> - public static event EventHandler OnPreRenderEvent = delegate { }; + public static event EventHandler OnPreRenderEvent; /// <summary>Raised after drawing everything to the screen during a draw loop.</summary> - public static event EventHandler OnPostRenderEvent = delegate { }; + public static event EventHandler OnPostRenderEvent; /**** ** HUD events ****/ /// <summary>Raised before drawing the HUD (item toolbar, clock, etc) to the screen. The HUD is available at this point, but not necessarily visible. (For example, the event is raised even if a menu is open.)</summary> - public static event EventHandler OnPreRenderHudEvent = delegate { }; + public static event EventHandler OnPreRenderHudEvent; /// <summary>Equivalent to <see cref="OnPreRenderHudEvent"/>, but invoked even if the HUD isn't available.</summary> - public static event EventHandler OnPreRenderHudEventNoCheck = delegate { }; + public static event EventHandler OnPreRenderHudEventNoCheck; /// <summary>Raised after drawing the HUD (item toolbar, clock, etc) to the screen. The HUD is available at this point, but not necessarily visible. (For example, the event is raised even if a menu is open.)</summary> - public static event EventHandler OnPostRenderHudEvent = delegate { }; + public static event EventHandler OnPostRenderHudEvent; /// <summary>Equivalent to <see cref="OnPostRenderHudEvent"/>, but invoked even if the HUD isn't available.</summary> - public static event EventHandler OnPostRenderHudEventNoCheck = delegate { }; + public static event EventHandler OnPostRenderHudEventNoCheck; /**** ** GUI events ****/ /// <summary>Raised before drawing a menu to the screen during a draw loop. This includes the game's internal menus like the title screen.</summary> - public static event EventHandler OnPreRenderGuiEvent = delegate { }; + public static event EventHandler OnPreRenderGuiEvent; /// <summary>Equivalent to <see cref="OnPreRenderGuiEvent"/>, but invoked even if there's no menu being drawn.</summary> - public static event EventHandler OnPreRenderGuiEventNoCheck = delegate { }; + public static event EventHandler OnPreRenderGuiEventNoCheck; /// <summary>Raised after drawing a menu to the screen during a draw loop. This includes the game's internal menus like the title screen.</summary> - public static event EventHandler OnPostRenderGuiEvent = delegate { }; + public static event EventHandler OnPostRenderGuiEvent; /// <summary>Equivalent to <see cref="OnPreRenderGuiEvent"/>, but invoked even if there's no menu being drawn.</summary> - public static event EventHandler OnPostRenderGuiEventNoCheck = delegate { }; + public static event EventHandler OnPostRenderGuiEventNoCheck; /********* @@ -76,7 +76,7 @@ namespace StardewModdingAPI.Events /// <param name="e">The event arguments.</param> internal static void InvokeResize(object sender, EventArgs e) { - GraphicsEvents.Resize.Invoke(sender, e); + GraphicsEvents.Resize?.Invoke(sender, e); } /// <summary>Raise a <see cref="DrawDebug"/> event.</summary> @@ -84,7 +84,7 @@ namespace StardewModdingAPI.Events /// <param name="e">The event arguments.</param> internal static void InvokeDrawDebug(object sender, EventArgs e) { - GraphicsEvents.DrawDebug.Invoke(sender, e); + GraphicsEvents.DrawDebug?.Invoke(sender, e); } /// <summary>Raise a <see cref="DrawTick"/> event.</summary> @@ -93,7 +93,7 @@ namespace StardewModdingAPI.Events { try { - GraphicsEvents.DrawTick.Invoke(null, EventArgs.Empty); + GraphicsEvents.DrawTick?.Invoke(null, EventArgs.Empty); } catch (Exception ex) { @@ -105,7 +105,7 @@ namespace StardewModdingAPI.Events [Obsolete("Should not be used.")] public static void InvokeDrawInRenderTargetTick() { - GraphicsEvents.DrawInRenderTargetTick.Invoke(null, EventArgs.Empty); + GraphicsEvents.DrawInRenderTargetTick?.Invoke(null, EventArgs.Empty); } /**** @@ -116,7 +116,7 @@ namespace StardewModdingAPI.Events /// <param name="e">The event arguments.</param> internal static void InvokeOnPreRenderEvent(object sender, EventArgs e) { - GraphicsEvents.OnPreRenderEvent.Invoke(sender, e); + GraphicsEvents.OnPreRenderEvent?.Invoke(sender, e); } /// <summary>Raise an <see cref="OnPostRenderEvent"/> event.</summary> @@ -124,7 +124,7 @@ namespace StardewModdingAPI.Events /// <param name="e">The event arguments.</param> internal static void InvokeOnPostRenderEvent(object sender, EventArgs e) { - GraphicsEvents.OnPostRenderEvent.Invoke(sender, e); + GraphicsEvents.OnPostRenderEvent?.Invoke(sender, e); } /**** @@ -135,7 +135,7 @@ namespace StardewModdingAPI.Events /// <param name="e">The event arguments.</param> internal static void InvokeOnPreRenderGuiEvent(object sender, EventArgs e) { - GraphicsEvents.OnPreRenderGuiEvent.Invoke(sender, e); + GraphicsEvents.OnPreRenderGuiEvent?.Invoke(sender, e); } /// <summary>Raise an <see cref="OnPreRenderGuiEventNoCheck"/> event.</summary> @@ -143,7 +143,7 @@ namespace StardewModdingAPI.Events /// <param name="e">The event arguments.</param> internal static void InvokeOnPreRenderGuiEventNoCheck(object sender, EventArgs e) { - GraphicsEvents.OnPreRenderGuiEventNoCheck.Invoke(sender, e); + GraphicsEvents.OnPreRenderGuiEventNoCheck?.Invoke(sender, e); } /// <summary>Raise an <see cref="OnPostRenderGuiEvent"/> event.</summary> @@ -151,7 +151,7 @@ namespace StardewModdingAPI.Events /// <param name="e">The event arguments.</param> internal static void InvokeOnPostRenderGuiEvent(object sender, EventArgs e) { - GraphicsEvents.OnPostRenderGuiEvent.Invoke(sender, e); + GraphicsEvents.OnPostRenderGuiEvent?.Invoke(sender, e); } /// <summary>Raise an <see cref="OnPostRenderGuiEventNoCheck"/> event.</summary> @@ -159,7 +159,7 @@ namespace StardewModdingAPI.Events /// <param name="e">The event arguments.</param> internal static void InvokeOnPostRenderGuiEventNoCheck(object sender, EventArgs e) { - GraphicsEvents.OnPostRenderGuiEventNoCheck.Invoke(sender, e); + GraphicsEvents.OnPostRenderGuiEventNoCheck?.Invoke(sender, e); } /**** @@ -170,7 +170,7 @@ namespace StardewModdingAPI.Events /// <param name="e">The event arguments.</param> internal static void InvokeOnPreRenderHudEvent(object sender, EventArgs e) { - GraphicsEvents.OnPreRenderHudEvent.Invoke(sender, e); + GraphicsEvents.OnPreRenderHudEvent?.Invoke(sender, e); } /// <summary>Raise an <see cref="OnPreRenderHudEventNoCheck"/> event.</summary> @@ -178,7 +178,7 @@ namespace StardewModdingAPI.Events /// <param name="e">The event arguments.</param> internal static void InvokeOnPreRenderHudEventNoCheck(object sender, EventArgs e) { - GraphicsEvents.OnPreRenderHudEventNoCheck.Invoke(sender, e); + GraphicsEvents.OnPreRenderHudEventNoCheck?.Invoke(sender, e); } /// <summary>Raise an <see cref="OnPostRenderHudEvent"/> event.</summary> @@ -186,7 +186,7 @@ namespace StardewModdingAPI.Events /// <param name="e">The event arguments.</param> internal static void InvokeOnPostRenderHudEvent(object sender, EventArgs e) { - GraphicsEvents.OnPostRenderHudEvent.Invoke(sender, e); + GraphicsEvents.OnPostRenderHudEvent?.Invoke(sender, e); } /// <summary>Raise an <see cref="OnPostRenderHudEventNoCheck"/> event.</summary> @@ -194,7 +194,7 @@ namespace StardewModdingAPI.Events /// <param name="e">The event arguments.</param> internal static void InvokeOnPostRenderHudEventNoCheck(object sender, EventArgs e) { - GraphicsEvents.OnPostRenderHudEventNoCheck.Invoke(sender, e); + GraphicsEvents.OnPostRenderHudEventNoCheck?.Invoke(sender, e); } } } |