|
@@ -3923,6 +3923,12 @@ void EditorInspector::_notification(int p_what) {
|
|
}
|
|
}
|
|
} break;
|
|
} break;
|
|
|
|
|
|
|
|
+ case NOTIFICATION_THEME_CHANGED: {
|
|
|
|
+ if (add_meta_error_panel) {
|
|
|
|
+ add_meta_error_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree")));
|
|
|
|
+ }
|
|
|
|
+ } break;
|
|
|
|
+
|
|
case NOTIFICATION_PREDELETE: {
|
|
case NOTIFICATION_PREDELETE: {
|
|
edit(nullptr); //just in case
|
|
edit(nullptr); //just in case
|
|
} break;
|
|
} break;
|
|
@@ -4103,13 +4109,16 @@ void EditorInspector::_show_add_meta_dialog() {
|
|
|
|
|
|
VBoxContainer *vbc = memnew(VBoxContainer);
|
|
VBoxContainer *vbc = memnew(VBoxContainer);
|
|
add_meta_dialog->add_child(vbc);
|
|
add_meta_dialog->add_child(vbc);
|
|
|
|
+
|
|
HBoxContainer *hbc = memnew(HBoxContainer);
|
|
HBoxContainer *hbc = memnew(HBoxContainer);
|
|
vbc->add_child(hbc);
|
|
vbc->add_child(hbc);
|
|
hbc->add_child(memnew(Label(TTR("Name:"))));
|
|
hbc->add_child(memnew(Label(TTR("Name:"))));
|
|
|
|
+
|
|
add_meta_name = memnew(LineEdit);
|
|
add_meta_name = memnew(LineEdit);
|
|
add_meta_name->set_custom_minimum_size(Size2(200 * EDSCALE, 1));
|
|
add_meta_name->set_custom_minimum_size(Size2(200 * EDSCALE, 1));
|
|
hbc->add_child(add_meta_name);
|
|
hbc->add_child(add_meta_name);
|
|
hbc->add_child(memnew(Label(TTR("Type:"))));
|
|
hbc->add_child(memnew(Label(TTR("Type:"))));
|
|
|
|
+
|
|
add_meta_type = memnew(OptionButton);
|
|
add_meta_type = memnew(OptionButton);
|
|
for (int i = 0; i < Variant::VARIANT_MAX; i++) {
|
|
for (int i = 0; i < Variant::VARIANT_MAX; i++) {
|
|
if (i == Variant::NIL || i == Variant::RID || i == Variant::CALLABLE || i == Variant::SIGNAL) {
|
|
if (i == Variant::NIL || i == Variant::RID || i == Variant::CALLABLE || i == Variant::SIGNAL) {
|
|
@@ -4120,12 +4129,24 @@ void EditorInspector::_show_add_meta_dialog() {
|
|
add_meta_type->add_icon_item(get_theme_icon(type, "EditorIcons"), type, i);
|
|
add_meta_type->add_icon_item(get_theme_icon(type, "EditorIcons"), type, i);
|
|
}
|
|
}
|
|
hbc->add_child(add_meta_type);
|
|
hbc->add_child(add_meta_type);
|
|
|
|
+
|
|
|
|
+ Control *spacing = memnew(Control);
|
|
|
|
+ vbc->add_child(spacing);
|
|
|
|
+ spacing->set_custom_minimum_size(Size2(0, 10 * EDSCALE));
|
|
|
|
+
|
|
add_meta_dialog->set_ok_button_text(TTR("Add"));
|
|
add_meta_dialog->set_ok_button_text(TTR("Add"));
|
|
add_child(add_meta_dialog);
|
|
add_child(add_meta_dialog);
|
|
add_meta_dialog->register_text_enter(add_meta_name);
|
|
add_meta_dialog->register_text_enter(add_meta_name);
|
|
add_meta_dialog->connect("confirmed", callable_mp(this, &EditorInspector::_add_meta_confirm));
|
|
add_meta_dialog->connect("confirmed", callable_mp(this, &EditorInspector::_add_meta_confirm));
|
|
|
|
+
|
|
|
|
+ add_meta_error_panel = memnew(PanelContainer);
|
|
|
|
+ vbc->add_child(add_meta_error_panel);
|
|
|
|
+ if (is_inside_tree()) {
|
|
|
|
+ add_meta_error_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("Tree")));
|
|
|
|
+ }
|
|
|
|
+
|
|
add_meta_error = memnew(Label);
|
|
add_meta_error = memnew(Label);
|
|
- vbc->add_child(add_meta_error);
|
|
|
|
|
|
+ add_meta_error_panel->add_child(add_meta_error);
|
|
|
|
|
|
add_meta_name->connect("text_changed", callable_mp(this, &EditorInspector::_check_meta_name));
|
|
add_meta_name->connect("text_changed", callable_mp(this, &EditorInspector::_check_meta_name));
|
|
}
|
|
}
|