Skip to content

Commit 9e39ba6

Browse files
committed
chore(release): merge dev into main for v0.4.14
2 parents 897ffab + c7d78c6 commit 9e39ba6

42 files changed

Lines changed: 3205 additions & 871 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"RitsuLib bilingual summary": {
3+
"scope": "csharp",
4+
"prefix": "docbi",
5+
"description": "Bilingual XML doc summary with xml:lang paras",
6+
"body": [
7+
"/// <summary>",
8+
"/// <para xml:lang=\"en\">${1:English summary.}</para>",
9+
"/// <para xml:lang=\"zh-CN\">${2:中文摘要。}</para>",
10+
"/// </summary>"
11+
]
12+
},
13+
"RitsuLib bilingual summary with cref": {
14+
"scope": "csharp",
15+
"prefix": "docbic",
16+
"description": "Bilingual XML doc summary with see cref",
17+
"body": [
18+
"/// <summary>",
19+
"/// <para xml:lang=\"en\">${1:Summary referencing} <see cref=\"${2:TypeName}\" />.</para>",
20+
"/// <para xml:lang=\"zh-CN\">${3:中文摘要,引用} <see cref=\"$2\" />。</para>",
21+
"/// </summary>"
22+
]
23+
}
24+
}

Combat/SecondaryResources/Patches/SecondaryResourceUiPatches.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using MegaCrit.Sts2.Core.Combat;
22
using MegaCrit.Sts2.Core.Context;
3+
using MegaCrit.Sts2.Core.Entities.Cards;
4+
using MegaCrit.Sts2.Core.Nodes.Cards;
35
using MegaCrit.Sts2.Core.Nodes.Combat;
46
using MegaCrit.Sts2.Core.Nodes.Multiplayer;
57
using MegaCrit.Sts2.Core.Rooms;
@@ -113,4 +115,25 @@ public static void Postfix(NMultiplayerPlayerState __instance)
113115
SecondaryResourceUiRuntime.SetMultiplayerPlayerStateCombatActive(__instance, false);
114116
}
115117
}
118+
119+
internal sealed class NCardUpdateVisualsSecondaryResourceCardUiPatch : IPatchMethod
120+
{
121+
public static string PatchId => "ritsulib_secondary_resource_card_ui_update";
122+
public static string Description => "Refresh secondary-resource card UI alongside NCard.UpdateVisuals";
123+
public static bool IsCritical => false;
124+
125+
public static ModPatchTarget[] GetTargets()
126+
{
127+
return [new(typeof(NCard), nameof(NCard.UpdateVisuals), [typeof(PileType), typeof(CardPreviewMode)])];
128+
}
129+
130+
public static void Postfix(NCard __instance)
131+
{
132+
if (!ModSecondaryResourceRegistry.HasAny ||
133+
__instance.Model == null)
134+
return;
135+
136+
SecondaryResourceUiRuntime.UpdateCardUi(__instance, __instance.Model);
137+
}
138+
}
116139
}

0 commit comments

Comments
 (0)