feat(ui): port retail selected-item mana
Parse and route the complete 0x0264 guid/fraction/valid response, send exact 0x0263 item-mana queries, and reproduce retail meter visibility plus guid-zero cancellation for mana and health selection changes. Keep the behavior in Core state and the retained selected-object controller with wire/state/UI conformance coverage. Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
parent
df460f94c3
commit
fa1da02783
21 changed files with 402 additions and 38 deletions
|
|
@ -177,6 +177,24 @@ public sealed class GameEventDispatcherTests
|
|||
Assert.Equal(0.42f, parsed.Value.HealthPercent, 4);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParseQueryItemManaResponse_RoundTripIncludingValidity()
|
||||
{
|
||||
// CM_Item::DispatchUI_QueryItemManaResponse @ 0x006A84D0 reads all three fields.
|
||||
byte[] payload = new byte[12];
|
||||
BinaryPrimitives.WriteUInt32LittleEndian(payload, 0x50000A01u);
|
||||
BinaryPrimitives.WriteSingleLittleEndian(payload.AsSpan(4), 0.625f);
|
||||
BinaryPrimitives.WriteUInt32LittleEndian(payload.AsSpan(8), 1u);
|
||||
|
||||
var parsed = GameEvents.ParseQueryItemManaResponse(payload);
|
||||
|
||||
Assert.NotNull(parsed);
|
||||
Assert.Equal(0x50000A01u, parsed!.Value.ItemGuid);
|
||||
Assert.Equal(0.625f, parsed.Value.ManaPercent);
|
||||
Assert.True(parsed.Value.Valid);
|
||||
Assert.Null(GameEvents.ParseQueryItemManaResponse(payload.AsSpan(0, 8)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParseWieldObject_acceptsAceEightBytePayload()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue