summaryrefslogtreecommitdiff
path: root/StardewModdingAPI
diff options
context:
space:
mode:
Diffstat (limited to 'StardewModdingAPI')
-rw-r--r--StardewModdingAPI/Constants.cs2
-rw-r--r--StardewModdingAPI/Events/Graphics.cs41
-rw-r--r--StardewModdingAPI/Inheritance/SGame.cs10
3 files changed, 51 insertions, 2 deletions
diff --git a/StardewModdingAPI/Constants.cs b/StardewModdingAPI/Constants.cs
index d1079f61..7ec60965 100644
--- a/StardewModdingAPI/Constants.cs
+++ b/StardewModdingAPI/Constants.cs
@@ -10,7 +10,7 @@ namespace StardewModdingAPI
/// </summary>
public static class Constants
{
- public static readonly Version Version = new Version(0, 39, 5, "Alpha");
+ public static readonly Version Version = new Version(0, 39, 7, "Alpha");
/// <summary>
/// Not quite "constant", but it makes more sense for it to be here, at least for now
diff --git a/StardewModdingAPI/Events/Graphics.cs b/StardewModdingAPI/Events/Graphics.cs
index 4e533f92..ed129137 100644
--- a/StardewModdingAPI/Events/Graphics.cs
+++ b/StardewModdingAPI/Events/Graphics.cs
@@ -43,6 +43,27 @@ namespace StardewModdingAPI.Events
public static event EventHandler OnPostRenderEvent = delegate { };
/// <summary>
+ /// Occurs before the GUI is drawn. Does not check for conditional statements.
+ /// </summary>
+
+ public static event EventHandler OnPreRenderGuiEventNoCheck = delegate { };
+ /// <summary>
+ /// Occurs after the GUI is drawn. Does not check for conditional statements.
+ /// </summary>
+
+ public static event EventHandler OnPostRenderGuiEventNoCheck = delegate { };
+ /// <summary>
+ /// Occurs before the HUD is drawn. Does not check for conditional statements.
+ /// </summary>
+
+ public static event EventHandler OnPreRenderHudEventNoCheck = delegate { };
+ /// <summary>
+ /// Occurs after the HUD is drawn. Does not check for conditional statements.
+ /// </summary>
+
+ public static event EventHandler OnPostRenderHudEventNoCheck = delegate { };
+
+ /// <summary>
/// Draws when SGame.Debug is true. F3 toggles this.
/// Game1.spriteBatch.Begin() is pre-called.
/// Do not make end or begin calls to the spritebatch.
@@ -85,6 +106,26 @@ namespace StardewModdingAPI.Events
OnPostRenderEvent.Invoke(sender, e);
}
+ internal static void InvokeOnPreRenderGuiEventNoCheck(object sender, EventArgs e)
+ {
+ OnPreRenderGuiEventNoCheck.Invoke(sender, e);
+ }
+
+ internal static void InvokeOnPostRenderGuiEventNoCheck(object sender, EventArgs e)
+ {
+ OnPostRenderGuiEventNoCheck.Invoke(sender, e);
+ }
+
+ internal static void InvokeOnPreRenderHudEventNoCheck(object sender, EventArgs e)
+ {
+ OnPreRenderHudEventNoCheck.Invoke(sender, e);
+ }
+
+ internal static void InvokeOnPostRenderHudEventNoCheck(object sender, EventArgs e)
+ {
+ OnPostRenderHudEventNoCheck.Invoke(sender, e);
+ }
+
internal static void InvokeResize(object sender, EventArgs e)
{
Resize.Invoke(sender, e);
diff --git a/StardewModdingAPI/Inheritance/SGame.cs b/StardewModdingAPI/Inheritance/SGame.cs
index 0337f21a..b0cff241 100644
--- a/StardewModdingAPI/Inheritance/SGame.cs
+++ b/StardewModdingAPI/Inheritance/SGame.cs
@@ -1210,6 +1210,8 @@ namespace StardewModdingAPI.Inheritance
{
drawBillboard();
}
+
+ GraphicsEvents.InvokeOnPreRenderHudEventNoCheck(null, EventArgs.Empty);
if ((displayHUD || eventUp) && currentBillboard == 0 && gameMode == 3 && !freezeControls && !panMode)
{
GraphicsEvents.InvokeOnPreRenderHudEvent(null, EventArgs.Empty);
@@ -1222,6 +1224,8 @@ namespace StardewModdingAPI.Inheritance
{
spriteBatch.Draw(mouseCursors, new Vector2(getOldMouseX(), getOldMouseY()), getSourceRectForStandardTileSheet(mouseCursors, 0, 16, 16), Color.White, 0f, Vector2.Zero, 4f + dialogueButtonScale / 150f, SpriteEffects.None, 1f);
}
+ GraphicsEvents.InvokeOnPostRenderHudEventNoCheck(null, EventArgs.Empty);
+
if (hudMessages.Any() && (!eventUp || isFestival()))
{
for (int l = hudMessages.Count - 1; l >= 0; l--)
@@ -1290,6 +1294,8 @@ namespace StardewModdingAPI.Inheritance
{
spriteBatch.DrawString(smallFont, keyHelpString, new Vector2(tileSize, viewport.Height - tileSize - (dialogueUp ? (tileSize * 3 + (isQuestion ? (questionChoices.Count * tileSize) : 0)) : 0) - smallFont.MeasureString(keyHelpString).Y), Color.LightGray, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0.9999999f);
}
+
+ GraphicsEvents.InvokeOnPreRenderGuiEventNoCheck(null, EventArgs.Empty);
if (activeClickableMenu != null)
{
GraphicsEvents.InvokeOnPreRenderGuiEvent(null, EventArgs.Empty);
@@ -1300,11 +1306,11 @@ namespace StardewModdingAPI.Inheritance
{
farmEvent?.drawAboveEverything(spriteBatch);
}
+ GraphicsEvents.InvokeOnPostRenderGuiEventNoCheck(null, EventArgs.Empty);
GraphicsEvents.InvokeOnPostRenderEvent(null, EventArgs.Empty);
spriteBatch.End();
- GraphicsEvents.InvokeDrawTick();
GraphicsEvents.InvokeDrawInRenderTargetTick();
if (!ZoomLevelIsOne)
@@ -1315,6 +1321,8 @@ namespace StardewModdingAPI.Inheritance
spriteBatch.Draw(Screen, Vector2.Zero, Screen.Bounds, Color.White, 0f, Vector2.Zero, options.zoomLevel, SpriteEffects.None, 1f);
spriteBatch.End();
}
+
+ GraphicsEvents.InvokeDrawTick();
}
catch (Exception ex)
{