summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_file_system.cpp2
-rw-r--r--editor/editor_paths.cpp14
-rw-r--r--editor/find_in_files.cpp2
-rw-r--r--editor/plugins/script_editor_plugin.cpp1
-rw-r--r--editor/plugins/script_text_editor.cpp2
-rw-r--r--editor/plugins/text_editor.cpp4
-rw-r--r--editor/plugins/text_editor.h2
-rw-r--r--editor/plugins/tiles/tile_map_editor.cpp26
-rw-r--r--editor/plugins/tiles/tile_map_editor.h1
9 files changed, 44 insertions, 10 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index 6fef65c92d..767856f939 100644
--- a/editor/editor_file_system.cpp
+++ b/editor/editor_file_system.cpp
@@ -2163,7 +2163,7 @@ Error EditorFileSystem::_resource_import(const String &p_path) {
}
bool EditorFileSystem::_should_skip_directory(const String &p_path) {
- if (p_path == ProjectSettings::get_singleton()->get_project_data_path()) {
+ if (p_path.begins_with(ProjectSettings::get_singleton()->get_project_data_path())) {
return true;
}
diff --git a/editor/editor_paths.cpp b/editor/editor_paths.cpp
index 71f13c0c2f..5b48cc2638 100644
--- a/editor/editor_paths.cpp
+++ b/editor/editor_paths.cpp
@@ -200,6 +200,20 @@ EditorPaths::EditorPaths() {
paths_valid = false;
}
}
+
+ // Check that the project data directory '.gdignore' file exists
+ String project_data_gdignore_file_path = project_data_dir.plus_file(".gdignore");
+ if (!FileAccess::exists(project_data_gdignore_file_path)) {
+ // Add an empty .gdignore file to avoid scan.
+ FileAccessRef f = FileAccess::open(project_data_gdignore_file_path, FileAccess::WRITE);
+ if (f) {
+ f->store_line("");
+ f->close();
+ } else {
+ ERR_PRINT("Failed to create file " + project_data_gdignore_file_path);
+ }
+ }
+
Engine::get_singleton()->set_shader_cache_path(project_data_dir);
// Editor metadata dir.
diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp
index 283496c0f1..b61f6e12eb 100644
--- a/editor/find_in_files.cpp
+++ b/editor/find_in_files.cpp
@@ -235,7 +235,7 @@ void FindInFiles::_scan_dir(String path, PackedStringArray &out_folders) {
// Ignore special dirs (such as .git and project data directory)
String project_data_dir_name = ProjectSettings::get_singleton()->get_project_data_dir_name();
- if (file.begins_with(".") || file == project_data_dir_name) {
+ if (file.begins_with(".") || file.begins_with(project_data_dir_name)) {
continue;
}
if (dir->current_is_hidden()) {
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 5df6743f4c..ca6ecfbd3a 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -214,6 +214,7 @@ Ref<EditorSyntaxHighlighter> EditorPlainTextSyntaxHighlighter::_create() const {
void ScriptEditorBase::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_base_editor"), &ScriptEditorBase::get_base_editor);
+ ClassDB::bind_method(D_METHOD("add_syntax_highlighter", "highlighter"), &ScriptEditorBase::add_syntax_highlighter);
ADD_SIGNAL(MethodInfo("name_changed"));
ADD_SIGNAL(MethodInfo("edited_script_changed"));
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index 1c251075de..2c02389db2 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -1341,8 +1341,6 @@ void ScriptTextEditor::_bind_methods() {
ClassDB::bind_method("_get_drag_data_fw", &ScriptTextEditor::get_drag_data_fw);
ClassDB::bind_method("_can_drop_data_fw", &ScriptTextEditor::can_drop_data_fw);
ClassDB::bind_method("_drop_data_fw", &ScriptTextEditor::drop_data_fw);
-
- ClassDB::bind_method(D_METHOD("add_syntax_highlighter", "highlighter"), &ScriptTextEditor::add_syntax_highlighter);
}
Control *ScriptTextEditor::get_edit_menu() {
diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp
index 06ba8a6168..1fc7eb98e0 100644
--- a/editor/plugins/text_editor.cpp
+++ b/editor/plugins/text_editor.cpp
@@ -407,10 +407,6 @@ void TextEditor::_convert_case(CodeTextEditor::CaseStyle p_case) {
code_editor->convert_case(p_case);
}
-void TextEditor::_bind_methods() {
- ClassDB::bind_method(D_METHOD("add_syntax_highlighter", "highlighter"), &TextEditor::add_syntax_highlighter);
-}
-
static ScriptEditorBase *create_editor(const RES &p_resource) {
if (Object::cast_to<TextFile>(*p_resource)) {
return memnew(TextEditor);
diff --git a/editor/plugins/text_editor.h b/editor/plugins/text_editor.h
index 9308fec210..7404557f46 100644
--- a/editor/plugins/text_editor.h
+++ b/editor/plugins/text_editor.h
@@ -87,8 +87,6 @@ private:
};
protected:
- static void _bind_methods();
-
void _edit_option(int p_op);
void _make_context_menu(bool p_selection, bool p_can_fold, bool p_is_folded, Vector2 p_position);
void _text_edit_gui_input(const Ref<InputEvent> &ev);
diff --git a/editor/plugins/tiles/tile_map_editor.cpp b/editor/plugins/tiles/tile_map_editor.cpp
index cc5ff90541..c2e86f8b43 100644
--- a/editor/plugins/tiles/tile_map_editor.cpp
+++ b/editor/plugins/tiles/tile_map_editor.cpp
@@ -465,6 +465,7 @@ bool TileMapEditorTilesPlugin::forward_canvas_gui_input(const Ref<InputEvent> &p
}
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;
case DRAG_TYPE_BUCKET: {
Vector<Vector2i> line = TileMapEditor::get_line(tile_map, tile_map->world_to_map(drag_last_mouse_pos), tile_map->world_to_map(mpos));
@@ -483,6 +484,7 @@ bool TileMapEditorTilesPlugin::forward_canvas_gui_input(const Ref<InputEvent> &p
}
}
}
+ _fix_invalid_tiles_in_tile_map_selection();
} break;
default:
break;
@@ -508,6 +510,7 @@ bool TileMapEditorTilesPlugin::forward_canvas_gui_input(const Ref<InputEvent> &p
drag_start_mouse_pos = mpos;
if (tile_map_selection.has(tile_map->world_to_map(drag_start_mouse_pos)) && !mb->is_shift_pressed()) {
// Move the selection
+ _update_selection_pattern_from_tilemap_selection(); // Make sure the pattern is up to date before moving.
drag_type = DRAG_TYPE_MOVE;
drag_modified.clear();
for (Set<Vector2i>::Element *E = tile_map_selection.front(); E; E = E->next()) {
@@ -541,6 +544,7 @@ bool TileMapEditorTilesPlugin::forward_canvas_gui_input(const Ref<InputEvent> &p
}
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();
} else if (tool_buttons_group->get_pressed_button() == line_tool_button) {
drag_type = DRAG_TYPE_LINE;
drag_start_mouse_pos = mpos;
@@ -569,6 +573,7 @@ bool TileMapEditorTilesPlugin::forward_canvas_gui_input(const Ref<InputEvent> &p
}
}
}
+ _fix_invalid_tiles_in_tile_map_selection();
}
}
}
@@ -1323,6 +1328,25 @@ void TileMapEditorTilesPlugin::_update_fix_selected_and_hovered() {
}
}
+void TileMapEditorTilesPlugin::_fix_invalid_tiles_in_tile_map_selection() {
+ TileMap *tile_map = Object::cast_to<TileMap>(ObjectDB::get_instance(tile_map_id));
+ if (!tile_map) {
+ return;
+ }
+
+ Set<Vector2i> to_remove;
+ for (Vector2i selected : tile_map_selection) {
+ TileMapCell cell = tile_map->get_cell(tile_map_layer, selected);
+ if (cell.source_id == TileSet::INVALID_SOURCE && cell.get_atlas_coords() == TileSetSource::INVALID_ATLAS_COORDS && cell.alternative_tile == TileSetAtlasSource::INVALID_TILE_ALTERNATIVE) {
+ to_remove.insert(selected);
+ }
+ }
+
+ for (Vector2i cell : to_remove) {
+ tile_map_selection.erase(cell);
+ }
+}
+
void TileMapEditorTilesPlugin::_update_selection_pattern_from_tilemap_selection() {
TileMap *tile_map = Object::cast_to<TileMap>(ObjectDB::get_instance(tile_map_id));
if (!tile_map) {
@@ -1423,6 +1447,8 @@ void TileMapEditorTilesPlugin::_update_tileset_selection_from_selection_pattern(
}
}
_update_bottom_panel();
+ tile_atlas_control->update();
+ alternative_tiles_control->update();
}
void TileMapEditorTilesPlugin::_tile_atlas_control_draw() {
diff --git a/editor/plugins/tiles/tile_map_editor.h b/editor/plugins/tiles/tile_map_editor.h
index 6126db59e9..a1ab3db318 100644
--- a/editor/plugins/tiles/tile_map_editor.h
+++ b/editor/plugins/tiles/tile_map_editor.h
@@ -124,6 +124,7 @@ private:
void _update_selection_pattern_from_tileset_selection();
void _update_tileset_selection_from_selection_pattern();
void _update_fix_selected_and_hovered();
+ void _fix_invalid_tiles_in_tile_map_selection();
///// Bottom panel. ////.
Label *missing_source_label;