From fa40aa020502f01998110fd74f6f5994492b8e0f Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 18 Sep 2018 17:50:22 -0400 Subject: update for Stardew Valley 1.3.30 --- src/SMAPI/Framework/SGame.cs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'src/SMAPI/Framework/SGame.cs') diff --git a/src/SMAPI/Framework/SGame.cs b/src/SMAPI/Framework/SGame.cs index 3af4beb1..166f958c 100644 --- a/src/SMAPI/Framework/SGame.cs +++ b/src/SMAPI/Framework/SGame.cs @@ -91,10 +91,6 @@ namespace StardewModdingAPI.Framework /// Whether the next content manager requested by the game will be for . private bool NextContentManagerIsMain; - /// A reference to the private _farmerShadows field on . - [SuppressMessage("ReSharper", "InconsistentNaming", Justification = "Deliberately named to match original game code as closely as possible.")] - private readonly List __farmerShadows; - /********* ** Accessors @@ -151,9 +147,6 @@ namespace StardewModdingAPI.Framework Game1.input = new SInputState(); Game1.multiplayer = new SMultiplayer(monitor, eventManager); - // init reflection - this.__farmerShadows = reflection.GetField>(this, "_farmerShadows").GetValue(); - // init observables Game1.locations = new ObservableCollection(); } @@ -991,13 +984,13 @@ namespace StardewModdingAPI.Framework Game1.mapDisplayDevice.BeginScene(Game1.spriteBatch); Game1.currentLocation.Map.GetLayer("Back").Draw(Game1.mapDisplayDevice, Game1.viewport, Location.Origin, false, 4); Game1.currentLocation.drawWater(Game1.spriteBatch); - this.__farmerShadows.Clear(); + this._farmerShadows.Clear(); if (Game1.currentLocation.currentEvent != null && !Game1.currentLocation.currentEvent.isFestival && Game1.currentLocation.currentEvent.farmerActors.Count > 0) { foreach (Farmer farmerActor in Game1.currentLocation.currentEvent.farmerActors) { if (farmerActor.IsLocalPlayer && Game1.displayFarmer || !(bool)((NetFieldBase)farmerActor.hidden)) - this.__farmerShadows.Add(farmerActor); + this._farmerShadows.Add(farmerActor); } } else @@ -1005,7 +998,7 @@ namespace StardewModdingAPI.Framework foreach (Farmer farmer in Game1.currentLocation.farmers) { if (farmer.IsLocalPlayer && Game1.displayFarmer || !(bool)((NetFieldBase)farmer.hidden)) - this.__farmerShadows.Add(farmer); + this._farmerShadows.Add(farmer); } } if (!Game1.currentLocation.shouldHideCharacters()) @@ -1026,7 +1019,7 @@ 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 : (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)actor.scale), SpriteEffects.None, Math.Max(0.0f, (float)actor.getStandingY() / 10000f) - 1E-06f); } } - foreach (Farmer farmerShadow in this.__farmerShadows) + foreach (Farmer farmerShadow in this._farmerShadows) { if (!(bool)((NetFieldBase)farmerShadow.swimming) && !farmerShadow.isRidingHorse() && (Game1.currentLocation == null || !Game1.currentLocation.shouldShadowBeDrawnAboveBuildingsLayer(farmerShadow.getTileLocation()))) { @@ -1070,7 +1063,7 @@ 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)actor.scale), SpriteEffects.None, Math.Max(0.0f, (float)actor.getStandingY() / 10000f) - 1E-06f); } } - foreach (Farmer farmerShadow in this.__farmerShadows) + foreach (Farmer farmerShadow in this._farmerShadows) { if (!(bool)((NetFieldBase)farmerShadow.swimming) && !farmerShadow.isRidingHorse() && (Game1.currentLocation != null && Game1.currentLocation.shouldShadowBeDrawnAboveBuildingsLayer(farmerShadow.getTileLocation()))) { -- cgit