summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/release-notes.md1
-rw-r--r--src/SMAPI/Framework/SGame.cs18
2 files changed, 19 insertions, 0 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 5f643f07..3771ec19 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -123,6 +123,7 @@ For modders:
* Fixed issue where, when a mod's `IAssetEditor` uses `asset.ReplaceWith` on a texture asset while playing in non-English, any changes from that point won't affect subsequent cached asset loads.
* Fixed asset propagation for NPC portraits resetting any unique portraits (e.g. Maru's hospital portrait) to the default.
* Fixed changes to `Data\NPCDispositions` not always propagated correctly to existing NPCs.
+ * Fixed `Rendering`/`Rendered` events not raised during minigames.
* Fixed `LoadStageChanged` event not raising correct flags in some cases when creating a new save.
* Fixed `GetApi` without an interface not checking if all mods are loaded.
diff --git a/src/SMAPI/Framework/SGame.cs b/src/SMAPI/Framework/SGame.cs
index cabbbc3a..aa84295c 100644
--- a/src/SMAPI/Framework/SGame.cs
+++ b/src/SMAPI/Framework/SGame.cs
@@ -908,6 +908,14 @@ namespace StardewModdingAPI.Framework
}
else if (Game1.currentMinigame != null)
{
+ int batchEnds = 0;
+
+ if (events.Rendering.HasListeners())
+ {
+ Game1.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null);
+ events.Rendering.RaiseEmpty();
+ Game1.spriteBatch.End();
+ }
Game1.currentMinigame.draw(Game1.spriteBatch);
if (Game1.globalFade && !Game1.menuUp && (!Game1.nameSelectUp || Game1.messagePause))
{
@@ -917,11 +925,21 @@ namespace StardewModdingAPI.Framework
}
this.drawOverlays(Game1.spriteBatch);
if (target_screen == null)
+ {
+ if (++batchEnds == 1 && events.Rendered.HasListeners())
+ {
+ Game1.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null);
+ events.Rendered.RaiseEmpty();
+ Game1.spriteBatch.End();
+ }
return;
+ }
this.GraphicsDevice.SetRenderTarget((RenderTarget2D)null);
this.GraphicsDevice.Clear(Game1.bgColor);
Game1.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.Default, RasterizerState.CullNone);
Game1.spriteBatch.Draw((Texture2D)target_screen, Vector2.Zero, new Microsoft.Xna.Framework.Rectangle?(target_screen.Bounds), Microsoft.Xna.Framework.Color.White, 0.0f, Vector2.Zero, Game1.options.zoomLevel, SpriteEffects.None, 1f);
+ if (++batchEnds == 1)
+ events.Rendered.RaiseEmpty();
Game1.spriteBatch.End();
}
else if (Game1.showingEndOfNightStuff)