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:
Erik 2026-07-11 11:16:21 +02:00
parent df460f94c3
commit fa1da02783
21 changed files with 402 additions and 38 deletions

View file

@ -728,6 +728,7 @@ public sealed class GameWindow : IDisposable
// SetTurbineChatChannels (0x0295) shortly after EnterWorld.
public readonly AcDream.Core.Chat.TurbineChatState TurbineChat = new();
public readonly AcDream.Core.Combat.CombatState Combat = new();
public readonly AcDream.Core.Items.ItemManaState ItemMana = new();
// Issue #11 — load static spell metadata from data/spells.csv at startup.
// Provides Family for buff stacking (issue #6) + names + icons + tooltips
// for the future Spellbook panel. The CSV is copied to bin/<config>/net10.0/data/
@ -2117,6 +2118,7 @@ public sealed class GameWindow : IDisposable
(type, icon, under, over, effects) => iconComposer.GetIcon(type, icon, under, over, effects),
UseItemByGuid,
Combat,
ItemMana,
ToggleLiveCombatMode,
_itemInteractionController,
entry => _liveSession?.SendAddShortcut(entry),
@ -2130,6 +2132,7 @@ public sealed class GameWindow : IDisposable
Combat.HasHealth,
guid => (uint)(Objects.Get(guid)?.StackSize ?? 0),
guid => _liveSession?.SendQueryHealth(guid),
guid => _liveSession?.SendQueryItemMana(guid),
() => _playerServerGuid,
(item, container, placement) =>
_liveSession?.SendPutItemInContainer(item, container, placement)),
@ -2590,7 +2593,8 @@ public sealed class GameWindow : IDisposable
},
onShortcuts: list => Shortcuts = list,
playerGuid: () => _playerServerGuid,
onUseDone: error => _itemInteractionController?.CompleteUse(error));
onUseDone: error => _itemInteractionController?.CompleteUse(error),
itemMana: ItemMana);
// Phase I.7: subscribe to CombatState events and emit
// retail-faithful "You hit X for Y damage" chat lines into