Remove unnecessary assignments
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
This commit is contained in:
parent
aa5b6ed13e
commit
80fb8db31f
19 changed files with 31 additions and 56 deletions
|
|
@ -5613,8 +5613,7 @@ void CanvasItemEditorViewport::_on_change_type_closed() {
|
|||
void CanvasItemEditorViewport::_create_preview(const Vector<String> &files) const {
|
||||
bool add_preview = false;
|
||||
for (int i = 0; i < files.size(); i++) {
|
||||
String path = files[i];
|
||||
Ref<Resource> res = ResourceLoader::load(path);
|
||||
Ref<Resource> res = ResourceLoader::load(files[i]);
|
||||
ERR_FAIL_COND(res.is_null());
|
||||
Ref<Texture2D> texture = Ref<Texture2D>(Object::cast_to<Texture2D>(*res));
|
||||
Ref<PackedScene> scene = Ref<PackedScene>(Object::cast_to<PackedScene>(*res));
|
||||
|
|
|
|||
|
|
@ -4154,8 +4154,7 @@ Node *Node3DEditorViewport::_sanitize_preview_node(Node *p_node) const {
|
|||
void Node3DEditorViewport::_create_preview_node(const Vector<String> &files) const {
|
||||
bool add_preview = false;
|
||||
for (int i = 0; i < files.size(); i++) {
|
||||
String path = files[i];
|
||||
Ref<Resource> res = ResourceLoader::load(path);
|
||||
Ref<Resource> res = ResourceLoader::load(files[i]);
|
||||
ERR_CONTINUE(res.is_null());
|
||||
Ref<PackedScene> scene = Ref<PackedScene>(Object::cast_to<PackedScene>(*res));
|
||||
Ref<Mesh> mesh = Ref<Mesh>(Object::cast_to<Mesh>(*res));
|
||||
|
|
|
|||
|
|
@ -86,8 +86,7 @@ bool TileSetEditor::_can_drop_data_fw(const Point2 &p_point, const Variant &p_da
|
|||
}
|
||||
|
||||
for (int i = 0; i < files.size(); i++) {
|
||||
String file = files[i];
|
||||
String ftype = EditorFileSystem::get_singleton()->get_file_type(file);
|
||||
String ftype = EditorFileSystem::get_singleton()->get_file_type(files[i]);
|
||||
|
||||
if (!ClassDB::is_parent_class(ftype, "Texture2D")) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -479,8 +479,7 @@ bool TileSetScenesCollectionSourceEditor::_can_drop_data_fw(const Point2 &p_poin
|
|||
}
|
||||
|
||||
for (int i = 0; i < files.size(); i++) {
|
||||
String file = files[i];
|
||||
String ftype = EditorFileSystem::get_singleton()->get_file_type(file);
|
||||
String ftype = EditorFileSystem::get_singleton()->get_file_type(files[i]);
|
||||
|
||||
if (!ClassDB::is_parent_class(ftype, "PackedScene")) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -4826,16 +4826,14 @@ void VisualShaderEditor::_varying_create() {
|
|||
add_varying_dialog->hide();
|
||||
}
|
||||
|
||||
void VisualShaderEditor::_varying_name_changed(const String &p_text) {
|
||||
String name = p_text;
|
||||
|
||||
if (!name.is_valid_identifier()) {
|
||||
void VisualShaderEditor::_varying_name_changed(const String &p_name) {
|
||||
if (!p_name.is_valid_identifier()) {
|
||||
varying_error_label->show();
|
||||
varying_error_label->set_text(TTR("Invalid name for varying."));
|
||||
add_varying_dialog->get_ok_button()->set_disabled(true);
|
||||
return;
|
||||
}
|
||||
if (visual_shader->has_varying(name)) {
|
||||
if (visual_shader->has_varying(p_name)) {
|
||||
varying_error_label->show();
|
||||
varying_error_label->set_text(TTR("Varying with that name is already exist."));
|
||||
add_varying_dialog->get_ok_button()->set_disabled(true);
|
||||
|
|
|
|||
|
|
@ -491,7 +491,7 @@ class VisualShaderEditor : public VBoxContainer {
|
|||
void _member_cancel();
|
||||
|
||||
void _varying_create();
|
||||
void _varying_name_changed(const String &p_text);
|
||||
void _varying_name_changed(const String &p_name);
|
||||
void _varying_deleted();
|
||||
void _varying_selected();
|
||||
void _varying_unselected();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue