fix(combat): preserve authored meter child geometry

Carry the consumed dark-range child's own retail edge policy into the procedural scrollbar, widening it to the authored post-reflow interval without covering the rendered labels. Restore the bright layer to live attack-charge feedback across the full bar from the left.

Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-12 21:57:53 +02:00
parent f8c174d707
commit e671b8a5c4
10 changed files with 66 additions and 105 deletions

View file

@ -29,6 +29,7 @@ public sealed class CombatLayoutConformanceTests
Assert.Equal(0x06001923u, power.ThumbSprite);
Assert.Equal(0x06001200u, power.ScalarFillSprite);
Assert.Equal(0x0600715Eu, power.ScalarRangeSprite);
Assert.NotNull(power.ScalarRangeLayoutPolicy);
Assert.False(power.ScalarFillFromRight);
var speed = Assert.IsType<UiText>(
@ -39,6 +40,7 @@ public sealed class CombatLayoutConformanceTests
(8f, 507f, 12f, 100f, 411f, 100f),
(power.Left, power.Width, speed.Left, speed.Width,
powerLabel.Left, powerLabel.Width));
Assert.Equal((50f, 407f), power.ScalarRangeRect());
var repeat = Assert.IsType<UiButton>(
layout.FindElement(CombatUiController.RepeatAttacksId));

View file

@ -50,9 +50,7 @@ public sealed class CombatUiControllerTests
high.OnEvent(new UiEvent(0, high, UiEventType.MouseDown, Data1: 2, Data2: 2));
now = 4.5d;
Assert.True(power.ScalarFillFollowsThumb);
var range = Assert.IsType<Func<(float Left, float Width)>>(power.ScalarRangeProvider);
Assert.Equal((104f, 299f), range());
Assert.Equal(0.5f, power.ScalarFill()!.Value, 3);
high.OnEvent(new UiEvent(0, high, UiEventType.MouseUp, Data1: 2, Data2: 2));
var attack = Assert.Single(sent);
@ -98,10 +96,6 @@ public sealed class CombatUiControllerTests
Assert.False(speed.RightAligned);
Assert.False(powerLabel.Centered);
Assert.True(powerLabel.RightAligned);
var range = Assert.IsType<Func<(float Left, float Width)>>(power.ScalarRangeProvider);
var (left, width) = range();
Assert.Equal(speed.Left + speed.Width - power.Left, left, 3);
Assert.Equal(powerLabel.Left - power.Left - left, width, 3);
}
[Fact]
@ -120,8 +114,7 @@ public sealed class CombatUiControllerTests
var power = Assert.IsType<UiScrollbar>(
layout.FindElement(CombatUiController.PowerControlId));
var range = Assert.IsType<Func<(float Left, float Width)>>(power.ScalarRangeProvider);
Assert.Equal((104f, 299f), range());
Assert.Equal((50f, 407f), power.ScalarRangeRect());
}
private static readonly CombatUiLabels Labels = new(

View file

@ -473,6 +473,9 @@ public class DatWidgetFactoryTests
X = 63,
Width = 407,
Height = 14,
OriginalParentWidth = 507,
OriginalParentHeight = 14,
HasOriginalParentSize = true,
};
range.StateMedia[""] = (0x0600715Eu, 1);
range.States[UiStateInfo.DirectStateId] = new UiStateInfo
@ -506,6 +509,7 @@ public class DatWidgetFactoryTests
Assert.Equal(0x06001923u, bar.ThumbSprite);
Assert.Equal(0x06001200u, bar.ScalarFillSprite);
Assert.Equal(0x0600715Eu, bar.ScalarRangeSprite);
Assert.NotNull(bar.ScalarRangeLayoutPolicy);
Assert.False(bar.ScalarFillFromRight);
}