-
Notifications
You must be signed in to change notification settings - Fork 57
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
Problems when dragging containers and contained items from one character to another #30
Comments
Just touching this Issue tonight to say this is a very complicated problem and we have to reckon with whether containers need an overhaul. Foundry doesn't natively allow Items to hold other Items inside them the same way Actors can have Items inside them. The way it's done in OSE is a hack, and I'm still not comfortable enough with the codebase to touch the container code. As we've discussed on #32, a fix here should also go through all the world actors, find hidden bugged items, and unhide them. |
Edited title just to clarify that the item drag-drop behavior between actors is the designed behavior and not a bug. Only the behavior of containers and contained items when dragged between sheets is unexpected/a bug |
Macro to temporarily fix the second point in your issue: /* Macro to fix items that may be stuck hidden because
* they have a containerId value but the container can't be found
* or two containers that contain each other */
// use with token selected
// updates the actor and linked tokens, not unlinked tokens
// If it's an unlinked token, delete the token afterward and create a new one
let arr = [];
actor.data.items.forEach((item) => {
if (item.data.type === "container")
arr.push({ _id: item.id, "data.containerId": "", "data.itemIds": []});
else
arr.push({ _id: item.id, "data.containerId": ""});
})
actor.updateEmbeddedDocuments("Item", arr); |
There's going to be a fix for this in the latest release. Please keep in mind the following: Contained items will "spill out" outside of the container on the new sheet. There's no way to prevent this behavior. The container and the items it contained are in fact entirely new instances of those objects with no way to "discover" each other's new item ids. |
When dragging items from one character to another they are not moved but copied instead. With containers this introduces some problems:
The text was updated successfully, but these errors were encountered: