-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Add a way to know when a TileMapLayer's cell is modified #96188
Add a way to know when a TileMapLayer's cell is modified #96188
Conversation
For the record, your commit seems not to be linked to your GitHub account. See: Why are my commits linked to the wrong user? for more info. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation is okay, it's consistent with what groud wrote in the past.
This has been pending for over a month can we have someone look at this that can move this forward? @Khusheete @groud I made a similar PR as well because I had difficulty finding this PR #97896 I would be happy with any implementation |
The checks on macOS have failed and I am not sure why. This PR may need a rebase, preferably squashing the commits, and then it's very good to merge. |
It needs a rebase indeed |
Ok, I fixed it ! |
doc/classes/TileMapLayer.xml
Outdated
Called when this [TileMapLayer]'s cells need an internal update. This update may be caused from individual cells being modified or by a change in the [member tile_set] (causing all cells to be queued for an update). The first call to this function is always for initializing all the [TileMapLayer]'s cells. [param coords] contains the coordinates of all modified cells, roughly in the order they were modified. [param forced_cleanup] is [code]true[/code] when a cleanup is required. This usually means that the [TileMapLayer] has either left the canvas, has left the tree or has been freed. It may also be [code]true[/code] if an update is requested when either [member tile_set] is [code]null[/code], [member enabled] is [code]false[/code] or this [TileMapLayer] is outside of the [SceneTree]. See also [method update_internals]. | ||
[b]Warning:[/b] Implementing this method may degrade the [TileMapLayer]'s performance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does it mean when "a cleanup is required"? You do explain well when and why it happens, but you don't explain how the user should handle this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A "cleanup" is needed when the TileMapLayer internals should be cleaned up. That mostly means:
- When layer is disabled
- The TileSet is null
- The layer is not visible
- The TileMapLayer quits the tree
- The node is freed
0fc5b69
to
b168ffa
Compare
b168ffa
to
e541c90
Compare
Force pushed an amend to fix the commit message which was mangled, and properly fix author credits. |
…eMapLayer's cells are updated Made `_update_cells` a hook into the `TileMapLayer`'s internal update
e541c90
to
d92f5e5
Compare
Thanks! Congratulations on your first contribution! 🎉 |
Hi !
This PR adds a callback inside the
TileMapLayer
that gets called when cells are updated. This was discussed in #96078, which was a previous attempt at implementing this feature.