Browse Source

[2.0.4.5] Now uses PatchMethods.HoverItem to increase compatibility

Zariteis 4 years ago
parent
commit
3bed7fd94d
2 changed files with 5 additions and 14 deletions
  1. 4 13
      Patches/Patch_GameScript_HoverRecipeSelect.cs
  2. 1 1
      RecipeMenuCore.cs

+ 4 - 13
Patches/Patch_GameScript_HoverRecipeSelect.cs

@@ -5,6 +5,7 @@ using System.Collections;
 using System.Reflection;
 using System.Collections.Generic;
 using System.Globalization;
+using GadgetCore;
 
 namespace RecipeMenuCore.Patches
 {
@@ -29,9 +30,12 @@ namespace RecipeMenuCore.Patches
           return false;
         }
       }
+
       var item = new Item(GetItemId(__instance, id, ___craftType, ___curRecipePage), 1, 0, 0, 0, new int[3], new int[3]);
       var itemInfo = ItemRegistry.GetItem(item.id);
 
+      PatchMethods.HoverItem(item);
+
       ___txtHoverStat[0].text = string.Empty;
       ___txtHoverStat[1].text = ___txtHoverStat[0].text;
       ___txtHoverStatInfo.text = string.Empty;
@@ -43,18 +47,8 @@ namespace RecipeMenuCore.Patches
       ___itemAspect[2].text = string.Empty;
       ___itemLevel.text = string.Empty;
 
-      if (Camera.main.ScreenToWorldPoint(Input.mousePosition).y < MenuScript.player.transform.position.y - 4.5f)
-        ___hoverItem.transform.localPosition = new Vector3(5f, 0f, -4.55f);
-      else
-        ___hoverItem.transform.localPosition = new Vector3(5f, -4f, -4.55f);
-
-      ___hoverDroid.SetActive(false);
-      ___itemexpbar.SetActive(false);
-
       if (item.id > 0)
       {
-        ___itemName.text = itemInfo.Name;
-        ___itemName.color = Color.white;
         ___itemDesc.text = GenerateDescription(itemInfo);
 
         bool hasStats = false;
@@ -63,11 +57,8 @@ namespace RecipeMenuCore.Patches
         {
           if (gearBaseStats[i] > 0)
           {
-            ___itemStat[i].text = "+" + gearBaseStats[i];
             hasStats = true;
           }
-          else
-            ___itemStat[i].text = string.Empty;
         }
         ___txtStats.SetActive(hasStats);
         ___hoverItem.SetActive(true);

+ 1 - 1
RecipeMenuCore.cs

@@ -11,7 +11,7 @@ namespace RecipeMenuCore
   [Gadget("RecipeMenuCore", RequiredOnClients: false)]
   public class RecipeMenuCore : Gadget<RecipeMenuCore>
   {
-    public const string MOD_VERSION = "1.6"; // Set this to the version of your mod.
+    public const string MOD_VERSION = "1.7"; // Set this to the version of your mod.
     public const string CONFIG_VERSION = "1.0"; // Increment this whenever you change your mod's config file.
 
     protected override void LoadConfig()