Skip to content

Fix: Tilemap tools not overriding main editor tools #107843

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DexterFstone
Copy link

@AThousandShips AThousandShips requested a review from a team June 23, 2025 07:21
@AThousandShips AThousandShips added this to the 4.5 milestone Jun 23, 2025
@groud groud added enhancement and removed bug labels Jun 23, 2025
@groud
Copy link
Member

groud commented Jun 23, 2025

Removed the "bug" label as this is the intended behavior.

I am not sure about this change, I'd like the proposal to be backed a bit more, as the other tools can be useful even if the TileMap editor is visible. Those other tools are more specific than the "select" one, which make me think when you change to them, then you know what you are doing and expect them to work right away.

@DexterFstone
Copy link
Author

DexterFstone commented Jun 23, 2025

I am not sure about this change, I'd like the proposal to be backed a bit more, as the other tools can be useful even if the TileMap editor is visible. Those other tools are more specific than the "select" one, which make me think when you change to them, then you know what you are doing and expect them to work right away.

The scenario I was considering was this:
The user has selected a tool other than the select tool
Now the user selects the TileMapLayer node and wants to start painting with the default tool, but since the selection tool is not a select, it is having trouble
I think the best place to edit the tool selection was when the TileMapEditor is displayed
After that, if needed, the user can select their own tool, such as rotate or scale

@groud
Copy link
Member

groud commented Jun 23, 2025

hmm. I guess it makes sense then. If it still allows you to use the tools afterward I guess it could work.

I wonder if it's still good though, there might be some users who you like, for example, the "move" tool to stay active when selecting nodes one after the other in the scene tree. And the fact we would introduce this new behavior (about selecting a node possibly auto-switching the tool) might be a bit confusing and annoying for some.

That being said, switching to select mode when clicking a tool in the tilemap bottom toolbar makes perfect sense. I think it might deserve either a dedicated function though, or simply _update_toolbar to be renamed to something like _tool_button_pressed (so that's it's a bit clearer it does now more than update the toolbar).

@Repiteo Repiteo modified the milestones: 4.5, 4.x Jun 24, 2025
@DexterFstone DexterFstone force-pushed the fix/tilemap-tool-override branch from 40afacf to 3482e43 Compare June 26, 2025 09:19
@DexterFstone
Copy link
Author

DexterFstone commented Jun 26, 2025

I updated the code, now it should be cleaner and work better. Additionally, it keeps track of the previously selected tool, so whenever TileMapLayerEditor is unavailable, the tool will revert to its original state.

  • When selecting TileMapLayer, it forces the CanvasItemEditor to select the Select tool.
  • When the mouse enters the TileMapLayerEditor, it forces the CanvasItemEditor to select the Select tool.
  • When selecting the TileMapLayerEditor tools, it forces the CanvasItemEditor to select the Select tool.
  • When deselecting the TileMapLayer, it forces the CanvasItemEditor to revert to the previous tool.

Note

In my tests, the mouse entered does not always work

@DexterFstone DexterFstone force-pushed the fix/tilemap-tool-override branch from 3482e43 to aa96ae3 Compare June 26, 2025 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make Tilemap tools override the tools on the top toolbar
4 participants