diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_inspector.cpp | 19 | ||||
-rw-r--r-- | editor/editor_inspector.h | 2 | ||||
-rw-r--r-- | editor/plugin_config_dialog.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/asset_library_editor_plugin.cpp | 1 | ||||
-rw-r--r-- | editor/plugins/mesh_instance_3d_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/scene_tree_dock.cpp | 5 |
6 files changed, 21 insertions, 10 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 14185ce2a4..a53938e3f1 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -413,17 +413,21 @@ bool EditorProperty::is_read_only() const { return read_only; } -Variant EditorPropertyRevert::get_property_revert_value(Object *p_object, const StringName &p_property) { +Variant EditorPropertyRevert::get_property_revert_value(Object *p_object, const StringName &p_property, bool *r_is_valid) { if (p_object->has_method("property_can_revert") && p_object->call("property_can_revert", p_property)) { + if (r_is_valid) { + *r_is_valid = true; + } return p_object->call("property_get_revert", p_property); } - return PropertyUtils::get_property_default_value(p_object, p_property); + return PropertyUtils::get_property_default_value(p_object, p_property, r_is_valid); } bool EditorPropertyRevert::can_property_revert(Object *p_object, const StringName &p_property) { - Variant revert_value = EditorPropertyRevert::get_property_revert_value(p_object, p_property); - if (revert_value.get_type() == Variant::NIL) { + bool is_valid_revert = false; + Variant revert_value = EditorPropertyRevert::get_property_revert_value(p_object, p_property, &is_valid_revert); + if (!is_valid_revert) { return false; } Variant current_value = p_object->get(p_property); @@ -637,7 +641,9 @@ void EditorProperty::gui_input(const Ref<InputEvent> &p_event) { } if (revert_rect.has_point(mpos)) { - Variant revert_value = EditorPropertyRevert::get_property_revert_value(object, property); + bool is_valid_revert = false; + Variant revert_value = EditorPropertyRevert::get_property_revert_value(object, property, &is_valid_revert); + ERR_FAIL_COND(!is_valid_revert); emit_changed(property, revert_value); update_property(); } @@ -783,8 +789,9 @@ static bool _is_value_potential_override(Node *p_node, const String &p_property) if (states_stack.size()) { return true; } else { + bool is_valid_default = false; bool is_class_default = false; - PropertyUtils::get_property_default_value(p_node, p_property, &states_stack, false, nullptr, &is_class_default); + PropertyUtils::get_property_default_value(p_node, p_property, &is_valid_default, &states_stack, false, nullptr, &is_class_default); return !is_class_default; } } diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h index f2dfe32f82..d247978649 100644 --- a/editor/editor_inspector.h +++ b/editor/editor_inspector.h @@ -46,7 +46,7 @@ public: static bool get_instantiated_node_original_property(Node *p_node, const StringName &p_prop, Variant &value, bool p_check_class_default = true); static bool is_node_property_different(Node *p_node, const Variant &p_current, const Variant &p_orig); static bool is_property_value_different(const Variant &p_a, const Variant &p_b); - static Variant get_property_revert_value(Object *p_object, const StringName &p_property); + static Variant get_property_revert_value(Object *p_object, const StringName &p_property, bool *r_is_valid); static bool can_property_revert(Object *p_object, const StringName &p_property); }; diff --git a/editor/plugin_config_dialog.cpp b/editor/plugin_config_dialog.cpp index c99b34e0c2..ad22aafb2b 100644 --- a/editor/plugin_config_dialog.cpp +++ b/editor/plugin_config_dialog.cpp @@ -216,6 +216,7 @@ void PluginConfigDialog::config(const String &p_config_path) { active_edit->hide(); Object::cast_to<Label>(active_edit->get_parent()->get_child(active_edit->get_index() - 2))->hide(); subfolder_edit->hide(); + subfolder_validation->hide(); Object::cast_to<Label>(subfolder_edit->get_parent()->get_child(subfolder_edit->get_index() - 2))->hide(); set_title(TTR("Edit a Plugin")); } else { @@ -224,6 +225,7 @@ void PluginConfigDialog::config(const String &p_config_path) { active_edit->show(); Object::cast_to<Label>(active_edit->get_parent()->get_child(active_edit->get_index() - 2))->show(); subfolder_edit->show(); + subfolder_validation->show(); Object::cast_to<Label>(subfolder_edit->get_parent()->get_child(subfolder_edit->get_index() - 2))->show(); set_title(TTR("Create a Plugin")); } diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index 0925b34ac1..951af92467 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -231,6 +231,7 @@ void EditorAssetLibraryItemDescription::configure(const String &p_title, int p_a description->pop(); description->add_text("\n" + TTR("Description:") + "\n\n"); description->append_text(p_description); + description->set_selection_enabled(true); set_title(p_title); } diff --git a/editor/plugins/mesh_instance_3d_editor_plugin.cpp b/editor/plugins/mesh_instance_3d_editor_plugin.cpp index 7a85c5167b..2ce13b717a 100644 --- a/editor/plugins/mesh_instance_3d_editor_plugin.cpp +++ b/editor/plugins/mesh_instance_3d_editor_plugin.cpp @@ -398,7 +398,7 @@ void MeshInstance3DEditor::_create_outline_mesh() { } if (mesh->get_surface_count() == 0) { - err_dialog->set_text(TTR("Mesh has not surface to create outlines from.")); + err_dialog->set_text(TTR("Mesh has no surface to create outlines from.")); err_dialog->popup_centered(); return; } else if (mesh->get_surface_count() == 1 && mesh->surface_get_primitive_type(0) != Mesh::PRIMITIVE_TRIANGLES) { diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 1934850160..14c70c6c50 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -3157,8 +3157,9 @@ void SceneTreeDock::_create_remap_for_node(Node *p_node, Map<RES, RES> &r_remap) states_stack_ready = true; } - Variant orig = PropertyUtils::get_property_default_value(p_node, E.name, &states_stack); - if (!PropertyUtils::is_property_value_different(v, orig)) { + bool is_valid_default = false; + Variant orig = PropertyUtils::get_property_default_value(p_node, E.name, &is_valid_default, &states_stack); + if (is_valid_default && !PropertyUtils::is_property_value_different(v, orig)) { continue; } |