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:
parent
eb6229394a
commit
05f6222865
11 changed files with 181 additions and 24 deletions
|
|
@ -4,17 +4,18 @@ using AcDream.Core.Player;
|
|||
namespace AcDream.UI.Abstractions.Panels.Vitals;
|
||||
|
||||
/// <summary>
|
||||
/// ViewModel for the vitals HUD panel. Reads live health percentage for the
|
||||
/// local player from <see cref="CombatState"/> (which is fed by the server's
|
||||
/// <c>UpdateHealth (0x01C0)</c> GameEvent).
|
||||
/// ViewModel for the vitals HUD panel. Reads the local player's authoritative
|
||||
/// private vital snapshot, falling back to world-combat health before that
|
||||
/// snapshot is available.
|
||||
///
|
||||
/// <para>
|
||||
/// <b>Sources:</b>
|
||||
/// </para>
|
||||
///
|
||||
/// <list type="bullet">
|
||||
/// <item>HP — <see cref="CombatState.GetHealthPercent"/> (percent-only,
|
||||
/// updated by <c>UpdateHealth (0x01C0)</c>).</item>
|
||||
/// <item>HP — <see cref="LocalPlayerState.HealthPercent"/> from
|
||||
/// <c>PrivateUpdateVital(Current)</c>, with
|
||||
/// <see cref="CombatState.GetHealthPercent"/> as fallback.</item>
|
||||
/// <item>Stamina / Mana — <see cref="LocalPlayerState"/>'s
|
||||
/// <c>StaminaPercent</c> / <c>ManaPercent</c>, populated from the
|
||||
/// <c>CreatureProfile</c> embedded in <c>PlayerDescription
|
||||
|
|
@ -60,11 +61,12 @@ public sealed class VitalsVM
|
|||
public void SetLocalPlayerGuid(uint guid) => _localPlayerGuid = guid;
|
||||
|
||||
/// <summary>
|
||||
/// Current health percent (0..1) for the local player. Returns 1.0
|
||||
/// before login or if the server has never sent an UpdateHealth for
|
||||
/// this GUID.
|
||||
/// Current health percent (0..1) for the local player. The private vital
|
||||
/// is authoritative for self; world-combat percentage is the pre-login
|
||||
/// and legacy fallback.
|
||||
/// </summary>
|
||||
public float HealthPercent => _combat.GetHealthPercent(_localPlayerGuid);
|
||||
public float HealthPercent
|
||||
=> _local?.HealthPercent ?? _combat.GetHealthPercent(_localPlayerGuid);
|
||||
|
||||
/// <summary>
|
||||
/// Stamina percent (0..1), or <c>null</c> when no
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue