Skip to content

Attach script dialog now respects user case choice - #79303

Closed
nyxkn wants to merge 1 commit into
godotengine:masterfrom
nyxkn:attach-script-case
Closed

Attach script dialog now respects user case choice#79303
nyxkn wants to merge 1 commit into
godotengine:masterfrom
nyxkn:attach-script-case

Conversation

@nyxkn

@nyxkn nyxkn commented Jul 10, 2023

Copy link
Copy Markdown

In the "Attach Node Script" dialog, the suggested file name will now respect user choice of case, as per the scene_name_casing setting.

This makes the naming behaviour consistent even when attaching a script to a new scene that wasn't already saved to any file path.

Resolves #39441 ?

when attaching a new script, the script filename path will now respect
the choice of case for file names
@RedMser

RedMser commented Jul 10, 2023

Copy link
Copy Markdown
Contributor

I implemented this in #78119 as well, but my approach adds a new setting which also allows for auto-detecting based on language (so C# uses PascalCase but GDScript uses snake_case).

@nyxkn

nyxkn commented Jul 11, 2023

Copy link
Copy Markdown
Author

Nice! I was also wondering about the setting. My thought was that it might be ideal to rename the current "scene name casing" setting to "file name casing" or similar, and let it apply for both scenes and scripts? And actually probably for any other file that the editor creates. Or is it desirable to treat script names differently?

@RedMser

RedMser commented Jul 11, 2023

Copy link
Copy Markdown
Contributor

Or is it desirable to treat script names differently?

Differently from the chosen scene file name convention? Yes definitely, since many language's IDEs/linters will complain about incorrect file naming schemes if they don't match the language's conventions.

Whether the auto-detection behavior in my implementation should be "the default / the only way it works", or an editor setting, is up to debate. I personally followed the superseded PR there, but it's not strictly necessary to go against conventions.

@nyxkn

nyxkn commented Jul 11, 2023

Copy link
Copy Markdown
Author

Good point. Then your work on #78119 seems more appropriate!

@nyxkn nyxkn closed this Jul 11, 2023
@AThousandShips AThousandShips removed this from the 4.x milestone Jul 11, 2023
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.

Inconsistent file naming convention between docs and editor when attaching a script to a node

3 participants