feat(D.5.1): persist PlayerDescription shortcuts (were parsed then discarded)
Add optional `onShortcuts` callback to `GameEventWiring.WireAll`; invoke it with `parsed.Shortcuts` after the inventory/equipped loops in the PlayerDescription handler. `GameWindow` holds the list in a new `Shortcuts` property (initialized to empty) so the toolbar (D.5.1 Task 5) can read hotbar slots without keeping a parser reference. Existing callers compile unchanged — the parameter defaults to null. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
5382d0a9d2
commit
6c485c2f06
3 changed files with 83 additions and 2 deletions
|
|
@ -596,6 +596,9 @@ public sealed class GameWindow : IDisposable
|
|||
public readonly AcDream.Core.Spells.SpellTable SpellTable = LoadSpellTable();
|
||||
public readonly AcDream.Core.Spells.Spellbook SpellBook = null!;
|
||||
public readonly AcDream.Core.Items.ItemRepository Items = new();
|
||||
/// <summary>Persisted hotbar shortcuts from the last PlayerDescription (D.5.1 toolbar source).</summary>
|
||||
public IReadOnlyList<AcDream.Core.Net.Messages.PlayerDescriptionParser.ShortcutEntry> Shortcuts { get; private set; }
|
||||
= System.Array.Empty<AcDream.Core.Net.Messages.PlayerDescriptionParser.ShortcutEntry>();
|
||||
// Issue #5 — caches CreatureProfile.{Stamina, Mana, *Max} from
|
||||
// PlayerDescription so the Vitals HUD can render those bars.
|
||||
// Issue #6 — wired to SpellBook so GetMaxApprox folds enchantment
|
||||
|
|
@ -2309,7 +2312,8 @@ public sealed class GameWindow : IDisposable
|
|||
_lastSeenRunSkill, _lastSeenJumpSkill);
|
||||
Console.WriteLine($"player: applied server skills run={_lastSeenRunSkill} jump={_lastSeenJumpSkill}");
|
||||
}
|
||||
});
|
||||
},
|
||||
onShortcuts: list => Shortcuts = list);
|
||||
|
||||
// Phase I.7: subscribe to CombatState events and emit
|
||||
// retail-faithful "You hit X for Y damage" chat lines into
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue