summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/SGame.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-04-11 20:32:00 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-04-11 20:32:00 -0400
commitb9bc1a6d17cafa0a97b46ffecda432cfc2f23b51 (patch)
tree319498e8724137a5680186645ca8324f2949eba3 /src/SMAPI/Framework/SGame.cs
parent46141a7af21a921284bc82d49d888da864887d6e (diff)
parent2d47e479a5e48a575db3ca9998653c0435419440 (diff)
downloadSMAPI-b9bc1a6d17cafa0a97b46ffecda432cfc2f23b51.tar.gz
SMAPI-b9bc1a6d17cafa0a97b46ffecda432cfc2f23b51.tar.bz2
SMAPI-b9bc1a6d17cafa0a97b46ffecda432cfc2f23b51.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Framework/SGame.cs')
-rw-r--r--src/SMAPI/Framework/SGame.cs194
1 files changed, 114 insertions, 80 deletions
diff --git a/src/SMAPI/Framework/SGame.cs b/src/SMAPI/Framework/SGame.cs
index 47bc40e6..c6e9aa92 100644
--- a/src/SMAPI/Framework/SGame.cs
+++ b/src/SMAPI/Framework/SGame.cs
@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
+using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Xna.Framework;
@@ -25,6 +26,8 @@ using StardewValley.Tools;
using xTile.Dimensions;
#if !STARDEW_VALLEY_1_3
using xTile.Layers;
+#else
+using SFarmer = StardewValley.Farmer;
#endif
namespace StardewModdingAPI.Framework
@@ -133,8 +136,10 @@ namespace StardewModdingAPI.Framework
/// <summary>Whether this is the very first update tick since the game started.</summary>
private bool FirstUpdate;
+#if !STARDEW_VALLEY_1_3
/// <summary>The current game instance.</summary>
private static SGame Instance;
+#endif
/// <summary>A callback to invoke after the game finishes initialising.</summary>
private readonly Action OnGameInitialised;
@@ -145,6 +150,7 @@ namespace StardewModdingAPI.Framework
/// <summary>Simplifies access to private game code.</summary>
private static Reflector Reflection;
+#if !STARDEW_VALLEY_1_3
// ReSharper disable ArrangeStaticMemberQualifier, ArrangeThisQualifier, InconsistentNaming
/// <summary>Used to access private fields and methods.</summary>
private static List<float> _fpsList => SGame.Reflection.GetField<List<float>>(typeof(Game1), nameof(_fpsList)).GetValue();
@@ -160,11 +166,13 @@ namespace StardewModdingAPI.Framework
private readonly Action drawFarmBuildings = () => SGame.Reflection.GetMethod(SGame.Instance, nameof(drawFarmBuildings)).Invoke();
private readonly Action drawHUD = () => SGame.Reflection.GetMethod(SGame.Instance, nameof(drawHUD)).Invoke();
private readonly Action drawDialogueBox = () => SGame.Reflection.GetMethod(SGame.Instance, nameof(drawDialogueBox)).Invoke();
-#if STARDEW_VALLEY_1_3
- private readonly Action<SpriteBatch> drawOverlays = spriteBatch => SGame.Reflection.GetMethod(SGame.Instance, nameof(SGame.drawOverlays)).Invoke(spriteBatch);
-#endif
private readonly Action renderScreenBuffer = () => SGame.Reflection.GetMethod(SGame.Instance, nameof(renderScreenBuffer)).Invoke();
// ReSharper restore ArrangeStaticMemberQualifier, ArrangeThisQualifier, InconsistentNaming
+#endif
+
+#if STARDEW_VALLEY_1_3
+ private static StringBuilder _debugStringBuilder => SGame.Reflection.GetField<StringBuilder>(typeof(Game1), nameof(_debugStringBuilder)).GetValue();
+#endif
/*********
@@ -191,7 +199,9 @@ namespace StardewModdingAPI.Framework
this.Monitor = monitor;
this.Events = eventManager;
this.FirstUpdate = true;
+#if !STARDEW_VALLEY_1_3
SGame.Instance = this;
+#endif
SGame.Reflection = reflection;
this.OnGameInitialised = onGameInitialised;
if (this.ContentCore == null) // shouldn't happen since CreateContentManager is called first, but let's init here just in case
@@ -252,7 +262,11 @@ namespace StardewModdingAPI.Framework
// a small chance that the task will finish after we defer but before the game checks,
// which means technically events should be raised, but the effects of missing one
// update tick are neglible and not worth the complications of bypassing Game1.Update.
+#if STARDEW_VALLEY_1_3
+ if (Game1._newDayTask != null)
+#else
if (SGame._newDayTask != null)
+#endif
{
base.Update(gameTime);
this.Events.Specialised_UnvalidatedUpdateTick.Raise();
@@ -565,7 +579,7 @@ namespace StardewModdingAPI.Framework
this.PreviousForagingLevel = Game1.player.foragingLevel;
this.PreviousMiningLevel = Game1.player.miningLevel;
this.PreviousLuckLevel = Game1.player.luckLevel;
- this.PreviousItems = Game1.player.items.Where(n => n != null).ToDictionary(n => n, n => n.Stack);
+ this.PreviousItems = Game1.player.items.Where(n => n != null).Distinct().ToDictionary(n => n, n => n.Stack);
this.PreviousLocationObjects = this.GetHash(Game1.currentLocation.objects);
this.PreviousTime = Game1.timeOfDay;
this.PreviousMineLevel = Game1.mine?.mineLevel ?? 0;
@@ -677,27 +691,27 @@ namespace StardewModdingAPI.Framework
{
if (Game1.debugMode)
{
- if (SGame._fpsStopwatch.IsRunning)
+ if (Game1._fpsStopwatch.IsRunning)
{
- float totalSeconds = (float)SGame._fpsStopwatch.Elapsed.TotalSeconds;
- SGame._fpsList.Add(totalSeconds);
- while (SGame._fpsList.Count >= 120)
- SGame._fpsList.RemoveAt(0);
+ float totalSeconds = (float)Game1._fpsStopwatch.Elapsed.TotalSeconds;
+ Game1._fpsList.Add(totalSeconds);
+ while (Game1._fpsList.Count >= 120)
+ Game1._fpsList.RemoveAt(0);
float num = 0.0f;
- foreach (float fps in SGame._fpsList)
+ foreach (float fps in Game1._fpsList)
num += fps;
- SGame._fps = (float)(1.0 / ((double)num / (double)SGame._fpsList.Count));
+ Game1._fps = (float)(1.0 / ((double)num / (double)Game1._fpsList.Count));
}
- SGame._fpsStopwatch.Restart();
+ Game1._fpsStopwatch.Restart();
}
else
{
- if (SGame._fpsStopwatch.IsRunning)
- SGame._fpsStopwatch.Reset();
- SGame._fps = 0.0f;
- SGame._fpsList.Clear();
+ if (Game1._fpsStopwatch.IsRunning)
+ Game1._fpsStopwatch.Reset();
+ Game1._fps = 0.0f;
+ Game1._fpsList.Clear();
}
- if (SGame._newDayTask != null)
+ if (Game1._newDayTask != null)
{
this.GraphicsDevice.Clear(this.bgColor);
//base.Draw(gameTime);
@@ -705,7 +719,7 @@ namespace StardewModdingAPI.Framework
else
{
if ((double)Game1.options.zoomLevel != 1.0)
- this.GraphicsDevice.SetRenderTarget(this.screenWrapper);
+ this.GraphicsDevice.SetRenderTarget(this.screen);
if (this.IsSaving)
{
this.GraphicsDevice.Clear(this.bgColor);
@@ -727,6 +741,12 @@ namespace StardewModdingAPI.Framework
this.RaisePostRender();
Game1.spriteBatch.End();
}
+ if (Game1.overlayMenu != null)
+ {
+ Game1.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null);
+ Game1.overlayMenu.draw(Game1.spriteBatch);
+ Game1.spriteBatch.End();
+ }
//base.Draw(gameTime);
this.renderScreenBuffer();
}
@@ -755,7 +775,7 @@ namespace StardewModdingAPI.Framework
this.GraphicsDevice.SetRenderTarget((RenderTarget2D)null);
this.GraphicsDevice.Clear(this.bgColor);
Game1.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.Default, RasterizerState.CullNone);
- Game1.spriteBatch.Draw((Texture2D)this.screenWrapper, Vector2.Zero, new Microsoft.Xna.Framework.Rectangle?(this.screenWrapper.Bounds), Color.White, 0.0f, Vector2.Zero, Game1.options.zoomLevel, SpriteEffects.None, 1f);
+ Game1.spriteBatch.Draw((Texture2D)this.screen, Vector2.Zero, new Microsoft.Xna.Framework.Rectangle?(this.screen.Bounds), Color.White, 0.0f, Vector2.Zero, Game1.options.zoomLevel, SpriteEffects.None, 1f);
Game1.spriteBatch.End();
}
this.drawOverlays(Game1.spriteBatch);
@@ -784,7 +804,7 @@ namespace StardewModdingAPI.Framework
this.GraphicsDevice.SetRenderTarget((RenderTarget2D)null);
this.GraphicsDevice.Clear(this.bgColor);
Game1.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.Default, RasterizerState.CullNone);
- Game1.spriteBatch.Draw((Texture2D)this.screenWrapper, Vector2.Zero, new Microsoft.Xna.Framework.Rectangle?(this.screenWrapper.Bounds), Color.White, 0.0f, Vector2.Zero, Game1.options.zoomLevel, SpriteEffects.None, 1f);
+ Game1.spriteBatch.Draw((Texture2D)this.screen, Vector2.Zero, new Microsoft.Xna.Framework.Rectangle?(this.screen.Bounds), Color.White, 0.0f, Vector2.Zero, Game1.options.zoomLevel, SpriteEffects.None, 1f);
Game1.spriteBatch.End();
}
this.drawOverlays(Game1.spriteBatch);
@@ -813,7 +833,7 @@ namespace StardewModdingAPI.Framework
this.GraphicsDevice.SetRenderTarget((RenderTarget2D)null);
this.GraphicsDevice.Clear(this.bgColor);
Game1.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.Default, RasterizerState.CullNone);
- Game1.spriteBatch.Draw((Texture2D)this.screenWrapper, Vector2.Zero, new Microsoft.Xna.Framework.Rectangle?(this.screenWrapper.Bounds), Color.White, 0.0f, Vector2.Zero, Game1.options.zoomLevel, SpriteEffects.None, 1f);
+ Game1.spriteBatch.Draw((Texture2D)this.screen, Vector2.Zero, new Microsoft.Xna.Framework.Rectangle?(this.screen.Bounds), Color.White, 0.0f, Vector2.Zero, Game1.options.zoomLevel, SpriteEffects.None, 1f);
Game1.spriteBatch.End();
}
this.drawOverlays(Game1.spriteBatch);
@@ -845,7 +865,7 @@ namespace StardewModdingAPI.Framework
int widthOfString = SpriteText.getWidthOfString(str3);
int height = 64;
int x = 64;
- int y = Game1.graphics.GraphicsDevice.Viewport.TitleSafeArea.Bottom - height;
+ int y = Game1.graphics.GraphicsDevice.Viewport.GetTitleSafeArea().Bottom - height;
SpriteText.drawString(Game1.spriteBatch, s, x, y, 999999, widthOfString, height, 1f, 0.88f, false, 0, str3, -1);
Game1.spriteBatch.End();
if ((double)Game1.options.zoomLevel != 1.0)
@@ -853,10 +873,11 @@ namespace StardewModdingAPI.Framework
this.GraphicsDevice.SetRenderTarget((RenderTarget2D)null);
this.GraphicsDevice.Clear(this.bgColor);
Game1.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.Default, RasterizerState.CullNone);
- Game1.spriteBatch.Draw((Texture2D)this.screenWrapper, Vector2.Zero, new Microsoft.Xna.Framework.Rectangle?(this.screenWrapper.Bounds), Color.White, 0.0f, Vector2.Zero, Game1.options.zoomLevel, SpriteEffects.None, 1f);
+ Game1.spriteBatch.Draw((Texture2D)this.screen, Vector2.Zero, new Microsoft.Xna.Framework.Rectangle?(this.screen.Bounds), Color.White, 0.0f, Vector2.Zero, Game1.options.zoomLevel, SpriteEffects.None, 1f);
Game1.spriteBatch.End();
}
this.drawOverlays(Game1.spriteBatch);
+ //base.Draw(gameTime);
}
else
{
@@ -896,7 +917,7 @@ namespace StardewModdingAPI.Framework
}
}
Game1.spriteBatch.End();
- this.GraphicsDevice.SetRenderTarget((double)Game1.options.zoomLevel == 1.0 ? (RenderTarget2D)null : this.screenWrapper);
+ this.GraphicsDevice.SetRenderTarget((double)Game1.options.zoomLevel == 1.0 ? (RenderTarget2D)null : this.screen);
}
if (Game1.bloomDay && Game1.bloom != null)
Game1.bloom.BeginDraw();
@@ -956,6 +977,27 @@ namespace StardewModdingAPI.Framework
}
}
}
+ foreach (SFarmer farmer in Game1.currentLocation.getFarmers())
+ {
+ if (!(bool)((NetFieldBase<bool, NetBool>)farmer.swimming) && !farmer.isRidingHorse() && (Game1.currentLocation == null || !Game1.currentLocation.shouldShadowBeDrawnAboveBuildingsLayer(farmer.getTileLocation())))
+ {
+ SpriteBatch spriteBatch = Game1.spriteBatch;
+ Texture2D shadowTexture = Game1.shadowTexture;
+ Vector2 local = Game1.GlobalToLocal(farmer.Position + new Vector2(32f, 24f));
+ Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(Game1.shadowTexture.Bounds);
+ Color white = Color.White;
+ double num2 = 0.0;
+ Microsoft.Xna.Framework.Rectangle bounds2 = Game1.shadowTexture.Bounds;
+ double x = (double)bounds2.Center.X;
+ bounds2 = Game1.shadowTexture.Bounds;
+ double y = (double)bounds2.Center.Y;
+ Vector2 origin = new Vector2((float)x, (float)y);
+ double num3 = 4.0 - (!farmer.running && !farmer.UsingTool || farmer.FarmerSprite.currentAnimationIndex <= 1 ? 0.0 : (double)Math.Abs(FarmerRenderer.featureYOffsetPerFrame[farmer.FarmerSprite.CurrentFrame]) * 0.5);
+ int num4 = 0;
+ double num5 = 0.0;
+ spriteBatch.Draw(shadowTexture, local, sourceRectangle, white, (float)num2, origin, (float)num3, (SpriteEffects)num4, (float)num5);
+ }
+ }
Game1.currentLocation.Map.GetLayer("Buildings").Draw(Game1.mapDisplayDevice, Game1.viewport, Location.Origin, false, 4);
Game1.mapDisplayDevice.EndScene();
Game1.spriteBatch.End();
@@ -976,6 +1018,27 @@ namespace StardewModdingAPI.Framework
Game1.spriteBatch.Draw(Game1.shadowTexture, Game1.GlobalToLocal(Game1.viewport, actor.Position + new Vector2((float)(actor.Sprite.SpriteWidth * 4) / 2f, (float)(actor.GetBoundingBox().Height + (actor.IsMonster ? 0 : 12)))), new Microsoft.Xna.Framework.Rectangle?(Game1.shadowTexture.Bounds), Color.White, 0.0f, new Vector2((float)Game1.shadowTexture.Bounds.Center.X, (float)Game1.shadowTexture.Bounds.Center.Y), (float)(4.0 + (double)actor.yJumpOffset / 40.0) * (float)((NetFieldBase<float, NetFloat>)actor.scale), SpriteEffects.None, Math.Max(0.0f, (float)actor.getStandingY() / 10000f) - 1E-06f);
}
}
+ foreach (SFarmer farmer in Game1.currentLocation.getFarmers())
+ {
+ if (!(bool)((NetFieldBase<bool, NetBool>)farmer.swimming) && !farmer.isRidingHorse() && (Game1.currentLocation != null && Game1.currentLocation.shouldShadowBeDrawnAboveBuildingsLayer(farmer.getTileLocation())))
+ {
+ SpriteBatch spriteBatch = Game1.spriteBatch;
+ Texture2D shadowTexture = Game1.shadowTexture;
+ Vector2 local = Game1.GlobalToLocal(farmer.Position + new Vector2(32f, 24f));
+ Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(Game1.shadowTexture.Bounds);
+ Color white = Color.White;
+ double num2 = 0.0;
+ Microsoft.Xna.Framework.Rectangle bounds2 = Game1.shadowTexture.Bounds;
+ double x = (double)bounds2.Center.X;
+ bounds2 = Game1.shadowTexture.Bounds;
+ double y = (double)bounds2.Center.Y;
+ Vector2 origin = new Vector2((float)x, (float)y);
+ double num3 = 4.0 - (!farmer.running && !farmer.UsingTool || farmer.FarmerSprite.currentAnimationIndex <= 1 ? 0.0 : (double)Math.Abs(FarmerRenderer.featureYOffsetPerFrame[farmer.FarmerSprite.CurrentFrame]) * 0.5);
+ int num4 = 0;
+ double num5 = 0.0;
+ spriteBatch.Draw(shadowTexture, local, sourceRectangle, white, (float)num2, origin, (float)num3, (SpriteEffects)num4, (float)num5);
+ }
+ }
if ((Game1.eventUp || Game1.killScreen) && (!Game1.killScreen && Game1.currentLocation.currentEvent != null))
Game1.currentLocation.currentEvent.draw(Game1.spriteBatch);
if (Game1.player.currentUpgrade != null && Game1.player.currentUpgrade.daysLeftTillUpgradeDone <= 3 && Game1.currentLocation.Name.Equals("Farm"))
@@ -1054,7 +1117,6 @@ namespace StardewModdingAPI.Framework
Game1.spriteBatch.Draw(Game1.rainTexture, Game1.rainDrops[index].position, new Microsoft.Xna.Framework.Rectangle?(Game1.getSourceRectForStandardTileSheet(Game1.rainTexture, Game1.rainDrops[index].frame, -1, -1)), Color.White);
}
Game1.spriteBatch.End();
- //base.Draw(gameTime);
Game1.spriteBatch.Begin(SpriteSortMode.FrontToBack, BlendState.AlphaBlend, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null);
if (Game1.eventUp && Game1.currentLocation.currentEvent != null)
{
@@ -1155,30 +1217,8 @@ namespace StardewModdingAPI.Framework
this.drawDialogueBox();
if (Game1.progressBar)
{
- SpriteBatch spriteBatch1 = Game1.spriteBatch;
- Texture2D fadeToBlackRect = Game1.fadeToBlackRect;
- viewport1 = Game1.graphics.GraphicsDevice.Viewport;
- int x1 = (viewport1.TitleSafeArea.Width - Game1.dialogueWidth) / 2;
- viewport1 = Game1.graphics.GraphicsDevice.Viewport;
- Microsoft.Xna.Framework.Rectangle titleSafeArea = viewport1.TitleSafeArea;
- int y1 = titleSafeArea.Bottom - 128;
- int dialogueWidth = Game1.dialogueWidth;
- int height1 = 32;
- Microsoft.Xna.Framework.Rectangle destinationRectangle1 = new Microsoft.Xna.Framework.Rectangle(x1, y1, dialogueWidth, height1);
- Color lightGray = Color.LightGray;
- spriteBatch1.Draw(fadeToBlackRect, destinationRectangle1, lightGray);
- SpriteBatch spriteBatch2 = Game1.spriteBatch;
- Texture2D staminaRect = Game1.staminaRect;
- viewport1 = Game1.graphics.GraphicsDevice.Viewport;
- int x2 = (viewport1.TitleSafeArea.Width - Game1.dialogueWidth) / 2;
- viewport1 = Game1.graphics.GraphicsDevice.Viewport;
- titleSafeArea = viewport1.TitleSafeArea;
- int y2 = titleSafeArea.Bottom - 128;
- int width = (int)((double)Game1.pauseAccumulator / (double)Game1.pauseTime * (double)Game1.dialogueWidth);
- int height2 = 32;
- Microsoft.Xna.Framework.Rectangle destinationRectangle2 = new Microsoft.Xna.Framework.Rectangle(x2, y2, width, height2);
- Color dimGray = Color.DimGray;
- spriteBatch2.Draw(staminaRect, destinationRectangle2, dimGray);
+ Game1.spriteBatch.Draw(Game1.fadeToBlackRect, new Microsoft.Xna.Framework.Rectangle((Game1.graphics.GraphicsDevice.Viewport.GetTitleSafeArea().Width - Game1.dialogueWidth) / 2, Game1.graphics.GraphicsDevice.Viewport.GetTitleSafeArea().Bottom - 128, Game1.dialogueWidth, 32), Color.LightGray);
+ Game1.spriteBatch.Draw(Game1.staminaRect, new Microsoft.Xna.Framework.Rectangle((Game1.graphics.GraphicsDevice.Viewport.GetTitleSafeArea().Width - Game1.dialogueWidth) / 2, Game1.graphics.GraphicsDevice.Viewport.GetTitleSafeArea().Bottom - 128, (int)((double)Game1.pauseAccumulator / (double)Game1.pauseTime * (double)Game1.dialogueWidth), 32), Color.DimGray);
}
if (Game1.eventUp && (Game1.currentLocation != null && Game1.currentLocation.currentEvent != null))
Game1.currentLocation.currentEvent.drawAfterMap(Game1.spriteBatch);
@@ -1219,38 +1259,31 @@ namespace StardewModdingAPI.Framework
overlayTempSprite.draw(Game1.spriteBatch, true, 0, 0, 1f);
if (Game1.debugMode)
{
- SpriteBatch spriteBatch = Game1.spriteBatch;
- SpriteFont smallFont = Game1.smallFont;
- object[] objArray = new object[10];
- int index = 0;
- string str;
- if (!Game1.panMode)
- str = "player: " + (object)(Game1.player.getStandingX() / 64) + ", " + (object)(Game1.player.getStandingY() / 64);
+ StringBuilder debugStringBuilder = SGame._debugStringBuilder;
+ debugStringBuilder.Clear();
+ if (Game1.panMode)
+ {
+ debugStringBuilder.Append((Game1.getOldMouseX() + Game1.viewport.X) / 64);
+ debugStringBuilder.Append(",");
+ debugStringBuilder.Append((Game1.getOldMouseY() + Game1.viewport.Y) / 64);
+ }
else
- str = ((Game1.getOldMouseX() + Game1.viewport.X) / 64).ToString() + "," + (object)((Game1.getOldMouseY() + Game1.viewport.Y) / 64);
- objArray[index] = (object)str;
- objArray[1] = (object)" mouseTransparency: ";
- objArray[2] = (object)Game1.mouseCursorTransparency;
- objArray[3] = (object)" mousePosition: ";
- objArray[4] = (object)Game1.getMouseX();
- objArray[5] = (object)",";
- objArray[6] = (object)Game1.getMouseY();
- objArray[7] = (object)Environment.NewLine;
- objArray[8] = (object)"debugOutput: ";
- objArray[9] = (object)Game1.debugOutput;
- string text = string.Concat(objArray);
- Viewport viewport2 = this.GraphicsDevice.Viewport;
- double x = (double)viewport2.TitleSafeArea.X;
- viewport2 = this.GraphicsDevice.Viewport;
- double y = (double)viewport2.TitleSafeArea.Y;
- Vector2 position = new Vector2((float)x, (float)y);
- Color red = Color.Red;
- double num2 = 0.0;
- Vector2 zero = Vector2.Zero;
- double num3 = 1.0;
- int num4 = 0;
- double num5 = 0.99999988079071;
- spriteBatch.DrawString(smallFont, text, position, red, (float)num2, zero, (float)num3, (SpriteEffects)num4, (float)num5);
+ {
+ debugStringBuilder.Append("player: ");
+ debugStringBuilder.Append(Game1.player.getStandingX() / 64);
+ debugStringBuilder.Append(", ");
+ debugStringBuilder.Append(Game1.player.getStandingY() / 64);
+ }
+ debugStringBuilder.Append(" mouseTransparency: ");
+ debugStringBuilder.Append(Game1.mouseCursorTransparency);
+ debugStringBuilder.Append(" mousePosition: ");
+ debugStringBuilder.Append(Game1.getMouseX());
+ debugStringBuilder.Append(",");
+ debugStringBuilder.Append(Game1.getMouseY());
+ debugStringBuilder.Append(Environment.NewLine);
+ debugStringBuilder.Append("debugOutput: ");
+ debugStringBuilder.Append(Game1.debugOutput);
+ Game1.spriteBatch.DrawString(Game1.smallFont, debugStringBuilder, new Vector2((float)this.GraphicsDevice.Viewport.GetTitleSafeArea().X, (float)(this.GraphicsDevice.Viewport.GetTitleSafeArea().Y + Game1.smallFont.LineSpacing * 8)), Color.Red, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.9999999f);
}
if (Game1.showKeyHelp)
Game1.spriteBatch.DrawString(Game1.smallFont, Game1.keyHelpString, new Vector2(64f, (float)(Game1.viewport.Height - 64 - (Game1.dialogueUp ? 192 + (Game1.isQuestion ? Game1.questionChoices.Count * 64 : 0) : 0)) - Game1.smallFont.MeasureString(Game1.keyHelpString).Y), Color.LightGray, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.9999999f);
@@ -1279,6 +1312,7 @@ namespace StardewModdingAPI.Framework
Game1.spriteBatch.End();
this.drawOverlays(Game1.spriteBatch);
this.renderScreenBuffer();
+ //base.Draw(gameTime);
}
}
}