fix(ui): restore retail vitals and window interactions
All checks were successful
CI / linux-portable (push) Successful in 3m16s
CI / windows-gate (push) Successful in 5m41s
CI / release (push) Successful in 2m5s

This commit is contained in:
Erik 2026-08-20 13:26:35 +02:00
parent 4d84456c21
commit 1bd2b30291
36 changed files with 1462 additions and 86 deletions

View file

@ -1,4 +1,6 @@
using AcDream.App.UI;
using AcDream.App.UI.Layout;
using AcDream.App.Tests.UI.Layout;
using AcDream.Core.Combat;
using AcDream.Core.Items;
@ -354,7 +356,7 @@ public sealed class CursorFeedbackControllerTests
}
[Fact]
public void UpdateFromRoot_worldProviderDrivesTargetCursor_whenUiNotHovered()
public void UpdateFromRoot_worldProviderContinuesBehindNonItemUi()
{
var objects = SeedTargetObjects();
var interaction = new ItemInteractionController(
@ -376,11 +378,38 @@ public sealed class CursorFeedbackControllerTests
// World hover (retail SmartBox found object) drives valid/invalid…
Assert.Equal(CursorFeedbackKind.TargetValid, c.Update(root).Kind);
// …but UI occludes the world: hovering a plain panel → PENDING even
// though the world provider would return a valid target.
// UIElement_SmartBoxWrapper::FindObject @0x004E5430 only returns
// early for UIElement_UIItem. Ordinary UI chrome falls through to
// SmartBox::find_object, so it does not occlude the world pick.
var panel = new UiPanel { Left = 390, Top = 290, Width = 40, Height = 40 };
root.AddChild(panel);
Assert.Equal(CursorFeedbackKind.TargetPending, c.Update(root).Kind);
Assert.Equal(CursorFeedbackKind.TargetValid, c.Update(root).Kind);
}
[Fact]
public void UpdateFromRoot_toolbarBackpackRepresentsSelfAndShowsFoundCursorWithoutWorldHit()
{
ImportedLayout toolbar = FixtureLoader.LoadToolbar();
using ToolbarController controller = ToolbarController.Bind(
toolbar,
new ClientObjectTable(),
new ShortcutStore(),
iconIds: static (_, _, _, _, _) => 0u,
useItem: static _ => { },
playerGuid: () => Player);
var root = new UiRoot { Width = 800, Height = 600 };
root.AddChild(toolbar.Root);
var backpack = Assert.IsType<UiButton>(toolbar.FindElement(0x100001B1u));
System.Numerics.Vector2 position = backpack.ScreenPosition;
root.OnMouseMove(
(int)(position.X + backpack.Width * 0.5f),
(int)(position.Y + backpack.Height * 0.5f));
var c = new CursorFeedbackController(worldTargetProvider: () => 0u);
CursorFeedback feedback = c.Update(root);
Assert.Equal(CursorFeedbackKind.Default, feedback.Kind);
Assert.Equal(RetailGlobalCursorKind.DefaultFound, feedback.GlobalKind);
}
[Fact]