X Tutup
Skip to content

Fix: Tilemap tools not overriding main editor tools#107843

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
DexterFstone:fix/tilemap-tool-override
Oct 22, 2025
Merged

Fix: Tilemap tools not overriding main editor tools#107843
Repiteo merged 1 commit intogodotengine:masterfrom
DexterFstone:fix/tilemap-tool-override

Conversation

@DexterFstone
Copy link
Contributor

@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
Contributor 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
Contributor 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
@KoBeWi
Copy link
Member

KoBeWi commented Jun 28, 2025

The tool switches as soon as you hover the TileMapLayer editor, it seems weird:

godot.windows.editor.dev.x86_64_vTMZxtVfxQ.mp4

Also not sure if switching the tool back after deselecting tilemap is intuitive.

@DexterFstone
Copy link
Contributor Author

DexterFstone commented Jun 28, 2025

The tool switches as soon as you hover the TileMapLayer editor, it seems weird:

godot.windows.editor.dev.x86_64_vTMZxtVfxQ.mp4
Also not sure if switching the tool back after deselecting tilemap is intuitive.

So you're saying is to completely remove the auto-switching tool?

@KoBeWi
Copy link
Member

KoBeWi commented Jun 28, 2025

Switching to Select when selecting the node is fine, not sure if it's necessary to switch afterwards (e.g. when user decides to use Move tool while the tilemap is selected).

Going back to the previous tool when tilemap is deselected should be removed IMO. The tilemap editor can be hidden e.g. when starting project, so "randomly" changing tools can be confusing.

@DexterFstone DexterFstone force-pushed the fix/tilemap-tool-override branch from aa96ae3 to 0473ad1 Compare June 29, 2025 09:56
Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine now.

@KoBeWi KoBeWi requested a review from groud July 3, 2025 15:34
@KoBeWi KoBeWi modified the milestones: 4.x, 4.6 Jul 3, 2025
@DexterFstone DexterFstone force-pushed the fix/tilemap-tool-override branch 3 times, most recently from 578525c to 46dbf36 Compare July 7, 2025 12:36
@Repiteo
Copy link
Contributor

Repiteo commented Oct 21, 2025

Needs rebase

@DexterFstone DexterFstone force-pushed the fix/tilemap-tool-override branch from 46dbf36 to 13bc66f Compare October 22, 2025 04:58
@DexterFstone
Copy link
Contributor Author

Needs rebase

Done

@DexterFstone DexterFstone force-pushed the fix/tilemap-tool-override branch from 13bc66f to b11fb7c Compare October 22, 2025 05:22
@DexterFstone DexterFstone force-pushed the fix/tilemap-tool-override branch from b11fb7c to 9aa0465 Compare October 22, 2025 05:46
@Repiteo Repiteo merged commit 73b0ea3 into godotengine:master Oct 22, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Oct 22, 2025

Thanks!

@DexterFstone DexterFstone deleted the fix/tilemap-tool-override branch October 22, 2025 19:30
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

5 participants

X Tutup