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

Scripting: Added tiled.load to load assets without opening an editor #3879

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bjorn
Copy link
Member

@bjorn bjorn commented Jan 23, 2024

Still WIP, has known issues are likely also undiscovered ones.

Intended as a solution for #3517.

@justgook
Copy link

maybe you can list issues? so some-one could fix / test those?

@bjorn
Copy link
Member Author

bjorn commented Feb 13, 2025

@justgook Ha, indeed, listing the ones I apparently knew about would have been good for myself as well. I even forgot I already had a patch in progress for this at some point. First step now would be to rebase this and test it.

@bjorn bjorn force-pushed the scripting-tiled-load branch from e6f2526 to 7dcf5e3 Compare February 13, 2025 14:30
Still WIP, has known issues are likely also undiscovered ones.
@bjorn bjorn force-pushed the scripting-tiled-load branch from 7dcf5e3 to 01ce144 Compare February 13, 2025 14:32
@bjorn
Copy link
Member Author

bjorn commented Feb 13, 2025

I've rebased it and gave it a quick test. Appears to work fine, but one noticeable issue is present on exit, it prints:

TilesetManager: There are still 3 tilesets loaded at exit!

This indicates tileset references are still alive when they shouldn't be. I don't get this message on the master branch.

@justgook
Copy link

just gut filling - that you have forgot to transfer ownership:

if (auto document = TilesetDocument::findDocumentForTileset(tileset->sharedFromThis()))
         return new EditableTileset(document);

     editable = new EditableTileset(tileset);
     editable->moveOwnershipToCpp();

or something in that area - so you left with tilesets that is not own by anyone

so it is still loaded, and "not closed" properly.

PS. not tested - just from own exp what that could be.
PSS. im not big expert in C++ - just gut filling from 20+ years exp in web dev.

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

Successfully merging this pull request may close these issues.

2 participants