fix(ui): match retail spell bar controls
Place favorite-bar arrows by their authored sides, import rollover and pressed media through the shared scrollbar, and preserve manual offsets across passive refreshes. Carry the mixed-parent DAT anchor chain to a fixed 18-cell favorite viewport so overflow controls and the Cast button remain inside the retail-sized combat frame. Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
parent
02c29e67c8
commit
0134122c28
17 changed files with 424 additions and 59 deletions
|
|
@ -157,6 +157,47 @@ public class UiScrollbarTests
|
|||
Assert.Equal(64, model.ScrollY);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void HorizontalModel_UsesIndependentRolloverAndPressedArrowMedia()
|
||||
{
|
||||
var root = new UiRoot { Width = 300f, Height = 100f };
|
||||
var model = new UiScrollable
|
||||
{
|
||||
ContentHeight = 640,
|
||||
ViewHeight = 320,
|
||||
LineHeight = 32,
|
||||
};
|
||||
var bar = new UiScrollbar
|
||||
{
|
||||
Width = 160f,
|
||||
Height = 36f,
|
||||
Horizontal = true,
|
||||
Model = model,
|
||||
UpSprite = 1u,
|
||||
UpRolloverSprite = 2u,
|
||||
UpPressedSprite = 3u,
|
||||
DownSprite = 4u,
|
||||
DownRolloverSprite = 5u,
|
||||
DownPressedSprite = 6u,
|
||||
};
|
||||
root.AddChild(bar);
|
||||
|
||||
root.OnMouseMove(5, 10);
|
||||
Assert.Equal(2u, bar.ActiveStartSpriteForTest);
|
||||
Assert.Equal(4u, bar.ActiveEndSpriteForTest);
|
||||
|
||||
// Moving between two regions of the same procedural scrollbar must
|
||||
// refresh its sub-control hover, not wait for a whole-widget leave.
|
||||
root.OnMouseMove(155, 10);
|
||||
Assert.Equal(1u, bar.ActiveStartSpriteForTest);
|
||||
Assert.Equal(5u, bar.ActiveEndSpriteForTest);
|
||||
|
||||
root.OnMouseDown(UiMouseButton.Left, 155, 10);
|
||||
Assert.Equal(6u, bar.ActiveEndSpriteForTest);
|
||||
root.OnMouseUp(UiMouseButton.Left, 155, 10);
|
||||
Assert.Equal(5u, bar.ActiveEndSpriteForTest);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ModelWithoutOverflow_IsDisabledAndHideDisabledSuppressesPresentation()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue