fix(ui): port exact paperdoll body selection
Resolve and sample retail's authored nine-color paperdoll click map, preserve local click coordinates, and select the stable highest-priority worn item with the player fallback. Keep targeted-use body clicks routed to self and pin both synthetic and live-DAT conformance. Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
parent
2644d1d527
commit
0b74d19475
16 changed files with 490 additions and 32 deletions
|
|
@ -9,20 +9,24 @@ public sealed class UiViewport : UiElement
|
|||
{
|
||||
public override bool ConsumesDatChildren => true;
|
||||
|
||||
/// <summary>Optional click action (e.g. the paperdoll doll = "target self"
|
||||
/// during item target-use). Non-null makes the viewport handle the press
|
||||
/// <summary>Optional click action. Non-null makes the viewport handle the press
|
||||
/// itself instead of it being captured as a window move.</summary>
|
||||
public System.Action? Clicked { get; set; }
|
||||
/// <summary>Position-aware variant with viewport-local pixel coordinates.</summary>
|
||||
public System.Action<int, int>? ClickedAt { get; set; }
|
||||
|
||||
public override bool HandlesClick => Clicked is not null;
|
||||
public override bool HandlesClick => Clicked is not null || ClickedAt is not null;
|
||||
|
||||
public override bool OnEvent(in UiEvent e)
|
||||
{
|
||||
if (Clicked is null) return base.OnEvent(e);
|
||||
if (Clicked is null && ClickedAt is null) return base.OnEvent(e);
|
||||
switch (e.Type)
|
||||
{
|
||||
case UiEventType.MouseDown: return true; // consume the press; act on Click
|
||||
case UiEventType.Click: Clicked.Invoke(); return true;
|
||||
case UiEventType.Click:
|
||||
Clicked?.Invoke();
|
||||
ClickedAt?.Invoke(e.Data1, e.Data2);
|
||||
return true;
|
||||
}
|
||||
return base.OnEvent(e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue