Compact quick parse legend badges
This commit is contained in:
@@ -88,7 +88,8 @@
|
||||
{
|
||||
<div class="critical-editor-quick-legend-item">
|
||||
<code>@entry.Token</code>
|
||||
<span class="muted">@entry.Meaning</span>
|
||||
<span class="critical-editor-quick-legend-equals">=</span>
|
||||
<AffixBadgeList Effects="@entry.Effects" />
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -385,17 +386,17 @@
|
||||
{
|
||||
WriteIndented = true
|
||||
};
|
||||
private static readonly IReadOnlyList<(string Token, string Meaning)> QuickParseLegendEntries =
|
||||
private static readonly IReadOnlyList<(string Token, IReadOnlyList<CriticalEffectLookupResponse> Effects)> QuickParseLegendEntries =
|
||||
[
|
||||
("+15", "Direct hits"),
|
||||
("3s", "Stunned 3 rounds"),
|
||||
("1mp", "Must parry 1 round"),
|
||||
("3np", "No parry 3 rounds"),
|
||||
("1hpr", "Bleed 1 hit per round"),
|
||||
("-20", "Foe penalty"),
|
||||
("+20b", "Attacker bonus next round"),
|
||||
("+2d10-3pp", "Power-point modifier"),
|
||||
("w/o shield: +15, 3s", "Conditional line")
|
||||
("+15", [CreateQuickLegendEffect(CriticalEffectCodes.DirectHits, valueInteger: 15)]),
|
||||
("3s", [CreateQuickLegendEffect(CriticalEffectCodes.StunnedRounds, durationRounds: 3)]),
|
||||
("1mp", [CreateQuickLegendEffect(CriticalEffectCodes.MustParryRounds, durationRounds: 1)]),
|
||||
("3np", [CreateQuickLegendEffect(CriticalEffectCodes.NoParryRounds, durationRounds: 3)]),
|
||||
("1hpr", [CreateQuickLegendEffect(CriticalEffectCodes.BleedPerRound, perRound: 1)]),
|
||||
("-20", [CreateQuickLegendEffect(CriticalEffectCodes.FoePenalty, modifier: -20)]),
|
||||
("+20b", [CreateQuickLegendEffect(CriticalEffectCodes.AttackerBonusNextRound, modifier: 20)]),
|
||||
("+2d10-3pp", [CreateQuickLegendEffect(CriticalEffectCodes.PowerPointModifier, valueExpression: "2d10-3")]),
|
||||
("w/o shield: +15, 3s", [CreateQuickLegendEffect(CriticalEffectCodes.DirectHits, valueInteger: 15), CreateQuickLegendEffect(CriticalEffectCodes.StunnedRounds, durationRounds: 3)])
|
||||
];
|
||||
private IJSObjectReference? jsModule;
|
||||
private bool isBackdropPointerDown;
|
||||
@@ -639,6 +640,26 @@
|
||||
? "1 parser note is available under Advanced Review & Diagnostics."
|
||||
: $"{noteCount} parser notes are available under Advanced Review & Diagnostics.";
|
||||
|
||||
private static CriticalEffectLookupResponse CreateQuickLegendEffect(
|
||||
string effectCode,
|
||||
int? valueInteger = null,
|
||||
string? valueExpression = null,
|
||||
int? durationRounds = null,
|
||||
int? perRound = null,
|
||||
int? modifier = null) =>
|
||||
new(
|
||||
effectCode,
|
||||
"foe",
|
||||
valueInteger,
|
||||
valueExpression,
|
||||
durationRounds,
|
||||
perRound,
|
||||
modifier,
|
||||
null,
|
||||
false,
|
||||
"legend",
|
||||
null);
|
||||
|
||||
private static string FormatJson(string json)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(json))
|
||||
|
||||
@@ -844,18 +844,20 @@ textarea {
|
||||
}
|
||||
|
||||
.critical-editor-quick-legend {
|
||||
display: grid;
|
||||
gap: 0.55rem;
|
||||
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.45rem 0.7rem;
|
||||
}
|
||||
|
||||
.critical-editor-quick-legend-item {
|
||||
display: grid;
|
||||
gap: 0.2rem;
|
||||
padding: 0.65rem 0.75rem;
|
||||
border-radius: 12px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.45rem;
|
||||
padding: 0.4rem 0.6rem;
|
||||
border-radius: 999px;
|
||||
background: rgba(255, 255, 255, 0.72);
|
||||
border: 1px solid rgba(127, 96, 55, 0.1);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.critical-editor-quick-legend-item code {
|
||||
@@ -863,6 +865,11 @@ textarea {
|
||||
color: #5b4327;
|
||||
}
|
||||
|
||||
.critical-editor-quick-legend-equals {
|
||||
color: #8d5e1a;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.critical-editor-compare-grid {
|
||||
display: grid;
|
||||
gap: 0.85rem;
|
||||
|
||||
Reference in New Issue
Block a user