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: Signal for brush changing #3928

Open
eishiya opened this issue Apr 17, 2024 · 0 comments
Open

Scripting: Signal for brush changing #3928

eishiya opened this issue Apr 17, 2024 · 0 comments
Labels
feature It's a feature, not a bug.

Comments

@eishiya
Copy link
Contributor

eishiya commented Apr 17, 2024

It is occasionally desirable to react to the current brush changing. For example, one may want to select a different layer based on the brush's contents, or sort the brush's tiles into multiple layers automatically. However, there is currently no signal for this, and listening to changes to tiled.mapEditor.currentBrush doesn't work because that TileMap gets replaced rather than modified when the brush changes.

So, I'd like to request something like tiled.mapEditor.brushChanged (or currentBrushChanged to match currentBrush).
Similarly to TileMap.regionEdited, this signal should probably not fire on changes resulting from scripts, to avoid infinite loops.

Somewhat related: There are also no signals for the tiles selected in a Tileset or in TilesetsView changing, those may also be useful occasionally. So far, the only scenarios where I've wanted the latter has been as a potential alternative to brushChanged, though.

@eishiya eishiya added the feature It's a feature, not a bug. label Apr 17, 2024
@eishiya eishiya changed the title Signal for brush changing Scripting: Signal for brush changing Apr 17, 2024
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

1 participant