diff --git a/SDVModTest/ModConfig.cs b/SDVModTest/ModConfig.cs index e57bfe1..198460c 100644 --- a/SDVModTest/ModConfig.cs +++ b/SDVModTest/ModConfig.cs @@ -4,12 +4,6 @@ namespace UIInfoSuite { class ModConfig { - public string[] KeysForBarrelAndCropTimes { get; set; } = new string[] - { - SButton.LeftShift.ToString() - }; - - public bool CanRightClickForBarrelAndCropTimes { get; set; } = true; public int[][] Sprinkler { get; set; } = new int[][] { diff --git a/SDVModTest/Properties/AssemblyInfo.cs b/SDVModTest/Properties/AssemblyInfo.cs index 90744d7..c9feffc 100644 --- a/SDVModTest/Properties/AssemblyInfo.cs +++ b/SDVModTest/Properties/AssemblyInfo.cs @@ -2,6 +2,10 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +/* + * 1.8.4 Fixed ShowHarvestPrices for SDV 1.4 changes. + * */ + // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. @@ -10,7 +14,6 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("UI Info Suite")] -[assembly: AssemblyCopyright("Copyright © 2019")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +35,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.8.3.0")] -[assembly: AssemblyFileVersion("1.8.3.0")] +[assembly: AssemblyVersion("1.8.4.0")] +[assembly: AssemblyFileVersion("1.8.4.0")] diff --git a/SDVModTest/UIElements/ShopHarvestPrices.cs b/SDVModTest/UIElements/ShopHarvestPrices.cs index 6e6bd19..93002f8 100644 --- a/SDVModTest/UIElements/ShopHarvestPrices.cs +++ b/SDVModTest/UIElements/ShopHarvestPrices.cs @@ -42,7 +42,7 @@ namespace UIInfoSuite.UIElements // draw shop harvest prices if (Game1.activeClickableMenu is ShopMenu menu) { - if (typeof(ShopMenu).GetField("hoveredItem", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(menu) is Item hoverItem) + if (menu.hoveredItem is Item hoverItem) { String text = string.Empty; bool itemHasPriceInfo = Tools.GetTruePrice(hoverItem) > 0; @@ -66,8 +66,8 @@ namespace UIInfoSuite.UIElements 1); text = " " + temp.Price; } - - Item heldItem = typeof(ShopMenu).GetField("heldItem", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(menu) as Item; + + var heldItem = menu.heldItem as Item; if (heldItem == null) { int value = 0; @@ -144,12 +144,10 @@ namespace UIInfoSuite.UIElements text, new Vector2(xPosition, yPosition + 4), Color.Black * 0.8f); - + String hoverText = _helper.Reflection.GetField(menu, "hoverText").GetValue(); String hoverTitle = _helper.Reflection.GetField(menu, "boldTitleText").GetValue(); - Item hoverItem2 = _helper.Reflection.GetField(menu, "hoveredItem").GetValue(); int currency = _helper.Reflection.GetField(menu, "currency").GetValue(); - int hoverPrice = _helper.Reflection.GetField(menu, "hoverPrice").GetValue(); IReflectedMethod getHoveredItemExtraItemIndex = _helper.Reflection.GetMethod(menu, "getHoveredItemExtraItemIndex"); IReflectedMethod getHoveredItemExtraItemAmount = _helper.Reflection.GetMethod(menu, "getHoveredItemExtraItemAmount"); @@ -157,14 +155,14 @@ namespace UIInfoSuite.UIElements Game1.spriteBatch, hoverText, hoverTitle, - hoverItem2, + hoverItem, heldItem != null, -1, currency, getHoveredItemExtraItemIndex.Invoke(new object[0]), getHoveredItemExtraItemAmount.Invoke(new object[0]), null, - hoverPrice); + menu.hoverPrice); } } } diff --git a/SDVModTest/manifest.json b/SDVModTest/manifest.json index f24ec47..1d7799f 100644 --- a/SDVModTest/manifest.json +++ b/SDVModTest/manifest.json @@ -1,7 +1,7 @@ { "Name": "UI Info Suite", "Author": "Cdaragorn", - "Version": "1.8.3", + "Version": "1.8.4", "Description": "Adds a lot of useful information to the user interface. This is based on Demiacle's excellent UIModSuite.", "UniqueID": "Cdaragorn.UiInfoSuite", "EntryDll": "UIInfoSuite.dll",