Add Stackable component for item stacking#1512
Closed
JakubIwicki wants to merge 2 commits into
Closed
Conversation
- Uncomment and complete Stackable.cs with SyncVar'd maxStack/amountInStack - Add IsStackable property to Item.cs - Add TryStackWithExisting to AttachedContainer for stack merging - Add world-space drop stacking via TryStackWithNearbyItem in Hand.cs - Add UI stack count display in SingleItemContainerSlot - Add examine hover text showing stack count in ExamineUI - Add 21 edit mode tests covering stacking logic - Add [Server] guards on all stack mutators - Ghost items properly despawned on full consumption Closes RE-SS3D#1258
Collaborator
|
PRs by AI agents are not allowed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1258
Items of the same type now stack together in containers. A Stackable component tracks max stack size and current count, and same-type items merge automatically when stored or dropped near each other.
Changes
Stackable.cs— new component with SyncVar'd maxStack/amountInStack, overflow handling, type matching, visual copy toggling, and examine integrationItem.cs— added IsStackable propertyAttachedContainer.cs— TryStackWithExisting merges incoming items into existing stacks during AddItem; fully-consumed items are despawnedHand.cs— TryStackWithNearbyItem merges dropped items with nearby same-type stacks in world spaceSingleItemContainerSlot.cs— stack count label displayed on container slot UIExamineUI.cs— examine hover text shows current stack countStackableTests.cs— 21 edit mode tests covering stacking, overflow, type matching, and edge casesVerification