diff options
Diffstat (limited to 'editor/inspector_dock.cpp')
-rw-r--r-- | editor/inspector_dock.cpp | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp index 8ada7e9ba5..2b26851140 100644 --- a/editor/inspector_dock.cpp +++ b/editor/inspector_dock.cpp @@ -68,14 +68,16 @@ void InspectorDock::_menu_option(int p_option) { case OBJECT_COPY_PARAMS: { editor_data->apply_changes_in_editors(); - if (current) + if (current) { editor_data->copy_object_params(current); + } } break; case OBJECT_PASTE_PARAMS: { editor_data->apply_changes_in_editors(); - if (current) + if (current) { editor_data->paste_object_params(current); + } } break; case OBJECT_UNIQUE_RESOURCES: { @@ -85,8 +87,9 @@ void InspectorDock::_menu_option(int p_option) { current->get_property_list(&props); Map<RES, RES> duplicates; for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) { - if (!(E->get().usage & PROPERTY_USAGE_STORAGE)) + if (!(E->get().usage & PROPERTY_USAGE_STORAGE)) { continue; + } Variant v = current->get(E->get().name); if (v.is_ref()) { @@ -169,10 +172,11 @@ void InspectorDock::_save_resource(bool save_as) const { RES current_res = RES(Object::cast_to<Resource>(current_obj)); - if (save_as) + if (save_as) { editor->save_resource_as(current_res); - else + } else { editor->save_resource(current_res); + } } void InspectorDock::_unref_resource() const { @@ -233,9 +237,9 @@ void InspectorDock::_prepare_history() { String text; if (Object::cast_to<Resource>(obj)) { Resource *r = Object::cast_to<Resource>(obj); - if (r->get_path().is_resource_file()) + if (r->get_path().is_resource_file()) { text = r->get_path().get_file(); - else if (r->get_name() != String()) { + } else if (r->get_name() != String()) { text = r->get_name(); } else { text = r->get_class(); @@ -259,8 +263,9 @@ void InspectorDock::_select_history(int p_idx) { //push it to the top, it is not correct, but it's more useful ObjectID id = EditorNode::get_singleton()->get_editor_history()->get_history_obj(p_idx); Object *obj = ObjectDB::get_instance(id); - if (!obj) + if (!obj) { return; + } editor->push_item(obj); } @@ -276,22 +281,25 @@ void InspectorDock::_resource_created() { } void InspectorDock::_resource_selected(const RES &p_res, const String &p_property) { - if (p_res.is_null()) + if (p_res.is_null()) { return; + } RES r = p_res; editor->push_item(r.operator->(), p_property); } void InspectorDock::_edit_forward() { - if (EditorNode::get_singleton()->get_editor_history()->next()) + if (EditorNode::get_singleton()->get_editor_history()->next()) { editor->edit_current(); + } } void InspectorDock::_edit_back() { EditorHistory *editor_history = EditorNode::get_singleton()->get_editor_history(); - if ((current && editor_history->previous()) || editor_history->get_path_size() == 1) + if ((current && editor_history->previous()) || editor_history->get_path_size() == 1) { editor->edit_current(); + } } void InspectorDock::_menu_collapseall() { @@ -308,8 +316,9 @@ void InspectorDock::_property_keyed(const String &p_keyed, const Variant &p_valu void InspectorDock::_transform_keyed(Object *sp, const String &p_sub, const Transform &p_key) { Node3D *s = Object::cast_to<Node3D>(sp); - if (!s) + if (!s) { return; + } AnimationPlayerEditor::singleton->get_track_editor()->insert_transform_key(s, p_sub, p_key); } |