Repository navigation
Toolbar: an item that leaves the player leaves the bar (fix #219) - #234
Merged
Merged
Conversation
Dropping a Treated Healing Kit left its shortcut on the bar; pressing the key then walked the character to the kit on the ground and picked it up. The original client clears the slot, and tells the server, whenever the server moves or removes an item on the bar that the player no longer owns (dropped, given, sold, put in a container that is not the player's, destroyed, used up). The server never clears a shortcut on its own, so the stale slot was also saved with the character. The inventory owner in the runtime now watches the server's placement changes and removals: for the slot holding that item it clears the shortcut and sends RemoveShortCut unless the player still owns the item. A local drag projection and a fresh incarnation of the same object keep the slot. The game runtime binds the player and the in-world send, so the graphical and headless clients behave the same; the bar repaints from the shortcut store. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merging a stack that sits on the toolbar moves its shortcut to the stack it joins, the moment the merge is sent. That lived only in the windowed toolbar panel, so a plugin, automatic or headless merge never moved the shortcut; with the new ownership rule the slot was then cleared and a RemoveShortCut sent when the server took the poured stack away. The inventory owner in the runtime now does the retarget and sends both changes; the game runtime subscribes it to the item owner's merge event, and the inventory panel's own drag merge calls the same method through its bindings. The toolbar panel's copy is gone. Tests: the retarget and its quiet aftermath on the runtime owner, a host parity scenario for a plugin merge on both clients (red with the runtime subscription removed), and the ownership rule's edges: a confirmed move of an item the client never held clears, an item on two slots loses only the first, an exact-incarnation delete clears, spell shortcuts are untouched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #219.
When the server moves or removes an item the player no longer owns (dropped, given, sold, traded, last use consumed), the toolbar clears that item's shortcut and tells the server (remove-shortcut), as the original client does. Moves between the player's own packs, wield and unwield keep the slot; a partial stack use keeps it.
A full stack merge of an item on the toolbar now moves its shortcut to the merged stack in the runtime (it lived only in the graphical toolbar), so plugins and the headless client keep the slot too instead of losing it.
RuntimeInventoryState: clear-on-ownership-loss and the merge retarget;GameRuntimebinds the player and the send on both hosts.🤖 Generated with Claude Code