diff --git a/src/SMAPI/Framework/RewriteFacades/AnimalQueryMenuMethods.cs b/src/SMAPI/Framework/RewriteFacades/AnimalQueryMenuMethods.cs new file mode 100644 index 00000000..166c5b17 --- /dev/null +++ b/src/SMAPI/Framework/RewriteFacades/AnimalQueryMenuMethods.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Xna.Framework; +using StardewValley; +using StardewValley.Menus; + +namespace StardewModdingAPI.Framework.RewriteFacades +{ + public class AnimalQueryMenuMethods : AnimalQueryMenu + { + public AnimalQueryMenuMethods(FarmAnimal animal) : base(animal) + { + } + + public ClickableTextureComponent AllowReproductionButtonProp + { + get + { + if (this.allowReproductionButton != null) + { + return new ClickableTextureComponent(this.allowReproductionButton.bounds, Game1.mouseCursors, new Rectangle(0x80, 0x189, 9, 9), this.allowReproductionButton.scale, false); + } + return null; + } + set + { + if (value != null) + { + this.allowReproductionButton = new ClickableComponent(value.bounds, "reproButton"); + } + this.allowReproductionButton = null; + } + } + + public ClickableTextureComponent SellButtonProp + { + get + { + if (this.sellButton != null) + { + return new ClickableTextureComponent(this.sellButton.bounds, Game1.mouseCursors, new Rectangle(0, 0x180, 0x10, 0x10), this.sellButton.scale, false); + } + return null; + } + set + { + if (value != null) + { + this.sellButton = new ClickableComponent(value.bounds, "sellButton"); + } + this.sellButton = null; + } + } + + public ClickableTextureComponent MoveHomeButtonProp + { + get + { + if (this.moveHomeButton != null) + { + return new ClickableTextureComponent(this.moveHomeButton.bounds, Game1.mouseCursors, new Rectangle(0x10, 0x180, 0x10, 0x10), this.moveHomeButton.scale, false); + } + return null; + } + set + { + if (value != null) + { + this.moveHomeButton = new ClickableComponent(value.bounds, "moveHomeButton"); + } + this.moveHomeButton = null; + } + } + + } +} diff --git a/src/SMAPI/Metadata/InstructionMetadata.cs b/src/SMAPI/Metadata/InstructionMetadata.cs index 14f03a49..a524829c 100644 --- a/src/SMAPI/Metadata/InstructionMetadata.cs +++ b/src/SMAPI/Metadata/InstructionMetadata.cs @@ -68,6 +68,9 @@ namespace StardewModdingAPI.Metadata yield return new TypeFieldToAnotherTypePropertyRewriter(typeof(ShopMenu), typeof(ShopMenuMethods), "forSale", "ForSaleProp"); yield return new TypeFieldToAnotherTypePropertyRewriter(typeof(MenuWithInventory), typeof(MenuWithInventoryMethods), "trashCan", "TrashCanProp"); yield return new TypeFieldToAnotherTypePropertyRewriter(typeof(ItemGrabMenu), typeof(ItemGrabMenuMethods), "fillStacksButton", "FillStacksButtonProp"); + yield return new TypeFieldToAnotherTypePropertyRewriter(typeof(AnimalQueryMenu), typeof(AnimalQueryMenuMethods), "allowReproductionButton", "AllowReproductionButtonProp"); + yield return new TypeFieldToAnotherTypePropertyRewriter(typeof(AnimalQueryMenu), typeof(AnimalQueryMenuMethods), "sellButton", "SellButtonProp"); + yield return new TypeFieldToAnotherTypePropertyRewriter(typeof(AnimalQueryMenu), typeof(AnimalQueryMenuMethods), "moveHomeButton", "MoveHomeButtonProp"); // Rewrite Missing Type yield return new TypeReferenceRewriter("StardewValley.Menus.CraftingPage", typeof(CraftingPageMobile)); diff --git a/src/SMAPI/SMAPI.csproj b/src/SMAPI/SMAPI.csproj index 494dfa0d..edee5ee9 100644 --- a/src/SMAPI/SMAPI.csproj +++ b/src/SMAPI/SMAPI.csproj @@ -267,6 +267,7 @@ +