Skip to content

Commit 966c836

Browse files
authored
Merge pull request #334 from HumabHatterZed/main
2.24.0 - minor fixes
2 parents f31fb6b + 95b5ce2 commit 966c836

7 files changed

Lines changed: 57 additions & 57 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# 2.24.0
2+
- Fixed Part2CardCostRender.UpdatePlayableCardCost not being invoked
3+
- Fixed Part2CardCostRender.UpdateVanillaPlayableCardCost not being invoked
4+
- Fixed SetEmissiveSacrificablePortrait functions which used to refer to SteelTrapPortrait instead of SacrificablePortrait
5+
- Updated API and community patch target frameworks to `netframework4.7.2` (closer to the Runtime netframework.)
6+
- Updated community patch plugin's mod version to match the API's
7+
- Updated list of API contributors
8+
- Added ability to set custom card given by Steel Trap sigil (cr. Snowi and SpecialAPI)
9+
- Added `GetSteelTrapPelt` and `SetSteelTrapPelt` card extensions
10+
- Added debug mode cards for testing custom Steel Trap pelts
11+
- Added functions to set 'TailLostPortrait' emission sprites
12+
- Added functions for setting 'TailLostPortrait' from a Sprite object
13+
- Added NoWarn property to API and community patch projects for AD0001, CS0612, CS0618, Publicizer001
14+
115
# 2.23.7
216
- Fixed log spam due to inverted condition in CardExtensions.GemsCost
317

InscryptionAPI/InscryptionAPI.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<DebugType>full</DebugType>
1111
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
1212
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
13-
<Version>2.23.7</Version>
13+
<Version>2.24.0</Version>
1414
</PropertyGroup>
1515

1616
<PropertyGroup>

InscryptionAPI/Slots/SlotModificationExtensions.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ namespace InscryptionAPI.Slots;
1515
/// <summary>
1616
/// Contains extension methods to simplify slot modification management
1717
/// </summary>
18-
public static class SlotModificationExtensions
19-
{
20-
18+
public static class SlotModificationExtensions {
2119
public static Info InfoByID(this IEnumerable<Info> modInfos, ModificationType mod)
2220
{
2321
return modInfos.FirstOrDefault(x => x.ModificationType == mod);
@@ -84,9 +82,9 @@ public static ModificationType SetSharedRulebook(this ModificationType mod, Modi
8482
}
8583

8684
/// <summary>
87-
/// Clears the slot modification in this CardSlot, if one is present.
85+
/// Sets the slot modification to 'no modification', effectively clearing/resetting the slot's modification.
8886
/// </summary>
89-
/// <param name="slot">The slot to assign the modification to.</param>
87+
/// <param name="slot">The slot to clear.</param>
9088
public static IEnumerator ClearSlotModification(this CardSlot slot) {
9189
yield return slot.SetSlotModification(ModificationType.NoModification);
9290
}

InscryptionCommunityPatch/Card/MergedSigilOnBottom.cs

Lines changed: 34 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ private static bool DontPlaceCardModIcons_IfShowOnBottom(CardAbilityIcons __inst
2222
{
2323
// If we are showing card modifications sigils on the bottom, we don't allow the
2424
// AppyAbilitiesToIcons method to do anything
25-
if (iconMat == __instance.emissiveIconMat && PatchPlugin.configMergeOnBottom.Value && PatchPlugin.configRemovePatches.Value)
25+
if (PatchPlugin.configMergeOnBottom.Value && PatchPlugin.configRemovePatches.Value && iconMat == __instance.emissiveIconMat)
2626
{
27-
foreach (var icon in icons)
27+
foreach (AbilityIconInteractable icon in icons) {
2828
icon.gameObject.SetActive(false);
29+
}
2930
return false;
3031
}
3132

@@ -39,13 +40,11 @@ private static void MoveMergeIconsToDefaultGroup_IfShowOnBottom(List<Ability> de
3940
// This is the first time that the default abilities list is used once it has been built
4041
// What we want to do is take all of the abilities from the merge group and move them to the default group
4142
// if the "show merged icons on bottom" setting is active.
42-
43-
if (PatchPlugin.configMergeOnBottom.Value)
44-
{
43+
if (PatchPlugin.configMergeOnBottom.Value) {
4544
defaultAbilities.AddRange(mergeAbilities);
46-
47-
if (PatchPlugin.configRemovePatches.Value)
45+
if (PatchPlugin.configRemovePatches.Value) {
4846
mergeAbilities.Clear();
47+
}
4948
}
5049
}
5150

@@ -54,55 +53,43 @@ private static void MoveMergeIconsToDefaultGroup_IfShowOnBottom(List<Ability> de
5453
[HarmonyPostfix]
5554
private static void RepositionAndRetextureMergedIcons_IfShowOnBottom(ref CardInfo info, ref AbilityInfo ability, ref AbilityIconInteractable __instance)
5655
{
57-
if (!PatchPlugin.configMergeOnBottom.Value)
58-
return;
56+
if (PatchPlugin.configMergeOnBottom.Value && info != null && info.Mods.Count > 0) {
57+
List<CardModificationInfo> MergeSigils = info.Mods.FindAll(x => x.fromCardMerge);
5958

60-
if (info != null)
61-
{
62-
if (info.Mods.Count > 0)
63-
{
64-
List<CardModificationInfo> MergeSigils = info.Mods.FindAll(x => x.fromCardMerge);
59+
if (MergeSigils.Count > 0) {
60+
foreach (CardModificationInfo mod in MergeSigils) {
61+
// if ability whose icon we're loading came from a card merge mod
62+
if (mod.abilities.Contains(ability.ability) && (__instance.name == "AbilityIcon" || __instance.name == "DefaultIcons_1Ability")) {
63+
if (PatchPlugin.configRemovePatches.Value) {
64+
__instance.SetMaterial(Singleton<CardAbilityIcons>.Instance.totemIconMat);
65+
if (__instance.GetComponentInParent<MeshRenderer>() != null)
66+
__instance.GetComponentInParent<MeshRenderer>().enabled = true;
6567

66-
if (MergeSigils.Count > 0)
67-
{
68-
foreach (CardModificationInfo mod in MergeSigils)
69-
{
70-
if (mod.abilities.Contains(ability.ability) && (__instance.name == "AbilityIcon" || __instance.name == "DefaultIcons_1Ability"))
71-
{
72-
if (PatchPlugin.configRemovePatches.Value)
73-
{
74-
__instance.SetMaterial(Singleton<CardAbilityIcons>.Instance.totemIconMat);
75-
if (__instance.GetComponentInParent<MeshRenderer>() != null)
76-
__instance.GetComponentInParent<MeshRenderer>().enabled = true;
68+
__instance.SetColor(Color.white);
69+
return;
70+
}
71+
int sigils = (info.DefaultAbilities.Count + MergeSigils.Count);
72+
if (sigils <= 8) {
73+
//Plugin.Log.LogInfo(sigils + " " + ability.ToString() + " " + info.name);
7774

78-
__instance.SetColor(Color.white);
79-
return;
75+
Transform[] allChildren;
76+
//Plugin.Log.LogInfo(__instance.name);
77+
if (__instance.name == "DefaultIcons_1Ability") {
78+
allChildren = __instance.transform.parent.GetComponentsInChildren<Transform>();
8079
}
81-
int sigils = (info.DefaultAbilities.Count + MergeSigils.Count);
82-
if (sigils <= 8)
83-
{
84-
//Plugin.Log.LogInfo(sigils + " " + ability.ToString() + " " + info.name);
85-
86-
Transform[] allChildren = __instance.transform.parent.transform.parent.GetComponentsInChildren<Transform>();
87-
//Plugin.Log.LogInfo(__instance.name);
88-
if (__instance.name == "DefaultIcons_1Ability")
89-
allChildren = __instance.transform.parent.GetComponentsInChildren<Transform>();
80+
else {
81+
allChildren = __instance.transform.parent.transform.parent.GetComponentsInChildren<Transform>();
82+
}
9083

91-
foreach (Transform child in allChildren)
92-
{
93-
if (child.gameObject.activeSelf && child.gameObject.name.StartsWith("CardMergeIcon_"))
94-
{
95-
if (child.gameObject.GetComponent<AbilityIconInteractable>().Ability == __instance.Ability)
96-
{
97-
child.gameObject.transform.localPosition = __instance.transform.localPosition;
98-
child.gameObject.transform.localScale = __instance.transform.localScale;
99-
}
100-
}
84+
foreach (Transform child in allChildren) {
85+
if (child.gameObject.activeSelf && child.gameObject.name.StartsWith("CardMergeIcon_") &&
86+
child.gameObject.GetComponent<AbilityIconInteractable>().Ability == __instance.Ability) {
87+
child.gameObject.transform.localPosition = __instance.transform.localPosition;
88+
child.gameObject.transform.localScale = __instance.transform.localScale;
10189
}
10290
}
10391
}
10492
}
105-
return;
10693
}
10794
}
10895
}

InscryptionCommunityPatch/Card/Part2CardCostRender.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ public static List<Texture2D> VanillaCostTextures(PixelCardDisplayer display, Ca
160160
// Call the event and allow others to modify the list of textures
161161
UpdateCardCost?.Invoke(cardInfo, costTextures);
162162
UpdateVanillaCardCost?.Invoke(cardInfo, costTextures);
163+
UpdatePlayableCardCost?.Invoke(playableCard, costTextures);
164+
UpdateVanillaPlayableCardCost?.Invoke(playableCard, costTextures);
165+
163166
return costTextures;
164167
}
165168

InscryptionCommunityPatch/InscryptionCommunityPatch.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1010
<DebugType>full</DebugType>
1111
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
12-
<Version>2.23.7</Version>
12+
<Version>2.24.0</Version>
1313
</PropertyGroup>
1414

1515
<PropertyGroup>

InscryptionCommunityPatch/PixelTutor/PixelPlayableCardArray.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,11 @@ private void InitialiseButtons(List<CardInfo> cards, bool deckReview, bool forPo
158158
}
159159
private void CleanUpButtons()
160160
{
161-
if (forwardButton.gameObject.active)
161+
if (forwardButton.gameObject.activeSelf)
162162
{
163163
forwardButton.gameObject.SetActive(false);
164164
backButton.gameObject.SetActive(false);
165165
}
166-
//Destroy(forwardButton.gameObject);
167-
//Destroy(backButton.gameObject);
168166
}
169167
private void EnableButtons(bool enable)
170168
{

0 commit comments

Comments
 (0)