Compatibility improvement.

This commit is contained in:
yangzhi 2020-02-15 20:17:21 +08:00
parent fc526bbe68
commit a2c3beee29
4 changed files with 21 additions and 7 deletions

View File

@ -20,7 +20,7 @@ namespace StardewModdingAPI
** Public
****/
/// <summary>SMAPI's current semantic version.</summary>
public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion("3.2.0.3-RC1", allowNonStandard: true);
public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion("3.2.0.3-RC2", allowNonStandard: true);
/// <summary>The minimum supported version of Stardew Valley.</summary>
public static ISemanticVersion MinimumGameVersion { get; } = new GameVersion("1.4.1");
@ -95,7 +95,7 @@ namespace StardewModdingAPI
internal static string ModsPath { get; set; }
/// <summary>The game's current semantic version.</summary>
internal static ISemanticVersion GameVersion { get; } = new GameVersion("1.4.5.136");
internal static ISemanticVersion GameVersion { get; } = new GameVersion("1.4.5.137");
/// <summary>The target game platform.</summary>
internal static Platform Platform { get; } = Platform.Android;

View File

@ -74,6 +74,17 @@ namespace StardewModdingAPI.Framework.RewriteFacades
typeof(ShopMenu).GetField("itemPriceAndStock", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public).SetValue(this, value);
}
}
public List<ISalable> ForSaleProp
{
get
{
return (List<ISalable>)typeof(ShopMenu).GetField("forSale", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public).GetValue(this);
}
set
{
typeof(ShopMenu).GetField("forSale", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public).SetValue(this, value);
}
}
public ShopMenuMethods(Dictionary<ISalable, int[]> itemPriceAndStock, int currency = 0, string who = null, Func<ISalable, Farmer, int, bool> on_purchase = null, Func<ISalable, bool> on_sell = null, string context = null) : base(itemPriceAndStock, currency, who, on_purchase, on_sell, context)
{

View File

@ -65,6 +65,7 @@ namespace StardewModdingAPI.Metadata
yield return new TypeFieldToAnotherTypePropertyRewriter(typeof(ShopMenu), typeof(ShopMenuMethods), "hoverText", "HoverTextProp");
yield return new TypeFieldToAnotherTypePropertyRewriter(typeof(ShopMenu), typeof(ShopMenuMethods), "categoriesToSellHere", "CategoriesToSellHereProp");
yield return new TypeFieldToAnotherTypePropertyRewriter(typeof(ShopMenu), typeof(ShopMenuMethods), "itemPriceAndStock", "ItemPriceAndStockProp");
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");
@ -80,6 +81,7 @@ namespace StardewModdingAPI.Metadata
yield return new MethodParentRewriter(typeof(SpriteText), typeof(SpriteTextMethods));
yield return new MethodParentRewriter(typeof(NPC), typeof(NPCMethods));
yield return new MethodParentRewriter(typeof(Utility), typeof(UtilityMethods));
yield return new MethodParentRewriter(typeof(DayTimeMoneyBox), typeof(DayTimeMoneyBoxMethods));
//Constructor Rewrites
yield return new MethodParentRewriter(typeof(HUDMessage), typeof(HUDMessageMethods));

View File

@ -48,10 +48,10 @@
<HintPath>..\..\..\..\..\AndroidStudioProjects\SMAPI Android Installer\app\src\main\assets\Stardew\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Google.Android.Vending.Expansion.Downloader">
<HintPath>..\..\..\..\..\Downloads\StardewValleyAndroidStuff\base_1.4.5.136\assemblies\Google.Android.Vending.Expansion.Downloader.dll</HintPath>
<HintPath>..\..\..\..\..\Downloads\StardewValleyAndroidStuff\base_1.4.5.137\assemblies\Google.Android.Vending.Expansion.Downloader.dll</HintPath>
</Reference>
<Reference Include="Google.Android.Vending.Licensing">
<HintPath>..\..\..\..\..\Downloads\StardewValleyAndroidStuff\base_1.4.5.136\assemblies\Google.Android.Vending.Licensing.dll</HintPath>
<HintPath>..\..\..\..\..\Downloads\StardewValleyAndroidStuff\base_1.4.5.137\assemblies\Google.Android.Vending.Licensing.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Mono.Android" />
@ -59,7 +59,7 @@
<HintPath>..\..\..\..\..\AndroidStudioProjects\SMAPI Android Installer\app\src\main\assets\Stardew\Mono.Cecil.dll</HintPath>
</Reference>
<Reference Include="MonoGame.Framework">
<HintPath>..\..\..\..\..\Downloads\StardewValleyAndroidStuff\base_1.4.5.136\assemblies\MonoGame.Framework.dll</HintPath>
<HintPath>..\..\..\..\..\Downloads\StardewValleyAndroidStuff\base_1.4.5.137\assemblies\MonoGame.Framework.dll</HintPath>
</Reference>
<Reference Include="MonoMod.RuntimeDetour">
<HintPath>..\..\..\..\..\AndroidStudioProjects\SMAPI Android Installer\app\src\main\assets\Stardew\MonoMod.RuntimeDetour.dll</HintPath>
@ -74,10 +74,10 @@
<HintPath>..\SMAPI.Toolkit\bin\Debug\net4.5\SMAPI.Toolkit.dll</HintPath>
</Reference>
<Reference Include="StardewValley">
<HintPath>..\..\..\..\..\Downloads\StardewValleyAndroidStuff\base_1.4.5.136\assemblies\StardewValley.dll</HintPath>
<HintPath>..\..\..\..\..\Downloads\StardewValleyAndroidStuff\base_1.4.5.137\assemblies\StardewValley.dll</HintPath>
</Reference>
<Reference Include="StardewValley.GameData">
<HintPath>..\..\..\..\..\Downloads\StardewValleyAndroidStuff\base_1.4.5.136\assemblies\StardewValley.GameData.dll</HintPath>
<HintPath>..\..\..\..\..\Downloads\StardewValleyAndroidStuff\base_1.4.5.137\assemblies\StardewValley.GameData.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@ -266,6 +266,7 @@
<Compile Include="Framework\RewriteFacades\DiscreteColorPickerMethods.cs" />
<Compile Include="Framework\RewriteFacades\CraftingPageMobileMethods.cs" />
<Compile Include="Framework\RewriteFacades\DialogueBoxMethods.cs" />
<Compile Include="Framework\RewriteFacades\DayTimeMoneyBoxMethods.cs" />
<Compile Include="Framework\RewriteFacades\ShopMenuMethods.cs" />
<Compile Include="Framework\RewriteFacades\FarmerMethods.cs" />
<Compile Include="Framework\RewriteFacades\FarmerRenderMethods.cs" />