fix(studio): polish character skill rows

This commit is contained in:
Erik 2026-06-26 17:25:09 +02:00
parent 5f92493742
commit ffaf593c76
3 changed files with 47 additions and 19 deletions

View file

@ -1,6 +1,7 @@
using AcDream.App.Studio;
using AcDream.App.UI;
using AcDream.App.UI.Layout;
using System.Numerics;
namespace AcDream.App.Tests.UI.Layout;
@ -634,20 +635,32 @@ public class CharacterStatControllerTests
ClickTab(layout, left: 92f);
var headers = list.Children
var headerPanels = list.Children
.Where(c => c is UiPanel and not UiClickablePanel)
.Cast<UiPanel>()
.ToList();
var headers = headerPanels
.Select(c => c.Children.OfType<UiText>().First().LinesProvider()[0].Text)
.ToList();
Assert.Equal(new[]
{
"Specialized Skills",
"Trained Skills",
"Useable Untrained Skills",
"Unuseable Untrained Skills",
"Untrained Skills",
"Unusable Skills",
}, headers);
Assert.Equal(new[] { 0x06000F90u, 0x06000F86u, 0x06000F98u, 0x06000F89u },
headerPanels.Select(h => h.BackgroundSprite).ToArray());
Assert.All(headerPanels, h =>
Assert.Equal(Vector4.One, h.Children.OfType<UiText>().First().LinesProvider()[0].Color));
var rows = list.Children.OfType<UiClickablePanel>().ToList();
Assert.Equal(12, rows.Count);
Assert.All(rows, row =>
{
Assert.Equal(new Vector4(0f, 0f, 0f, 1f), row.BackgroundColor);
Assert.Equal(0u, row.BackgroundSprite);
});
var rowNames = rows
.Select(r => r.Children.OfType<UiText>().ToList()[1].LinesProvider()[0].Text)
.ToList();
@ -658,6 +671,14 @@ public class CharacterStatControllerTests
"Healing", "Jump", "Loyalty", "Run",
"Alchemy", "Cooking", "Fletching",
}, rowNames);
var meleeTexts = rows[0].Children.OfType<UiText>().ToList();
Assert.Equal(Vector4.One, meleeTexts[1].LinesProvider()[0].Color);
Assert.Equal(new Vector4(0.55f, 1f, 0.55f, 1f), meleeTexts[2].LinesProvider()[0].Color);
var healingTexts = rows[5].Children.OfType<UiText>().ToList();
Assert.Equal(Vector4.One, healingTexts[1].LinesProvider()[0].Color);
Assert.Equal(Vector4.One, healingTexts[2].LinesProvider()[0].Color);
}
[Fact]