godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.11k stars 69 forks source link

Automatically change the scene tab highlighted when selecting the script of the scene #10163

Open JSolde opened 1 month ago

JSolde commented 1 month ago

Describe the project you are working on

It is just a general impovement for usability of the editor

Describe the problem or limitation you are having in your project

If you select a scene and display its script then if you select a new script the scene tab does not change. So if you go to 2D then you do not see the scene corresponding to the selected script and you have to manually select it.

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

It'd be good if when a script that corresponds to a scene is selected then the corresponding scene is also selected in the scenes tab and thus will appear if 2D icon is selected. This is what happens if you select a new scene,

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

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

No that I can think of.

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

Improving editor usability.

Mickeon commented 1 month ago

While a single script can be attached to multiple scene roots, narrowing it down to only currently open Scenes would make this feature more usable in a real scenario.

Should really be an Editor Setting, however. Changing Scene without user input can potentially be disorienting, particularly so for returning users.

AThousandShips commented 1 month ago

Related:

Arguably a duplicate of:

lostminds commented 1 month ago

Something I think complicates this a fair bit is that we don't just have the 2D/3D scene viewport and the script editor to consider. If this was the case I'd agree it could be a good idea to switch selected scene when switching to the related script.

But now we also have the Scene tree view to the left and the Inspector panel to the right, which both relate to the currently open scene. So switching scripts would then also switch out and lose current selection in both the scene tree (of the old selected scene) and the inspector panel to the right by changing the open scene. This I think would be both unexpected and unwanted in many cases. If it's restricted to open scenes it might be better, but it could also make it more unexpected to the user since the change will only happen sometimes when changing what script you edit.