From 29ffc9be684da4222d5f2adb42542b0fba657db2 Mon Sep 17 00:00:00 2001 From: Arsenii Fomin Date: Mon, 19 Feb 2024 10:52:52 +0700 Subject: [PATCH 1/3] Fixed bug with incorrect initial value of enchantment table upgrades when "Upgrades Active = false" leading to duping of items on the table build/destroy cycle --- EpicLoot-UnityLib/EnchantingTable.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EpicLoot-UnityLib/EnchantingTable.cs b/EpicLoot-UnityLib/EnchantingTable.cs index 472e1b012..72a948ef0 100644 --- a/EpicLoot-UnityLib/EnchantingTable.cs +++ b/EpicLoot-UnityLib/EnchantingTable.cs @@ -11,7 +11,7 @@ public class EnchantingTable : MonoBehaviour, Hoverable, Interactable public const string DisplayNameLocID = "mod_epicloot_assets_enchantingtable"; public const int FeatureUnavailableSentinel = -2; public const int FeatureLockedSentinel = -1; - public const int FeatureLevelOne = 1; + public const int FeatureLevelOne = 0; public GameObject EnchantingUIPrefab; From 2894defb6c060fe9bf46fad220161aa5b9ef97a0 Mon Sep 17 00:00:00 2001 From: Arsenii Fomin Date: Mon, 19 Feb 2024 12:37:52 +0700 Subject: [PATCH 2/3] Hotfix --- EpicLoot/CraftingV2/EnchantingTable_Patch.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/EpicLoot/CraftingV2/EnchantingTable_Patch.cs b/EpicLoot/CraftingV2/EnchantingTable_Patch.cs index 3eefb6282..a27808efa 100644 --- a/EpicLoot/CraftingV2/EnchantingTable_Patch.cs +++ b/EpicLoot/CraftingV2/EnchantingTable_Patch.cs @@ -15,6 +15,11 @@ public static void Postfix(Piece __instance) if (table == null) return; + if(!EpicLoot.EnchantingTableUpgradesActive.Value) + { + return; + } + foreach (EnchantingFeature feature in Enum.GetValues(typeof(EnchantingFeature))) { if (!table.IsFeatureAvailable(feature) || table.IsFeatureLocked(feature)) From a9ffad871d4028e91a894f4f61d31892ea5e6fe6 Mon Sep 17 00:00:00 2001 From: Arsenii Fomin Date: Mon, 19 Feb 2024 13:17:53 +0700 Subject: [PATCH 3/3] Trying to improve enchant table appearance when no upgrades are available --- EpicLoot-UnityLib/FeatureStatus3D.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/EpicLoot-UnityLib/FeatureStatus3D.cs b/EpicLoot-UnityLib/FeatureStatus3D.cs index 07ca5d4a1..07ebab749 100644 --- a/EpicLoot-UnityLib/FeatureStatus3D.cs +++ b/EpicLoot-UnityLib/FeatureStatus3D.cs @@ -27,6 +27,12 @@ public void Refresh() UnlockedObject.SetActive(featureIsUnlocked); var currentLevel = SourceTable.GetFeatureLevel(Feature); + if(!EnchantingTable.UpgradesActive(Feature, out bool featureActive)) + { + // To improve table appearance when no upgrades are available ever + currentLevel = 1; + } + for (var index = 0; index < LevelObjects.Length; index++) { var levelObject = LevelObjects[index];