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

Automatically create folder in project manager create and import #56420

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/classes/EditorSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,9 @@
<member name="project_manager/default_renderer" type="String" setter="" getter="">
The renderer type that will be checked off by default when creating a new project. Accepted strings are "forward_plus", "mobile" or "gl_compatibility".
</member>
<member name="project_manager/directory_naming_convention" type="int" setter="" getter="">
Directory naming convention for the project manager. Options are "No convention" (project name is directory name), "kebab-case" (default), "snake_case", "camelCase", "PascalCase", or "Title Case".
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "kebab-case" (default) the default for filenames? I thought it was snake_case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now, the default is kebab-case and it replaces underscores: t e_s-tt-e-s-t
It would probably be better to keep underscores instead: t e_s-tt-e_s-t

Could be implemented like this: dir_name = project_name.to_lower().replace(" ", "-")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default (kebab-case) is now implemented as to_lower().replace(" ", "-"). So underscores are preserved: t e_s-tt-e_s-t

</member>
<member name="project_manager/sorting_order" type="int" setter="" getter="">
The sorting order to use in the project manager. When changing the sorting order in the project manager, this setting is set permanently in the editor settings.
</member>
Expand Down
1 change: 1 addition & 0 deletions editor/editor_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {

// TRANSLATORS: Project Manager here refers to the tool used to create/manage Godot projects.
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "project_manager/sorting_order", 0, "Last Edited,Name,Path")
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "project_manager/directory_naming_convention", 1, "No convention,kebab-case,snake_case,camelCase,PascalCase,Title Case")

#if defined(WEB_ENABLED)
// Web platform only supports `gl_compatibility`.
Expand Down
7 changes: 4 additions & 3 deletions editor/project_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -618,14 +618,15 @@ void ProjectManager::_new_project() {
}

void ProjectManager::_rename_project() {
const HashSet<String> &selected_list = project_list->get_selected_project_keys();
const Vector<ProjectList::Item> &selected_list = project_list->get_selected_projects();

if (selected_list.size() == 0) {
return;
}

for (const String &E : selected_list) {
project_dialog->set_project_path(E);
for (const ProjectList::Item &E : selected_list) {
project_dialog->set_project_name(E.project_name);
project_dialog->set_project_path(E.path);
project_dialog->set_mode(ProjectDialog::MODE_RENAME);
project_dialog->show_dialog();
}
Expand Down
Loading
Loading