TypeFieldToAnotherTypeMethodRewriter, a much more flexible choice to deal with fields changes
This commit is contained in:
parent
bc0cb5f5ed
commit
1bc88f2817
|
@ -43,7 +43,7 @@ namespace StardewModdingAPI.Framework.ModLoading
|
|||
public static bool IsSameType(Type type, TypeReference reference)
|
||||
{
|
||||
// same namespace & name
|
||||
if (type.Namespace != reference.Namespace || type.Name != reference.Name)
|
||||
if ((type.Namespace != reference.Namespace || type.Name != reference.Name) && !(reference.Namespace == "" && reference.FullName.Replace("/", "+") == type.FullName))
|
||||
return false;
|
||||
|
||||
// same generic parameters
|
||||
|
|
|
@ -86,6 +86,15 @@ namespace StardewModdingAPI.Metadata
|
|||
|
||||
yield return new PropertyToFieldRewriter(typeof(Game1), "toolSpriteSheet", "toolSpriteSheet");
|
||||
|
||||
// Accessibility fix
|
||||
yield return new TypeFieldToAnotherTypeMethodRewriter(typeof(GameMenu), typeof(GameMenuMethods), "hoverText", "GetHoverText");
|
||||
yield return new TypeFieldToAnotherTypeMethodRewriter(typeof(ShopMenu), typeof(ShopMenuMethods), "heldItem", "GetHeldItem");
|
||||
yield return new TypeFieldToAnotherTypeMethodRewriter(typeof(ShopMenu), typeof(ShopMenuMethods), "hoveredItem", "GetHoveredItem");
|
||||
yield return new TypeFieldToAnotherTypeMethodRewriter(typeof(ShopMenu), typeof(ShopMenuMethods), "hoverPrice", "GetHoverPrice");
|
||||
yield return new TypeFieldToAnotherTypeMethodRewriter(typeof(ShopMenu), typeof(ShopMenuMethods), "hoverText", "GetHoverText");
|
||||
yield return new TypeFieldToAnotherTypeMethodRewriter(typeof(ShopMenu), typeof(ShopMenuMethods), "categoriesToSellHere", "GetCategoriesToSellHere");
|
||||
yield return new TypeFieldToAnotherTypeMethodRewriter(typeof(MenuWithInventory), typeof(MenuWithInventoryMethods), "trashCan", "GetTrashCan");
|
||||
|
||||
//Method Rewrites
|
||||
yield return new MethodParentRewriter(typeof(Game1), typeof(Game1Methods));
|
||||
yield return new MethodParentRewriter(typeof(IClickableMenu), typeof(IClickableMenuMethods));
|
||||
|
|
Loading…
Reference in New Issue