From 7940c118a1bbd4e2f1aef1eaac1f95094d1d27c8 Mon Sep 17 00:00:00 2001 From: Ivaylo Lafchiev Date: Sun, 16 May 2021 09:27:50 +0100 Subject: [PATCH] Fix for Chest UI with nocost and 1.3.2 errors --- GameClasses/InventoryGui.cs | 14 ++++---------- ValheimRecycle.cs | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/GameClasses/InventoryGui.cs b/GameClasses/InventoryGui.cs index c7db628..e943c60 100644 --- a/GameClasses/InventoryGui.cs +++ b/GameClasses/InventoryGui.cs @@ -51,8 +51,10 @@ internal static bool PrefixUpdateCraftingPanel(InventoryGui __instance, bool foc if (ValheimRecycle.instance != null) { Player localPlayer = Player.m_localPlayer; - if (localPlayer.GetCurrentCraftingStation().gameObject.name.Contains("artisanstation")) + if (localPlayer.GetCurrentCraftingStation() && (localPlayer.GetCurrentCraftingStation().gameObject.name.Contains("cauldron") || localPlayer.GetCurrentCraftingStation().gameObject.name.Contains("artisanstation"))) { + ValheimRecycle.instance.recycleObject.SetActive(false); + ValheimRecycle.instance.recycleButton.interactable = true; return true; } if (!localPlayer.GetCurrentCraftingStation() && !localPlayer.NoCostCheat()) @@ -62,19 +64,11 @@ internal static bool PrefixUpdateCraftingPanel(InventoryGui __instance, bool foc __instance.m_tabUpgrade.gameObject.SetActive(false); ValheimRecycle.instance.recycleObject.SetActive(false); ValheimRecycle.instance.recycleButton.interactable = true; - } else { __instance.m_tabUpgrade.gameObject.SetActive(true); - if (!localPlayer.GetCurrentCraftingStation().gameObject.name.Contains("cauldron")) - { - ValheimRecycle.instance.recycleObject.SetActive(true); - } - else - { - ValheimRecycle.instance.recycleObject.SetActive(false); - } + ValheimRecycle.instance.recycleObject.SetActive(true); } List recipes = new List(); localPlayer.GetAvailableRecipes(ref recipes); diff --git a/ValheimRecycle.cs b/ValheimRecycle.cs index a00566a..9b2874a 100644 --- a/ValheimRecycle.cs +++ b/ValheimRecycle.cs @@ -6,7 +6,7 @@ namespace ValheimRecycle { - [BepInPlugin("org.lafchi.plugins.valheim_recycle", "Valheim Recycle", "1.3.2")] + [BepInPlugin("org.lafchi.plugins.valheim_recycle", "Valheim Recycle", "1.3.3")] [BepInProcess("valheim.exe")] public class ValheimRecycle : BaseUnityPlugin {