Merge pull request #70223 from KoBeWi/condition_of_arguable_usefulness
Remove unnecessary condition
This commit is contained in:
commit
f4eac63bc2
@ -1965,37 +1965,21 @@ void SceneTreeDock::_script_created(Ref<Script> p_script) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Ref<EditorUndoRedoManager> &undo_redo = EditorNode::get_undo_redo();
|
Ref<EditorUndoRedoManager> &undo_redo = EditorNode::get_undo_redo();
|
||||||
if (selected.size() == 1) {
|
undo_redo->create_action(TTR("Attach Script"), UndoRedo::MERGE_DISABLE, selected.front()->get());
|
||||||
Node *node = selected.front()->get();
|
for (Node *E : selected) {
|
||||||
Ref<Script> existing = node->get_script();
|
Ref<Script> existing = E->get_script();
|
||||||
|
undo_redo->add_do_method(InspectorDock::get_singleton(), "store_script_properties", E);
|
||||||
undo_redo->create_action(TTR("Attach Script"), UndoRedo::MERGE_DISABLE, node);
|
undo_redo->add_undo_method(InspectorDock::get_singleton(), "store_script_properties", E);
|
||||||
undo_redo->add_do_method(InspectorDock::get_singleton(), "store_script_properties", node);
|
undo_redo->add_do_method(E, "set_script", p_script);
|
||||||
undo_redo->add_undo_method(InspectorDock::get_singleton(), "store_script_properties", node);
|
undo_redo->add_undo_method(E, "set_script", existing);
|
||||||
undo_redo->add_do_method(node, "set_script", p_script);
|
undo_redo->add_do_method(InspectorDock::get_singleton(), "apply_script_properties", E);
|
||||||
undo_redo->add_undo_method(node, "set_script", existing);
|
undo_redo->add_undo_method(InspectorDock::get_singleton(), "apply_script_properties", E);
|
||||||
undo_redo->add_do_method(InspectorDock::get_singleton(), "apply_script_properties", node);
|
|
||||||
undo_redo->add_undo_method(InspectorDock::get_singleton(), "apply_script_properties", node);
|
|
||||||
undo_redo->add_do_method(this, "_update_script_button");
|
undo_redo->add_do_method(this, "_update_script_button");
|
||||||
undo_redo->add_undo_method(this, "_update_script_button");
|
undo_redo->add_undo_method(this, "_update_script_button");
|
||||||
undo_redo->commit_action();
|
|
||||||
} else {
|
|
||||||
undo_redo->create_action(TTR("Attach Script"), UndoRedo::MERGE_DISABLE, selected.front()->get());
|
|
||||||
for (Node *E : selected) {
|
|
||||||
Ref<Script> existing = E->get_script();
|
|
||||||
undo_redo->add_do_method(InspectorDock::get_singleton(), "store_script_properties", E);
|
|
||||||
undo_redo->add_undo_method(InspectorDock::get_singleton(), "store_script_properties", E);
|
|
||||||
undo_redo->add_do_method(E, "set_script", p_script);
|
|
||||||
undo_redo->add_undo_method(E, "set_script", existing);
|
|
||||||
undo_redo->add_do_method(InspectorDock::get_singleton(), "apply_script_properties", E);
|
|
||||||
undo_redo->add_undo_method(InspectorDock::get_singleton(), "apply_script_properties", E);
|
|
||||||
undo_redo->add_do_method(this, "_update_script_button");
|
|
||||||
undo_redo->add_undo_method(this, "_update_script_button");
|
|
||||||
}
|
|
||||||
undo_redo->commit_action();
|
|
||||||
}
|
}
|
||||||
|
undo_redo->commit_action();
|
||||||
|
|
||||||
_push_item(p_script.operator->());
|
_push_item(p_script.ptr());
|
||||||
_update_script_button();
|
_update_script_button();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user