summaryrefslogtreecommitdiff
path: root/editor/editor_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r--editor/editor_node.cpp38
1 files changed, 29 insertions, 9 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index ff415c83f1..f109cdddc3 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -373,6 +373,9 @@ void EditorNode::_fs_changed() {
String err = "Preset \"" + export_defer.preset + "\" doesn't have a platform.";
ERR_PRINT(err.utf8().get_data());
} else {
+ // ensures export_project does not loop infinitely, because notifications may
+ // come during the export
+ export_defer.preset = "";
platform->export_project(preset, export_defer.debug, export_defer.path, /*p_flags*/ 0);
}
}
@@ -1451,7 +1454,7 @@ void EditorNode::_edit_current() {
}
} else if (current_res->get_path().is_resource_file()) {
if (FileAccess::exists(current_res->get_path() + ".import")) {
- editable_warning = TTR("This resource was imported, so it's not editable. Change it's settings in the import panel and re-import.");
+ editable_warning = TTR("This resource was imported, so it's not editable. Change its settings in the import panel and then re-import.");
}
}
} else if (is_node) {
@@ -3153,12 +3156,19 @@ void EditorNode::_add_to_recent_scenes(const String &p_scene) {
void EditorNode::_open_recent_scene(int p_idx) {
String base = "_" + ProjectSettings::get_singleton()->get_resource_path().replace("\\", "::").replace("/", "::");
- Vector<String> rc = EDITOR_DEF(base + "/_recent_scenes", Array());
- ERR_FAIL_INDEX(p_idx, rc.size());
+ if (p_idx == recent_scenes->get_item_count() - 1) {
+
+ EditorSettings::get_singleton()->erase(base + "/_recent_scenes");
+ call_deferred("_update_recent_scenes");
+ } else {
+
+ Vector<String> rc = EDITOR_DEF(base + "/_recent_scenes", Array());
+ ERR_FAIL_INDEX(p_idx, rc.size());
- String path = "res://" + rc[p_idx];
- load_scene(path);
+ String path = "res://" + rc[p_idx];
+ load_scene(path);
+ }
}
void EditorNode::_update_recent_scenes() {
@@ -3166,10 +3176,15 @@ void EditorNode::_update_recent_scenes() {
String base = "_" + ProjectSettings::get_singleton()->get_resource_path().replace("\\", "::").replace("/", "::");
Vector<String> rc = EDITOR_DEF(base + "/_recent_scenes", Array());
recent_scenes->clear();
+
for (int i = 0; i < rc.size(); i++) {
recent_scenes->add_item(rc[i], i);
}
+
+ recent_scenes->add_separator();
+ recent_scenes->add_shortcut(ED_SHORTCUT("editor/clear_recent", TTR("Clear Recent Scenes")));
+ recent_scenes->set_as_minsize();
}
void EditorNode::_quick_opened() {
@@ -4510,6 +4525,7 @@ void EditorNode::_bind_methods() {
ClassDB::bind_method("_set_main_scene_state", &EditorNode::_set_main_scene_state);
ClassDB::bind_method("_update_scene_tabs", &EditorNode::_update_scene_tabs);
ClassDB::bind_method("_discard_changes", &EditorNode::_discard_changes);
+ ClassDB::bind_method("_update_recent_scenes", &EditorNode::_update_recent_scenes);
ClassDB::bind_method("_prepare_history", &EditorNode::_prepare_history);
ClassDB::bind_method("_select_history", &EditorNode::_select_history);
@@ -5525,6 +5541,10 @@ EditorNode::EditorNode() {
Ref<SpatialMaterialConversionPlugin> spatial_mat_convert;
spatial_mat_convert.instance();
resource_conversion_plugins.push_back(spatial_mat_convert);
+
+ Ref<ParticlesMaterialConversionPlugin> particles_mat_convert;
+ particles_mat_convert.instance();
+ resource_conversion_plugins.push_back(particles_mat_convert);
}
circle_step_msec = OS::get_singleton()->get_ticks_msec();
circle_step_frame = Engine::get_singleton()->get_frames_drawn();
@@ -5675,12 +5695,12 @@ void EditorPluginList::edit(Object *p_object) {
}
}
-bool EditorPluginList::forward_gui_input(const Transform2D &p_canvas_xform, const Ref<InputEvent> &p_event) {
+bool EditorPluginList::forward_gui_input(const Ref<InputEvent> &p_event) {
bool discard = false;
for (int i = 0; i < plugins_list.size(); i++) {
- if (plugins_list[i]->forward_canvas_gui_input(p_canvas_xform, p_event)) {
+ if (plugins_list[i]->forward_canvas_gui_input(p_event)) {
discard = true;
}
}
@@ -5704,10 +5724,10 @@ bool EditorPluginList::forward_spatial_gui_input(Camera *p_camera, const Ref<Inp
return discard;
}
-void EditorPluginList::forward_draw_over_canvas(const Transform2D &p_canvas_xform, Control *p_canvas) {
+void EditorPluginList::forward_draw_over_canvas(Control *p_canvas) {
for (int i = 0; i < plugins_list.size(); i++) {
- plugins_list[i]->forward_draw_over_canvas(p_canvas_xform, p_canvas);
+ plugins_list[i]->forward_draw_over_canvas(p_canvas);
}
}