diff options
Diffstat (limited to 'editor/editor_properties.cpp')
-rw-r--r-- | editor/editor_properties.cpp | 62 |
1 files changed, 22 insertions, 40 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 68a3fabe1e..b495d29911 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -110,9 +110,6 @@ EditorPropertyText::EditorPropertyText() { add_focusable(text); text->connect("text_changed", callable_mp(this, &EditorPropertyText::_text_changed)); text->connect("text_submitted", callable_mp(this, &EditorPropertyText::_text_submitted)); - - string_name = false; - updating = false; } ///////////////////// MULTILINE TEXT ///////////////////////// @@ -500,9 +497,6 @@ EditorPropertyPath::EditorPropertyPath() { add_focusable(path); dialog = nullptr; path_edit->connect("pressed", callable_mp(this, &EditorPropertyPath::_path_pressed)); - folder = false; - global = false; - save_mode = false; } ///////////////////// CLASS NAME ///////////////////////// @@ -1185,7 +1179,7 @@ void EditorPropertyLayers::_button_pressed() { } Rect2 gp = button->get_screen_rect(); - layers->set_as_minsize(); + layers->reset_size(); Vector2 popup_pos = gp.position - Vector2(layers->get_contents_minimum_size().x, 0); layers->set_position(popup_pos); layers->popup(); @@ -1278,7 +1272,6 @@ EditorPropertyInteger::EditorPropertyInteger() { add_child(spin); add_focusable(spin); spin->connect("value_changed", callable_mp(this, &EditorPropertyInteger::_value_changed)); - setting = false; } ///////////////////// OBJECT ID ///////////////////////// @@ -1587,10 +1580,6 @@ EditorPropertyEasing::EditorPropertyEasing() { spin->get_line_edit()->connect("focus_exited", callable_mp(this, &EditorPropertyEasing::_spin_focus_exited)); spin->hide(); add_child(spin); - - dragging = false; - flip = false; - full = false; } ///////////////////// VECTOR2 ///////////////////////// @@ -1626,7 +1615,7 @@ void EditorPropertyVector2::_notification(int p_what) { case NOTIFICATION_THEME_CHANGED: { const Color *colors = _get_property_colors(); for (int i = 0; i < 2; i++) { - spin[i]->set_custom_label_color(true, colors[i]); + spin[i]->add_theme_color_override("label_color", colors[i]); } } break; } @@ -1680,7 +1669,6 @@ EditorPropertyVector2::EditorPropertyVector2(bool p_force_wide) { if (!horizontal) { set_label_reference(spin[0]); //show text and buttons around this } - setting = false; } ///////////////////// RECT2 ///////////////////////// @@ -1720,7 +1708,7 @@ void EditorPropertyRect2::_notification(int p_what) { case NOTIFICATION_THEME_CHANGED: { const Color *colors = _get_property_colors(); for (int i = 0; i < 4; i++) { - spin[i]->set_custom_label_color(true, colors[i % 2]); + spin[i]->add_theme_color_override("label_color", colors[i % 2]); } } break; } @@ -1784,7 +1772,6 @@ EditorPropertyRect2::EditorPropertyRect2(bool p_force_wide) { if (!horizontal) { set_label_reference(spin[0]); //show text and buttons around this } - setting = false; } ///////////////////// VECTOR3 ///////////////////////// @@ -1849,7 +1836,7 @@ void EditorPropertyVector3::_notification(int p_what) { case NOTIFICATION_THEME_CHANGED: { const Color *colors = _get_property_colors(); for (int i = 0; i < 3; i++) { - spin[i]->set_custom_label_color(true, colors[i]); + spin[i]->add_theme_color_override("label_color", colors[i]); } } break; } @@ -1939,7 +1926,7 @@ void EditorPropertyVector2i::_notification(int p_what) { case NOTIFICATION_THEME_CHANGED: { const Color *colors = _get_property_colors(); for (int i = 0; i < 2; i++) { - spin[i]->set_custom_label_color(true, colors[i]); + spin[i]->add_theme_color_override("label_color", colors[i]); } } break; } @@ -1993,7 +1980,6 @@ EditorPropertyVector2i::EditorPropertyVector2i(bool p_force_wide) { if (!horizontal) { set_label_reference(spin[0]); //show text and buttons around this } - setting = false; } ///////////////////// RECT2i ///////////////////////// @@ -2033,7 +2019,7 @@ void EditorPropertyRect2i::_notification(int p_what) { case NOTIFICATION_THEME_CHANGED: { const Color *colors = _get_property_colors(); for (int i = 0; i < 4; i++) { - spin[i]->set_custom_label_color(true, colors[i % 2]); + spin[i]->add_theme_color_override("label_color", colors[i % 2]); } } break; } @@ -2097,7 +2083,6 @@ EditorPropertyRect2i::EditorPropertyRect2i(bool p_force_wide) { if (!horizontal) { set_label_reference(spin[0]); //show text and buttons around this } - setting = false; } ///////////////////// VECTOR3i ///////////////////////// @@ -2135,7 +2120,7 @@ void EditorPropertyVector3i::_notification(int p_what) { case NOTIFICATION_THEME_CHANGED: { const Color *colors = _get_property_colors(); for (int i = 0; i < 3; i++) { - spin[i]->set_custom_label_color(true, colors[i]); + spin[i]->add_theme_color_override("label_color", colors[i]); } } break; } @@ -2188,7 +2173,6 @@ EditorPropertyVector3i::EditorPropertyVector3i(bool p_force_wide) { if (!horizontal) { set_label_reference(spin[0]); //show text and buttons around this } - setting = false; } ///////////////////// PLANE ///////////////////////// @@ -2228,7 +2212,7 @@ void EditorPropertyPlane::_notification(int p_what) { case NOTIFICATION_THEME_CHANGED: { const Color *colors = _get_property_colors(); for (int i = 0; i < 4; i++) { - spin[i]->set_custom_label_color(true, colors[i]); + spin[i]->add_theme_color_override("label_color", colors[i]); } } break; } @@ -2282,7 +2266,6 @@ EditorPropertyPlane::EditorPropertyPlane(bool p_force_wide) { if (!horizontal) { set_label_reference(spin[0]); //show text and buttons around this } - setting = false; } ///////////////////// QUATERNION ///////////////////////// @@ -2322,7 +2305,7 @@ void EditorPropertyQuaternion::_notification(int p_what) { case NOTIFICATION_THEME_CHANGED: { const Color *colors = _get_property_colors(); for (int i = 0; i < 4; i++) { - spin[i]->set_custom_label_color(true, colors[i]); + spin[i]->add_theme_color_override("label_color", colors[i]); } } break; } @@ -2373,7 +2356,6 @@ EditorPropertyQuaternion::EditorPropertyQuaternion() { if (!horizontal) { set_label_reference(spin[0]); //show text and buttons around this } - setting = false; } ///////////////////// AABB ///////////////////////// @@ -2419,7 +2401,7 @@ void EditorPropertyAABB::_notification(int p_what) { case NOTIFICATION_THEME_CHANGED: { const Color *colors = _get_property_colors(); for (int i = 0; i < 6; i++) { - spin[i]->set_custom_label_color(true, colors[i % 3]); + spin[i]->add_theme_color_override("label_color", colors[i % 3]); } } break; } @@ -2457,7 +2439,6 @@ EditorPropertyAABB::EditorPropertyAABB() { spin[i]->connect("value_changed", callable_mp(this, &EditorPropertyAABB::_value_changed), varray(desc[i])); } set_bottom_editor(g); - setting = false; } ///////////////////// TRANSFORM2D ///////////////////////// @@ -2505,9 +2486,9 @@ void EditorPropertyTransform2D::_notification(int p_what) { for (int i = 0; i < 6; i++) { // For Transform2D, use the 4th color (cyan) for the origin vector. if (i % 3 == 2) { - spin[i]->set_custom_label_color(true, colors[3]); + spin[i]->add_theme_color_override("label_color", colors[3]); } else { - spin[i]->set_custom_label_color(true, colors[i % 3]); + spin[i]->add_theme_color_override("label_color", colors[i % 3]); } } } break; @@ -2547,7 +2528,6 @@ EditorPropertyTransform2D::EditorPropertyTransform2D(bool p_include_origin) { spin[i]->connect("value_changed", callable_mp(this, &EditorPropertyTransform2D::_value_changed), varray(desc[i])); } set_bottom_editor(g); - setting = false; } ///////////////////// BASIS ///////////////////////// @@ -2599,7 +2579,7 @@ void EditorPropertyBasis::_notification(int p_what) { case NOTIFICATION_THEME_CHANGED: { const Color *colors = _get_property_colors(); for (int i = 0; i < 9; i++) { - spin[i]->set_custom_label_color(true, colors[i % 3]); + spin[i]->add_theme_color_override("label_color", colors[i % 3]); } } break; } @@ -2636,7 +2616,6 @@ EditorPropertyBasis::EditorPropertyBasis() { spin[i]->connect("value_changed", callable_mp(this, &EditorPropertyBasis::_value_changed), varray(desc[i])); } set_bottom_editor(g); - setting = false; } ///////////////////// TRANSFORM ///////////////////////// @@ -2696,7 +2675,7 @@ void EditorPropertyTransform3D::_notification(int p_what) { case NOTIFICATION_THEME_CHANGED: { const Color *colors = _get_property_colors(); for (int i = 0; i < 12; i++) { - spin[i]->set_custom_label_color(true, colors[i % 4]); + spin[i]->add_theme_color_override("label_color", colors[i % 4]); } } break; } @@ -2733,7 +2712,6 @@ EditorPropertyTransform3D::EditorPropertyTransform3D() { spin[i]->connect("value_changed", callable_mp(this, &EditorPropertyTransform3D::_value_changed), varray(desc[i])); } set_bottom_editor(g); - setting = false; } ////////////// COLOR PICKER ////////////////////// @@ -2969,7 +2947,6 @@ EditorPropertyNodePath::EditorPropertyNodePath() { clear->set_flat(true); clear->connect("pressed", callable_mp(this, &EditorPropertyNodePath::_node_clear)); hbc->add_child(clear); - use_path_from_scene_root = false; scene_tree = nullptr; //do not allocate unnecessarily } @@ -3059,7 +3036,7 @@ void EditorPropertyResource::_sub_inspector_property_keyed(const String &p_prope // The second parameter could be null, causing the event to fire with less arguments, so use the pointer call which preserves it. const Variant args[3] = { String(get_edited_property()) + ":" + p_property, p_value, p_advance }; const Variant *argp[3] = { &args[0], &args[1], &args[2] }; - emit_signal(SNAME("property_keyed_with_value"), argp, 3); + emit_signalp(SNAME("property_keyed_with_value"), argp, 3); } void EditorPropertyResource::_sub_inspector_resource_selected(const RES &p_resource, const String &p_property) { @@ -3738,8 +3715,13 @@ EditorProperty *EditorInspectorDefaultPlugin::get_editor_for_property(Object *p_ } break; case Variant::DICTIONARY: { - EditorPropertyDictionary *editor = memnew(EditorPropertyDictionary); - return editor; + if (p_hint == PROPERTY_HINT_LOCALIZABLE_STRING) { + EditorPropertyLocalizableString *editor = memnew(EditorPropertyLocalizableString); + return editor; + } else { + EditorPropertyDictionary *editor = memnew(EditorPropertyDictionary); + return editor; + } } break; case Variant::ARRAY: { EditorPropertyArray *editor = memnew(EditorPropertyArray); |