Add inventory persistence restore hook
This commit is contained in:
@@ -100,7 +100,9 @@ player's inventory without a translation layer.
|
||||
Save/load responsibilities:
|
||||
|
||||
- Save the player inventory from `UAgrarianInventoryComponent::Items`.
|
||||
- Restore the stack array onto the component during load.
|
||||
- Restore the stack array through
|
||||
`UAgrarianInventoryComponent::RestoreSavedItems` during load so HUD/UI
|
||||
listeners receive `OnInventoryChanged`.
|
||||
- Recompute derived values such as total weight after load from stack data.
|
||||
- Avoid saving UI-only selection state as part of the inventory model.
|
||||
|
||||
|
||||
@@ -144,6 +144,12 @@ array, shows occupied slots, total carried weight, and a short visible stack
|
||||
list, and leaves mutation actions on the existing server-authoritative commands
|
||||
and RPCs until a full UMG inventory screen is introduced.
|
||||
|
||||
Inventory persistence saves `UAgrarianInventoryComponent::Items` into
|
||||
`FAgrarianSavedPlayer::Inventory` and restores through
|
||||
`UAgrarianInventoryComponent::RestoreSavedItems`. Restore broadcasts
|
||||
`OnInventoryChanged`, which keeps the MVP HUD panel and future UI listeners in
|
||||
sync after load while preserving total weight as a derived value.
|
||||
|
||||
## Time And Environment
|
||||
|
||||
The MVP gameplay calendar target is:
|
||||
|
||||
Reference in New Issue
Block a user