feat(ability-builder): add delete buttons to all visual canvas nodes
Cost node rows now have per-item × buttons. Conditions node has a clear-all × in the header. Sub-group action and sub-group effect nodes both have × buttons in their headers. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -1058,9 +1058,19 @@
|
||||
<i class="bi bi-coin me-1"></i>Cost
|
||||
<span class="badge bg-dark ms-auto">@fabi.Costs.Count</span>
|
||||
</div>
|
||||
@foreach (var ce in fabi.Costs.Take(3))
|
||||
@for (int ci = 0; ci < Math.Min(fabi.Costs.Count, 3); ci++)
|
||||
{
|
||||
<div class="ab-node-body border-top border-secondary text-truncate">@ce.TypeStr @(ce.Amount>0?ce.Amount:"")</div>
|
||||
int cidx = ci;
|
||||
var ce = fabi.Costs[cidx];
|
||||
<div class="ab-node-body border-top border-secondary d-flex align-items-center">
|
||||
<span class="text-truncate flex-grow-1">@ce.TypeStr @(ce.Amount>0?ce.Amount:"")</span>
|
||||
<button class="btn border-0 p-0 ms-1 text-danger opacity-75"
|
||||
style="font-size:0.7rem;line-height:1;background:transparent"
|
||||
@onclick='()=>{fabi.Costs.RemoveAt(cidx);Compile();}'
|
||||
@onclick:stopPropagation="true">
|
||||
<i class="bi bi-x-lg"></i>
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
@if (fabi.Costs.Count > 3){<div class="ab-node-body text-muted">+@(fabi.Costs.Count-3) more…</div>}
|
||||
</div>
|
||||
@@ -1075,6 +1085,12 @@
|
||||
<div class="ab-node-hd ab-yellow-hd">
|
||||
<i class="bi bi-funnel me-1"></i>Conditions
|
||||
<span class="badge bg-dark ms-auto">@fabi.Conditions.Count</span>
|
||||
<button class="btn border-0 p-0 ms-1 text-danger opacity-75"
|
||||
style="font-size:0.7rem;line-height:1;background:transparent"
|
||||
@onclick='()=>{fabi.Conditions.Clear();Compile();}'
|
||||
@onclick:stopPropagation="true">
|
||||
<i class="bi bi-x-lg"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -1177,6 +1193,12 @@
|
||||
@onmousedown="e=>OnNodeMouseDown(e,sgActK)" @onmousedown:stopPropagation="true">
|
||||
<div class="ab-node-hd ab-green-hd" style="opacity:0.8">
|
||||
<i class="bi bi-cursor me-1"></i>SG@(sgiIdx+1) · Act @(sgjIdx+1)
|
||||
<button class="btn border-0 p-0 ms-auto text-danger opacity-75"
|
||||
style="font-size:0.7rem;line-height:1;background:transparent"
|
||||
@onclick='()=>{sg.Actions.RemoveAt(sgjIdx);Compile();}'
|
||||
@onclick:stopPropagation="true">
|
||||
<i class="bi bi-x-lg"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="ab-node-body">
|
||||
<span class="text-muted">→ </span>@sgAct.Ownership @sgAct.TargetType
|
||||
@@ -1194,6 +1216,12 @@
|
||||
<div class="ab-node-hd ab-red-hd" style="opacity:0.8">
|
||||
<i class="bi bi-lightning-charge me-1"></i>
|
||||
<span class="text-truncate flex-grow-1">@sgEff.TypeKey</span>
|
||||
<button class="btn border-0 p-0 ms-auto text-danger opacity-75"
|
||||
style="font-size:0.7rem;line-height:1;background:transparent"
|
||||
@onclick='()=>{sgAct.Effects.RemoveAt(sgkIdx);Compile();}'
|
||||
@onclick:stopPropagation="true">
|
||||
<i class="bi bi-x-lg"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="ab-node-body text-muted">@EffectSummary(sgEff)</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user