fix(studio): match skill row selection layout

This commit is contained in:
Erik 2026-06-26 17:31:30 +02:00
parent ffaf593c76
commit e3fc7ac5ba
3 changed files with 15 additions and 14 deletions

View file

@ -138,7 +138,6 @@ public static class CharacterStatController
/// <summary>Row highlight color — semi-translucent gold, matches retail
/// UIStateId.Highlight (0x06) sprite 0x06001397 visual intent.</summary>
private static readonly Vector4 HighlightBg = new(1f, 0.75f, 0.2f, 0.25f);
private static readonly Vector4 SkillRowBackground = new(0f, 0f, 0f, 1f);
private static readonly Vector4 BuffedSkillGreen = new(0.55f, 1f, 0.55f, 1f);
// ── Row layout constants ─────────────────────────────────────────────────
@ -608,9 +607,7 @@ public static class CharacterStatController
nameText: skill.Name,
valueProvider: () => skill.CurrentLevel.ToString(),
valueColorProvider: () => SkillValueColor(skill),
nameColor: Vector4.One,
backgroundColor: SkillRowBackground,
useSelectionBars: false);
nameColor: Vector4.One);
row.OnClick = () => HandleSkillRowClick(rowIndex, sel, bindings, spriteResolve, data, allRaise1, allRaise10);
bindings.Add(new SkillRowBinding(row, skill));
entries.Add(row);
@ -784,7 +781,7 @@ public static class CharacterStatController
{
if (spriteResolve is not null)
{
row.BackgroundColor = SkillRowBackground;
row.BackgroundColor = Vector4.Zero;
row.BackgroundSprite = RowHighlightSprite;
row.SpriteResolve = id => { var (h, w, ht) = spriteResolve(id); return (h, w, ht); };
row.UseSelectionBars = true;
@ -799,10 +796,10 @@ public static class CharacterStatController
}
else
{
row.BackgroundColor = SkillRowBackground;
row.BackgroundColor = Vector4.Zero;
row.BackgroundSprite = 0u;
row.SpriteResolve = null;
row.UseSelectionBars = false;
row.UseSelectionBars = true;
}
}
@ -933,7 +930,6 @@ public static class CharacterStatController
Func<string> valueProvider,
Func<Vector4>? valueColorProvider = null,
Vector4? nameColor = null,
Vector4? backgroundColor = null,
uint backgroundSprite = 0u,
bool useSelectionBars = true)
{
@ -943,7 +939,7 @@ public static class CharacterStatController
Top = top,
Width = width,
Height = height,
BackgroundColor = backgroundColor ?? Vector4.Zero,
BackgroundColor = Vector4.Zero, // transparent until selected
BackgroundSprite = spriteResolve is not null ? backgroundSprite : 0u,
SpriteResolve = spriteResolve is not null && backgroundSprite != 0u
? id => { var (h, w, ht) = spriteResolve(id); return (h, w, ht); }

View file

@ -175,9 +175,6 @@ public class UiClickablePanel : UiPanel
{
if (UseSelectionBars && BackgroundSprite != 0 && SpriteResolve is { } sr)
{
if (BackgroundColor.W > 0f)
ctx.DrawRect(0, 0, Width, Height, BackgroundColor);
// Draw the selection highlight as a thin bar at the TOP and BOTTOM of the row.
// The sprite (0x06001397) is 300×32 px — we draw it as horizontal strips at
// native height (SelectionBarHeight), stretched to full panel width (UV tile