diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/animation_track_editor.cpp | 3 | ||||
-rw-r--r-- | editor/editor_inspector.cpp | 2 | ||||
-rw-r--r-- | editor/editor_path.cpp | 160 | ||||
-rw-r--r-- | editor/editor_path.h | 14 | ||||
-rw-r--r-- | editor/editor_themes.cpp | 2 | ||||
-rw-r--r-- | editor/import/resource_importer_scene.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 48 | ||||
-rw-r--r-- | editor/plugins/curve_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 49 | ||||
-rw-r--r-- | editor/progress_dialog.cpp | 3 | ||||
-rw-r--r-- | editor/scene_tree_editor.cpp | 25 | ||||
-rw-r--r-- | editor/script_editor_debugger.cpp | 5 |
12 files changed, 155 insertions, 160 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 2376d08077..def55d6057 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -544,7 +544,7 @@ public: if (use_fps && animation->get_step() > 0) { float max_frame = animation->get_length() / animation->get_step(); - p_list->push_back(PropertyInfo(Variant::REAL, "frame", PROPERTY_HINT_RANGE, "0," + rtos(max_frame) + ",0.01")); + p_list->push_back(PropertyInfo(Variant::REAL, "frame", PROPERTY_HINT_RANGE, "0," + rtos(max_frame) + ",1")); } else { p_list->push_back(PropertyInfo(Variant::REAL, "time", PROPERTY_HINT_RANGE, "0," + rtos(animation->get_length()) + ",0.01")); } @@ -4122,6 +4122,7 @@ void AnimationTrackEditor::_update_key_edit() { key_edit = memnew(AnimationTrackKeyEdit); key_edit->animation = animation; key_edit->track = selection.front()->key().track; + key_edit->use_fps = timeline->is_using_fps(); float ofs = animation->track_get_key_time(key_edit->track, selection.front()->key().key); key_edit->key_ofs = ofs; diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index b0a1331b2e..ecb9ea5f35 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -434,7 +434,7 @@ bool EditorPropertyRevert::is_node_property_different(Node *p_node, const Varian float a = p_current; float b = p_orig; - return Math::abs(a - b) > CMP_EPSILON; //this must be done because, as some scenes save as text, there might be a tiny difference in floats due to numerical error + return !Math::is_equal_approx(a, b); //this must be done because, as some scenes save as text, there might be a tiny difference in floats due to numerical error } return bool(Variant::evaluate(Variant::OP_NOT_EQUAL, p_current, p_orig)); diff --git a/editor/editor_path.cpp b/editor/editor_path.cpp index 7e9d3a889e..12510e27de 100644 --- a/editor/editor_path.cpp +++ b/editor/editor_path.cpp @@ -56,122 +56,67 @@ void EditorPath::_add_children_to_popup(Object *p_obj, int p_depth) { Ref<Texture> icon = EditorNode::get_singleton()->get_object_icon(obj); - int index = popup->get_item_count(); - popup->add_icon_item(icon, E->get().name.capitalize(), objects.size()); - popup->set_item_h_offset(index, p_depth * 10 * EDSCALE); + int index = get_popup()->get_item_count(); + get_popup()->add_icon_item(icon, E->get().name.capitalize(), objects.size()); + get_popup()->set_item_h_offset(index, p_depth * 10 * EDSCALE); objects.push_back(obj->get_instance_id()); _add_children_to_popup(obj, p_depth + 1); } } -void EditorPath::_gui_input(const Ref<InputEvent> &p_event) { +void EditorPath::_about_to_show() { - Ref<InputEventMouseButton> mb = p_event; - if (mb.is_valid() && mb->get_button_index() == BUTTON_LEFT && mb->is_pressed()) { - - Object *obj = ObjectDB::get_instance(history->get_path_object(history->get_path_size() - 1)); - if (!obj) - return; - - objects.clear(); - popup->clear(); - _add_children_to_popup(obj); - popup->set_position(get_global_position() + Vector2(0, get_size().height)); - popup->set_size(Size2(get_size().width, 1)); - popup->popup(); - } -} + Object *obj = ObjectDB::get_instance(history->get_path_object(history->get_path_size() - 1)); + if (!obj) + return; -void EditorPath::_notification(int p_what) { - - switch (p_what) { - - case NOTIFICATION_MOUSE_ENTER: { - mouse_over = true; - update(); - } break; - case NOTIFICATION_MOUSE_EXIT: { - mouse_over = false; - update(); - } break; - case NOTIFICATION_DRAW: { - - RID ci = get_canvas_item(); - Ref<Font> label_font = get_font("font", "Label"); - Size2i size = get_size(); - Ref<Texture> sn = get_icon("SmallNext", "EditorIcons"); - Ref<StyleBox> sb = get_stylebox("pressed", "Button"); - - int ofs = sb->get_margin(MARGIN_LEFT); - - if (mouse_over) { - draw_style_box(sb, Rect2(Point2(), get_size())); - } - - for (int i = 0; i < history->get_path_size(); i++) { - - Object *obj = ObjectDB::get_instance(history->get_path_object(i)); - if (!obj) - continue; - - String type = obj->get_class(); - - Ref<Texture> icon = EditorNode::get_singleton()->get_object_icon(obj); - - if (icon.is_valid()) { - icon->draw(ci, Point2i(ofs, (size.height - icon->get_height()) / 2)); - ofs += icon->get_width(); - } - - if (i == history->get_path_size() - 1) { - //add name - ofs += 4; - int left = size.width - ofs; - if (left < 0) - continue; - String name; - if (Object::cast_to<Resource>(obj)) { - - Resource *r = Object::cast_to<Resource>(obj); - if (r->get_path().is_resource_file()) - name = r->get_path().get_file(); - else - name = r->get_name(); - - if (name == "") - name = r->get_class(); - } else if (obj->is_class("ScriptEditorDebuggerInspectedObject")) - name = obj->call("get_title"); - else if (Object::cast_to<Node>(obj)) - name = Object::cast_to<Node>(obj)->get_name(); - else if (Object::cast_to<Resource>(obj) && Object::cast_to<Resource>(obj)->get_name() != "") - name = Object::cast_to<Resource>(obj)->get_name(); - else - name = obj->get_class(); - - set_tooltip(obj->get_class()); - - label_font->draw(ci, Point2i(ofs, (size.height - label_font->get_height()) / 2 + label_font->get_ascent()), name, get_color("font_color", "Label"), left); - } else { - //add arrow - - //sn->draw(ci,Point2i(ofs,(size.height-sn->get_height())/2)); - //ofs+=sn->get_width(); - ofs += 5; //just looks better! somehow - } - } - - } break; - } + objects.clear(); + get_popup()->clear(); + get_popup()->set_size(Size2(get_size().width, 1)); + _add_children_to_popup(obj); } void EditorPath::update_path() { - update(); + for (int i = 0; i < history->get_path_size(); i++) { + + Object *obj = ObjectDB::get_instance(history->get_path_object(i)); + if (!obj) + continue; + + Ref<Texture> icon = EditorNode::get_singleton()->get_object_icon(obj); + if (icon.is_valid()) + set_icon(icon); + + if (i == history->get_path_size() - 1) { + String name; + if (Object::cast_to<Resource>(obj)) { + + Resource *r = Object::cast_to<Resource>(obj); + if (r->get_path().is_resource_file()) + name = r->get_path().get_file(); + else + name = r->get_name(); + + if (name == "") + name = r->get_class(); + } else if (obj->is_class("ScriptEditorDebuggerInspectedObject")) + name = obj->call("get_title"); + else if (Object::cast_to<Node>(obj)) + name = Object::cast_to<Node>(obj)->get_name(); + else if (Object::cast_to<Resource>(obj) && Object::cast_to<Resource>(obj)->get_name() != "") + name = Object::cast_to<Resource>(obj)->get_name(); + else + name = obj->get_class(); + + set_text(" " + name); // An extra space so the text is not too close of the icon. + set_tooltip(obj->get_class()); + } + } } -void EditorPath::_popup_select(int p_idx) { +void EditorPath::_id_pressed(int p_idx) { ERR_FAIL_INDEX(p_idx, objects.size()); @@ -184,15 +129,14 @@ void EditorPath::_popup_select(int p_idx) { void EditorPath::_bind_methods() { - ClassDB::bind_method("_gui_input", &EditorPath::_gui_input); - ClassDB::bind_method("_popup_select", &EditorPath::_popup_select); + ClassDB::bind_method("_about_to_show", &EditorPath::_about_to_show); + ClassDB::bind_method("_id_pressed", &EditorPath::_id_pressed); } EditorPath::EditorPath(EditorHistory *p_history) { history = p_history; - mouse_over = false; - popup = memnew(PopupMenu); - popup->connect("id_pressed", this, "_popup_select"); - add_child(popup); + set_text_align(ALIGN_LEFT); + get_popup()->connect("about_to_show", this, "_about_to_show"); + get_popup()->connect("id_pressed", this, "_id_pressed"); } diff --git a/editor/editor_path.h b/editor/editor_path.h index e12ca02534..2dc4d21f9b 100644 --- a/editor/editor_path.h +++ b/editor/editor_path.h @@ -32,27 +32,23 @@ #define EDITOR_PATH_H #include "editor_data.h" -#include "scene/gui/control.h" -#include "scene/gui/popup_menu.h" +#include "scene/gui/menu_button.h" -class EditorPath : public Control { +class EditorPath : public MenuButton { - GDCLASS(EditorPath, Control); + GDCLASS(EditorPath, MenuButton); EditorHistory *history; Vector<ObjectID> objects; - PopupMenu *popup; - bool mouse_over; EditorPath(); - void _popup_select(int p_idx); - void _gui_input(const Ref<InputEvent> &p_event); + void _id_pressed(int p_idx); + void _about_to_show(); void _add_children_to_popup(Object *p_obj, int p_depth = 0); protected: static void _bind_methods(); - void _notification(int p_what); public: void update_path(); diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 9641e10114..2e9c664108 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -831,6 +831,8 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_stylebox("read_only", "TextEdit", style_widget_disabled); theme->set_constant("side_margin", "TabContainer", 0); theme->set_icon("tab", "TextEdit", theme->get_icon("GuiTab", "EditorIcons")); + theme->set_icon("folded", "TextEdit", theme->get_icon("GuiTreeArrowRight", "EditorIcons")); + theme->set_icon("fold", "TextEdit", theme->get_icon("GuiTreeArrowDown", "EditorIcons")); theme->set_color("font_color", "TextEdit", font_color); theme->set_color("caret_color", "TextEdit", font_color); theme->set_color("selection_color", "TextEdit", font_color_selection); diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index ab515785da..8f66cce39a 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -1127,7 +1127,7 @@ void ResourceImporterScene::get_import_options(List<ImportOption> *r_options, in r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "animation/import", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), true)); r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "animation/fps", PROPERTY_HINT_RANGE, "1,120,1"), 15)); r_options->push_back(ImportOption(PropertyInfo(Variant::STRING, "animation/filter_script", PROPERTY_HINT_MULTILINE_TEXT), "")); - r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "animation/storage", PROPERTY_HINT_ENUM, "Built-In,Files"), animations_out ? true : false)); + r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "animation/storage", PROPERTY_HINT_ENUM, "Built-In,Files", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), animations_out ? true : false)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "animation/keep_custom_tracks"), animations_out ? true : false)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "animation/optimizer/enabled", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), true)); r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "animation/optimizer/max_linear_error"), 0.05)); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index e5228ff1e7..ab5ff7dee4 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -3916,6 +3916,8 @@ void CanvasItemEditor::_popup_callback(int p_op) { viewport->update(); } break; case LOCK_SELECTED: { + undo_redo->create_action(TTR("Lock Selected")); + List<Node *> selection = editor_selection->get_selected_node_list(); for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { CanvasItem *canvas_item = Object::cast_to<CanvasItem>(E->get()); @@ -3924,12 +3926,18 @@ void CanvasItemEditor::_popup_callback(int p_op) { if (canvas_item->get_viewport() != EditorNode::get_singleton()->get_scene_root()) continue; - canvas_item->set_meta("_edit_lock_", true); - emit_signal("item_lock_status_changed"); + undo_redo->add_do_method(canvas_item, "set_meta", "_edit_lock_", true); + undo_redo->add_undo_method(canvas_item, "remove_meta", "_edit_lock_"); + undo_redo->add_do_method(this, "emit_signal", "item_lock_status_changed"); + undo_redo->add_undo_method(this, "emit_signal", "item_lock_status_changed"); } - viewport->update(); + undo_redo->add_do_method(viewport, "update", Variant()); + undo_redo->add_undo_method(viewport, "update", Variant()); + undo_redo->commit_action(); } break; case UNLOCK_SELECTED: { + undo_redo->create_action(TTR("Unlock Selected")); + List<Node *> selection = editor_selection->get_selected_node_list(); for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { CanvasItem *canvas_item = Object::cast_to<CanvasItem>(E->get()); @@ -3938,12 +3946,18 @@ void CanvasItemEditor::_popup_callback(int p_op) { if (canvas_item->get_viewport() != EditorNode::get_singleton()->get_scene_root()) continue; - canvas_item->set_meta("_edit_lock_", Variant()); - emit_signal("item_lock_status_changed"); + undo_redo->add_do_method(canvas_item, "remove_meta", "_edit_lock_"); + undo_redo->add_undo_method(canvas_item, "set_meta", "_edit_lock_", true); + undo_redo->add_do_method(this, "emit_signal", "item_lock_status_changed"); + undo_redo->add_undo_method(this, "emit_signal", "item_lock_status_changed"); } - viewport->update(); + undo_redo->add_do_method(viewport, "update", Variant()); + undo_redo->add_undo_method(viewport, "update", Variant()); + undo_redo->commit_action(); } break; case GROUP_SELECTED: { + undo_redo->create_action(TTR("Group Selected")); + List<Node *> selection = editor_selection->get_selected_node_list(); for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { CanvasItem *canvas_item = Object::cast_to<CanvasItem>(E->get()); @@ -3952,12 +3966,18 @@ void CanvasItemEditor::_popup_callback(int p_op) { if (canvas_item->get_viewport() != EditorNode::get_singleton()->get_scene_root()) continue; - canvas_item->set_meta("_edit_group_", true); - emit_signal("item_group_status_changed"); + undo_redo->add_do_method(canvas_item, "set_meta", "_edit_group_", true); + undo_redo->add_undo_method(canvas_item, "remove_meta", "_edit_group_"); + undo_redo->add_do_method(this, "emit_signal", "item_group_status_changed"); + undo_redo->add_undo_method(this, "emit_signal", "item_group_status_changed"); } - viewport->update(); + undo_redo->add_do_method(viewport, "update", Variant()); + undo_redo->add_undo_method(viewport, "update", Variant()); + undo_redo->commit_action(); } break; case UNGROUP_SELECTED: { + undo_redo->create_action(TTR("Ungroup Selected")); + List<Node *> selection = editor_selection->get_selected_node_list(); for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { CanvasItem *canvas_item = Object::cast_to<CanvasItem>(E->get()); @@ -3966,10 +3986,14 @@ void CanvasItemEditor::_popup_callback(int p_op) { if (canvas_item->get_viewport() != EditorNode::get_singleton()->get_scene_root()) continue; - canvas_item->set_meta("_edit_group_", Variant()); - emit_signal("item_group_status_changed"); + undo_redo->add_do_method(canvas_item, "remove_meta", "_edit_group_"); + undo_redo->add_undo_method(canvas_item, "set_meta", "_edit_group_", true); + undo_redo->add_do_method(this, "emit_signal", "item_group_status_changed"); + undo_redo->add_undo_method(this, "emit_signal", "item_group_status_changed"); } - viewport->update(); + undo_redo->add_do_method(viewport, "update", Variant()); + undo_redo->add_undo_method(viewport, "update", Variant()); + undo_redo->commit_action(); } break; case ANCHORS_AND_MARGINS_PRESET_TOP_LEFT: { _set_anchors_and_margins_preset(PRESET_TOP_LEFT); diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index 3d76b5da21..2c0dd5f1db 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -194,7 +194,7 @@ void CurveEditor::on_gui_input(const Ref<InputEvent> &p_event) { Vector2 dir = (control_pos - point_pos).normalized(); real_t tangent; - if (Math::abs(dir.x) > CMP_EPSILON) + if (!Math::is_zero_approx(dir.x)) tangent = dir.y / dir.x; else tangent = 9999 * (dir.y >= 0 ? 1 : -1); diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 47f00dc480..5a733f6509 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -2473,7 +2473,7 @@ void SpatialEditorViewport::_draw() { real_t max_speed = camera->get_zfar(); real_t scale_length = (max_speed - min_speed); - if (Math::abs(scale_length) > CMP_EPSILON) { + if (!Math::is_zero_approx(scale_length)) { real_t logscale_t = 1.0 - Math::log(1 + freelook_speed - min_speed) / Math::log(1 + scale_length); // There is no real maximum speed so that factor can become negative, @@ -2491,7 +2491,7 @@ void SpatialEditorViewport::_draw() { real_t max_distance = camera->get_zfar(); real_t scale_length = (max_distance - min_distance); - if (Math::abs(scale_length) > CMP_EPSILON) { + if (!Math::is_zero_approx(scale_length)) { real_t logscale_t = 1.0 - Math::log(1 + cursor.distance - min_distance) / Math::log(1 + scale_length); // There is no real maximum distance so that factor can become negative, @@ -4515,6 +4515,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) { snap_selected_nodes_to_floor(); } break; case MENU_LOCK_SELECTED: { + undo_redo->create_action(TTR("Lock Selected")); List<Node *> &selection = editor_selection->get_selected_node_list(); @@ -4527,13 +4528,18 @@ void SpatialEditor::_menu_item_pressed(int p_option) { if (spatial->get_viewport() != EditorNode::get_singleton()->get_scene_root()) continue; - spatial->set_meta("_edit_lock_", true); - emit_signal("item_lock_status_changed"); + undo_redo->add_do_method(spatial, "set_meta", "_edit_lock_", true); + undo_redo->add_undo_method(spatial, "remove_meta", "_edit_lock_"); + undo_redo->add_do_method(this, "emit_signal", "item_lock_status_changed"); + undo_redo->add_undo_method(this, "emit_signal", "item_lock_status_changed"); } - _refresh_menu_icons(); + undo_redo->add_do_method(this, "_refresh_menu_icons", Variant()); + undo_redo->add_undo_method(this, "_refresh_menu_icons", Variant()); + undo_redo->commit_action(); } break; case MENU_UNLOCK_SELECTED: { + undo_redo->create_action(TTR("Unlock Selected")); List<Node *> &selection = editor_selection->get_selected_node_list(); @@ -4546,13 +4552,18 @@ void SpatialEditor::_menu_item_pressed(int p_option) { if (spatial->get_viewport() != EditorNode::get_singleton()->get_scene_root()) continue; - spatial->set_meta("_edit_lock_", Variant()); - emit_signal("item_lock_status_changed"); + undo_redo->add_do_method(spatial, "remove_meta", "_edit_lock_"); + undo_redo->add_undo_method(spatial, "set_meta", "_edit_lock_", true); + undo_redo->add_do_method(this, "emit_signal", "item_lock_status_changed"); + undo_redo->add_undo_method(this, "emit_signal", "item_lock_status_changed"); } - _refresh_menu_icons(); + undo_redo->add_do_method(this, "_refresh_menu_icons", Variant()); + undo_redo->add_undo_method(this, "_refresh_menu_icons", Variant()); + undo_redo->commit_action(); } break; case MENU_GROUP_SELECTED: { + undo_redo->create_action(TTR("Group Selected")); List<Node *> &selection = editor_selection->get_selected_node_list(); @@ -4565,14 +4576,18 @@ void SpatialEditor::_menu_item_pressed(int p_option) { if (spatial->get_viewport() != EditorNode::get_singleton()->get_scene_root()) continue; - spatial->set_meta("_edit_group_", true); - emit_signal("item_group_status_changed"); + undo_redo->add_do_method(spatial, "set_meta", "_edit_group_", true); + undo_redo->add_undo_method(spatial, "remove_meta", "_edit_group_"); + undo_redo->add_do_method(this, "emit_signal", "item_group_status_changed"); + undo_redo->add_undo_method(this, "emit_signal", "item_group_status_changed"); } - _refresh_menu_icons(); + undo_redo->add_do_method(this, "_refresh_menu_icons", Variant()); + undo_redo->add_undo_method(this, "_refresh_menu_icons", Variant()); + undo_redo->commit_action(); } break; case MENU_UNGROUP_SELECTED: { - + undo_redo->create_action(TTR("Ungroup Selected")); List<Node *> &selection = editor_selection->get_selected_node_list(); for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { @@ -4584,11 +4599,15 @@ void SpatialEditor::_menu_item_pressed(int p_option) { if (spatial->get_viewport() != EditorNode::get_singleton()->get_scene_root()) continue; - spatial->set_meta("_edit_group_", Variant()); - emit_signal("item_group_status_changed"); + undo_redo->add_do_method(spatial, "remove_meta", "_edit_group_"); + undo_redo->add_undo_method(spatial, "set_meta", "_edit_group_", true); + undo_redo->add_do_method(this, "emit_signal", "item_group_status_changed"); + undo_redo->add_undo_method(this, "emit_signal", "item_group_status_changed"); } - _refresh_menu_icons(); + undo_redo->add_do_method(this, "_refresh_menu_icons", Variant()); + undo_redo->add_undo_method(this, "_refresh_menu_icons", Variant()); + undo_redo->commit_action(); } break; } } diff --git a/editor/progress_dialog.cpp b/editor/progress_dialog.cpp index 09203a70a0..8dac5fa6b5 100644 --- a/editor/progress_dialog.cpp +++ b/editor/progress_dialog.cpp @@ -220,9 +220,8 @@ bool ProgressDialog::task_step(const String &p_task, const String &p_state, int last_progress_tick = OS::get_singleton()->get_ticks_usec(); if (cancel_hb->is_visible()) { OS::get_singleton()->force_process_input(); - } else { - OS::get_singleton()->process_and_drop_events(); } + Main::iteration(); // this will not work on a lot of platforms, so it's only meant for the editor return cancelled; } diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index 879d072b10..62845bfb9b 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -88,12 +88,18 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item, int p_column, int p_i } undo_redo->commit_action(); } else if (p_id == BUTTON_LOCK) { + undo_redo->create_action(TTR("Unlock Node")); if (n->is_class("CanvasItem") || n->is_class("Spatial")) { - n->set_meta("_edit_lock_", Variant()); - _update_tree(); - emit_signal("node_changed"); + + undo_redo->add_do_method(n, "remove_meta", "_edit_lock_"); + undo_redo->add_undo_method(n, "set_meta", "_edit_lock_", true); + undo_redo->add_do_method(this, "_update_tree", Variant()); + undo_redo->add_undo_method(this, "_update_tree", Variant()); + undo_redo->add_do_method(this, "emit_signal", "node_changed"); + undo_redo->add_undo_method(this, "emit_signal", "node_changed"); } + undo_redo->commit_action(); } else if (p_id == BUTTON_PIN) { if (n->is_class("AnimationPlayer")) { @@ -102,11 +108,18 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item, int p_column, int p_i } } else if (p_id == BUTTON_GROUP) { + undo_redo->create_action(TTR("Button Group")); + if (n->is_class("CanvasItem") || n->is_class("Spatial")) { - n->set_meta("_edit_group_", Variant()); - _update_tree(); - emit_signal("node_changed"); + + undo_redo->add_do_method(n, "remove_meta", "_edit_group_"); + undo_redo->add_undo_method(n, "set_meta", "_edit_group_", true); + undo_redo->add_do_method(this, "_update_tree", Variant()); + undo_redo->add_undo_method(this, "_update_tree", Variant()); + undo_redo->add_do_method(this, "emit_signal", "node_changed"); + undo_redo->add_undo_method(this, "emit_signal", "node_changed"); } + undo_redo->commit_action(); } else if (p_id == BUTTON_WARNING) { String config_err = n->get_configuration_warning(); diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index 717d6bc8f6..82117b9505 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -210,7 +210,6 @@ void ScriptEditorDebugger::debug_next() { msg.push_back("next"); ppeer->put_var(msg); stack_dump->clear(); - inspector->edit(NULL); } void ScriptEditorDebugger::debug_step() { @@ -222,7 +221,6 @@ void ScriptEditorDebugger::debug_step() { msg.push_back("step"); ppeer->put_var(msg); stack_dump->clear(); - inspector->edit(NULL); } void ScriptEditorDebugger::debug_break() { @@ -436,7 +434,6 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da emit_signal("breaked", false, false, Variant()); profiler->set_enabled(true); profiler->disable_seeking(); - inspector->edit(NULL); EditorNode::get_singleton()->get_pause_button()->set_pressed(false); } else if (p_msg == "message:click_ctrl") { @@ -1337,7 +1334,7 @@ void ScriptEditorDebugger::stop() { profiler->set_enabled(true); inspect_scene_tree->clear(); - + inspector->edit(NULL); EditorNode::get_singleton()->get_pause_button()->set_pressed(false); EditorNode::get_singleton()->get_pause_button()->set_disabled(true); EditorNode::get_singleton()->get_scene_tree_dock()->hide_remote_tree(); |