diff --git a/CHANGELOG.md b/CHANGELOG.md index b965165f..d72b91d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +# 2.24.0 +- Fixed Part2CardCostRender.UpdatePlayableCardCost not being invoked +- Fixed Part2CardCostRender.UpdateVanillaPlayableCardCost not being invoked +- Fixed SetEmissiveSacrificablePortrait functions which used to refer to SteelTrapPortrait instead of SacrificablePortrait +- Updated API and community patch target frameworks to `netframework4.7.2` (closer to the Runtime netframework.) +- Updated community patch plugin's mod version to match the API's +- Updated list of API contributors +- Added ability to set custom card given by Steel Trap sigil (cr. Snowi and SpecialAPI) +- Added `GetSteelTrapPelt` and `SetSteelTrapPelt` card extensions +- Added debug mode cards for testing custom Steel Trap pelts +- Added functions to set 'TailLostPortrait' emission sprites +- Added functions for setting 'TailLostPortrait' from a Sprite object +- Added NoWarn property to API and community patch projects for AD0001, CS0612, CS0618, Publicizer001 + # 2.23.7 - Fixed log spam due to inverted condition in CardExtensions.GemsCost diff --git a/InscryptionAPI/InscryptionAPI.csproj b/InscryptionAPI/InscryptionAPI.csproj index 0b37740a..53e29465 100644 --- a/InscryptionAPI/InscryptionAPI.csproj +++ b/InscryptionAPI/InscryptionAPI.csproj @@ -10,7 +10,7 @@ full false true - 2.23.7 + 2.24.0 diff --git a/InscryptionAPI/Slots/SlotModificationExtensions.cs b/InscryptionAPI/Slots/SlotModificationExtensions.cs index c529489a..99a99a0c 100644 --- a/InscryptionAPI/Slots/SlotModificationExtensions.cs +++ b/InscryptionAPI/Slots/SlotModificationExtensions.cs @@ -15,9 +15,7 @@ namespace InscryptionAPI.Slots; /// /// Contains extension methods to simplify slot modification management /// -public static class SlotModificationExtensions -{ - +public static class SlotModificationExtensions { public static Info InfoByID(this IEnumerable modInfos, ModificationType mod) { return modInfos.FirstOrDefault(x => x.ModificationType == mod); @@ -84,9 +82,9 @@ public static ModificationType SetSharedRulebook(this ModificationType mod, Modi } /// - /// Clears the slot modification in this CardSlot, if one is present. + /// Sets the slot modification to 'no modification', effectively clearing/resetting the slot's modification. /// - /// The slot to assign the modification to. + /// The slot to clear. public static IEnumerator ClearSlotModification(this CardSlot slot) { yield return slot.SetSlotModification(ModificationType.NoModification); } diff --git a/InscryptionCommunityPatch/Card/MergedSigilOnBottom.cs b/InscryptionCommunityPatch/Card/MergedSigilOnBottom.cs index 2f0a87c6..31e30a69 100644 --- a/InscryptionCommunityPatch/Card/MergedSigilOnBottom.cs +++ b/InscryptionCommunityPatch/Card/MergedSigilOnBottom.cs @@ -22,10 +22,11 @@ private static bool DontPlaceCardModIcons_IfShowOnBottom(CardAbilityIcons __inst { // If we are showing card modifications sigils on the bottom, we don't allow the // AppyAbilitiesToIcons method to do anything - if (iconMat == __instance.emissiveIconMat && PatchPlugin.configMergeOnBottom.Value && PatchPlugin.configRemovePatches.Value) + if (PatchPlugin.configMergeOnBottom.Value && PatchPlugin.configRemovePatches.Value && iconMat == __instance.emissiveIconMat) { - foreach (var icon in icons) + foreach (AbilityIconInteractable icon in icons) { icon.gameObject.SetActive(false); + } return false; } @@ -39,13 +40,11 @@ private static void MoveMergeIconsToDefaultGroup_IfShowOnBottom(List de // This is the first time that the default abilities list is used once it has been built // What we want to do is take all of the abilities from the merge group and move them to the default group // if the "show merged icons on bottom" setting is active. - - if (PatchPlugin.configMergeOnBottom.Value) - { + if (PatchPlugin.configMergeOnBottom.Value) { defaultAbilities.AddRange(mergeAbilities); - - if (PatchPlugin.configRemovePatches.Value) + if (PatchPlugin.configRemovePatches.Value) { mergeAbilities.Clear(); + } } } @@ -54,55 +53,43 @@ private static void MoveMergeIconsToDefaultGroup_IfShowOnBottom(List de [HarmonyPostfix] private static void RepositionAndRetextureMergedIcons_IfShowOnBottom(ref CardInfo info, ref AbilityInfo ability, ref AbilityIconInteractable __instance) { - if (!PatchPlugin.configMergeOnBottom.Value) - return; + if (PatchPlugin.configMergeOnBottom.Value && info != null && info.Mods.Count > 0) { + List MergeSigils = info.Mods.FindAll(x => x.fromCardMerge); - if (info != null) - { - if (info.Mods.Count > 0) - { - List MergeSigils = info.Mods.FindAll(x => x.fromCardMerge); + if (MergeSigils.Count > 0) { + foreach (CardModificationInfo mod in MergeSigils) { + // if ability whose icon we're loading came from a card merge mod + if (mod.abilities.Contains(ability.ability) && (__instance.name == "AbilityIcon" || __instance.name == "DefaultIcons_1Ability")) { + if (PatchPlugin.configRemovePatches.Value) { + __instance.SetMaterial(Singleton.Instance.totemIconMat); + if (__instance.GetComponentInParent() != null) + __instance.GetComponentInParent().enabled = true; - if (MergeSigils.Count > 0) - { - foreach (CardModificationInfo mod in MergeSigils) - { - if (mod.abilities.Contains(ability.ability) && (__instance.name == "AbilityIcon" || __instance.name == "DefaultIcons_1Ability")) - { - if (PatchPlugin.configRemovePatches.Value) - { - __instance.SetMaterial(Singleton.Instance.totemIconMat); - if (__instance.GetComponentInParent() != null) - __instance.GetComponentInParent().enabled = true; + __instance.SetColor(Color.white); + return; + } + int sigils = (info.DefaultAbilities.Count + MergeSigils.Count); + if (sigils <= 8) { + //Plugin.Log.LogInfo(sigils + " " + ability.ToString() + " " + info.name); - __instance.SetColor(Color.white); - return; + Transform[] allChildren; + //Plugin.Log.LogInfo(__instance.name); + if (__instance.name == "DefaultIcons_1Ability") { + allChildren = __instance.transform.parent.GetComponentsInChildren(); } - int sigils = (info.DefaultAbilities.Count + MergeSigils.Count); - if (sigils <= 8) - { - //Plugin.Log.LogInfo(sigils + " " + ability.ToString() + " " + info.name); - - Transform[] allChildren = __instance.transform.parent.transform.parent.GetComponentsInChildren(); - //Plugin.Log.LogInfo(__instance.name); - if (__instance.name == "DefaultIcons_1Ability") - allChildren = __instance.transform.parent.GetComponentsInChildren(); + else { + allChildren = __instance.transform.parent.transform.parent.GetComponentsInChildren(); + } - foreach (Transform child in allChildren) - { - if (child.gameObject.activeSelf && child.gameObject.name.StartsWith("CardMergeIcon_")) - { - if (child.gameObject.GetComponent().Ability == __instance.Ability) - { - child.gameObject.transform.localPosition = __instance.transform.localPosition; - child.gameObject.transform.localScale = __instance.transform.localScale; - } - } + foreach (Transform child in allChildren) { + if (child.gameObject.activeSelf && child.gameObject.name.StartsWith("CardMergeIcon_") && + child.gameObject.GetComponent().Ability == __instance.Ability) { + child.gameObject.transform.localPosition = __instance.transform.localPosition; + child.gameObject.transform.localScale = __instance.transform.localScale; } } } } - return; } } } diff --git a/InscryptionCommunityPatch/Card/Part2CardCostRender.cs b/InscryptionCommunityPatch/Card/Part2CardCostRender.cs index a51266fe..5330d53e 100644 --- a/InscryptionCommunityPatch/Card/Part2CardCostRender.cs +++ b/InscryptionCommunityPatch/Card/Part2CardCostRender.cs @@ -160,6 +160,9 @@ public static List VanillaCostTextures(PixelCardDisplayer display, Ca // Call the event and allow others to modify the list of textures UpdateCardCost?.Invoke(cardInfo, costTextures); UpdateVanillaCardCost?.Invoke(cardInfo, costTextures); + UpdatePlayableCardCost?.Invoke(playableCard, costTextures); + UpdateVanillaPlayableCardCost?.Invoke(playableCard, costTextures); + return costTextures; } diff --git a/InscryptionCommunityPatch/InscryptionCommunityPatch.csproj b/InscryptionCommunityPatch/InscryptionCommunityPatch.csproj index 924b6b18..aff823b4 100644 --- a/InscryptionCommunityPatch/InscryptionCommunityPatch.csproj +++ b/InscryptionCommunityPatch/InscryptionCommunityPatch.csproj @@ -9,7 +9,7 @@ true full false - 2.23.7 + 2.24.0 diff --git a/InscryptionCommunityPatch/PixelTutor/PixelPlayableCardArray.cs b/InscryptionCommunityPatch/PixelTutor/PixelPlayableCardArray.cs index e50db0bb..9a3bc244 100644 --- a/InscryptionCommunityPatch/PixelTutor/PixelPlayableCardArray.cs +++ b/InscryptionCommunityPatch/PixelTutor/PixelPlayableCardArray.cs @@ -158,13 +158,11 @@ private void InitialiseButtons(List cards, bool deckReview, bool forPo } private void CleanUpButtons() { - if (forwardButton.gameObject.active) + if (forwardButton.gameObject.activeSelf) { forwardButton.gameObject.SetActive(false); backButton.gameObject.SetActive(false); } - //Destroy(forwardButton.gameObject); - //Destroy(backButton.gameObject); } private void EnableButtons(bool enable) {