branchrust_reboot/main/item_ownershipcancel
76 Commits over 31 Days - 0.10cph!
Rename ItemOwnership.cs -> ItemOwnershipPhrases.cs
Store ownership of item inside the entity when the deployable is placed
Reapply ownership to the item when the deployable is picked back up
Add method to take 1 share of item ownership (incase we do stackable item ownership in future)
Save deployable item ownership so it can persist across saves (incase workbench is picked up days after it's placed)
Refactor ItemOwnershipShare to have `.IsValid()` method (since it's a struct)
Add ItemOwnership to the protobuf of an entity
- allows us to save the ownership that the item of a deployable originally had
Add ownership phrase to easter egg items
Add ownership phrase to christmas presents
Add code support for ownership to ItemModUnwrap (christmas presents & easter eggs)
- also adds support for items spawned from a loot table to be created with ownership
Fix Christmas Presents & Easter Eggs not giving items
- Unity bug from primitive where it was serializing `allowedItems` cached array as an empty array instead of null even though it was private
Add ownership when item is taken from advent calendar
Ensure phrase gets translated when shown as a tooltip
Change all the hardcoded english strings to phrases
Fish & skull ownership item prefab changes
Add ownership when gutting item from fish / crushing skulls
Re-run protobuf generation
merge from main -> item_ownership
Add converts to add, remove and transfer ownership on an item
Add convar `stackable_item_ownership` to enable ownership on stackable items (that were configured in ItemDefinition)
- default disabled (only enable for testing)
Fix item not being marked as dirty when item ownership is transferred off of it
Add colors in inventory prefab
If there are multiple owners on a single item, show a different color for each owner (rotating through 7 different colors)
Enable stackable ownership on rockets since they are a low stack size item (max 3 owners) and an item you likely want to know who made it
Change GameUI.Inventory prefab with support for stackable ownership
Significantly refactor so the code can support ownership on stackable items, however only enable only on single stack items by default
- can be applied to individual stackable items through `ItemDefinition.supportsStackableOwnership`
- transfers ownership between item stacks when merging stacks instead of averaging it
- ownership is stored in whole number shares based on the amount of the item rather than percentage per stack
- ownership will try to merge with existing ownership names + reasons before creating new ones
- ownership panels above item description can show multiple panels if there are multiple owners
merge from main -> item_ownership
Simplified version of original item ownership system
- only applies to single stack items (no mixed ownership)
- ownership can't change: will always show the name of the user who first created it / looted it
- shows owner's display name above the item (like it used to)
- hovering over the owner's name will show a tooltip of how it was created, like "Crafted by Jake"
Show different forms of item aquisition
- crafted
- looted
- born (respawn with rock + torch)
- spawned (F1 spawn menu)
- mission reward