Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion EpicLoot-UnityLib/EnchantingTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
6 changes: 6 additions & 0 deletions EpicLoot-UnityLib/FeatureStatus3D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
5 changes: 5 additions & 0 deletions EpicLoot/CraftingV2/EnchantingTable_Patch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down