godot icon indicating copy to clipboard operation
godot copied to clipboard

Add editor setting to keep bottom panel state on play and stop game

Open Hilderin opened this issue 1 year ago • 14 comments

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

image

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

Hilderin avatar Apr 22 '24 23:04 Hilderin

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: image image image

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

Hilderin avatar Apr 25 '24 23:04 Hilderin

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.

akien-mga avatar Apr 26 '24 07:04 akien-mga

"Open Debugger" currently opens the output panel for me

passivestar avatar Apr 26 '24 08:04 passivestar

Also I just randomly found another PR that can be closed when this one is merged: https://github.com/godotengine/godot/pull/66503

passivestar avatar Apr 26 '24 08:04 passivestar

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

akien-mga avatar Apr 26 '24 08:04 akien-mga

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

passivestar avatar Apr 26 '24 08:04 passivestar

"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.

Hilderin avatar Apr 26 '24 09:04 Hilderin

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".

Hilderin avatar Apr 26 '24 09:04 Hilderin

Opening debugger works now

I have this in Output though:

image

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

passivestar avatar Apr 26 '24 09:04 passivestar

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?!?! image

Hilderin avatar Apr 26 '24 10:04 Hilderin

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: image

Hilderin avatar Apr 26 '24 10:04 Hilderin

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

passivestar avatar Apr 26 '24 10:04 passivestar

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

passivestar avatar Apr 26 '24 10:04 passivestar

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??

image image

Hilderin avatar Apr 28 '24 12:04 Hilderin

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

passivestar avatar Apr 29 '24 21:04 passivestar

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

KoBeWi avatar May 24 '24 15:05 KoBeWi

This last commit adds 2 enums and move the code from editor_debugger_node to editor_node which effectively is much cleaner. thanks @KoBeWi

Hilderin avatar May 24 '24 16:05 Hilderin

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.

Hilderin avatar May 27 '24 19:05 Hilderin

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.

Hilderin avatar May 27 '24 20:05 Hilderin

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.

KoBeWi avatar May 27 '24 21:05 KoBeWi

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.

akien-mga avatar May 29 '24 09:05 akien-mga

Wonderful! I changed the default value for Action on play to be Open output, which should match the pre-existing behavior.

Hilderin avatar May 29 '24 09:05 Hilderin

Thanks!

akien-mga avatar May 29 '24 20:05 akien-mga