fix(ui): complete live targeted healing flow

Route ACE server commands through the existing chat path, bind the retail paperdoll hit mask instead of its obscured viewport, and prefer authoritative private health vitals. Record the user-confirmed live gate and pin the production DAT widget type in tests.
This commit is contained in:
Erik 2026-07-11 07:58:59 +02:00
parent eb6229394a
commit 05f6222865
11 changed files with 181 additions and 24 deletions

View file

@ -15,6 +15,9 @@ namespace AcDream.App.UI.Layout;
/// </summary>
public sealed class PaperdollController : IItemListDragHandler, IRetainedPanelController
{
public const uint DollViewportId = 0x100001D5u;
public const uint DollDragMaskId = 0x100001D6u;
// ── Slots-toggle public surface ───────────────────────────────────────────────────────────────
/// <summary>
/// The 9 armor-slot element-ids whose Visible state the Slots button (0x100005BE) toggles.
@ -84,6 +87,7 @@ public sealed class PaperdollController : IItemListDragHandler, IRetainedPanelCo
private readonly PaperdollViewState _viewState = new();
private readonly List<UiItemList> _armorSlots = new();
private UiElement? _dollViewport; // UiViewport wired in Slice 3; UiElement? keeps this task independent
private UiElement? _dollDragMask;
private bool _disposed;
private PaperdollController(
@ -137,13 +141,30 @@ public sealed class PaperdollController : IItemListDragHandler, IRetainedPanelCo
foreach (var id in ArmorSlotElementIds)
if (layout.FindElement(id) is UiItemList armor) _armorSlots.Add(armor);
_dollViewport = layout.FindElement(0x100001D5u); // doll viewport (may be null until Slice 3)
_dollViewport = layout.FindElement(DollViewportId); // doll viewport (may be null until Slice 3)
// The doll IS the player: clicking it during target-use self-targets
// like the equip cells do. (The CURSOR over it stays the pending
// four-arrows — retail resolves target cursors off the SmartBox world
// object only; UI hover is always pending. 2026-07-03 visual gate.)
Action offerSelf = () => { _itemInteraction?.OfferSelfPrimaryClick(); };
if (_dollViewport is UiViewport doll)
doll.Clicked = () => { _itemInteraction?.OfferSelfPrimaryClick(); };
doll.Clicked = offerSelf;
// Retail's authored click/drag mask sits above the viewport and owns
// doll hit-testing (gmPaperDollUI::ListenToElementMessage). Binding only
// the viewport cannot win a live hit against this full-height overlay.
switch (layout.FindElement(DollDragMaskId))
{
case UiButton dragMaskButton:
_dollDragMask = dragMaskButton;
dragMaskButton.OnClick = offerSelf;
break;
case UiDatElement dragMaskElement:
_dollDragMask = dragMaskElement;
dragMaskElement.ClickThrough = false;
dragMaskElement.OnClick = offerSelf;
break;
}
var slotsBtnEl = layout.FindElement(0x100005BEu);
if (slotsBtnEl is UiButton slotsBtn)
@ -266,6 +287,7 @@ public sealed class PaperdollController : IItemListDragHandler, IRetainedPanelCo
private void ApplyView()
{
if (_dollViewport is not null) _dollViewport.Visible = _viewState.DollVisible;
if (_dollDragMask is not null) _dollDragMask.Visible = _viewState.DollVisible;
foreach (var a in _armorSlots) a.Visible = _viewState.ArmorSlotsVisible;
}
@ -279,5 +301,16 @@ public sealed class PaperdollController : IItemListDragHandler, IRetainedPanelCo
_objects.ObjectRemoved -= OnObjectChanged;
_objects.ObjectUpdated -= OnObjectChanged;
_selection.Changed -= OnSelectionChanged;
if (_dollViewport is UiViewport doll)
doll.Clicked = null;
switch (_dollDragMask)
{
case UiButton button:
button.OnClick = null;
break;
case UiDatElement element:
element.OnClick = null;
break;
}
}
}