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 API - Add a signal for when a object was selected #3240

Closed
BlaXun opened this issue Jan 18, 2022 · 4 comments
Closed

Scripting API - Add a signal for when a object was selected #3240

BlaXun opened this issue Jan 18, 2022 · 4 comments
Assignees
Labels
documentation Issue related to the Tiled Manual.

Comments

@BlaXun
Copy link

BlaXun commented Jan 18, 2022

For my tiled extension I added a tool that should only be available if the currently selected object is of a specific type. Unfortunately I can not enable/disable the tool because I don't have a signal / event that informs me that a object was selected/ deselected. I think it would be a good idea to throw such an event / signal that we extension-users could subscribe to.

@bjorn
Copy link
Member

bjorn commented Jan 18, 2022

Hmm, some signals are currently not documented. Among these is TileMap.selectedObjectsChanged, which is called when the TileMap.selectedObjects property changes:

tiled.activeAsset.selectedObjectsChanged.connect(() => tiled.log(tiled.activeAsset.selectedObjects))

I'll have to go through the currently available "Changed" signals and add them to the documentation.

@bjorn bjorn added the documentation Issue related to the Tiled Manual. label Jan 18, 2022
@BlaXun
Copy link
Author

BlaXun commented Jan 18, 2022 via email

@eishiya
Copy link
Contributor

eishiya commented Jan 18, 2022

It would be nice to get a list of signals somewhere too. Currently they're just listed as variables in tiled, MapEditor, etc, but they're mixed together with other things, so it's not clear what's signals and what isn't. The old documentation handled this much better by listing signals separately from everything else, in the same area where it described how to connect to them.

@bjorn bjorn changed the title [Request] Scripting API - Add a signal for when a object was selected Scripting API - Add a signal for when a object was selected Jan 18, 2022
@bjorn bjorn self-assigned this Jan 19, 2022
@bjorn
Copy link
Member

bjorn commented Jan 19, 2022

It would be nice to get a list of signals somewhere too.

I agree. Let's keep this in mind when we try to improve the format in general, based on generating Markdown instead (#3174).

@bjorn bjorn closed this as completed in 0c7b83d Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issue related to the Tiled Manual.
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants