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

Get path to current project with Tiled API #3527

Closed
solerante opened this issue Nov 17, 2022 · 2 comments
Closed

Get path to current project with Tiled API #3527

solerante opened this issue Nov 17, 2022 · 2 comments
Labels
feature It's a feature, not a bug.

Comments

@solerante
Copy link

Is your feature request related to a problem? Please describe.
I would like to fetch the current project's path using the Tiled API.

Describe the solution you'd like
Something like tiled.activeProject which returns the path of the current open project.

Describe alternatives you've considered

  • Asking the user the path of the current project.
  • Putting the path in tiled.activeProject.path if there is some reason to make it an object. Maybe to dynamically make projects?
@solerante solerante added the feature It's a feature, not a bug. label Nov 17, 2022
@eishiya
Copy link
Contributor

eishiya commented Nov 17, 2022

I think this would be better as a comment on #2902 - Projects aren't accessible to the scripting API at all, and it would be better to have the path available as part of a proper API rather than just as a file path. The Project API should, of course, have a way to get the base path of the project, as well as the paths of directories added to it.

@bjorn
Copy link
Member

bjorn commented Nov 26, 2022

I recently added this actually (462986c). I thought I might not get around to finishing the project API for 1.10 but at least wanted to provide access to the path, since it's most commonly needed.

@bjorn bjorn closed this as completed Nov 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature It's a feature, not a bug.
Projects
None yet
Development

No branches or pull requests

3 participants