godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
86.64k stars 19.32k forks source link

F5 and F6 shortcuts do not reload the scene when focused on the running project window #91705

Open SlyBew opened 2 months ago

SlyBew commented 2 months ago

Tested versions

Godot v4.2.2.stable

System information

Godot v4.2.2.stable - Windows 10.0.22631 - Vulkan (Mobile) - integrated Intel(R) Iris(R) Plus Graphics (Intel Corporation; 31.0.101.2125) - Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz (8 Threads)

Issue description

When you try to reload the played scene using the F5 or F6 shortcut, the 'reload the played scene' does not reload. You have to click the button to reload the current scene.

Steps to reproduce

When you Run Project or Run Current Scene, either via the button, or the F5/F6 shortcuts, the game plays. The Run Project or Run Current Scene icon then changes to a reload icon. If you attempt to reload the scene by clicking the icon, it reloads as expected. If you try to use the F5/F6 shortcut it does not reload the scene.

Minimal reproduction project (MRP)

N/A

AThousandShips commented 2 months ago

To confirm, you are pressing the key while having the editor focused and not the running game?

SlyBew commented 2 months ago

I have the game window set to Always on Top, so this is in focus. I assume this is therefor the expected behaviour. Sorry.

SlyBew commented 1 month ago

Having said that, with the game window in focus (the game running) I can press F8 to stop Running Project, so if I can use the F8 shortcut logic would suggest I should be able to use the F5/F6 short cuts in exactly the same way?

AThousandShips commented 1 month ago

I don't know if the F8 key should be a thing, and I don't think the F5/F6 ones should either, but I'm not sure, but unless the F5/F6 keys are documented to work with the game focused, or used to work like that, this would be an enhancement and not a bug

Edit: This key is a separate one, this is the debugger stop shortcut, which defaults to F8 as well, and is unrelated to the editor one

Borges-IST-2003 commented 3 weeks ago

I'm trying to implement this feature tho I'm having some difficulty understanding how the scene is ran, where does the scene starts being ran and how I can change a flag or return a value to the editor to indicate that I want to run the default scene or the current scene. Can someone explain how the program flow works please?

AThousandShips commented 3 weeks ago

It's run in editor/run.cpp and editor/run_native.cpp

Borges-IST-2003 commented 2 weeks ago

I'm trying to call the editor_run_bar methods stop_playing() and play_main_scene() from the editor_debugger_node, however, the scene is stopping, but isnt being ran after, why could that be?

Andre-Tita commented 1 week ago

https://github.com/godotengine/godot/pull/93776

SlyBew commented 6 days ago

I don't quite understand the whole GitHub workflow, however it looks like @Andre-Tita did some amazing work on this, and within 2 months is why I am starting to understand the benefits of FOSS and community driven.

Thank you so much for working on it, regardless of whether they decide to merge or not; I appreciate the effort!