refactor(runtime): close canonical gameplay ownership
Unify the toolbar shortcut manager with Runtime inventory state, route retail-ordered shortcut and spellbook command effects through the canonical owners, and make retained controllers borrow those exact instances. Remove the item-interaction transaction fallback and add graphical/no-window parity plus failure-safe terminal ownership-ledger coverage. Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
parent
ce6fae7b38
commit
89e6b207f8
36 changed files with 1433 additions and 251 deletions
|
|
@ -401,11 +401,25 @@ public sealed class Spellbook
|
|||
|
||||
public void SetDesiredComponent(uint componentId, uint amount)
|
||||
{
|
||||
uint current = _desiredComponents.TryGetValue(componentId, out uint existing)
|
||||
? existing : 0u;
|
||||
if (current == amount) return;
|
||||
if (amount == 0) _desiredComponents.Remove(componentId);
|
||||
else _desiredComponents[componentId] = amount;
|
||||
bool exists = _desiredComponents.TryGetValue(
|
||||
componentId,
|
||||
out uint current);
|
||||
if (exists && current == amount) return;
|
||||
// PlayerModule::SetDesiredCompLevel @ 0x005D4940 retains zero as a
|
||||
// real table value; only ClearDesiredCompList destroys the entry set.
|
||||
_desiredComponents[componentId] = amount;
|
||||
DesiredComponentsChanged?.Invoke();
|
||||
StateChanged?.Invoke();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Destroy the complete desired-component list, matching
|
||||
/// <c>PlayerModule::ClearDesiredCompList @ 0x005D2A00</c>.
|
||||
/// </summary>
|
||||
public void ClearDesiredComponents()
|
||||
{
|
||||
if (_desiredComponents.Count == 0) return;
|
||||
_desiredComponents.Clear();
|
||||
DesiredComponentsChanged?.Invoke();
|
||||
StateChanged?.Invoke();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue