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

Emit a signal for modified cells on TileMapLayer #10917

Closed
jeffbdavenport opened this issue Oct 6, 2024 · 3 comments
Closed

Emit a signal for modified cells on TileMapLayer #10917

jeffbdavenport opened this issue Oct 6, 2024 · 3 comments

Comments

@jeffbdavenport
Copy link

jeffbdavenport commented Oct 6, 2024

Describe the project you are working on

Creating a plugin/tool that implements a DualGrid TileMap system for 16 autotiles

Describe the problem or limitation you are having in your project

We have to resort to using _process as well as keeping a cached copy of get_used_cells() in order to figure out when a cell has been added or removed. Also the "changed" signal does not get emitted when adding or removing cells, I'm not sure if that is intentional or a bug.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

It would be a relief for there to be a signal that gets emitted when cells have been modified along with the cell coordinate so that cell modifications can be easily and distinctively be processed without having to do runtime comparisons of cached cell data in order to figure out what has changed.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Add a signal to TileMapLayer class and emit the signal at the end of the set_cell function.

I have created a pull request 97896

If this enhancement will not be used often, can it be worked around with a few lines of script?

I suspect this will not incur much of any penalty at all for those who don't use it.

Is there a reason why this should be core and not an add-on in the asset library?

Adding add-ons is cumbersome and this a feature that any potential add-ons working with TileMapLayer's could need or at least it would make life easier for them with just a couple lines of code.

@Mickeon
Copy link

Mickeon commented Nov 16, 2024

This has been implemented by godotengine/godot#96188

@Mickeon Mickeon closed this as completed Nov 16, 2024
@Mickeon Mickeon added this to the 4.4 milestone Nov 16, 2024
@Mickeon
Copy link

Mickeon commented Nov 16, 2024

Well, actually, quick correction. The signal has not been implemented, but virtual method has. So I'm swiftly reopening again after this lapse in judgement.

If you believe this proposal is no longer necessary, feel free to close it.

@Mickeon Mickeon reopened this Nov 16, 2024
@Mickeon Mickeon removed this from the 4.4 milestone Nov 16, 2024
@jeffbdavenport
Copy link
Author

@Mickeon yes that merge is sufficient for my proposal purposes, thank you!

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

No branches or pull requests

3 participants