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

Duplicate scenes refer to the same drawing (editing one also edits the other) #135

Open
manabreak opened this issue Jul 21, 2024 · 2 comments

Comments

@manabreak
Copy link

Just lost 5+ hours' worth of work because of this.

  1. Create a scene, name it "test 1" and draw something to it with Dungeon Draw
  2. Duplicate the scene and rename the duplicate as "test 2"
  3. Edit the new "test 2" scene (remove stuff, add new stuff etc.)
  4. Observe the original "test 1" scene

I'd assume the original scene would be left intact and the modifications would only affect the new scene. Everything else (tiles, tokens etc.) work this way.

@mcglincy
Copy link
Owner

mcglincy commented Jul 21, 2024

Sorry you lost work! That is never pleasant.

Dungeon Draw currently stores its JSON data in a Journal document in the Foundry database, and that Journal is tied to the scene (it's actually visible in the upper left of the scene). Usually when you create a new scene and start a new dungeon drawing, that causes a new Journal document to be created.

It sounds like duplicating a scene is keeping the original Journal document from the original scene, and instead now both scenes are using the same Journal... so dungeon draw edits on either are changing the same data. Boo.

I can think of a couple ways to address this, but I'll have to dig a bit into Foundry to understand which would be better.

  • One would be switching to flags on the scene to store the JSON data, rather than using a Journal document. For this I'd have to check how scene duplication handles flags (does it make a new copy?), and also would need to provide some sort of migration from existing Journal documents to a newer flag-on-scene storage.

  • The other would be to pay attention to scene duplication (I'm assuming there's a Foundry hook for that), and use the hook to also duplicate the Journal document and link that to the new duplicate scene.

@PXR5
Copy link

PXR5 commented Sep 20, 2024

For information I also encountered this. Fortunately I hadn't made too many changes before I noticed and guessed the cause. Now I create Dungeondraw scenes from scratch which of course avoids the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants