Unify agent update events into AgentUpdate

This commit is contained in:
Haselnussbomber 2025-11-08 11:31:10 +01:00
parent 0b6f3b8bcf
commit 8fd49f261a
No known key found for this signature in database
GPG key ID: BB905BB49E7295D1
4 changed files with 46 additions and 70 deletions

View file

@ -46,7 +46,7 @@ internal class GameInventory : IInternalDisposableService
this.inventoryTypes = Enum.GetValues<GameInventoryType>();
this.inventoryItems = new GameInventoryItem[this.inventoryTypes.Length][];
this.gameGui.InventoryUpdate += this.OnInventoryUpdate;
this.gameGui.AgentUpdate += this.OnAgentUpdate;
}
/// <inheritdoc/>
@ -58,7 +58,7 @@ internal class GameInventory : IInternalDisposableService
this.subscribersPendingChange.Clear();
this.subscribersChanged = false;
this.framework.Update -= this.OnFrameworkUpdate;
this.gameGui.InventoryUpdate -= this.OnInventoryUpdate;
this.gameGui.AgentUpdate -= this.OnAgentUpdate;
}
}
@ -309,7 +309,7 @@ internal class GameInventory : IInternalDisposableService
return items;
}
private void OnInventoryUpdate()
private void OnAgentUpdate(AgentUpdateFlag agentUpdateFlag)
{
this.inventoriesMightBeChanged |= true;
}