Skip to content

Support creating new scene autoloads from menu #107456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Zshandi
Copy link
Contributor

@Zshandi Zshandi commented Jun 12, 2025

Fixes #107131

Update the test for the file picker to make it clear it supports scripts and scenes
Update the "Add" button to open a drop-down instead of just adding a script

  • The drop-down has options for both "Script" and "Scene"
  • "Scene" opens the usual scene creation popup, but with one change
  • Create scene window updated to allow calling into it from the autoloads section
    Create scene window allows editing the directory via a new "Scene Path" field
  • Only allows entering a directory, not the full file path
  • This is a config option, so the regular create scene window (accessed from the File Browser) still functions exactly as it did

@Zshandi Zshandi requested a review from a team as a code owner June 12, 2025 14:17
@AThousandShips AThousandShips changed the title Update autoload to include scene Support creating new scene autoloads from menu Jun 12, 2025
@AThousandShips AThousandShips added this to the 4.x milestone Jun 12, 2025
@Zshandi
Copy link
Contributor Author

Zshandi commented Jun 12, 2025

Only my second Godot PR, so I'm very open to feedback and suggestions!

One thing in particular I wasn't super sure about was whether, for the create scene window, I should add a separate field for the directory or just include it in the "Scene Name" one instead. I decided to go with making it separate so that it can easily just be a config option and not affect the regular Create Scene dialog. Also, this was necessary, since otherwise there would be no way from the autoload window to create a scene in a sub-directory (in the regular one you can right-click the sub-folder so you don't need to worry about it).

If we'd rather just overhaul the scene creation a bit to just have one "Scene Path" that includes the directory and file name, then I'd be totally fine and would help with that too, just wanted to keep the changes here to a minimal to start 🙂

Another thing I wasn't sure about was the name "Scene Path". I chose that because "Path" is more OS-agnostic than "Directory" or "Folder". However, this has the downside that a "Path" is more generic and could include the file name as well. Feel free to give me your opinion on if that should be changed (provided we don't decide to go with a totally different approach).

@AThousandShips
Copy link
Member

See also:

@Zshandi
Copy link
Contributor Author

Zshandi commented Jun 15, 2025

See also:

Nice! I'll check that out and can probably close this one then. I'm sure it's better than what I've done, since I was trying not to change too much.

I'm still glad I did this though as it gave me a chance to gain some experience in working on the Godot UI 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autoload UI makes it seem like you can only use scripts
2 participants