Name new resource files with snake_case
This commit is contained in:
parent
bdcc8741e4
commit
ae7a74625d
@ -1168,7 +1168,8 @@ void EditorNode::save_resource_as(const Ref<Resource> &p_resource, const String
|
|||||||
file->set_current_file(p_resource->get_path().get_file());
|
file->set_current_file(p_resource->get_path().get_file());
|
||||||
} else {
|
} else {
|
||||||
if (extensions.size()) {
|
if (extensions.size()) {
|
||||||
file->set_current_file("new_" + p_resource->get_class().to_lower() + "." + preferred.front()->get().to_lower());
|
String resource_name_snake_case = p_resource->get_class().camelcase_to_underscore();
|
||||||
|
file->set_current_file("new_" + resource_name_snake_case + "." + preferred.front()->get().to_lower());
|
||||||
} else {
|
} else {
|
||||||
file->set_current_file(String());
|
file->set_current_file(String());
|
||||||
}
|
}
|
||||||
@ -1184,7 +1185,8 @@ void EditorNode::save_resource_as(const Ref<Resource> &p_resource, const String
|
|||||||
} else if (preferred.size()) {
|
} else if (preferred.size()) {
|
||||||
String existing;
|
String existing;
|
||||||
if (extensions.size()) {
|
if (extensions.size()) {
|
||||||
existing = "new_" + p_resource->get_class().to_lower() + "." + preferred.front()->get().to_lower();
|
String resource_name_snake_case = p_resource->get_class().camelcase_to_underscore();
|
||||||
|
existing = "new_" + resource_name_snake_case + "." + preferred.front()->get().to_lower();
|
||||||
}
|
}
|
||||||
file->set_current_path(existing);
|
file->set_current_path(existing);
|
||||||
}
|
}
|
||||||
|
@ -408,7 +408,8 @@ void AnimationPlayerEditor::_animation_save_as(const Ref<Resource> &p_resource)
|
|||||||
if (p_resource->get_name() != "") {
|
if (p_resource->get_name() != "") {
|
||||||
path = p_resource->get_name() + "." + extensions.front()->get().to_lower();
|
path = p_resource->get_name() + "." + extensions.front()->get().to_lower();
|
||||||
} else {
|
} else {
|
||||||
path = "new_" + p_resource->get_class().to_lower() + "." + extensions.front()->get().to_lower();
|
String resource_name_snake_case = p_resource->get_class().camelcase_to_underscore();
|
||||||
|
path = "new_" + resource_name_snake_case + "." + extensions.front()->get().to_lower();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user