Skip to content

Commit 4de9c9f

Browse files
Added 'UpdatePlayableCardCosts' event to community patch's Part1CardCostRender and Part2CardCostRender classes
1 parent 6f75b37 commit 4de9c9f

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# 2.23.2
22
- Fixed error when trying to create cards that evolve/transform in 4 or more turns
33
- Fixed Fledgling and Transformer sigil appearing as black boxes when a card evolves/transform in 4 or more turns
4+
- Fixed Part2VanillaCardCost event not being invoked
45
- Evolve and Transformer icons now show support cards that evolve in 4 or more turns
6+
- Added 'UpdatePlayableCardCosts' event to community patch's Part1CardCostRender and Part2CardCostRender classes
57
- Added extension methods for PlayableCard and CardInfo: ProvidesBlueGem, ProvidesGreenGem, ProvidesOrangeGem
68

79
# 2.23.1

InscryptionCommunityPatch/Card/Part1CardCostRender.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
namespace InscryptionCommunityPatch.Card;
99

10-
//[HarmonyPatch]
1110
/// <summary>
1211
/// Modifies how card costs are rendered in Act to add support for mixed card costs, custom costs, and energy and Mox costs.
1312
/// </summary>
1413
public static class Part1CardCostRender
1514
{
1615
public static event Action<CardInfo, List<Texture2D>> UpdateCardCost;
16+
public static event Action<PlayableCard, List<Texture2D>> UpdatePlayableCardCost;
1717

1818
public static List<Texture2D> CostTextures(CardInfo cardInfo, PlayableCard playableCard, int bloodCost, int bonesCost, int energyCost, List<GemType> gemsCost)
1919
{
@@ -66,6 +66,7 @@ public static List<Texture2D> CostTextures(CardInfo cardInfo, PlayableCard playa
6666

6767
// Call the event and allow others to modify the list of textures
6868
UpdateCardCost?.Invoke(cardInfo, costTextures);
69+
UpdatePlayableCardCost?.Invoke(playableCard, costTextures);
6970
return costTextures;
7071
}
7172

InscryptionCommunityPatch/Card/Part2CardCostRender.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,18 @@ namespace InscryptionCommunityPatch.Card;
1515
public static class Part2CardCostRender
1616
{
1717
public static event Action<CardInfo, List<Texture2D>> UpdateCardCost;
18+
/// <summary>
19+
/// For textures that are 24 x 13 in size.
20+
/// </summary>
1821
public static event Action<CardInfo, List<Texture2D>> UpdateVanillaCardCost; // 24 x 13
1922

23+
public static event Action<PlayableCard, List<Texture2D>> UpdatePlayableCardCost;
24+
/// <summary>
25+
/// For textures that are 24 x 13 in size.
26+
/// </summary>
27+
28+
public static event Action<PlayableCard, List<Texture2D>> UpdateVanillaPlayableCardCost;
29+
2030
public static bool RightAct2Cost => PatchPlugin.rightAct2Cost.Value;
2131

2232
public static Sprite FinalVanillaCostSprite(
@@ -149,6 +159,7 @@ public static List<Texture2D> VanillaCostTextures(PixelCardDisplayer display, Ca
149159

150160
// Call the event and allow others to modify the list of textures
151161
UpdateCardCost?.Invoke(cardInfo, costTextures);
162+
UpdateVanillaCardCost?.Invoke(cardInfo, costTextures);
152163
return costTextures;
153164
}
154165

InscryptionCommunityPatch/Card/Part3CardCostRender.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ public class CustomCostRenderInfo
4545

4646
internal void UpdateDisplayedTextures()
4747
{
48-
if (CostContainer != null)
49-
CostContainer.DisplayCostOnContainer(MainCostTexture, EmissionTexture);
48+
CostContainer?.DisplayCostOnContainer(MainCostTexture, EmissionTexture);
5049
}
5150

5251
/// <summary>

0 commit comments

Comments
 (0)