diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_file_system.cpp | 24 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_map_editor.cpp | 28 | ||||
-rw-r--r-- | editor/project_manager.cpp | 2 |
3 files changed, 37 insertions, 17 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index 88831e0c33..8a595be6e6 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -1237,10 +1237,23 @@ void EditorFileSystem::_notification(int p_what) { case NOTIFICATION_PROCESS: { if (use_threads) { + /** This hack exists because of the EditorProgress nature + * of processing events recursively. This needs to be rewritten + * at some point entirely, but in the meantime the following + * hack prevents deadlock on import. + */ + + static bool prevent_recursive_process_hack = false; + if (prevent_recursive_process_hack) { + break; + } + + prevent_recursive_process_hack = true; + + bool done_importing = false; + if (scanning_changes) { if (scanning_changes_done) { - scanning_changes = false; - set_process(false); thread_sources.wait_to_finish(); @@ -1251,6 +1264,8 @@ void EditorFileSystem::_notification(int p_what) { } emit_signal(SNAME("sources_changed"), sources_changed.size() > 0); first_scan = false; + scanning_changes = false; // Changed to false here to prevent recursive triggering of scan thread. + done_importing = true; } } else if (!scanning && thread.is_started()) { set_process(false); @@ -1268,10 +1283,12 @@ void EditorFileSystem::_notification(int p_what) { first_scan = false; } - if (!is_processing() && scan_changes_pending) { + if (done_importing && scan_changes_pending) { scan_changes_pending = false; scan_changes(); } + + prevent_recursive_process_hack = false; } } break; } @@ -2180,6 +2197,7 @@ void EditorFileSystem::_reimport_thread(uint32_t p_index, ImportThreadData *p_im } void EditorFileSystem::reimport_files(const Vector<String> &p_files) { + ERR_FAIL_COND_MSG(importing, "Attempted to call reimport_files() recursively, this is not allowed."); importing = true; Vector<String> reloads; diff --git a/editor/plugins/tiles/tile_map_editor.cpp b/editor/plugins/tiles/tile_map_editor.cpp index 8277e473fd..04a09a97e7 100644 --- a/editor/plugins/tiles/tile_map_editor.cpp +++ b/editor/plugins/tiles/tile_map_editor.cpp @@ -571,14 +571,14 @@ bool TileMapEditorTilesPlugin::forward_canvas_gui_input(const Ref<InputEvent> &p case DRAG_TYPE_PAINT: { HashMap<Vector2i, TileMapCell> to_draw = _draw_line(drag_start_mouse_pos, drag_last_mouse_pos, mpos, drag_erasing); for (const KeyValue<Vector2i, TileMapCell> &E : to_draw) { - if (!drag_erasing && E.value.source_id == TileSet::INVALID_SOURCE) { - continue; - } Vector2i coords = E.key; if (!drag_modified.has(coords)) { drag_modified.insert(coords, tile_map->get_cell(tile_map_layer, coords)); + if (!drag_erasing && E.value.source_id == TileSet::INVALID_SOURCE) { + continue; + } + tile_map->set_cell(tile_map_layer, coords, E.value.source_id, E.value.get_atlas_coords(), E.value.alternative_tile); } - tile_map->set_cell(tile_map_layer, coords, E.value.source_id, E.value.get_atlas_coords(), E.value.alternative_tile); } _fix_invalid_tiles_in_tile_map_selection(); } break; @@ -588,14 +588,14 @@ bool TileMapEditorTilesPlugin::forward_canvas_gui_input(const Ref<InputEvent> &p if (!drag_modified.has(line[i])) { HashMap<Vector2i, TileMapCell> to_draw = _draw_bucket_fill(line[i], bucket_contiguous_checkbox->is_pressed(), drag_erasing); for (const KeyValue<Vector2i, TileMapCell> &E : to_draw) { - if (!drag_erasing && E.value.source_id == TileSet::INVALID_SOURCE) { - continue; - } Vector2i coords = E.key; if (!drag_modified.has(coords)) { drag_modified.insert(coords, tile_map->get_cell(tile_map_layer, coords)); + if (!drag_erasing && E.value.source_id == TileSet::INVALID_SOURCE) { + continue; + } + tile_map->set_cell(tile_map_layer, coords, E.value.source_id, E.value.get_atlas_coords(), E.value.alternative_tile); } - tile_map->set_cell(tile_map_layer, coords, E.value.source_id, E.value.get_atlas_coords(), E.value.alternative_tile); } } } @@ -684,14 +684,14 @@ bool TileMapEditorTilesPlugin::forward_canvas_gui_input(const Ref<InputEvent> &p if (!drag_modified.has(line[i])) { HashMap<Vector2i, TileMapCell> to_draw = _draw_bucket_fill(line[i], bucket_contiguous_checkbox->is_pressed(), drag_erasing); for (const KeyValue<Vector2i, TileMapCell> &E : to_draw) { - if (!drag_erasing && E.value.source_id == TileSet::INVALID_SOURCE) { - continue; - } Vector2i coords = E.key; if (!drag_modified.has(coords)) { drag_modified.insert(coords, tile_map->get_cell(tile_map_layer, coords)); + if (!drag_erasing && E.value.source_id == TileSet::INVALID_SOURCE) { + continue; + } + tile_map->set_cell(tile_map_layer, coords, E.value.source_id, E.value.get_atlas_coords(), E.value.alternative_tile); } - tile_map->set_cell(tile_map_layer, coords, E.value.source_id, E.value.get_atlas_coords(), E.value.alternative_tile); } } } @@ -2141,7 +2141,7 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() { scatter_controls_container = memnew(HBoxContainer); scatter_label = memnew(Label); - scatter_label->set_tooltip_text(TTR("Defines the probability of painting nothing instead of a randomly selected tile.")); + scatter_label->set_tooltip_text(TTR("Modifies the chance of painting nothing instead of a randomly selected tile.")); scatter_label->set_text(TTR("Scattering:")); scatter_controls_container->add_child(scatter_label); @@ -2149,7 +2149,7 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() { scatter_spinbox->set_min(0.0); scatter_spinbox->set_max(1000); scatter_spinbox->set_step(0.001); - scatter_spinbox->set_tooltip_text(TTR("Defines the probability of painting nothing instead of a randomly selected tile.")); + scatter_spinbox->set_tooltip_text(TTR("Modifies the chance of painting nothing instead of a randomly selected tile.")); scatter_spinbox->get_line_edit()->add_theme_constant_override("minimum_character_width", 4); scatter_spinbox->connect("value_changed", callable_mp(this, &TileMapEditorTilesPlugin::_on_scattering_spinbox_changed)); scatter_controls_container->add_child(scatter_spinbox); diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 5d66be3853..dc019d8e7c 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -1359,6 +1359,8 @@ void ProjectList::load_projects() { create_project_item_control(i); } + sort_projects(); + set_v_scroll(0); update_icons_async(); |