summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/create_dialog.cpp2
-rw-r--r--editor/editor_help.cpp2
-rw-r--r--editor/editor_inspector.cpp5
-rw-r--r--editor/editor_properties.cpp25
-rw-r--r--editor/editor_properties.h3
-rw-r--r--editor/multi_node_edit.cpp2
-rw-r--r--editor/scene_tree_editor.cpp5
-rw-r--r--editor/script_editor_debugger.cpp5
8 files changed, 45 insertions, 4 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index c4516c1f17..926fa37040 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -118,8 +118,10 @@ void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode) {
if (enable_rl) {
search_options->add_constant_override("draw_relationship_lines", 1);
search_options->add_color_override("relationship_line_color", rl_color);
+ search_options->add_constant_override("draw_guides", 0);
} else {
search_options->add_constant_override("draw_relationship_lines", 0);
+ search_options->add_constant_override("draw_guides", 1);
}
is_replace_mode = p_replace_mode;
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index 3ee8d9c6c5..de1f856608 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -399,8 +399,10 @@ void EditorHelpIndex::_notification(int p_what) {
if (enable_rl) {
class_list->add_constant_override("draw_relationship_lines", 1);
class_list->add_color_override("relationship_line_color", rl_color);
+ class_list->add_constant_override("draw_guides", 0);
} else {
class_list->add_constant_override("draw_relationship_lines", 0);
+ class_list->add_constant_override("draw_guides", 1);
}
}
}
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index d6f337cc20..a564a2a113 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -1153,6 +1153,11 @@ void EditorInspectorSection::_gui_input(const Ref<InputEvent> &p_event) {
Ref<InputEventMouseButton> mb = p_event;
if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
+ Ref<Font> font = get_font("font", "Tree");
+ if (mb->get_position().y > font->get_height()) { //clicked outside
+ return;
+ }
+
_test_unfold();
bool unfold = !object->editor_is_section_unfolded(section);
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index 9c1d22f6ec..3730807243 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -2145,7 +2145,8 @@ void EditorPropertyResource::_resource_preview(const String &p_path, const Ref<T
}
}
-void EditorPropertyResource::_update_menu() {
+void EditorPropertyResource::_update_menu_items() {
+
//////////////////// UPDATE MENU //////////////////////////
RES res = get_edited_object()->get(get_edited_property());
@@ -2287,6 +2288,11 @@ void EditorPropertyResource::_update_menu() {
menu->add_icon_item(icon, vformat(TTR("Convert To %s"), what), CONVERT_BASE_ID + i);
}
}
+}
+
+void EditorPropertyResource::_update_menu() {
+
+ _update_menu_items();
Rect2 gt = edit->get_global_rect();
menu->set_as_minsize();
@@ -2311,6 +2317,20 @@ void EditorPropertyResource::_sub_inspector_object_id_selected(int p_id) {
emit_signal("object_id_selected", get_edited_property(), p_id);
}
+void EditorPropertyResource::_button_input(const Ref<InputEvent> &p_event) {
+ Ref<InputEventMouseButton> mb = p_event;
+ if (mb.is_valid()) {
+ if (mb->is_pressed() && mb->get_button_index() == BUTTON_RIGHT) {
+ _update_menu_items();
+ Vector2 pos = mb->get_global_position();
+ //pos = assign->get_global_transform().xform(pos);
+ menu->set_as_minsize();
+ menu->set_global_position(pos);
+ menu->popup();
+ }
+ }
+}
+
void EditorPropertyResource::_open_editor_pressed() {
RES res = get_edited_object()->get(get_edited_property());
if (res.is_valid()) {
@@ -2598,6 +2618,7 @@ void EditorPropertyResource::_bind_methods() {
ClassDB::bind_method(D_METHOD("drop_data_fw"), &EditorPropertyResource::drop_data_fw);
ClassDB::bind_method(D_METHOD("_button_draw"), &EditorPropertyResource::_button_draw);
ClassDB::bind_method(D_METHOD("_open_editor_pressed"), &EditorPropertyResource::_open_editor_pressed);
+ ClassDB::bind_method(D_METHOD("_button_input"), &EditorPropertyResource::_button_input);
}
EditorPropertyResource::EditorPropertyResource() {
@@ -2624,6 +2645,7 @@ EditorPropertyResource::EditorPropertyResource() {
preview->set_margin(MARGIN_BOTTOM, -1);
preview->set_margin(MARGIN_RIGHT, -1);
assign->add_child(preview);
+ assign->connect("gui_input", this, "_button_input");
menu = memnew(PopupMenu);
add_child(menu);
@@ -2632,6 +2654,7 @@ EditorPropertyResource::EditorPropertyResource() {
menu->connect("id_pressed", this, "_menu_option");
edit->connect("pressed", this, "_update_menu");
hbc->add_child(edit);
+ edit->connect("gui_input", this, "_button_input");
file = NULL;
scene_tree = NULL;
diff --git a/editor/editor_properties.h b/editor/editor_properties.h
index 35d8f4d306..541abb1f22 100644
--- a/editor/editor_properties.h
+++ b/editor/editor_properties.h
@@ -552,6 +552,8 @@ class EditorPropertyResource : public EditorProperty {
void _resource_selected();
void _viewport_selected(const NodePath &p_path);
+ void _update_menu_items();
+
void _update_menu();
void _sub_inspector_property_keyed(const String &p_property, const Variant &p_value, bool);
@@ -564,6 +566,7 @@ class EditorPropertyResource : public EditorProperty {
bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const;
void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from);
+ void _button_input(const Ref<InputEvent> &p_event);
void _open_editor_pressed();
protected:
diff --git a/editor/multi_node_edit.cpp b/editor/multi_node_edit.cpp
index be4e752d55..420d8ad3cf 100644
--- a/editor/multi_node_edit.cpp
+++ b/editor/multi_node_edit.cpp
@@ -52,7 +52,7 @@ bool MultiNodeEdit::_set_impl(const StringName &p_name, const Variant &p_value,
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
- ur->create_action(TTR("MultiNode Set") + " " + String(name));
+ ur->create_action(TTR("MultiNode Set") + " " + String(name), UndoRedo::MERGE_ENDS);
for (const List<NodePath>::Element *E = nodes.front(); E; E = E->next()) {
if (!es->has_node(E->get()))
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp
index 6614e24df7..95f0c4870e 100644
--- a/editor/scene_tree_editor.cpp
+++ b/editor/scene_tree_editor.cpp
@@ -980,8 +980,11 @@ void SceneTreeEditor::_editor_settings_changed() {
if (enable_rl) {
tree->add_constant_override("draw_relationship_lines", 1);
tree->add_color_override("relationship_line_color", rl_color);
- } else
+ tree->add_constant_override("draw_guides", 0);
+ } else {
tree->add_constant_override("draw_relationship_lines", 0);
+ tree->add_constant_override("draw_guides", 1);
+ }
}
void SceneTreeEditor::_bind_methods() {
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index 089ffa285d..faa561ad54 100644
--- a/editor/script_editor_debugger.cpp
+++ b/editor/script_editor_debugger.cpp
@@ -1041,8 +1041,11 @@ void ScriptEditorDebugger::_notification(int p_what) {
if (enable_rl) {
inspect_scene_tree->add_constant_override("draw_relationship_lines", 1);
inspect_scene_tree->add_color_override("relationship_line_color", rl_color);
- } else
+ inspect_scene_tree->add_constant_override("draw_guides", 0);
+ } else {
inspect_scene_tree->add_constant_override("draw_relationship_lines", 0);
+ inspect_scene_tree->add_constant_override("draw_guides", 1);
+ }
} break;
case NOTIFICATION_PROCESS: {