From 9c1617c9ee51a0f6b93242fe8fc789336957460c Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 11 Apr 2018 21:15:16 -0400 Subject: drop support for Stardew Valley 1.2 (#453) --- src/SMAPI/Metadata/CoreAssetPropagator.cs | 47 ++----------------------------- 1 file changed, 2 insertions(+), 45 deletions(-) (limited to 'src/SMAPI/Metadata/CoreAssetPropagator.cs') diff --git a/src/SMAPI/Metadata/CoreAssetPropagator.cs b/src/SMAPI/Metadata/CoreAssetPropagator.cs index e54e0286..01ea24df 100644 --- a/src/SMAPI/Metadata/CoreAssetPropagator.cs +++ b/src/SMAPI/Metadata/CoreAssetPropagator.cs @@ -80,17 +80,8 @@ namespace StardewModdingAPI.Metadata ** Buildings ****/ case "buildings\\houses": // Farm -#if STARDEW_VALLEY_1_3 reflection.GetField(typeof(Farm), nameof(Farm.houseTextures)).SetValue(content.Load(key)); return true; -#else - { - Farm farm = Game1.getFarm(); - if (farm == null) - return false; - return farm.houseTextures = content.Load(key); - } -#endif /**** ** Content\Characters\Farmer @@ -101,20 +92,12 @@ namespace StardewModdingAPI.Metadata case "characters\\farmer\\farmer_base": // Farmer if (Game1.player == null || !Game1.player.isMale) return false; -#if STARDEW_VALLEY_1_3 return Game1.player.FarmerRenderer = new FarmerRenderer(key); -#else - return Game1.player.FarmerRenderer = new FarmerRenderer(content.Load(key)); -#endif case "characters\\farmer\\farmer_girl_base": // Farmer if (Game1.player == null || Game1.player.isMale) return false; -#if STARDEW_VALLEY_1_3 return Game1.player.FarmerRenderer = new FarmerRenderer(key); -#else - return Game1.player.FarmerRenderer = new FarmerRenderer(content.Load(key)); -#endif case "characters\\farmer\\hairstyles": // Game1.loadContent return FarmerRenderer.hairStylesTexture = content.Load(key); @@ -206,11 +189,6 @@ namespace StardewModdingAPI.Metadata /**** ** Content\Critters ****/ -#if !STARDEW_VALLEY_1_3 - case "tilesheets\\critters": // Criter.InitShared - return Critter.critterTexture = content.Load(key); -#endif - case "tilesheets\\crops": // Game1.loadContent return Game1.cropSpriteSheet = content.Load(key); @@ -265,11 +243,7 @@ namespace StardewModdingAPI.Metadata Texture2D texture = content.Load(key); reflection.GetField(titleMenu, "titleButtonsTexture").SetValue(texture); foreach (TemporaryAnimatedSprite bird in reflection.GetField>(titleMenu, "birds").GetValue()) -#if STARDEW_VALLEY_1_3 bird.texture = texture; -#else - bird.Texture = texture; -#endif return true; } return false; @@ -284,12 +258,8 @@ namespace StardewModdingAPI.Metadata return Game1.buffsIcons = content.Load(key); case "tilesheets\\bushes": // new Bush() -#if STARDEW_VALLEY_1_3 reflection.GetField>(typeof(Bush), "texture").SetValue(new Lazy(() => content.Load(key))); return true; -#else - return Bush.texture = content.Load(key); -#endif case "tilesheets\\craftables": // Game1.loadContent return Game1.bigCraftableSpriteSheet = content.Load(key); @@ -350,7 +320,7 @@ namespace StardewModdingAPI.Metadata return this.ReloadNpcSprites(content, key, monster: true); if (key.StartsWith(this.GetNormalisedPath("LooseSprites\\Fence"), StringComparison.InvariantCultureIgnoreCase)) - return this.ReloadFenceTextures(content, key); + return this.ReloadFenceTextures(key); if (this.IsInFolder(key, "Portraits")) return this.ReloadNpcPortraits(content, key); @@ -435,21 +405,16 @@ namespace StardewModdingAPI.Metadata { Lazy texture = new Lazy(() => content.Load(key)); foreach (Building building in buildings) -#if STARDEW_VALLEY_1_3 building.texture = texture; -#else - building.texture = texture.Value; -#endif return true; } return false; } /// Reload the sprites for a fence type. - /// The content manager through which to reload the asset. /// The asset key to reload. /// Returns whether any textures were reloaded. - private bool ReloadFenceTextures(LocalizedContentManager content, string key) + private bool ReloadFenceTextures(string key) { // get fence type if (!int.TryParse(this.GetSegments(key)[1].Substring("Fence".Length), out int fenceType)) @@ -528,11 +493,7 @@ namespace StardewModdingAPI.Metadata { Lazy texture = new Lazy(() => content.Load(key)); foreach (Tree tree in trees) -#if STARDEW_VALLEY_1_3 this.Reflection.GetField>(tree, "texture").SetValue(texture); -#else - this.Reflection.GetField(tree, "texture").SetValue(texture.Value); -#endif return true; } @@ -547,11 +508,7 @@ namespace StardewModdingAPI.Metadata /// The texture to set. private void SetSpriteTexture(AnimatedSprite sprite, Texture2D texture) { -#if STARDEW_VALLEY_1_3 this.Reflection.GetField(sprite, "spriteTexture").SetValue(texture); -#else - sprite.Texture = texture; -#endif } /// Get an NPC name from the name of their file under Content/Characters. -- cgit