diff --git a/HookahPlace/src/TerminalPatch.cs b/HookahPlace/src/TerminalPatch.cs new file mode 100644 index 0000000..3bc44be --- /dev/null +++ b/HookahPlace/src/TerminalPatch.cs @@ -0,0 +1,22 @@ +using HarmonyLib; +using System.Linq; +using Dawn; + +namespace HookahPlace; + +[HarmonyPatch(typeof(Terminal))] +internal static class TerminalPatch +{ + [HarmonyPrefix] + [HarmonyPatch("Update")] + private static void UpdatePatch(Terminal __instance) + { + var hookahNode = LethalContent.Unlockables[HookahPlaceKeys.Hookah].UnlockableItem.shopSelectionNode; + + if (!__instance.ShipDecorSelection.Any(node => node.shipUnlockableID == hookahNode.shipUnlockableID)) + { + HookahPlace.Logger.LogInfo($"Patching terminal selection list {hookahNode.shipUnlockableID}"); + __instance.ShipDecorSelection = [.. __instance.ShipDecorSelection, hookahNode]; + } + } +}