Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#5156] Add dialog for splitting items in inventory into two stacks #5157

Open
wants to merge 1 commit into
base: 4.3.x
Choose a base branch
from

Conversation

arbron
Copy link
Collaborator

@arbron arbron commented Feb 10, 2025

Adds a "Split Stack" context menu option for an item that has a quantity of at least 2. Contains a modified version of core's <range-picker> element that has a number input on the left side. This modified element won't be required if
foundryvtt/foundryvtt#12147 is resolved.

Closes #5156

Adds a "Split Stack" context menu option for an item that has a
quantity of at least 2. Contains a modified version of core's
`<range-picker>` element that has a number input on the left side.
This modified element won't be required if
foundryvtt/foundryvtt#12147 is resolved.

Closes #5156
@arbron arbron added feature request ux User experience related features or bugs labels Feb 10, 2025
@arbron arbron added this to the D&D5E 4.4.0 milestone Feb 10, 2025
@arbron arbron self-assigned this Feb 10, 2025
const right = formData.object.right ?? 0;
const left = (this.options.document.system.quantity ?? 1) - right;
if ( left === this.options.document.system.quantity ) return;
await this.options.document.update({ "system.quantity": left }, { render: false });
Copy link
Contributor

@krbz999 krbz999 Feb 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is render: false to prevent the actor sheet rendering twice? This would prevent the item sheet rendering too, though. So maybe just Promise.all like is done with advancements? (Or swap the order of operations here.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request ux User experience related features or bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add context option for splitting stack of items in two
2 participants