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

Add a method to access the GridMap editor's current selection #11161

Closed
mav006 opened this issue Nov 15, 2024 · 0 comments · Fixed by godotengine/godot#99639
Closed

Add a method to access the GridMap editor's current selection #11161

mav006 opened this issue Nov 15, 2024 · 0 comments · Fixed by godotengine/godot#99639

Comments

@mav006
Copy link

mav006 commented Nov 15, 2024

Describe the project you are working on

I'm working on a 3D game. I want to use gridmaps for a couple of things. To make the gridmap more easy to use I'm adding the functionality of splitting gridmaps. I want to be able to select a part of grdmapA (with the shift + click selection that is implemented), hit a button, and then the selected part of the gridmapA separates from it and becomes gridmapB in my hierarchy.

Describe the problem or limitation you are having in your project

There is no way (that I have found) to access the cells I select with the shift + click selection box. Since I want to manipulate the selected cells specifically, I need to know which ones they are. I can see the whole selection process in the source code, but It would be great to have a simple function to access the selected cells.

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

Being able to manipulate only the parts of a gridmap the user wants through code can be useful. I already have another function I want to impolement that requires me to access the selection

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

One of the methods of the gridmap is
Array get_selected_cells()
It returns null if there is no selection, and returns an array of cell items

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

The way to work aroudn this is to create your own selection method, which is what I'm going to use. But it is a very simple line since the code is done, I just need access to it.

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

It would allow people to make the addons

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