godotengine / godot-proposals

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

"Run Last Ran Scene" button and keyboard shortcut #6414

Open dkaste opened 1 year ago

dkaste commented 1 year ago

Describe the project you are working on

A game with multiple "entrypoint" scenes (game, world editor, etc.) that also uses many nested "instantiated child" scenes.

Describe the problem or limitation you are having in your project

When working on my project, I often choose an "entrypoint" scene to work on for that session (world editor, for example). I use F6 ("Run Current Scene") to run the entrypoint scene. Then, as I work, I open "instantiated children" as scene tabs to change them. Now, if I press F6, the open child scene will run instead of the entrypoint.

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

Add a button (with a keyboard shortcut) to the top right Run/Play button group that will run the scene that ran most recently. This way, there is always an easy way to run the scene you are interested in with a single keypress.

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

See above.

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

An editor plugin could possibly accomplish this, but I think it would be useful for all Godot users.

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

It would be a useful quality-of-life feature for all Godot users.

AThousandShips commented 1 year ago

The top right area can feel a bit crowded as it is

spindlebink commented 1 year ago

You can right click a scene and select "Set as Main Scene" to set it to open when you run your project (F5 instead of F6): your goal is exactly the use case that using the "Run Current Scene" button circumvents.

KoBeWi commented 1 year ago

An editor plugin could possibly accomplish this, but I think it would be useful for all Godot users.

There is a way to have an addon that also benefits all Godot users. It's called AssetLib.

Check these: https://godotengine.org/asset-library/asset/1460 https://godotengine.org/asset-library/asset/1433

dkaste commented 1 year ago

@spindlebink In my opinion, changing that setting makes it too easy to forget to set it back to the "proper" main scene before checking in changes to a version control system.

@KoBeWi Thanks! I didn't even think to check the asset library. That "Quick Scenes" asset looks particularly useful in my case.

I still think the feature I described could be useful in general though, and perhaps simple enough to warrant inclusion into core.