fix(vt): plugin <list> draws no selection band by default in either mode
Slice-7 resemblance re-check found UiMarkupList's column-less items= mode and its <column> mode disagreed on whether a selected row gets a persistent SelectedColor fill, so a plugin's Buffs lists highlighted a row while the Monsters/Meta grids looked different for the same widget. Real VVS lists (VTank's HudList) draw no such fill at all. UiMarkupList.SelectionBandEnabled (default false) now gates the fill in both OnDraw's legacy branch and DrawColumns; MarkupDocument parses <list selectionband="true"> (same literal-bool convention as openupward/clearonsubmit) to opt a single list back in. selected/onchange semantics and scroll-into-view of the selected row are unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
69638584e8
commit
3cec9df4ab
4 changed files with 158 additions and 3 deletions
|
|
@ -594,6 +594,12 @@ public static class MarkupDocument
|
|||
binding,
|
||||
"list selected"),
|
||||
SelectionChanged = listChanged,
|
||||
// Campaign VT slice 7 resemblance re-check: VVS lists draw
|
||||
// no persistent row-selection fill by default (matches
|
||||
// both single-column and <column> mode now — see
|
||||
// UiMarkupList.SelectionBandEnabled). A plugin that wants
|
||||
// one back opts in with <list selectionband="true">.
|
||||
SelectionBandEnabled = B(el, "selectionband", false),
|
||||
};
|
||||
|
||||
if (listUsesColumns)
|
||||
|
|
|
|||
|
|
@ -73,6 +73,25 @@ public sealed class UiMarkupList : UiElement
|
|||
public Vector4 TextColor { get; set; } = new(0.91f, 0.87f, 0.76f, 1f);
|
||||
public Vector4 SelectedColor { get; set; } = new(0.28f, 0.23f, 0.08f, 0.95f);
|
||||
|
||||
/// <summary>
|
||||
/// Campaign VT slice 7 resemblance re-check (2026-09-07): real VVS lists
|
||||
/// (VTank's own <c>HudList</c>) draw no persistent row-selection fill at
|
||||
/// all — before this fix the column-less <c>items=</c> mode drew
|
||||
/// <see cref="SelectedColor"/> under the selected row while the
|
||||
/// <c><column></c> mode did the same, so a plugin's Buffs lists
|
||||
/// highlighted a row while the Monsters/Meta grids happened not to (or
|
||||
/// vice versa, depending on which mode a given list used) — same-looking
|
||||
/// widgets, inconsistent behavior. Default false now suppresses the fill
|
||||
/// in BOTH <see cref="OnDraw"/>'s legacy branch and
|
||||
/// <see cref="DrawColumns"/>, matching VVS. <c><list
|
||||
/// selectionband="true"></c> (parsed in <see cref="MarkupDocument"/>'s
|
||||
/// <c>case "list"</c>) opts a single list back into a visible band for
|
||||
/// plugins that want one. This gates ONLY the fill — <see cref="SelectedIndexSource"/>,
|
||||
/// <see cref="SelectionChanged"/>, and the selected-row scroll-into-view
|
||||
/// logic in <see cref="OnDraw"/>/<see cref="DrawColumns"/> are unchanged.
|
||||
/// </summary>
|
||||
public bool SelectionBandEnabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Owner live-client report 2026-09-07 ("For scrollable dropdown or the
|
||||
/// meta window we use the same assets as we do in for example chat or
|
||||
|
|
@ -163,7 +182,7 @@ public sealed class UiMarkupList : UiElement
|
|||
for (int index = _topRow; index < end; index++)
|
||||
{
|
||||
float y = (index - _topRow) * RowHeight;
|
||||
if (index == selected)
|
||||
if (index == selected && SelectionBandEnabled)
|
||||
context.DrawFill(1f, y + 1f, contentWidth - 2f, RowHeight - 1f, SelectedColor);
|
||||
|
||||
if (iconIds is not null && index < iconIds.Count && IconResolve is { } resolve)
|
||||
|
|
@ -380,7 +399,7 @@ public sealed class UiMarkupList : UiElement
|
|||
for (int index = _topRow; index < end; index++)
|
||||
{
|
||||
float y = (index - _topRow) * RowHeight;
|
||||
if (index == selected)
|
||||
if (index == selected && SelectionBandEnabled)
|
||||
context.DrawFill(1f, y + 1f, contentWidth - 2f, RowHeight - 1f, SelectedColor);
|
||||
|
||||
for (int c = 0; c < columns.Count; c++)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue