Add editor setting to keep bottom panel state on play and stop game
This PR adds the editor settings run/output/keep_current_bottom_panel_on_play. The setting is false by default keep the old behavior. It should close the proposal: https://github.com/godotengine/godot-proposals/issues/9513
The objective is to override the settings run/output/always_close_output_on_stop and run/output/keep_current_bottom_panel_on_play so the bottom panel stay the way it was when starting and stopping the game.
Production edit:
- Closes https://github.com/godotengine/godot-proposals/issues/8507
- Closes https://github.com/godotengine/godot-proposals/issues/9513
Following the suggestions of @passivestar and @Calinou, I made the following modifications: I removed the new settting and the old settings Action On Play and Action On Stop and replaced them with 2 new settings:
Action On Play: Open Output (default), Open Debugger and Do Nothing
Action On Stop: Close Bottom Panel and Do Nothing (default)
I also created a migrate_settings method in EditorSettings to convert old settings into the new ones.
This is what it looks like:
With these modifications, we should be able to close the proposal https://github.com/godotengine/godot-proposals/issues/8507 and https://github.com/godotengine/godot-proposals/issues/9513
I think this is a good approach :thumbsup:
Given the popularity of https://github.com/godotengine/godot-proposals/issues/8507 though, I wonder if we should consider making the default for "Action on Play" also to do nothing?
We could trial it in 4.3 beta, and see if the feedback we get is mostly that people miss having the Output dock automatically displayed, or actually like this new behavior.
One potential concern would be for new users to outright miss the fact that there's an Output panel where messages from their running game are displayed. There might be other ways to raise awareness about it, like adding a (*) in the title to show that there are unread messages or something? Ideas welcome.
"Open Debugger" currently opens the output panel for me
Also I just randomly found another PR that can be closed when this one is merged: https://github.com/godotengine/godot/pull/66503
Also I just randomly found another PR that can be closed when this one is merged: #66503
And so this PR should also:
- Fix #66496
And while at it, see also:
- #82277
- for https://github.com/godotengine/godot-proposals/issues/7848
One potential concern would be for new users to outright miss the fact that there's an Output panel where messages from their running game are displayed
@akien-mga Was it ever discussed to add an option to overlay output in the game itself like unreal does? I feel like godot might benefit from that a lot since it runs the game in a separate window and it can be inconvenient to see the output in a single-monitor setup
"Open Debugger" currently opens the output panel for me
Effectively, I used the wrong value in EditorNode::_project_run_started
It will be fixed in my next commit.
Given the popularity of godotengine/godot-proposals#8507 though, I wonder if we should consider making the default for "Action on Play" also to do nothing?
I changed the defaut value for "Action on Play" to "Do nothing". I'll wait for more feedback to see if we change it back to "Open Output".
Opening debugger works now
I have this in Output though:
If you make the debugger keep the currently opened tab instead of switching to stack trace this PR will also close https://github.com/godotengine/godot-proposals/issues/7848. But I don't know how easy it is to do, so it's your call
I have this in Output though:
Hum... very weird... I don't have this behavior and I don't see how it is even possible, this setting has been removed from editor_settings.cpp!! Someone have a suggestion to fix this?!?!
If you make the debugger keep the currently opened tab instead of switching to stack trace this PR will also close godotengine/godot-proposals#7848. But I don't know how easy it is to do, so it's your call
Ok, it was kinda too easy:
Hum... very weird... I don't have this behavior and I don't see how it is even possible, this setting has been removed from editor_settings.cpp!! Someone have a suggestion to fix this?!?!
If I manually remove it from my editor-settings-4.tres it's gone, I don't know if it's something that will happen automatically when people update editor versions. iirc there are now also minor versions of editor settings (editor-settings-4.3.tres, etc), but I don't know how it migrates, if it's blindly copies it or actually checks individual settings. Somebody who knows will need to clarify
Ok, it was kinda too easy
Tested, works as expected
@akien-mga This PR now also closes both of https://github.com/godotengine/godot-proposals/issues/7848 and https://github.com/godotengine/godot-proposals/issues/3480
Probably also closes https://github.com/godotengine/godot/issues/60898 because it's now possible to keep the Animation tab opened when working on animations
I placed "Do nothing" first in both settings, that way, the default option is the first and it will be easier to add new options in the future without having "Do nothing" in the middle.
Also, I found a problem with the "Close bottom panel" on stop, it was closing the bottom panel only if current panel was Output. It now always closes the bottom panel whatever panel you are on. This changes the behavior of the previous option "Always close on stop". I think it's ok and makes more sense??
Also, I found a problem with the "Close bottom panel" on stop, it was closing the bottom panel only if current panel was Output. It now always closes the bottom panel whatever panel you are on. This changes the behavior of the previous option "Always close on stop". I think it's ok and makes more sense??
This makes sense to me, I could imagine somebody for example messing with the debugger when the game is running and wanting it to close when the game stops
If we dive deep we'd probably find an even better design for all of this but tbh I think it's good enough at this point. This PR solves a bunch of actual reported problems, including mine
I don't know if it's something that will happen automatically when people update editor versions.
It won't. See https://github.com/godotengine/godot-proposals/issues/4444
This last commit adds 2 enums and move the code from editor_debugger_node to editor_node which effectively is much cleaner. thanks @KoBeWi
I understand your concern and like your idea of unread count like the debugger. I think when you start Godot for the first time the default layout has the Output panel open. In fact, I remember as a new user searching how to close this panel at the bottom. My point is if the Ouput panel is there by default, the user should see the output by default because the default setting is Do nothing.
I'm thinking about what @Calinou said and I don't see a lot of possibilities. The easy solution is to change the default value for Action on play to be Open output, which will be equivalent to Godot 4.2.
I'm not sure about the suggestion "I wonder if we should make it so the Output panel is opened if you currently don't have any panel open." because I personally don't use the builtin print. I have a custom print that prints output directly in the game (similar to Unreal) and Godot prints thinks that I don't need.
I'm not sure about the suggestion "I wonder if we should make it so the Output panel is opened if you currently don't have any panel open." because I personally don't use the builtin print.
It could be one of the available options, but IMO it's too specific.
Given the above discussion, I think we can still merge this now to include in 4.3 (despite feature freeze - this is a relatively safe change and with a lot of demand), but given the timeline I would opt for using defaults that match the pre-existing behavior for now.
We won't have much time during the short beta period for collecting user feedback about potential new defaults, so I think it's safer to provide the extra features while keeping the same defaults for 4.3. And we can try out changing the defaults for 4.4 early on the dev cycle, so we have several months to gather and address user feedback.
Wonderful! I changed the default value for Action on play to be Open output, which should match the pre-existing behavior.
Thanks!