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:
parent
e3fc7ac5ba
commit
b7dc91a053
74 changed files with 6669 additions and 238 deletions
|
|
@ -156,6 +156,22 @@ public sealed class CreateObjectTests
|
|||
Assert.Equal(2.5f, parsed.Value.UseRadius!.Value, precision: 3);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TryParse_WeenieFlagsTargetType_ReadsTargetType()
|
||||
{
|
||||
byte[] body = BuildMinimalCreateObjectWithWeenieHeader(
|
||||
guid: 0x50000009u,
|
||||
name: "Healing Kit",
|
||||
itemType: (uint)ItemType.Misc,
|
||||
weenieFlags: 0x00080000u,
|
||||
targetType: (uint)ItemType.Creature);
|
||||
|
||||
var parsed = CreateObject.TryParse(body);
|
||||
|
||||
Assert.NotNull(parsed);
|
||||
Assert.Equal((uint)ItemType.Creature, parsed!.Value.TargetType);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// D.5.1 (2026-06-16): IconId was discarded at cs:516 — surface it so the
|
||||
// action bar / equipment UI can read icon dat ids from spawn messages.
|
||||
|
|
@ -451,6 +467,7 @@ public sealed class CreateObjectTests
|
|||
uint? value = null,
|
||||
uint? useability = null,
|
||||
float? useRadius = null,
|
||||
uint? targetType = null,
|
||||
uint iconOverlayId = 0,
|
||||
uint iconUnderlayId = 0,
|
||||
// intermediate fields for cursor-arithmetic test
|
||||
|
|
@ -516,7 +533,7 @@ public sealed class CreateObjectTests
|
|||
BinaryPrimitives.WriteSingleLittleEndian(tmp, useRadius ?? 0f);
|
||||
bytes.AddRange(tmp.ToArray());
|
||||
}
|
||||
if ((weenieFlags & 0x00080000u) != 0) WriteU32(bytes, 0); // TargetType u32
|
||||
if ((weenieFlags & 0x00080000u) != 0) WriteU32(bytes, targetType ?? 0u); // TargetType u32
|
||||
if ((weenieFlags & 0x00000080u) != 0) WriteU32(bytes, uiEffects); // UiEffects u32
|
||||
if ((weenieFlags & 0x00000200u) != 0) bytes.Add(0); // CombatUse sbyte/1 byte
|
||||
if ((weenieFlags & 0x00000400u) != 0) WriteU16(bytes, structure ?? 0); // Structure u16
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Buffers.Binary;
|
||||
using System.Text;
|
||||
using AcDream.Core.Items;
|
||||
using AcDream.Core.Net.Messages;
|
||||
using Xunit;
|
||||
|
||||
|
|
@ -176,6 +177,21 @@ public sealed class GameEventDispatcherTests
|
|||
Assert.Equal(0.42f, parsed.Value.HealthPercent, 4);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParseWieldObject_acceptsAceEightBytePayload()
|
||||
{
|
||||
byte[] payload = new byte[8];
|
||||
BinaryPrimitives.WriteUInt32LittleEndian(payload, 0x50000A01u);
|
||||
BinaryPrimitives.WriteUInt32LittleEndian(payload.AsSpan(4), (uint)EquipMask.ChestArmor);
|
||||
|
||||
var parsed = GameEvents.ParseWieldObject(payload);
|
||||
|
||||
Assert.NotNull(parsed);
|
||||
Assert.Equal(0x50000A01u, parsed!.Value.ItemGuid);
|
||||
Assert.Equal((uint)EquipMask.ChestArmor, parsed.Value.EquipLoc);
|
||||
Assert.Equal(0u, parsed.Value.WielderGuid);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParseWeenieError_RoundTrip()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue