spacechase0 / StardewValleyMods

New home for my stardew valley mod source code
Other
120 stars 142 forks source link

[SpaceCore] Fallback for Recipe Descriptions and Fix Double Ingredient Count #460

Closed lisyce closed 3 months ago

lisyce commented 6 months ago

Resolves #459

If the provided recipeOverride in the SpaceCore.Framework.CustomCraftingRecipe constructor has an empty description, it now does not display an empty space where the description should go. It now falls back on the vanilla game's CraftingRecipe.description field, which is auto-populated with the output item's description.

The changes in the constructor ensure that vanilla methods like CraftingRecipe.getDescriptionHeight use the right data. (Currently, if CraftingRecipe.description is two lines but recipeOverride.Description is one line, space for two lines will be allocated when only one is needed).

I don't think VAECraftingRecipe.Description has any more references in SpaceCore now that this one was removed, but I did not delete it because I don't know what else outside of SpaceCore may rely on it.

Additionally, fixed the bug where the number of ingredients shown was doubled because it checked the player's inventory twice rather than checking the inventory AND the additional containers.