godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.13k stars 93 forks source link

Respect the last mode a scene is opened in #7762

Open josefalanga opened 1 year ago

josefalanga commented 1 year ago

Describe the project you are working on

A roguelike platformer with proc gen

Describe the problem or limitation you are having in your project

I need to work back and forth with the Script Editor in one scene, and the 2D View in another one. If I select code in the first scene and I switch to the one I had looking at the 2D TileMap, suddenly I lost what I was looking at in that scene, and I'm looking at some code I don't care about at the moment. Also switching tabs in scripting mode, makes me lose the script I was looking at and just selects the first one in the scene tree, or something like that.

Working at Rooms script in Game scene tab. imagen I switch to Room0 to take a look at the scene structure in 2D mode, it shows some code of that scene, so I switch to 2D. imagen I switch back to Game scene tab to continue working on the script, now shows some random place of the 2D view. imagen I switch to Script, and it doesn't even keeps the one I had opened. imagen

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

If scene tabs are meant to be contextual, I wish to keep the last thing I was looking at in any given scene tab, ie: keep the mode for each scene tab between switches (2D, 3D, Script).

This behaviour is probably disruptive for existing workflows, so I'll appreciate it being a editor setting to opt-in.

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

Working at Rooms script in Game scene tab. imagen I switch to Room0 to take a look at the scene structure in 2D mode imagen I switch back to Game scene tab to continue working on the script, and it's exactly where I left it, in the same mode imagen

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

This will be used often, it's a quality of life improvement for the basic contextual editing loop of scenes.

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

I don't know if an add-on can handle this, because it modifies current behaviour of the editor. If it's possible to do, I'm proposing it anyway because it's QoL, and it's not practical to have it outside the core editor.

inhalt120g commented 1 year ago

This sounds like you have that crazy "Open dominant script" setting turned on. image

Edit: if you turn it off, the views will behave as described in "Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams" part.