feat(ui): D.2b item interaction + retail cursors + live character sheet

Lands the codex-worktree D.2b stream plus the extraction the 2026-07-02
UI architecture review mandated before commit:

- ItemInteractionController: single owner of double-click use/equip/
  container-open, targeted-use mode (health kits), drag-out drop;
  toolbar shortcut drags don't drop the real item. ItemEquipRules for
  multi-slot (coat) coverage via equip masks.
- Cursor phase: CursorFeedbackController (semantic priority chain:
  drag > resize > window-move > target-mode > text) + RetailCursorCatalog
  (enums 0x27/0x28/0x29, hotspot 14,14; ClientUISystem::UpdateCursorState
  0x00564630) resolved through the portal EnumIDMap chain by
  RetailCursorResolver; RetailCursorManager applies dat cursor art to the
  OS cursor. Register row AP-72 covers the OS standard-cursor fallback.
- Character window goes live: CharacterSheetProvider owns sheet assembly,
  XP-curve/raise-cost math and the raise flow — extracted out of
  GameWindow per Code Structure Rule 1 instead of committing the ~430-line
  feature body there. Optimistic XP/credit debits go through eventful
  store APIs (new ClientObjectTable.UpdateInt64Property +
  LocalPlayerState.DebitIntProperty/DebitInt64Property) instead of raw
  property-dictionary writes; register row AP-73 covers the still-missing
  raise ledger (#163).
- RetailWindowFrame: the shared nine-slice window mount recipe; the
  character window uses it, remaining windows migrate via #164.
- Status-bar buttons toggle inventory/character windows; retail row-major
  backpack ordering; WorldSession.SendUseWithTarget + raise/train sends.

GameWindow shrinks 14,214 -> 13,877 lines despite the new features; the
sheet/raise logic is unit-tested in CharacterSheetProviderTests instead
of trapped in the god object. Build green; full suite 3,286 tests pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-07-03 09:18:43 +02:00
parent e3fc7ac5ba
commit b7dc91a053
74 changed files with 6669 additions and 238 deletions

View file

@ -82,6 +82,7 @@ public sealed class WorldSession : IDisposable
// server publishes it for non-useable display entities.
uint? Useability = null,
float? UseRadius = null,
uint? TargetType = null,
// D.5.1: icon datId from CreateObject WeenieHeader, for toolbar rendering.
uint IconId = 0,
// D.5.1 (2026-06-17): icon overlay/underlay dat ids from the extended
@ -807,6 +808,7 @@ public sealed class WorldSession : IDisposable
parsed.Value.Elasticity,
parsed.Value.Useability,
parsed.Value.UseRadius,
parsed.Value.TargetType,
parsed.Value.IconId,
parsed.Value.IconOverlayId,
parsed.Value.IconUnderlayId,
@ -1209,6 +1211,34 @@ public sealed class WorldSession : IDisposable
SendGameAction(body);
}
/// <summary>Send retail RaiseAttribute (0x0045).</summary>
public void SendRaiseAttribute(uint attrId, ulong xpSpent)
{
uint seq = NextGameActionSequence();
SendGameAction(CharacterActions.BuildRaiseAttribute(seq, attrId, xpSpent));
}
/// <summary>Send retail RaiseVital (0x0044).</summary>
public void SendRaiseVital(uint vitalId, ulong xpSpent)
{
uint seq = NextGameActionSequence();
SendGameAction(CharacterActions.BuildRaiseVital(seq, vitalId, xpSpent));
}
/// <summary>Send retail RaiseSkill (0x0046).</summary>
public void SendRaiseSkill(uint skillId, ulong xpSpent)
{
uint seq = NextGameActionSequence();
SendGameAction(CharacterActions.BuildRaiseSkill(seq, skillId, xpSpent));
}
/// <summary>Send retail TrainSkill (0x0047).</summary>
public void SendTrainSkill(uint skillId, uint credits)
{
uint seq = NextGameActionSequence();
SendGameAction(CharacterActions.BuildTrainSkill(seq, skillId, credits));
}
/// <summary>Send AddShortcut (0x019C) — pin an item to toolbar slot <paramref name="index"/>.
/// Retail: CM_Character::Event_AddShortCut. Mirrors the SendChangeCombatMode pattern.</summary>
public void SendAddShortcut(uint index, uint objectGuid, ushort spellId = 0, ushort layer = 0)
@ -1255,9 +1285,17 @@ public sealed class WorldSession : IDisposable
SendGameAction(InteractRequests.BuildUse(seq, targetGuid));
}
/// <summary>Send PutItemInContainer (0x0019) — move an item into a container at a slot. placement
/// <summary>Send UseWithTarget (0x0035) - use a source item on an acquired target.
/// Retail: CM_Inventory::Event_UseWithTargetEvent.</summary>
public void SendUseWithTarget(uint sourceGuid, uint targetGuid)
{
uint seq = NextGameActionSequence();
SendGameAction(InteractRequests.BuildUseWithTarget(seq, sourceGuid, targetGuid));
}
/// <summary>Send PutItemInContainer (0x0019) - move an item into a container at a slot. placement
/// = the target slot (server packs/shifts); the drag-drop drop handler computes it. Retail:
/// CM_Inventory::Event_PutItemInContainer → ACE Player.HandleActionPutItemInContainer.</summary>
/// CM_Inventory::Event_PutItemInContainer -> ACE Player.HandleActionPutItemInContainer.</summary>
public void SendPutItemInContainer(uint itemGuid, uint containerGuid, int placement)
{
uint seq = NextGameActionSequence();