summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/code_editor.cpp2
-rw-r--r--editor/create_dialog.cpp4
-rw-r--r--editor/editor_file_system.cpp2
-rw-r--r--editor/editor_properties_array_dict.cpp179
-rw-r--r--editor/icons/icon_GUI_checked.svg4
-rw-r--r--editor/icons/icon_GUI_radio_checked.svg7
-rw-r--r--editor/icons/icon_GUI_radio_unchecked.svg6
-rw-r--r--editor/icons/icon_GUI_unchecked.svg4
-rw-r--r--editor/plugins/abstract_polygon_2d_editor.cpp8
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp36
-rw-r--r--editor/plugins/canvas_item_editor_plugin.h10
-rw-r--r--editor/plugins/script_text_editor.cpp2
-rw-r--r--editor/plugins/text_editor.cpp3
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp7
-rw-r--r--editor/scene_tree_dock.cpp3
-rw-r--r--editor/script_editor_debugger.cpp26
16 files changed, 170 insertions, 133 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index 80bc73bc12..33d36e5e9c 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -374,7 +374,7 @@ void FindReplaceBar::_hide_bar() {
void FindReplaceBar::_show_search() {
show();
- search_text->grab_focus();
+ search_text->call_deferred("grab_focus");
if (text_edit->is_selection_active() && !selection_only->is_pressed()) {
search_text->set_text(text_edit->get_selection_text());
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index ff34618b04..eb11aea9cc 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -55,9 +55,9 @@ void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode) {
while (!f->eof_reached()) {
String l = f->get_line().strip_edges();
+ String name = l.split(" ")[0];
- if (l != String()) {
-
+ if (ClassDB::class_exists(name) || ScriptServer::is_global_class(name)) {
TreeItem *ti = recent->create_item(root);
ti->set_text(0, l);
ti->set_icon(0, EditorNode::get_singleton()->get_class_icon(l, base_type));
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index 56358cf5b7..ee20d95f25 100644
--- a/editor/editor_file_system.cpp
+++ b/editor/editor_file_system.cpp
@@ -1378,7 +1378,6 @@ void EditorFileSystem::update_script_classes() {
ScriptServer::save_global_classes();
EditorNode::get_editor_data().script_class_save_icon_paths();
- emit_signal("script_classes_updated");
}
void EditorFileSystem::_queue_update_script_classes() {
@@ -1721,7 +1720,6 @@ void EditorFileSystem::_bind_methods() {
ADD_SIGNAL(MethodInfo("filesystem_changed"));
ADD_SIGNAL(MethodInfo("sources_changed", PropertyInfo(Variant::BOOL, "exist")));
ADD_SIGNAL(MethodInfo("resources_reimported", PropertyInfo(Variant::POOL_STRING_ARRAY, "resources")));
- ADD_SIGNAL(MethodInfo("script_classes_updated"));
}
void EditorFileSystem::_update_extensions() {
diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp
index 9982a31b7b..808a8ac2f8 100644
--- a/editor/editor_properties_array_dict.cpp
+++ b/editor/editor_properties_array_dict.cpp
@@ -336,16 +336,16 @@ void EditorPropertyArray::update_property() {
} break;
case Variant::INT: {
- EditorPropertyInteger *ed = memnew(EditorPropertyInteger);
- ed->setup(-100000, 100000, true, true);
- prop = ed;
+ EditorPropertyInteger *editor = memnew(EditorPropertyInteger);
+ editor->setup(-100000, 100000, true, true);
+ prop = editor;
} break;
case Variant::REAL: {
- EditorPropertyFloat *ed = memnew(EditorPropertyFloat);
- ed->setup(-100000, 100000, 0.001, true, false, true, true);
- prop = ed;
+ EditorPropertyFloat *editor = memnew(EditorPropertyFloat);
+ editor->setup(-100000, 100000, 0.001, true, false, true, true);
+ prop = editor;
} break;
case Variant::STRING: {
@@ -357,63 +357,63 @@ void EditorPropertyArray::update_property() {
case Variant::VECTOR2: {
- EditorPropertyVector2 *ed = memnew(EditorPropertyVector2);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyVector2 *editor = memnew(EditorPropertyVector2);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::RECT2: {
- EditorPropertyRect2 *ed = memnew(EditorPropertyRect2);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyRect2 *editor = memnew(EditorPropertyRect2);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::VECTOR3: {
- EditorPropertyVector3 *ed = memnew(EditorPropertyVector3);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyVector3 *editor = memnew(EditorPropertyVector3);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::TRANSFORM2D: {
- EditorPropertyTransform2D *ed = memnew(EditorPropertyTransform2D);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyTransform2D *editor = memnew(EditorPropertyTransform2D);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::PLANE: {
- EditorPropertyPlane *ed = memnew(EditorPropertyPlane);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyPlane *editor = memnew(EditorPropertyPlane);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::QUAT: {
- EditorPropertyQuat *ed = memnew(EditorPropertyQuat);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyQuat *editor = memnew(EditorPropertyQuat);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::AABB: {
- EditorPropertyAABB *ed = memnew(EditorPropertyAABB);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyAABB *editor = memnew(EditorPropertyAABB);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::BASIS: {
- EditorPropertyBasis *ed = memnew(EditorPropertyBasis);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyBasis *editor = memnew(EditorPropertyBasis);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::TRANSFORM: {
- EditorPropertyTransform *ed = memnew(EditorPropertyTransform);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyTransform *editor = memnew(EditorPropertyTransform);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
@@ -431,8 +431,9 @@ void EditorPropertyArray::update_property() {
} break;
case Variant::OBJECT: {
-
- prop = memnew(EditorPropertyResource);
+ EditorPropertyResource *editor = memnew(EditorPropertyResource);
+ editor->setup("Resource");
+ prop = editor;
} break;
case Variant::DICTIONARY: {
@@ -798,16 +799,16 @@ void EditorPropertyDictionary::update_property() {
} break;
case Variant::INT: {
- EditorPropertyInteger *ed = memnew(EditorPropertyInteger);
- ed->setup(-100000, 100000, true, true);
- prop = ed;
+ EditorPropertyInteger *editor = memnew(EditorPropertyInteger);
+ editor->setup(-100000, 100000, true, true);
+ prop = editor;
} break;
case Variant::REAL: {
- EditorPropertyFloat *ed = memnew(EditorPropertyFloat);
- ed->setup(-100000, 100000, 0.001, true, false, true, true);
- prop = ed;
+ EditorPropertyFloat *editor = memnew(EditorPropertyFloat);
+ editor->setup(-100000, 100000, 0.001, true, false, true, true);
+ prop = editor;
} break;
case Variant::STRING: {
@@ -815,67 +816,66 @@ void EditorPropertyDictionary::update_property() {
} break;
- // math types
-
+ // math types
case Variant::VECTOR2: {
- EditorPropertyVector2 *ed = memnew(EditorPropertyVector2);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyVector2 *editor = memnew(EditorPropertyVector2);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::RECT2: {
- EditorPropertyRect2 *ed = memnew(EditorPropertyRect2);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyRect2 *editor = memnew(EditorPropertyRect2);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::VECTOR3: {
- EditorPropertyVector3 *ed = memnew(EditorPropertyVector3);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyVector3 *editor = memnew(EditorPropertyVector3);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::TRANSFORM2D: {
- EditorPropertyTransform2D *ed = memnew(EditorPropertyTransform2D);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyTransform2D *editor = memnew(EditorPropertyTransform2D);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::PLANE: {
- EditorPropertyPlane *ed = memnew(EditorPropertyPlane);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyPlane *editor = memnew(EditorPropertyPlane);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::QUAT: {
- EditorPropertyQuat *ed = memnew(EditorPropertyQuat);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyQuat *editor = memnew(EditorPropertyQuat);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::AABB: {
- EditorPropertyAABB *ed = memnew(EditorPropertyAABB);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyAABB *editor = memnew(EditorPropertyAABB);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::BASIS: {
- EditorPropertyBasis *ed = memnew(EditorPropertyBasis);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyBasis *editor = memnew(EditorPropertyBasis);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::TRANSFORM: {
- EditorPropertyTransform *ed = memnew(EditorPropertyTransform);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyTransform *editor = memnew(EditorPropertyTransform);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
@@ -893,8 +893,9 @@ void EditorPropertyDictionary::update_property() {
} break;
case Variant::OBJECT: {
-
- prop = memnew(EditorPropertyResource);
+ EditorPropertyResource *editor = memnew(EditorPropertyResource);
+ editor->setup("Resource");
+ prop = editor;
} break;
case Variant::DICTIONARY: {
@@ -902,39 +903,53 @@ void EditorPropertyDictionary::update_property() {
} break;
case Variant::ARRAY: {
-
- prop = memnew(EditorPropertyArray);
-
+ EditorPropertyArray *editor = memnew(EditorPropertyArray);
+ editor->setup(Variant::ARRAY);
+ prop = editor;
} break;
// arrays
case Variant::POOL_BYTE_ARRAY: {
- prop = memnew(EditorPropertyArray);
+ EditorPropertyArray *editor = memnew(EditorPropertyArray);
+ editor->setup(Variant::POOL_BYTE_ARRAY);
+ prop = editor;
} break;
case Variant::POOL_INT_ARRAY: {
- prop = memnew(EditorPropertyArray);
+ EditorPropertyArray *editor = memnew(EditorPropertyArray);
+ editor->setup(Variant::POOL_INT_ARRAY);
+ prop = editor;
} break;
case Variant::POOL_REAL_ARRAY: {
- prop = memnew(EditorPropertyArray);
+ EditorPropertyArray *editor = memnew(EditorPropertyArray);
+ editor->setup(Variant::POOL_REAL_ARRAY);
+ prop = editor;
} break;
case Variant::POOL_STRING_ARRAY: {
- prop = memnew(EditorPropertyArray);
+ EditorPropertyArray *editor = memnew(EditorPropertyArray);
+ editor->setup(Variant::POOL_STRING_ARRAY);
+ prop = editor;
} break;
case Variant::POOL_VECTOR2_ARRAY: {
- prop = memnew(EditorPropertyArray);
+ EditorPropertyArray *editor = memnew(EditorPropertyArray);
+ editor->setup(Variant::POOL_VECTOR2_ARRAY);
+ prop = editor;
} break;
case Variant::POOL_VECTOR3_ARRAY: {
- prop = memnew(EditorPropertyArray);
+ EditorPropertyArray *editor = memnew(EditorPropertyArray);
+ editor->setup(Variant::POOL_VECTOR3_ARRAY);
+ prop = editor;
} break;
case Variant::POOL_COLOR_ARRAY: {
- prop = memnew(EditorPropertyArray);
+ EditorPropertyArray *editor = memnew(EditorPropertyArray);
+ editor->setup(Variant::POOL_COLOR_ARRAY);
+ prop = editor;
} break;
default: {}
}
diff --git a/editor/icons/icon_GUI_checked.svg b/editor/icons/icon_GUI_checked.svg
index e5fa67ebf5..8d00eca8d3 100644
--- a/editor/icons/icon_GUI_checked.svg
+++ b/editor/icons/icon_GUI_checked.svg
@@ -1,3 +1 @@
-<svg width="16" height="16" version="1.1" viewBox="0 0 16 15.999999" xmlns="http://www.w3.org/2000/svg">
-<path d="m4 2c-1.1046 0-2 0.89543-2 2v8c0 1.1046 0.89543 2 2 2h8c1.1046 0 2-0.89543 2-2v-8c0-1.1046-0.89543-2-2-2h-8zm7.293 2.293l1.4141 1.4141-6.707 6.707-2.707-2.707 1.4141-1.4141 1.293 1.293 5.293-5.293z" fill="#e0e0e0" fill-opacity=".78431"/>
-</svg>
+<svg height="16" viewBox="0 0 16 15.999999" width="16" xmlns="http://www.w3.org/2000/svg"><g fill="#e0e0e0"><path d="m3.3333333 1c-1.2887 0-2.3333333 1.0446683-2.3333333 2.3333333v9.3333337c0 1.2887 1.0446683 2.333333 2.3333333 2.333333h9.3333337c1.2887 0 2.333333-1.044668 2.333333-2.333333v-9.3333337c0-1.2887-1.044668-2.3333333-2.333333-2.3333333z" fill-opacity=".188235" stroke-width="1.166667"/><path d="m11.500773 3.7343508-5.6117507 5.6117502-1.7045017-1.6814543-1.4992276 1.4992276 3.2037293 3.1806817 7.1109777-7.1109775z" stroke-width="1.060227"/></g></svg> \ No newline at end of file
diff --git a/editor/icons/icon_GUI_radio_checked.svg b/editor/icons/icon_GUI_radio_checked.svg
index 6a65d49eeb..447b57f8ae 100644
--- a/editor/icons/icon_GUI_radio_checked.svg
+++ b/editor/icons/icon_GUI_radio_checked.svg
@@ -1,6 +1 @@
-<svg width="16" height="16" version="1.1" viewBox="0 0 16 15.999999" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1036.4)">
-<circle cx="8" cy="1044.4" r="5" fill="none" stroke="#e0e0e0" stroke-linecap="round" stroke-linejoin="round" stroke-opacity=".78431" stroke-width="2"/>
-<circle cx="8" cy="1044.4" r="3" fill="#e0e0e0" fill-opacity=".78431"/>
-</g>
-</svg>
+<svg height="16" viewBox="0 0 16 15.999999" width="16" xmlns="http://www.w3.org/2000/svg"><g fill="#e0e0e0"><path d="m15 8a7 7 0 0 1 -7 7 7 7 0 0 1 -7-7 7 7 0 0 1 7-7 7 7 0 0 1 7 7" fill-opacity=".188235" stroke-width="2.333333"/><path d="m12 8a4 4 0 0 1 -4 4 4 4 0 0 1 -4-4 4 4 0 0 1 4-4 4 4 0 0 1 4 4" stroke-width="1.333333"/></g></svg> \ No newline at end of file
diff --git a/editor/icons/icon_GUI_radio_unchecked.svg b/editor/icons/icon_GUI_radio_unchecked.svg
index 6e52a8af77..1e8117bd10 100644
--- a/editor/icons/icon_GUI_radio_unchecked.svg
+++ b/editor/icons/icon_GUI_radio_unchecked.svg
@@ -1,5 +1 @@
-<svg width="16" height="16" version="1.1" viewBox="0 0 16 15.999999" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1036.4)">
-<circle cx="8" cy="1044.4" r="5" fill="none" stroke="#e0e0e0" stroke-linecap="round" stroke-linejoin="round" stroke-opacity=".78431" stroke-width="2"/>
-</g>
-</svg>
+<svg height="16" viewBox="0 0 16 15.999999" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m15 8a7 7 0 0 1 -7 7 7 7 0 0 1 -7-7 7 7 0 0 1 7-7 7 7 0 0 1 7 7" fill="#e0e0e0" fill-opacity=".188235" stroke-width="2.333333"/></svg> \ No newline at end of file
diff --git a/editor/icons/icon_GUI_unchecked.svg b/editor/icons/icon_GUI_unchecked.svg
index 59df40954f..9575422df3 100644
--- a/editor/icons/icon_GUI_unchecked.svg
+++ b/editor/icons/icon_GUI_unchecked.svg
@@ -1,3 +1 @@
-<svg width="16" height="16" version="1.1" viewBox="0 0 16 15.999999" xmlns="http://www.w3.org/2000/svg">
-<path d="m4 2a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2v-8a2 2 0 0 0 -2 -2h-8zm0.80078 2h6.3984a0.8 0.8 0 0 1 0.80078 0.80078v6.3984a0.8 0.8 0 0 1 -0.80078 0.80078h-6.3984a0.8 0.8 0 0 1 -0.80078 -0.80078v-6.3984a0.8 0.8 0 0 1 0.80078 -0.80078z" fill="#e0e0e0" fill-opacity=".78431"/>
-</svg>
+<svg height="16" viewBox="0 0 16 15.999999" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m3.3333333 1c-1.2887 0-2.3333333 1.0446683-2.3333333 2.3333333v9.3333337c0 1.2887 1.0446683 2.333333 2.3333333 2.333333h9.3333337c1.2887 0 2.333333-1.044668 2.333333-2.333333v-9.3333337c0-1.2887-1.044668-2.3333333-2.333333-2.3333333z" fill="#e0e0e0" fill-opacity=".188235" stroke-width="1.166667"/></svg> \ No newline at end of file
diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp
index 2d341cdd93..b51ff8b320 100644
--- a/editor/plugins/abstract_polygon_2d_editor.cpp
+++ b/editor/plugins/abstract_polygon_2d_editor.cpp
@@ -275,6 +275,10 @@ bool AbstractPolygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event)
return (mb.is_valid() && mb->get_button_index() == 1);
}
+ CanvasItemEditor::Tool tool = CanvasItemEditor::get_singleton()->get_current_tool();
+ if (tool != CanvasItemEditor::TOOL_SELECT)
+ return false;
+
if (mb.is_valid()) {
Transform2D xform = canvas_item_editor->get_canvas_transform() * _get_node()->get_global_transform();
@@ -283,10 +287,10 @@ bool AbstractPolygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event)
Vector2 cpoint = _get_node()->get_global_transform().affine_inverse().xform(canvas_item_editor->snap_point(canvas_item_editor->get_canvas_transform().affine_inverse().xform(mb->get_position())));
if (mode == MODE_EDIT || (_is_line() && mode == MODE_CREATE)) {
-
if (mb->get_button_index() == BUTTON_LEFT) {
-
if (mb->is_pressed()) {
+ if (mb->get_control() || mb->get_shift() || mb->get_alt())
+ return false;
const PosVertex insert = closest_edge_point(gpoint);
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 79578989d5..61433bbeec 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -443,8 +443,12 @@ void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos, Node *p_no
CanvasItem *canvas_item = Object::cast_to<CanvasItem>(p_node);
for (int i = p_node->get_child_count() - 1; i >= 0; i--) {
- if (canvas_item && !canvas_item->is_set_as_toplevel()) {
- _find_canvas_items_at_pos(p_pos, p_node->get_child(i), r_items, p_limit, p_parent_xform * canvas_item->get_transform(), p_canvas_xform);
+ if (canvas_item) {
+ if (!canvas_item->is_set_as_toplevel()) {
+ _find_canvas_items_at_pos(p_pos, p_node->get_child(i), r_items, p_limit, p_parent_xform * canvas_item->get_transform(), p_canvas_xform);
+ } else {
+ _find_canvas_items_at_pos(p_pos, p_node->get_child(i), r_items, p_limit, canvas_item->get_transform(), p_canvas_xform);
+ }
} else {
CanvasLayer *cl = Object::cast_to<CanvasLayer>(p_node);
_find_canvas_items_at_pos(p_pos, p_node->get_child(i), r_items, p_limit, Transform2D(), cl ? cl->get_transform() : p_canvas_xform);
@@ -610,8 +614,12 @@ void CanvasItemEditor::_find_canvas_items_in_rect(const Rect2 &p_rect, Node *p_n
if (!lock_children || !editable) {
for (int i = p_node->get_child_count() - 1; i >= 0; i--) {
- if (canvas_item && !canvas_item->is_set_as_toplevel()) {
- _find_canvas_items_in_rect(p_rect, p_node->get_child(i), r_items, p_parent_xform * canvas_item->get_transform(), p_canvas_xform);
+ if (canvas_item) {
+ if (!canvas_item->is_set_as_toplevel()) {
+ _find_canvas_items_in_rect(p_rect, p_node->get_child(i), r_items, p_parent_xform * canvas_item->get_transform(), p_canvas_xform);
+ } else {
+ _find_canvas_items_in_rect(p_rect, p_node->get_child(i), r_items, canvas_item->get_transform(), p_canvas_xform);
+ }
} else {
CanvasLayer *canvas_layer = Object::cast_to<CanvasLayer>(p_node);
_find_canvas_items_in_rect(p_rect, p_node->get_child(i), r_items, Transform2D(), canvas_layer ? canvas_layer->get_transform() : p_canvas_xform);
@@ -2938,13 +2946,13 @@ void CanvasItemEditor::_draw_locks_and_groups(Node *p_node, const Transform2D &p
float offset = 0;
Ref<Texture> lock = get_icon("LockViewport", "EditorIcons");
- if (p_node->has_meta("_edit_lock_")) {
+ if (p_node->has_meta("_edit_lock_") && show_edit_locks) {
lock->draw(viewport_canvas_item, (transform * canvas_xform * parent_xform).xform(Point2(0, 0)) + Point2(offset, 0));
offset += lock->get_size().x;
}
Ref<Texture> group = get_icon("GroupViewport", "EditorIcons");
- if (canvas_item->has_meta("_edit_group_")) {
+ if (canvas_item->has_meta("_edit_group_") && show_edit_locks) {
group->draw(viewport_canvas_item, (transform * canvas_xform * parent_xform).xform(Point2(0, 0)) + Point2(offset, 0));
//offset += group->get_size().x;
}
@@ -3543,6 +3551,12 @@ void CanvasItemEditor::_popup_callback(int p_op) {
view_menu->get_popup()->set_item_checked(idx, show_viewport);
viewport->update();
} break;
+ case SHOW_EDIT_LOCKS: {
+ show_edit_locks = !show_edit_locks;
+ int idx = view_menu->get_popup()->get_item_index(SHOW_EDIT_LOCKS);
+ view_menu->get_popup()->set_item_checked(idx, show_edit_locks);
+ viewport->update();
+ } break;
case SNAP_USE_NODE_PARENT: {
snap_node_parent = !snap_node_parent;
int idx = smartsnap_config_popup->get_item_index(SNAP_USE_NODE_PARENT);
@@ -4146,6 +4160,7 @@ Dictionary CanvasItemEditor::get_state() const {
state["show_rulers"] = show_rulers;
state["show_guides"] = show_guides;
state["show_helpers"] = show_helpers;
+ state["show_edit_locks"] = show_edit_locks;
state["snap_rotation"] = snap_rotation;
state["snap_relative"] = snap_relative;
state["snap_pixel"] = snap_pixel;
@@ -4265,6 +4280,12 @@ void CanvasItemEditor::set_state(const Dictionary &p_state) {
view_menu->get_popup()->set_item_checked(idx, show_helpers);
}
+ if (state.has("show_edit_locks")) {
+ show_edit_locks = state["show_edit_locks"];
+ int idx = view_menu->get_popup()->get_item_index(SHOW_EDIT_LOCKS);
+ view_menu->get_popup()->set_item_checked(idx, show_edit_locks);
+ }
+
if (state.has("snap_rotation")) {
snap_rotation = state["snap_rotation"];
int idx = snap_config_menu->get_popup()->get_item_index(SNAP_USE_ROTATION);
@@ -4535,6 +4556,8 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
p->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/show_guides", TTR("Show Guides"), KEY_Y), SHOW_GUIDES);
p->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/show_origin", TTR("Show Origin")), SHOW_ORIGIN);
p->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/show_viewport", TTR("Show Viewport")), SHOW_VIEWPORT);
+ p->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/show_edit_locks", TTR("Show Group And Lock Icons")), SHOW_EDIT_LOCKS);
+
p->add_separator();
p->add_shortcut(ED_SHORTCUT("canvas_item_editor/center_selection", TTR("Center Selection"), KEY_F), VIEW_CENTER_TO_SELECTION);
p->add_shortcut(ED_SHORTCUT("canvas_item_editor/frame_selection", TTR("Frame Selection"), KEY_MASK_SHIFT | KEY_F), VIEW_FRAME_TO_SELECTION);
@@ -4625,6 +4648,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
show_helpers = false;
show_rulers = true;
show_guides = true;
+ show_edit_locks = true;
zoom = 1;
view_offset = Point2(-150 - RULER_WIDTH, -95 - RULER_WIDTH);
previous_update_view_offset = view_offset; // Moves the view a little bit to the left so that (0,0) is visible. The values a relative to a 16/10 screen
diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h
index 61d77581d3..61631dee7d 100644
--- a/editor/plugins/canvas_item_editor_plugin.h
+++ b/editor/plugins/canvas_item_editor_plugin.h
@@ -71,8 +71,7 @@ class CanvasItemEditor : public VBoxContainer {
GDCLASS(CanvasItemEditor, VBoxContainer);
- EditorNode *editor;
-
+public:
enum Tool {
TOOL_SELECT,
TOOL_LIST_SELECT,
@@ -84,6 +83,9 @@ class CanvasItemEditor : public VBoxContainer {
TOOL_MAX
};
+private:
+ EditorNode *editor;
+
enum MenuOption {
SNAP_USE,
SNAP_USE_NODE_PARENT,
@@ -103,6 +105,7 @@ class CanvasItemEditor : public VBoxContainer {
SHOW_GUIDES,
SHOW_ORIGIN,
SHOW_VIEWPORT,
+ SHOW_EDIT_LOCKS,
LOCK_SELECTED,
UNLOCK_SELECTED,
GROUP_SELECTED,
@@ -223,6 +226,7 @@ class CanvasItemEditor : public VBoxContainer {
bool show_origin;
bool show_viewport;
bool show_helpers;
+ bool show_edit_locks;
float zoom;
Point2 view_offset;
Point2 previous_update_view_offset;
@@ -535,6 +539,8 @@ public:
Control *get_viewport_control() { return viewport; }
+ Tool get_current_tool() { return tool; }
+
void set_undo_redo(UndoRedo *p_undo_redo) { undo_redo = p_undo_redo; }
void edit(CanvasItem *p_canvas_item);
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index bdeeaa106d..d4ddaf274f 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -317,6 +317,7 @@ void ScriptTextEditor::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_READY:
_load_theme_settings();
+ _change_syntax_highlighter(EditorSettings::get_singleton()->get_project_metadata("script_text_editor", "syntax_highlighter", 0));
break;
}
}
@@ -1058,6 +1059,7 @@ void ScriptTextEditor::_change_syntax_highlighter(int p_idx) {
}
// highlighter_menu->set_item_checked(p_idx, true);
set_syntax_highlighter(highlighters[highlighter_menu->get_item_text(p_idx)]);
+ EditorSettings::get_singleton()->set_project_metadata("script_text_editor", "syntax_highlighter", p_idx);
}
void ScriptTextEditor::_bind_methods() {
diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp
index 3bf4140591..4ff7046a35 100644
--- a/editor/plugins/text_editor.cpp
+++ b/editor/plugins/text_editor.cpp
@@ -66,6 +66,7 @@ void TextEditor::_change_syntax_highlighter(int p_idx) {
el = el->next();
}
set_syntax_highlighter(highlighters[highlighter_menu->get_item_text(p_idx)]);
+ EditorSettings::get_singleton()->set_project_metadata("text_editor", "syntax_highlighter", p_idx);
}
void TextEditor::_load_theme_settings() {
@@ -298,7 +299,7 @@ void TextEditor::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_READY:
_load_theme_settings();
- set_syntax_highlighter(NULL);
+ _change_syntax_highlighter(EditorSettings::get_singleton()->get_project_metadata("text_editor", "syntax_highlighter", 0));
break;
}
}
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index 0d683ea0a0..207078d90f 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -932,7 +932,10 @@ public:
class VisualShaderNodePluginDefaultEditor : public VBoxContainer {
GDCLASS(VisualShaderNodePluginDefaultEditor, VBoxContainer)
public:
- void _property_changed(const String &prop, const Variant &p_value) {
+ void _property_changed(const String &prop, const Variant &p_value, bool p_changing = false) {
+
+ if (p_changing)
+ return;
UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo();
@@ -979,7 +982,7 @@ public:
}
static void _bind_methods() {
- ClassDB::bind_method("_property_changed", &VisualShaderNodePluginDefaultEditor::_property_changed);
+ ClassDB::bind_method("_property_changed", &VisualShaderNodePluginDefaultEditor::_property_changed, DEFVAL(false));
ClassDB::bind_method("_node_changed", &VisualShaderNodePluginDefaultEditor::_node_changed);
ClassDB::bind_method("_refresh_request", &VisualShaderNodePluginDefaultEditor::_refresh_request);
}
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 8637417598..ff6832177e 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -830,6 +830,8 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
editor_data->get_undo_redo().add_undo_method(editor, "set_edited_scene", (Object *)NULL);
editor_data->get_undo_redo().commit_action();
+ editor->edit_node(new_node);
+
} break;
default: {
@@ -2401,7 +2403,6 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel
add_child(create_dialog);
create_dialog->connect("create", this, "_create");
create_dialog->connect("favorites_updated", this, "_update_create_root_dialog");
- EditorFileSystem::get_singleton()->connect("script_classes_updated", create_dialog, "_save_and_update_favorite_list");
rename_dialog = memnew(RenameDialog(scene_tree, &editor_data->get_undo_redo()));
add_child(rename_dialog);
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index a28a111025..cc477314e9 100644
--- a/editor/script_editor_debugger.cpp
+++ b/editor/script_editor_debugger.cpp
@@ -492,17 +492,19 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
pinfo.usage = PropertyUsageFlags(int(prop[4]));
Variant var = prop[5];
- String hint_string = pinfo.hint_string;
- if (hint_string.begins_with("RES:") && hint_string != "RES:") {
- String path = hint_string.substr(4, hint_string.length());
- var = ResourceLoader::load(path);
- }
-
if (is_new_object) {
//don't update.. it's the same, instead refresh
debugObj->prop_list.push_back(pinfo);
}
+ if (var.get_type() == Variant::STRING) {
+ String str = var;
+ var = str.substr(4, str.length());
+
+ if (str.begins_with("PATH"))
+ var = ResourceLoader::load(var);
+ }
+
debugObj->prop_values[pinfo.name] = var;
}
@@ -573,9 +575,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
PropertyHint h = PROPERTY_HINT_NONE;
String hs = String();
- if (n.begins_with("*")) {
-
- n = n.substr(1, n.length());
+ if (v.get_type() == Variant::OBJECT) {
h = PROPERTY_HINT_OBJECT_ID;
String s = v;
s = s.replace("[", "");
@@ -596,9 +596,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
PropertyHint h = PROPERTY_HINT_NONE;
String hs = String();
- if (n.begins_with("*")) {
-
- n = n.substr(1, n.length());
+ if (v.get_type() == Variant::OBJECT) {
h = PROPERTY_HINT_OBJECT_ID;
String s = v;
s = s.replace("[", "");
@@ -619,9 +617,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
PropertyHint h = PROPERTY_HINT_NONE;
String hs = String();
- if (n.begins_with("*")) {
-
- n = n.substr(1, n.length());
+ if (v.get_type() == Variant::OBJECT) {
h = PROPERTY_HINT_OBJECT_ID;
String s = v;
s = s.replace("[", "");