update for draw changes in SDV 1.4 (#638)
This commit is contained in:
parent
fd6a719b02
commit
7a2fc8471f
|
@ -815,12 +815,20 @@ namespace StardewModdingAPI.Framework
|
|||
{
|
||||
var events = this.Events;
|
||||
|
||||
// from Game1.Draw
|
||||
RenderTarget2D target_screen = (RenderTarget2D)null;
|
||||
if ((double)Game1.options.zoomLevel != 1.0)
|
||||
target_screen = this.screen;
|
||||
|
||||
// from Game1._draw
|
||||
if (Game1._newDayTask != null)
|
||||
{
|
||||
this.GraphicsDevice.Clear(Game1.bgColor);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((double)Game1.options.zoomLevel != 1.0)
|
||||
this.GraphicsDevice.SetRenderTarget(this.screen);
|
||||
if (target_screen != null)
|
||||
this.GraphicsDevice.SetRenderTarget(target_screen);
|
||||
if (this.IsSaving)
|
||||
{
|
||||
this.GraphicsDevice.Clear(Game1.bgColor);
|
||||
|
@ -874,12 +882,12 @@ namespace StardewModdingAPI.Framework
|
|||
events.Rendered.RaiseEmpty();
|
||||
Game1.spriteBatch.End();
|
||||
this.drawOverlays(Game1.spriteBatch);
|
||||
if ((double)Game1.options.zoomLevel != 1.0)
|
||||
if (target_screen != null)
|
||||
{
|
||||
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)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.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);
|
||||
Game1.spriteBatch.End();
|
||||
}
|
||||
if (Game1.overlayMenu == null)
|
||||
|
@ -892,9 +900,9 @@ namespace StardewModdingAPI.Framework
|
|||
{
|
||||
Game1.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null);
|
||||
events.Rendering.RaiseEmpty();
|
||||
Game1.spriteBatch.DrawString(Game1.dialogueFont, Game1.content.LoadString("Strings\\StringsFromCSFiles:Game1.cs.3685"), new Vector2(16f, 16f), Color.HotPink);
|
||||
Game1.spriteBatch.DrawString(Game1.dialogueFont, Game1.content.LoadString("Strings\\StringsFromCSFiles:Game1.cs.3686"), new Vector2(16f, 32f), new Color(0, (int)byte.MaxValue, 0));
|
||||
Game1.spriteBatch.DrawString(Game1.dialogueFont, Game1.parseText(Game1.errorMessage, Game1.dialogueFont, Game1.graphics.GraphicsDevice.Viewport.Width), new Vector2(16f, 48f), Color.White);
|
||||
Game1.spriteBatch.DrawString(Game1.dialogueFont, Game1.content.LoadString("Strings\\StringsFromCSFiles:Game1.cs.3685"), new Vector2(16f, 16f), Microsoft.Xna.Framework.Color.HotPink);
|
||||
Game1.spriteBatch.DrawString(Game1.dialogueFont, Game1.content.LoadString("Strings\\StringsFromCSFiles:Game1.cs.3686"), new Vector2(16f, 32f), new Microsoft.Xna.Framework.Color(0, (int)byte.MaxValue, 0));
|
||||
Game1.spriteBatch.DrawString(Game1.dialogueFont, Game1.parseText(Game1.errorMessage, Game1.dialogueFont, Game1.graphics.GraphicsDevice.Viewport.Width), new Vector2(16f, 48f), Microsoft.Xna.Framework.Color.White);
|
||||
events.Rendered.RaiseEmpty();
|
||||
Game1.spriteBatch.End();
|
||||
}
|
||||
|
@ -904,16 +912,16 @@ namespace StardewModdingAPI.Framework
|
|||
if (Game1.globalFade && !Game1.menuUp && (!Game1.nameSelectUp || Game1.messagePause))
|
||||
{
|
||||
Game1.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null);
|
||||
Game1.spriteBatch.Draw(Game1.fadeToBlackRect, Game1.graphics.GraphicsDevice.Viewport.Bounds, Color.Black * (Game1.gameMode == (byte)0 ? 1f - Game1.fadeToBlackAlpha : Game1.fadeToBlackAlpha));
|
||||
Game1.spriteBatch.Draw(Game1.fadeToBlackRect, Game1.graphics.GraphicsDevice.Viewport.Bounds, Microsoft.Xna.Framework.Color.Black * (Game1.gameMode == (byte)0 ? 1f - Game1.fadeToBlackAlpha : Game1.fadeToBlackAlpha));
|
||||
Game1.spriteBatch.End();
|
||||
}
|
||||
this.drawOverlays(Game1.spriteBatch);
|
||||
if ((double)Game1.options.zoomLevel == 1.0)
|
||||
if (target_screen == null)
|
||||
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)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.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);
|
||||
Game1.spriteBatch.End();
|
||||
}
|
||||
else if (Game1.showingEndOfNightStuff)
|
||||
|
@ -937,12 +945,12 @@ namespace StardewModdingAPI.Framework
|
|||
events.Rendered.RaiseEmpty();
|
||||
Game1.spriteBatch.End();
|
||||
this.drawOverlays(Game1.spriteBatch);
|
||||
if ((double)Game1.options.zoomLevel == 1.0)
|
||||
if (target_screen == null)
|
||||
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)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.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);
|
||||
Game1.spriteBatch.End();
|
||||
}
|
||||
else if (Game1.gameMode == (byte)6 || Game1.gameMode == (byte)3 && Game1.currentLocation == null)
|
||||
|
@ -963,12 +971,12 @@ namespace StardewModdingAPI.Framework
|
|||
events.Rendered.RaiseEmpty();
|
||||
Game1.spriteBatch.End();
|
||||
this.drawOverlays(Game1.spriteBatch);
|
||||
if ((double)Game1.options.zoomLevel != 1.0)
|
||||
if (target_screen != null)
|
||||
{
|
||||
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)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.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);
|
||||
Game1.spriteBatch.End();
|
||||
}
|
||||
if (Game1.overlayMenu != null)
|
||||
|
@ -995,12 +1003,12 @@ namespace StardewModdingAPI.Framework
|
|||
if (Game1.drawLighting)
|
||||
{
|
||||
this.GraphicsDevice.SetRenderTarget(Game1.lightmap);
|
||||
this.GraphicsDevice.Clear(Color.White * 0.0f);
|
||||
this.GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.White * 0.0f);
|
||||
Game1.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null);
|
||||
if (++batchOpens == 1)
|
||||
events.Rendering.RaiseEmpty();
|
||||
Color color1 = !Game1.currentLocation.Name.StartsWith("UndergroundMine") || !(Game1.currentLocation is MineShaft) ? (Game1.ambientLight.Equals(Color.White) || Game1.isRaining && (bool)((NetFieldBase<bool, NetBool>)Game1.currentLocation.isOutdoors) ? Game1.outdoorLight : Game1.ambientLight) : (Game1.currentLocation as MineShaft).getLightingColor(gameTime);
|
||||
Game1.spriteBatch.Draw(Game1.staminaRect, Game1.lightmap.Bounds, color1);
|
||||
Microsoft.Xna.Framework.Color color = !Game1.currentLocation.Name.StartsWith("UndergroundMine") || !(Game1.currentLocation is MineShaft) ? (Game1.ambientLight.Equals(Microsoft.Xna.Framework.Color.White) || Game1.isRaining && (bool)((NetFieldBase<bool, NetBool>)Game1.currentLocation.isOutdoors) ? Game1.outdoorLight : Game1.ambientLight) : (Game1.currentLocation as MineShaft).getLightingColor(gameTime);
|
||||
Game1.spriteBatch.Draw(Game1.staminaRect, Game1.lightmap.Bounds, color);
|
||||
for (int index = 0; index < Game1.currentLightSources.Count; ++index)
|
||||
{
|
||||
LightSource lightSource = Game1.currentLightSources.ElementAt<LightSource>(index);
|
||||
|
@ -1011,23 +1019,10 @@ namespace StardewModdingAPI.Framework
|
|||
continue;
|
||||
}
|
||||
if (Utility.isOnScreen((Vector2)((NetFieldBase<Vector2, NetVector2>)Game1.currentLightSources.ElementAt<LightSource>(index).position), (int)((double)(float)((NetFieldBase<float, NetFloat>)Game1.currentLightSources.ElementAt<LightSource>(index).radius) * 64.0 * 4.0)))
|
||||
{
|
||||
SpriteBatch spriteBatch = Game1.spriteBatch;
|
||||
Texture2D lightTexture = Game1.currentLightSources.ElementAt<LightSource>(index).lightTexture;
|
||||
Vector2 position = Game1.GlobalToLocal(Game1.viewport, (Vector2)((NetFieldBase<Vector2, NetVector2>)Game1.currentLightSources.ElementAt<LightSource>(index).position)) / (float)(Game1.options.lightingQuality / 2);
|
||||
Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(Game1.currentLightSources.ElementAt<LightSource>(index).lightTexture.Bounds);
|
||||
Color color2 = (Color)((NetFieldBase<Color, NetColor>)Game1.currentLightSources.ElementAt<LightSource>(index).color);
|
||||
Microsoft.Xna.Framework.Rectangle bounds = Game1.currentLightSources.ElementAt<LightSource>(index).lightTexture.Bounds;
|
||||
double x = (double)bounds.Center.X;
|
||||
bounds = Game1.currentLightSources.ElementAt<LightSource>(index).lightTexture.Bounds;
|
||||
double y = (double)bounds.Center.Y;
|
||||
Vector2 origin = new Vector2((float)x, (float)y);
|
||||
double num = (double)(float)((NetFieldBase<float, NetFloat>)Game1.currentLightSources.ElementAt<LightSource>(index).radius) / (double)(Game1.options.lightingQuality / 2);
|
||||
spriteBatch.Draw(lightTexture, position, sourceRectangle, color2, 0.0f, origin, (float)num, SpriteEffects.None, 0.9f);
|
||||
}
|
||||
Game1.spriteBatch.Draw(Game1.currentLightSources.ElementAt<LightSource>(index).lightTexture, Game1.GlobalToLocal(Game1.viewport, (Vector2)((NetFieldBase<Vector2, NetVector2>)Game1.currentLightSources.ElementAt<LightSource>(index).position)) / (float)(Game1.options.lightingQuality / 2), new Microsoft.Xna.Framework.Rectangle?(Game1.currentLightSources.ElementAt<LightSource>(index).lightTexture.Bounds), (Microsoft.Xna.Framework.Color)((NetFieldBase<Microsoft.Xna.Framework.Color, NetColor>)Game1.currentLightSources.ElementAt<LightSource>(index).color), 0.0f, new Vector2((float)Game1.currentLightSources.ElementAt<LightSource>(index).lightTexture.Bounds.Center.X, (float)Game1.currentLightSources.ElementAt<LightSource>(index).lightTexture.Bounds.Center.Y), (float)((NetFieldBase<float, NetFloat>)Game1.currentLightSources.ElementAt<LightSource>(index).radius) / (float)(Game1.options.lightingQuality / 2), SpriteEffects.None, 0.9f);
|
||||
}
|
||||
Game1.spriteBatch.End();
|
||||
this.GraphicsDevice.SetRenderTarget((double)Game1.options.zoomLevel == 1.0 ? (RenderTarget2D)null : this.screen);
|
||||
this.GraphicsDevice.SetRenderTarget(target_screen);
|
||||
}
|
||||
if (Game1.bloomDay && Game1.bloom != null)
|
||||
Game1.bloom.BeginDraw();
|
||||
|
@ -1065,7 +1060,7 @@ namespace StardewModdingAPI.Framework
|
|||
foreach (NPC character in Game1.currentLocation.characters)
|
||||
{
|
||||
if (!(bool)((NetFieldBase<bool, NetBool>)character.swimming) && !character.HideShadow && (!character.IsInvisible && !Game1.currentLocation.shouldShadowBeDrawnAboveBuildingsLayer(character.getTileLocation())))
|
||||
Game1.spriteBatch.Draw(Game1.shadowTexture, Game1.GlobalToLocal(Game1.viewport, character.Position + new Vector2((float)(character.Sprite.SpriteWidth * 4) / 2f, (float)(character.GetBoundingBox().Height + (character.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)character.yJumpOffset / 40.0) * (float)((NetFieldBase<float, NetFloat>)character.scale), SpriteEffects.None, Math.Max(0.0f, (float)character.getStandingY() / 10000f) - 1E-06f);
|
||||
Game1.spriteBatch.Draw(Game1.shadowTexture, Game1.GlobalToLocal(Game1.viewport, character.Position + new Vector2((float)(character.Sprite.SpriteWidth * 4) / 2f, (float)(character.GetBoundingBox().Height + (character.IsMonster ? 0 : 12)))), new Microsoft.Xna.Framework.Rectangle?(Game1.shadowTexture.Bounds), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2((float)Game1.shadowTexture.Bounds.Center.X, (float)Game1.shadowTexture.Bounds.Center.Y), (float)(4.0 + (double)character.yJumpOffset / 40.0) * (float)((NetFieldBase<float, NetFloat>)character.scale), SpriteEffects.None, Math.Max(0.0f, (float)character.getStandingY() / 10000f) - 1E-06f);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1073,26 +1068,13 @@ namespace StardewModdingAPI.Framework
|
|||
foreach (NPC actor in Game1.CurrentEvent.actors)
|
||||
{
|
||||
if (!(bool)((NetFieldBase<bool, NetBool>)actor.swimming) && !actor.HideShadow && !Game1.currentLocation.shouldShadowBeDrawnAboveBuildingsLayer(actor.getTileLocation()))
|
||||
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 : (actor.Sprite.SpriteHeight <= 16 ? -4 : 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);
|
||||
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 : (actor.Sprite.SpriteHeight <= 16 ? -4 : 12))))), new Microsoft.Xna.Framework.Rectangle?(Game1.shadowTexture.Bounds), Microsoft.Xna.Framework.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 (Farmer farmerShadow in this._farmerShadows)
|
||||
{
|
||||
if (!Game1.multiplayer.isDisconnecting(farmerShadow.UniqueMultiplayerID) && !(bool)((NetFieldBase<bool, NetBool>)farmerShadow.swimming) && !farmerShadow.isRidingHorse() && (Game1.currentLocation == null || !Game1.currentLocation.shouldShadowBeDrawnAboveBuildingsLayer(farmerShadow.getTileLocation())))
|
||||
{
|
||||
SpriteBatch spriteBatch = Game1.spriteBatch;
|
||||
Texture2D shadowTexture = Game1.shadowTexture;
|
||||
Vector2 local = Game1.GlobalToLocal(farmerShadow.Position + new Vector2(32f, 24f));
|
||||
Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(Game1.shadowTexture.Bounds);
|
||||
Color white = Color.White;
|
||||
Microsoft.Xna.Framework.Rectangle bounds = Game1.shadowTexture.Bounds;
|
||||
double x = (double)bounds.Center.X;
|
||||
bounds = Game1.shadowTexture.Bounds;
|
||||
double y = (double)bounds.Center.Y;
|
||||
Vector2 origin = new Vector2((float)x, (float)y);
|
||||
double num = 4.0 - (!farmerShadow.running && !farmerShadow.UsingTool || farmerShadow.FarmerSprite.currentAnimationIndex <= 1 ? 0.0 : (double)Math.Abs(FarmerRenderer.featureYOffsetPerFrame[farmerShadow.FarmerSprite.CurrentFrame]) * 0.5);
|
||||
spriteBatch.Draw(shadowTexture, local, sourceRectangle, white, 0.0f, origin, (float)num, SpriteEffects.None, 0.0f);
|
||||
}
|
||||
Game1.spriteBatch.Draw(Game1.shadowTexture, Game1.GlobalToLocal(farmerShadow.Position + new Vector2(32f, 24f)), new Microsoft.Xna.Framework.Rectangle?(Game1.shadowTexture.Bounds), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2((float)Game1.shadowTexture.Bounds.Center.X, (float)Game1.shadowTexture.Bounds.Center.Y), (float)(4.0 - (!farmerShadow.running && !farmerShadow.UsingTool || farmerShadow.FarmerSprite.currentAnimationIndex <= 1 ? 0.0 : (double)Math.Abs(FarmerRenderer.featureYOffsetPerFrame[farmerShadow.FarmerSprite.CurrentFrame]) * 0.5)), SpriteEffects.None, 0.0f);
|
||||
}
|
||||
}
|
||||
Layer layer = Game1.currentLocation.Map.GetLayer("Buildings");
|
||||
|
@ -1107,7 +1089,7 @@ namespace StardewModdingAPI.Framework
|
|||
foreach (NPC character in Game1.currentLocation.characters)
|
||||
{
|
||||
if (!(bool)((NetFieldBase<bool, NetBool>)character.swimming) && !character.HideShadow && (!(bool)((NetFieldBase<bool, NetBool>)character.isInvisible) && Game1.currentLocation.shouldShadowBeDrawnAboveBuildingsLayer(character.getTileLocation())))
|
||||
Game1.spriteBatch.Draw(Game1.shadowTexture, Game1.GlobalToLocal(Game1.viewport, character.Position + new Vector2((float)(character.Sprite.SpriteWidth * 4) / 2f, (float)(character.GetBoundingBox().Height + (character.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)character.yJumpOffset / 40.0) * (float)((NetFieldBase<float, NetFloat>)character.scale), SpriteEffects.None, Math.Max(0.0f, (float)character.getStandingY() / 10000f) - 1E-06f);
|
||||
Game1.spriteBatch.Draw(Game1.shadowTexture, Game1.GlobalToLocal(Game1.viewport, character.Position + new Vector2((float)(character.Sprite.SpriteWidth * 4) / 2f, (float)(character.GetBoundingBox().Height + (character.IsMonster ? 0 : 12)))), new Microsoft.Xna.Framework.Rectangle?(Game1.shadowTexture.Bounds), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2((float)Game1.shadowTexture.Bounds.Center.X, (float)Game1.shadowTexture.Bounds.Center.Y), (float)(4.0 + (double)character.yJumpOffset / 40.0) * (float)((NetFieldBase<float, NetFloat>)character.scale), SpriteEffects.None, Math.Max(0.0f, (float)character.getStandingY() / 10000f) - 1E-06f);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1115,34 +1097,20 @@ namespace StardewModdingAPI.Framework
|
|||
foreach (NPC actor in Game1.CurrentEvent.actors)
|
||||
{
|
||||
if (!(bool)((NetFieldBase<bool, NetBool>)actor.swimming) && !actor.HideShadow && Game1.currentLocation.shouldShadowBeDrawnAboveBuildingsLayer(actor.getTileLocation()))
|
||||
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);
|
||||
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), Microsoft.Xna.Framework.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 (Farmer farmerShadow in this._farmerShadows)
|
||||
{
|
||||
float num1 = Math.Max(0.0001f, farmerShadow.getDrawLayer() + 0.00011f) - 0.0001f;
|
||||
float layerDepth = Math.Max(0.0001f, farmerShadow.getDrawLayer() + 0.00011f) - 0.0001f;
|
||||
if (!(bool)((NetFieldBase<bool, NetBool>)farmerShadow.swimming) && !farmerShadow.isRidingHorse() && (Game1.currentLocation != null && Game1.currentLocation.shouldShadowBeDrawnAboveBuildingsLayer(farmerShadow.getTileLocation())))
|
||||
{
|
||||
SpriteBatch spriteBatch = Game1.spriteBatch;
|
||||
Texture2D shadowTexture = Game1.shadowTexture;
|
||||
Vector2 local = Game1.GlobalToLocal(farmerShadow.Position + new Vector2(32f, 24f));
|
||||
Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(Game1.shadowTexture.Bounds);
|
||||
Color white = Color.White;
|
||||
Microsoft.Xna.Framework.Rectangle bounds = Game1.shadowTexture.Bounds;
|
||||
double x = (double)bounds.Center.X;
|
||||
bounds = Game1.shadowTexture.Bounds;
|
||||
double y = (double)bounds.Center.Y;
|
||||
Vector2 origin = new Vector2((float)x, (float)y);
|
||||
double num2 = 4.0 - (!farmerShadow.running && !farmerShadow.UsingTool || farmerShadow.FarmerSprite.currentAnimationIndex <= 1 ? 0.0 : (double)Math.Abs(FarmerRenderer.featureYOffsetPerFrame[farmerShadow.FarmerSprite.CurrentFrame]) * 0.5);
|
||||
double num3 = (double)num1;
|
||||
spriteBatch.Draw(shadowTexture, local, sourceRectangle, white, 0.0f, origin, (float)num2, SpriteEffects.None, (float)num3);
|
||||
}
|
||||
Game1.spriteBatch.Draw(Game1.shadowTexture, Game1.GlobalToLocal(farmerShadow.Position + new Vector2(32f, 24f)), new Microsoft.Xna.Framework.Rectangle?(Game1.shadowTexture.Bounds), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2((float)Game1.shadowTexture.Bounds.Center.X, (float)Game1.shadowTexture.Bounds.Center.Y), (float)(4.0 - (!farmerShadow.running && !farmerShadow.UsingTool || farmerShadow.FarmerSprite.currentAnimationIndex <= 1 ? 0.0 : (double)Math.Abs(FarmerRenderer.featureYOffsetPerFrame[farmerShadow.FarmerSprite.CurrentFrame]) * 0.5)), SpriteEffects.None, layerDepth);
|
||||
}
|
||||
}
|
||||
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"))
|
||||
Game1.spriteBatch.Draw(Game1.player.currentUpgrade.workerTexture, Game1.GlobalToLocal(Game1.viewport, Game1.player.currentUpgrade.positionOfCarpenter), new Microsoft.Xna.Framework.Rectangle?(Game1.player.currentUpgrade.getSourceRectangle()), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, (float)(((double)Game1.player.currentUpgrade.positionOfCarpenter.Y + 48.0) / 10000.0));
|
||||
Game1.spriteBatch.Draw(Game1.player.currentUpgrade.workerTexture, Game1.GlobalToLocal(Game1.viewport, Game1.player.currentUpgrade.positionOfCarpenter), new Microsoft.Xna.Framework.Rectangle?(Game1.player.currentUpgrade.getSourceRectangle()), Microsoft.Xna.Framework.Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, (float)(((double)Game1.player.currentUpgrade.positionOfCarpenter.Y + 48.0) / 10000.0));
|
||||
Game1.currentLocation.draw(Game1.spriteBatch);
|
||||
foreach (Vector2 key in Game1.crabPotOverlayTiles.Keys)
|
||||
{
|
||||
|
@ -1163,12 +1131,12 @@ namespace StardewModdingAPI.Framework
|
|||
if (Game1.currentLocation.Name.Equals("Farm"))
|
||||
this.drawFarmBuildings();
|
||||
if (Game1.tvStation >= 0)
|
||||
Game1.spriteBatch.Draw(Game1.tvStationTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2(400f, 160f)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(Game1.tvStation * 24, 0, 24, 15)), Color.White, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 1E-08f);
|
||||
Game1.spriteBatch.Draw(Game1.tvStationTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2(400f, 160f)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(Game1.tvStation * 24, 0, 24, 15)), Microsoft.Xna.Framework.Color.White, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 1E-08f);
|
||||
if (Game1.panMode)
|
||||
{
|
||||
Game1.spriteBatch.Draw(Game1.fadeToBlackRect, new Microsoft.Xna.Framework.Rectangle((int)Math.Floor((double)(Game1.getOldMouseX() + Game1.viewport.X) / 64.0) * 64 - Game1.viewport.X, (int)Math.Floor((double)(Game1.getOldMouseY() + Game1.viewport.Y) / 64.0) * 64 - Game1.viewport.Y, 64, 64), Color.Lime * 0.75f);
|
||||
Game1.spriteBatch.Draw(Game1.fadeToBlackRect, new Microsoft.Xna.Framework.Rectangle((int)Math.Floor((double)(Game1.getOldMouseX() + Game1.viewport.X) / 64.0) * 64 - Game1.viewport.X, (int)Math.Floor((double)(Game1.getOldMouseY() + Game1.viewport.Y) / 64.0) * 64 - Game1.viewport.Y, 64, 64), Microsoft.Xna.Framework.Color.Lime * 0.75f);
|
||||
foreach (Warp warp in (NetList<Warp, NetRef<Warp>>)Game1.currentLocation.warps)
|
||||
Game1.spriteBatch.Draw(Game1.fadeToBlackRect, new Microsoft.Xna.Framework.Rectangle(warp.X * 64 - Game1.viewport.X, warp.Y * 64 - Game1.viewport.Y, 64, 64), Color.Red * 0.75f);
|
||||
Game1.spriteBatch.Draw(Game1.fadeToBlackRect, new Microsoft.Xna.Framework.Rectangle(warp.X * 64 - Game1.viewport.X, warp.Y * 64 - Game1.viewport.Y, 64, 64), Microsoft.Xna.Framework.Color.Red * 0.75f);
|
||||
}
|
||||
Game1.mapDisplayDevice.BeginScene(Game1.spriteBatch);
|
||||
Game1.currentLocation.Map.GetLayer("Front").Draw(Game1.mapDisplayDevice, Game1.viewport, Location.Origin, false, 4);
|
||||
|
@ -1190,7 +1158,7 @@ namespace StardewModdingAPI.Framework
|
|||
}
|
||||
if ((double)Game1.toolHold > 400.0 && Game1.player.CurrentTool.UpgradeLevel >= 1 && Game1.player.canReleaseTool)
|
||||
{
|
||||
Color color = Color.White;
|
||||
Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.White;
|
||||
switch ((int)((double)Game1.toolHold / 600.0) + 2)
|
||||
{
|
||||
case 1:
|
||||
|
@ -1206,7 +1174,7 @@ namespace StardewModdingAPI.Framework
|
|||
color = Tool.iridiumColor;
|
||||
break;
|
||||
}
|
||||
Game1.spriteBatch.Draw(Game1.littleEffect, new Microsoft.Xna.Framework.Rectangle((int)Game1.player.getLocalPosition(Game1.viewport).X - 2, (int)Game1.player.getLocalPosition(Game1.viewport).Y - (Game1.player.CurrentTool.Name.Equals("Watering Can") ? 0 : 64) - 2, (int)((double)Game1.toolHold % 600.0 * 0.0799999982118607) + 4, 12), Color.Black);
|
||||
Game1.spriteBatch.Draw(Game1.littleEffect, new Microsoft.Xna.Framework.Rectangle((int)Game1.player.getLocalPosition(Game1.viewport).X - 2, (int)Game1.player.getLocalPosition(Game1.viewport).Y - (Game1.player.CurrentTool.Name.Equals("Watering Can") ? 0 : 64) - 2, (int)((double)Game1.toolHold % 600.0 * 0.0799999982118607) + 4, 12), Microsoft.Xna.Framework.Color.Black);
|
||||
Game1.spriteBatch.Draw(Game1.littleEffect, new Microsoft.Xna.Framework.Rectangle((int)Game1.player.getLocalPosition(Game1.viewport).X, (int)Game1.player.getLocalPosition(Game1.viewport).Y - (Game1.player.CurrentTool.Name.Equals("Watering Can") ? 0 : 64), (int)((double)Game1.toolHold % 600.0 * 0.0799999982118607), 8), color);
|
||||
}
|
||||
bool flag = Game1.viewport.X > -Game1.viewport.Width;
|
||||
|
@ -1223,7 +1191,7 @@ namespace StardewModdingAPI.Framework
|
|||
Texture2D fadeToBlackRect = Game1.fadeToBlackRect;
|
||||
viewport = Game1.graphics.GraphicsDevice.Viewport;
|
||||
Microsoft.Xna.Framework.Rectangle bounds = viewport.Bounds;
|
||||
Color color = Color.Black * Game1.currentLocation.LightLevel;
|
||||
Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.Black * Game1.currentLocation.LightLevel;
|
||||
spriteBatch.Draw(fadeToBlackRect, bounds, color);
|
||||
}
|
||||
if (Game1.screenGlow)
|
||||
|
@ -1232,7 +1200,7 @@ namespace StardewModdingAPI.Framework
|
|||
Texture2D fadeToBlackRect = Game1.fadeToBlackRect;
|
||||
viewport = Game1.graphics.GraphicsDevice.Viewport;
|
||||
Microsoft.Xna.Framework.Rectangle bounds = viewport.Bounds;
|
||||
Color color = Game1.screenGlowColor * Game1.screenGlowAlpha;
|
||||
Microsoft.Xna.Framework.Color color = Game1.screenGlowColor * Game1.screenGlowAlpha;
|
||||
spriteBatch.Draw(fadeToBlackRect, bounds, color);
|
||||
}
|
||||
Game1.currentLocation.drawAboveAlwaysFrontLayer(Game1.spriteBatch);
|
||||
|
@ -1241,7 +1209,7 @@ namespace StardewModdingAPI.Framework
|
|||
if (Game1.isRaining && Game1.currentLocation.IsOutdoors && (!Game1.currentLocation.Name.Equals("Desert") && !(Game1.currentLocation is Summit)) && (!Game1.eventUp || Game1.currentLocation.isTileOnMap(new Vector2((float)(Game1.viewport.X / 64), (float)(Game1.viewport.Y / 64)))))
|
||||
{
|
||||
for (int index = 0; index < Game1.rainDrops.Length; ++index)
|
||||
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.Draw(Game1.rainTexture, Game1.rainDrops[index].position, new Microsoft.Xna.Framework.Rectangle?(Game1.getSourceRectForStandardTileSheet(Game1.rainTexture, Game1.rainDrops[index].frame, -1, -1)), Microsoft.Xna.Framework.Color.White);
|
||||
}
|
||||
Game1.spriteBatch.End();
|
||||
Game1.spriteBatch.Begin(SpriteSortMode.FrontToBack, BlendState.AlphaBlend, SamplerState.PointClamp, (DepthStencilState)null, (RasterizerState)null);
|
||||
|
@ -1257,7 +1225,7 @@ namespace StardewModdingAPI.Framework
|
|||
localPosition.Y += 32f;
|
||||
else if (actor.Gender == 1)
|
||||
localPosition.Y += 10f;
|
||||
Game1.spriteBatch.Draw(Game1.emoteSpriteSheet, localPosition, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(actor.CurrentEmoteIndex * 16 % Game1.emoteSpriteSheet.Width, actor.CurrentEmoteIndex * 16 / Game1.emoteSpriteSheet.Width * 16, 16, 16)), Color.White, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, (float)actor.getStandingY() / 10000f);
|
||||
Game1.spriteBatch.Draw(Game1.emoteSpriteSheet, localPosition, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(actor.CurrentEmoteIndex * 16 % Game1.emoteSpriteSheet.Width, actor.CurrentEmoteIndex * 16 / Game1.emoteSpriteSheet.Width * 16, 16, 16)), Microsoft.Xna.Framework.Color.White, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, (float)actor.getStandingY() / 10000f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1265,14 +1233,14 @@ namespace StardewModdingAPI.Framework
|
|||
if (Game1.drawLighting)
|
||||
{
|
||||
Game1.spriteBatch.Begin(SpriteSortMode.Deferred, this.lightingBlend, SamplerState.LinearClamp, (DepthStencilState)null, (RasterizerState)null);
|
||||
Game1.spriteBatch.Draw((Texture2D)Game1.lightmap, Vector2.Zero, new Microsoft.Xna.Framework.Rectangle?(Game1.lightmap.Bounds), Color.White, 0.0f, Vector2.Zero, (float)(Game1.options.lightingQuality / 2), SpriteEffects.None, 1f);
|
||||
Game1.spriteBatch.Draw((Texture2D)Game1.lightmap, Vector2.Zero, new Microsoft.Xna.Framework.Rectangle?(Game1.lightmap.Bounds), Microsoft.Xna.Framework.Color.White, 0.0f, Vector2.Zero, (float)(Game1.options.lightingQuality / 2), SpriteEffects.None, 1f);
|
||||
if (Game1.isRaining && (bool)((NetFieldBase<bool, NetBool>)Game1.currentLocation.isOutdoors) && !(Game1.currentLocation is Desert))
|
||||
{
|
||||
SpriteBatch spriteBatch = Game1.spriteBatch;
|
||||
Texture2D staminaRect = Game1.staminaRect;
|
||||
viewport = Game1.graphics.GraphicsDevice.Viewport;
|
||||
Microsoft.Xna.Framework.Rectangle bounds = viewport.Bounds;
|
||||
Color color = Color.OrangeRed * 0.45f;
|
||||
Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.OrangeRed * 0.45f;
|
||||
spriteBatch.Draw(staminaRect, bounds, color);
|
||||
}
|
||||
Game1.spriteBatch.End();
|
||||
|
@ -1298,7 +1266,7 @@ namespace StardewModdingAPI.Framework
|
|||
viewport = Game1.graphics.GraphicsDevice.Viewport;
|
||||
int height = viewport.Height;
|
||||
Microsoft.Xna.Framework.Rectangle destinationRectangle = new Microsoft.Xna.Framework.Rectangle(x, y, 1, height);
|
||||
Color color = Color.Red * 0.5f;
|
||||
Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.Red * 0.5f;
|
||||
spriteBatch.Draw(staminaRect, destinationRectangle, color);
|
||||
num3 += 64;
|
||||
}
|
||||
|
@ -1320,7 +1288,7 @@ namespace StardewModdingAPI.Framework
|
|||
viewport = Game1.graphics.GraphicsDevice.Viewport;
|
||||
int width = viewport.Width;
|
||||
Microsoft.Xna.Framework.Rectangle destinationRectangle = new Microsoft.Xna.Framework.Rectangle(x, y, width, 1);
|
||||
Color color = Color.Red * 0.5f;
|
||||
Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.Red * 0.5f;
|
||||
spriteBatch.Draw(staminaRect, destinationRectangle, color);
|
||||
num5 += 64f;
|
||||
}
|
||||
|
@ -1328,9 +1296,9 @@ namespace StardewModdingAPI.Framework
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (Game1.currentBillboard != 0)
|
||||
if (Game1.currentBillboard != 0 && !this.takingMapScreenshot)
|
||||
this.drawBillboard();
|
||||
if (!Game1.eventUp && Game1.farmEvent == null && (Game1.currentBillboard == 0 && Game1.gameMode == (byte)3) && Game1.isOutdoorMapSmallerThanViewport())
|
||||
if (!Game1.eventUp && Game1.farmEvent == null && (Game1.currentBillboard == 0 && Game1.gameMode == (byte)3) && (!this.takingMapScreenshot && Game1.isOutdoorMapSmallerThanViewport()))
|
||||
{
|
||||
SpriteBatch spriteBatch1 = Game1.spriteBatch;
|
||||
Texture2D fadeToBlackRect1 = Game1.fadeToBlackRect;
|
||||
|
@ -1338,7 +1306,7 @@ namespace StardewModdingAPI.Framework
|
|||
viewport = Game1.graphics.GraphicsDevice.Viewport;
|
||||
int height1 = viewport.Height;
|
||||
Microsoft.Xna.Framework.Rectangle destinationRectangle1 = new Microsoft.Xna.Framework.Rectangle(0, 0, width1, height1);
|
||||
Color black1 = Color.Black;
|
||||
Microsoft.Xna.Framework.Color black1 = Microsoft.Xna.Framework.Color.Black;
|
||||
spriteBatch1.Draw(fadeToBlackRect1, destinationRectangle1, black1);
|
||||
SpriteBatch spriteBatch2 = Game1.spriteBatch;
|
||||
Texture2D fadeToBlackRect2 = Game1.fadeToBlackRect;
|
||||
|
@ -1348,10 +1316,10 @@ namespace StardewModdingAPI.Framework
|
|||
viewport = Game1.graphics.GraphicsDevice.Viewport;
|
||||
int height2 = viewport.Height;
|
||||
Microsoft.Xna.Framework.Rectangle destinationRectangle2 = new Microsoft.Xna.Framework.Rectangle(x, 0, width2, height2);
|
||||
Color black2 = Color.Black;
|
||||
Microsoft.Xna.Framework.Color black2 = Microsoft.Xna.Framework.Color.Black;
|
||||
spriteBatch2.Draw(fadeToBlackRect2, destinationRectangle2, black2);
|
||||
}
|
||||
if ((Game1.displayHUD || Game1.eventUp) && (Game1.currentBillboard == 0 && Game1.gameMode == (byte)3) && (!Game1.freezeControls && !Game1.panMode && !Game1.HostPaused))
|
||||
if ((Game1.displayHUD || Game1.eventUp) && (Game1.currentBillboard == 0 && Game1.gameMode == (byte)3) && (!Game1.freezeControls && !Game1.panMode && (!Game1.HostPaused && !this.takingMapScreenshot)))
|
||||
{
|
||||
events.RenderingHud.RaiseEmpty();
|
||||
this.drawHUD();
|
||||
|
@ -1361,7 +1329,7 @@ namespace StardewModdingAPI.Framework
|
|||
{
|
||||
FarmEvent farmEvent = Game1.farmEvent;
|
||||
}
|
||||
if (Game1.hudMessages.Count > 0)
|
||||
if (Game1.hudMessages.Count > 0 && !this.takingMapScreenshot)
|
||||
{
|
||||
for (int i = Game1.hudMessages.Count - 1; i >= 0; --i)
|
||||
Game1.hudMessages[i].draw(Game1.spriteBatch, i);
|
||||
|
@ -1369,12 +1337,12 @@ namespace StardewModdingAPI.Framework
|
|||
}
|
||||
if (Game1.farmEvent != null)
|
||||
Game1.farmEvent.draw(Game1.spriteBatch);
|
||||
if (Game1.dialogueUp && !Game1.nameSelectUp && !Game1.messagePause && (Game1.activeClickableMenu == null || !(Game1.activeClickableMenu is DialogueBox)))
|
||||
if (Game1.dialogueUp && !Game1.nameSelectUp && !Game1.messagePause && ((Game1.activeClickableMenu == null || !(Game1.activeClickableMenu is DialogueBox)) && !this.takingMapScreenshot))
|
||||
this.drawDialogueBox();
|
||||
if (Game1.progressBar)
|
||||
if (Game1.progressBar && !this.takingMapScreenshot)
|
||||
{
|
||||
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);
|
||||
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), Microsoft.Xna.Framework.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), Microsoft.Xna.Framework.Color.DimGray);
|
||||
}
|
||||
if (Game1.eventUp && Game1.currentLocation != null && Game1.currentLocation.currentEvent != null)
|
||||
Game1.currentLocation.currentEvent.drawAfterMap(Game1.spriteBatch);
|
||||
|
@ -1384,19 +1352,19 @@ namespace StardewModdingAPI.Framework
|
|||
Texture2D staminaRect = Game1.staminaRect;
|
||||
viewport = Game1.graphics.GraphicsDevice.Viewport;
|
||||
Microsoft.Xna.Framework.Rectangle bounds = viewport.Bounds;
|
||||
Color color = Color.Blue * 0.2f;
|
||||
Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.Blue * 0.2f;
|
||||
spriteBatch.Draw(staminaRect, bounds, color);
|
||||
}
|
||||
if ((Game1.fadeToBlack || Game1.globalFade) && !Game1.menuUp && (!Game1.nameSelectUp || Game1.messagePause))
|
||||
if ((Game1.fadeToBlack || Game1.globalFade) && !Game1.menuUp && ((!Game1.nameSelectUp || Game1.messagePause) && !this.takingMapScreenshot))
|
||||
{
|
||||
SpriteBatch spriteBatch = Game1.spriteBatch;
|
||||
Texture2D fadeToBlackRect = Game1.fadeToBlackRect;
|
||||
viewport = Game1.graphics.GraphicsDevice.Viewport;
|
||||
Microsoft.Xna.Framework.Rectangle bounds = viewport.Bounds;
|
||||
Color color = Color.Black * (Game1.gameMode == (byte)0 ? 1f - Game1.fadeToBlackAlpha : Game1.fadeToBlackAlpha);
|
||||
Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.Black * (Game1.gameMode == (byte)0 ? 1f - Game1.fadeToBlackAlpha : Game1.fadeToBlackAlpha);
|
||||
spriteBatch.Draw(fadeToBlackRect, bounds, color);
|
||||
}
|
||||
else if ((double)Game1.flashAlpha > 0.0)
|
||||
else if ((double)Game1.flashAlpha > 0.0 && !this.takingMapScreenshot)
|
||||
{
|
||||
if (Game1.options.screenFlash)
|
||||
{
|
||||
|
@ -1404,15 +1372,18 @@ namespace StardewModdingAPI.Framework
|
|||
Texture2D fadeToBlackRect = Game1.fadeToBlackRect;
|
||||
viewport = Game1.graphics.GraphicsDevice.Viewport;
|
||||
Microsoft.Xna.Framework.Rectangle bounds = viewport.Bounds;
|
||||
Color color = Color.White * Math.Min(1f, Game1.flashAlpha);
|
||||
Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.White * Math.Min(1f, Game1.flashAlpha);
|
||||
spriteBatch.Draw(fadeToBlackRect, bounds, color);
|
||||
}
|
||||
Game1.flashAlpha -= 0.1f;
|
||||
}
|
||||
if ((Game1.messagePause || Game1.globalFade) && Game1.dialogueUp)
|
||||
if ((Game1.messagePause || Game1.globalFade) && (Game1.dialogueUp && !this.takingMapScreenshot))
|
||||
this.drawDialogueBox();
|
||||
foreach (TemporaryAnimatedSprite overlayTempSprite in Game1.screenOverlayTempSprites)
|
||||
overlayTempSprite.draw(Game1.spriteBatch, true, 0, 0, 1f);
|
||||
if (!this.takingMapScreenshot)
|
||||
{
|
||||
foreach (TemporaryAnimatedSprite overlayTempSprite in Game1.screenOverlayTempSprites)
|
||||
overlayTempSprite.draw(Game1.spriteBatch, true, 0, 0, 1f);
|
||||
}
|
||||
if (Game1.debugMode)
|
||||
{
|
||||
StringBuilder debugStringBuilder = Game1._debugStringBuilder;
|
||||
|
@ -1443,11 +1414,11 @@ namespace StardewModdingAPI.Framework
|
|||
debugStringBuilder.Append(Game1.getMouseY() + Game1.viewport.Y);
|
||||
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);
|
||||
Game1.spriteBatch.DrawString(Game1.smallFont, debugStringBuilder, new Vector2((float)this.GraphicsDevice.Viewport.GetTitleSafeArea().X, (float)(this.GraphicsDevice.Viewport.GetTitleSafeArea().Y + Game1.smallFont.LineSpacing * 8)), Microsoft.Xna.Framework.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);
|
||||
if (Game1.activeClickableMenu != null)
|
||||
if (Game1.showKeyHelp && !this.takingMapScreenshot)
|
||||
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), Microsoft.Xna.Framework.Color.LightGray, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.9999999f);
|
||||
if (Game1.activeClickableMenu != null && !this.takingMapScreenshot)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -1463,9 +1434,9 @@ namespace StardewModdingAPI.Framework
|
|||
}
|
||||
else if (Game1.farmEvent != null)
|
||||
Game1.farmEvent.drawAboveEverything(Game1.spriteBatch);
|
||||
if (Game1.emoteMenu != null)
|
||||
if (Game1.emoteMenu != null && !this.takingMapScreenshot)
|
||||
Game1.emoteMenu.draw(Game1.spriteBatch);
|
||||
if (Game1.HostPaused)
|
||||
if (Game1.HostPaused && !this.takingMapScreenshot)
|
||||
{
|
||||
string s = Game1.content.LoadString("Strings\\StringsFromCSFiles:DayTimeMoneyBox.cs.10378");
|
||||
SpriteText.drawStringWithScrollBackground(Game1.spriteBatch, s, 96, 32, "", 1f, -1, SpriteText.ScrollTextAlignment.Left);
|
||||
|
|
Loading…
Reference in New Issue