fix(combat): charge power bar from speed

Read the authored meter direction instead of inferring it from the combat element id, so the bright charge texture grows left-to-right from Speed. Keep the user-approved dark-red middle baseline visible independently and record its exact retail Recklessness visibility edge.

Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-12 21:25:24 +02:00
parent 256c1930bd
commit 707add8539
13 changed files with 50 additions and 49 deletions

View file

@ -104,26 +104,26 @@ public class UiScrollbarTests
}
[Theory]
[InlineData(0f, 100f, 0f)]
[InlineData(0.5f, 50f, 50f)]
[InlineData(1f, 0f, 100f)]
public void ScalarFillRect_CombatPower_GrowsRightToLeft(
[InlineData(0f, 0f, 0f)]
[InlineData(0.5f, 0f, 50f)]
[InlineData(1f, 0f, 100f)]
public void ScalarFillRect_CombatPower_GrowsLeftToRight(
float fill, float expectedX, float expectedWidth)
{
var (x, width) = UiScrollbar.ScalarFillRect(100f, fill, fromRight: true);
var (x, width) = UiScrollbar.ScalarFillRect(100f, fill, fromRight: false);
Assert.Equal(expectedX, x, 3);
Assert.Equal(expectedWidth, width, 3);
}
[Theory]
[InlineData(0f, 403f, 0f)]
[InlineData(0.5f, 253.5f, 149.5f)]
[InlineData(0f, 104f, 0f)]
[InlineData(0.5f, 104f, 149.5f)]
[InlineData(1f, 104f, 299f)]
public void ScalarFillRect_CombatPower_StaysBetweenAuthoredLabels(
float fill, float expectedX, float expectedWidth)
{
var (x, width) = UiScrollbar.ScalarFillRect(
rangeLeft: 104f, rangeWidth: 299f, fill, fromRight: true);
rangeLeft: 104f, rangeWidth: 299f, fill, fromRight: false);
Assert.Equal(expectedX, x, 3);
Assert.Equal(expectedWidth, width, 3);
}