Skip to content
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

Make C# script names default to PascalCase in the "attach new script" popup #5956

Closed
lewiji opened this issue Dec 18, 2022 · 4 comments · Fixed by godotengine/godot#78119
Closed

Comments

@lewiji
Copy link

lewiji commented Dec 18, 2022

Describe the project you are working on

Any Godot 4 C# project

Describe the problem or limitation you are having in your project

This PR:

godotengine/godot#52597

Changed the behaviour of this script creation dialog to autofill the script filename with a lowercased version of the node name. This changed previous behaviour in 3.x which respected the node name casing setting.

C# documentation recommends, and most C# developers use the PascalCase convention for class names, and Godot expects C# source filenames to match their class names to work.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Change the behaviour of the dialogue to suggest PascalCase when switching to the C# script type and lowercase when switching to gdscript.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Either revert to the old behaviour of the dialog when the c# script type is selected, or else add a configurable option for how this name is determined in all cases.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No

Is there a reason why this should be core and not an add-on in the asset library?

This is a core godot component.

@lewiji
Copy link
Author

lewiji commented Dec 18, 2022

I've just realised this isn't quite what I thought it was; the change is for scene filenames, and creating a script on the root node of a scene tries to use the scene filename instead of the node name. You can indeed change the project settings to make scene filenames PascalCase instead. I suppose someone might want snake case scene names and PascalCase script names if working with C#, but I interpreted the problem incorrectly, so I'm going to close this.

@lewiji lewiji closed this as completed Dec 18, 2022
@lewiji
Copy link
Author

lewiji commented Dec 18, 2022

Ok, I've heard from a couple of people that this actually did impact them as they prefer snake case resource names, but there's no option to default to PascalCase script names. Reopening!

@lewiji lewiji reopened this Dec 18, 2022
@brunoamancio
Copy link

Nothing else matters other than if the script being created is c#, PascalCase

@Calinou
Copy link
Member

Calinou commented Dec 18, 2022

Related to #5446.

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

Successfully merging a pull request may close this issue.

5 participants