godot icon indicating copy to clipboard operation
godot copied to clipboard

"Create New Scene" dialog doesn't follow naming conventions

Open nyxkn opened this issue 2 years ago • 8 comments

Godot version

master (46424488e)

System information

Godot v4.1.rc (46424488e) - Arch Linux #1 ZEN SMP PREEMPT_DYNAMIC Wed, 21 Jun 2023 20:46:07 +0000 - Vulkan (Compatibility) - AMD Radeon R9 380 Series (tonga, LLVM 15.0.7, DRM 3.52, 6.3.9-zen1-1-zen) () - AMD Ryzen 5 5600X 6-Core Processor (12 Threads)

Issue description

This is the dialog that shows up when you right click in the FileSystem dock and select Create New -> Scene...

We are prompted for a required filename to save the scene as, and an optional root name to use for the root node. If I leave the optional name empty, and use a snake_case name for the filename, the root node of the scene will also be set to the same snake_case name. I'd instead expect to have it converted to PascalCase.

Note that this only happens through this specific dialog. Creating a scene through main menu Scene -> New Scene creates an "unsaved" scene with a PascalCase root node, and when saved, it will correctly be renamed to snake_case.

Steps to reproduce

In FileSystem dock, right click and select Create New -> Scene....

Minimal reproduction project

None.

nyxkn avatar Jul 02 '23 12:07 nyxkn

The tooltip simply says it will use the scene name, so there's no indication it will change any format

AThousandShips avatar Jul 02 '23 12:07 AThousandShips

Be aware of editor/naming/node_name_casing and editor/naming/scene_name_casing. If this is implemented, it should follow those.

theraot avatar Jul 02 '23 13:07 theraot

The tooltip simply says it will use the scene name, so there's no indication it will change any format

Right. I wouldn't expect any case change to happen if we were to manually fill in the root node name. But if left empty I'd assume it would get auto-guessed correctly.

nyxkn avatar Jul 02 '23 13:07 nyxkn

It doesn't say that though, it says "Leave empty to use scene name", so the assumption is unfounded, hence enhancement not bug

AThousandShips avatar Jul 02 '23 13:07 AThousandShips

Fair.

In my mind, since I'm used to the case always changing between node and filename, the concept of "scene name" exists outside of case choice. But I can see how the literal interpretation of "scene name" in the context of this dialog would rather refer to the filename. Mostly because "Scene Name" identifies the filename in the other textbox.

Screenshot to aid in discussion:

2023-07-02_151326_427974065

Maybe the wording needs to be changed? What if the "Scene Name" textbox was labelled "Scene Filename" instead? Could the tooltip's "scene name" then be more readily thought of as the generic concept of the name rather than the specific filename / case choice? Or maybe the tooltip needs to change?

nyxkn avatar Jul 02 '23 14:07 nyxkn

After some thinking, this is what I've come up with for the dialog:

2023-07-10_170126_001374341

"Scene Name" is changed to "File Name". And the tooltip now reads "Leave empty to infer from file name"

To me it seems more clear this way. Thoughts?

nyxkn avatar Jul 10 '23 16:07 nyxkn

~~I'd also like to extend this issue to the "Attach Node Script" dialog, opened from right clicking on a scene node -> "Attach Script". The path of the script should be auto-guessed respecting the casing choices. The fix is analogous to this one, simply adding a call to the adjust case functions.~~

~~As a side note, the editor setting for the filename casing is "scene name casing", but if we are to use this for the script name as well (which should follow the same rules as the scene filename), then maybe it could be more appropriately renamed as "file name casing"?~~

EDIT: this is covered more in-depth in https://github.com/godotengine/godot-proposals/issues/1211 and #78119.

nyxkn avatar Jul 10 '23 16:07 nyxkn

The script part is already covered in https://github.com/godotengine/godot/issues/39441.

Calinou avatar Jul 10 '23 16:07 Calinou

Closed by #79756 ? Alternative wording suggested in https://github.com/godotengine/godot/issues/78946#issuecomment-1629260967 might still be nicer. But good enough for me.

nyxkn avatar Sep 22 '23 09:09 nyxkn