@@ -1075,7 +1075,7 @@ void EditorFileSystem::_process_file_system(const ScannedDirectory *p_scan_dir,
1075
1075
fi->script_class_name = _get_global_script_class (fi->type , path, &fi->script_class_extends , &fi->script_class_icon_path );
1076
1076
fi->modified_time = 0 ;
1077
1077
fi->import_modified_time = 0 ;
1078
- fi->import_valid = fi->type == " TextFile" ? true : ResourceLoader::is_import_valid (path);
1078
+ fi->import_valid = ( fi->type == " TextFile" || fi-> type == " OtherFile " ) ? true : ResourceLoader::is_import_valid (path);
1079
1079
1080
1080
ItemAction ia;
1081
1081
ia.action = ItemAction::ACTION_FILE_TEST_REIMPORT;
@@ -1118,6 +1118,9 @@ void EditorFileSystem::_process_file_system(const ScannedDirectory *p_scan_dir,
1118
1118
if (fi->type == " " && textfile_extensions.has (ext)) {
1119
1119
fi->type = " TextFile" ;
1120
1120
}
1121
+ if (fi->type == " " && other_file_extensions.has (ext)) {
1122
+ fi->type = " OtherFile" ;
1123
+ }
1121
1124
fi->uid = ResourceLoader::get_resource_uid (path);
1122
1125
fi->script_class_name = _get_global_script_class (fi->type , path, &fi->script_class_extends , &fi->script_class_icon_path );
1123
1126
fi->deps = _get_dependencies (path);
@@ -1263,8 +1266,11 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir, ScanPr
1263
1266
if (fi->type == " " && textfile_extensions.has (ext)) {
1264
1267
fi->type = " TextFile" ;
1265
1268
}
1269
+ if (fi->type == " " && other_file_extensions.has (ext)) {
1270
+ fi->type = " OtherFile" ;
1271
+ }
1266
1272
fi->script_class_name = _get_global_script_class (fi->type , path, &fi->script_class_extends , &fi->script_class_icon_path );
1267
- fi->import_valid = fi->type == " TextFile" ? true : ResourceLoader::is_import_valid (path);
1273
+ fi->import_valid = ( fi->type == " TextFile" || fi-> type == " OtherFile " ) ? true : ResourceLoader::is_import_valid (path);
1268
1274
fi->import_group_file = ResourceLoader::get_import_group_file (path);
1269
1275
1270
1276
{
@@ -2118,6 +2124,9 @@ void EditorFileSystem::update_files(const Vector<String> &p_script_paths) {
2118
2124
if (type.is_empty () && textfile_extensions.has (file.get_extension ())) {
2119
2125
type = " TextFile" ;
2120
2126
}
2127
+ if (type.is_empty () && other_file_extensions.has (file.get_extension ())) {
2128
+ type = " OtherFile" ;
2129
+ }
2121
2130
String script_class = ResourceLoader::get_resource_script_class (file);
2122
2131
2123
2132
ResourceUID::ID uid = ResourceLoader::get_resource_uid (file);
@@ -2137,7 +2146,7 @@ void EditorFileSystem::update_files(const Vector<String> &p_script_paths) {
2137
2146
EditorFileSystemDirectory::FileInfo *fi = memnew (EditorFileSystemDirectory::FileInfo);
2138
2147
fi->file = file_name;
2139
2148
fi->import_modified_time = 0 ;
2140
- fi->import_valid = type == " TextFile" ? true : ResourceLoader::is_import_valid (file);
2149
+ fi->import_valid = ( type == " TextFile" || type == " OtherFile " ) ? true : ResourceLoader::is_import_valid (file);
2141
2150
2142
2151
if (idx == fs->files .size ()) {
2143
2152
fs->files .push_back (fi);
@@ -2161,7 +2170,7 @@ void EditorFileSystem::update_files(const Vector<String> &p_script_paths) {
2161
2170
fs->files [cpos]->import_group_file = ResourceLoader::get_import_group_file (file);
2162
2171
fs->files [cpos]->modified_time = FileAccess::get_modified_time (file);
2163
2172
fs->files [cpos]->deps = _get_dependencies (file);
2164
- fs->files [cpos]->import_valid = type == " TextFile" ? true : ResourceLoader::is_import_valid (file);
2173
+ fs->files [cpos]->import_valid = ( type == " TextFile" || type == " OtherFile " ) ? true : ResourceLoader::is_import_valid (file);
2165
2174
2166
2175
if (uid != ResourceUID::INVALID_ID) {
2167
2176
if (ResourceUID::get_singleton ()->has_id (uid)) {
@@ -2419,6 +2428,9 @@ Error EditorFileSystem::_reimport_group(const String &p_group_file, const Vector
2419
2428
if (fs->files [cpos]->type == " " && textfile_extensions.has (file.get_extension ())) {
2420
2429
fs->files [cpos]->type = " TextFile" ;
2421
2430
}
2431
+ if (fs->files [cpos]->type == " " && other_file_extensions.has (file.get_extension ())) {
2432
+ fs->files [cpos]->type = " OtherFile" ;
2433
+ }
2422
2434
fs->files [cpos]->import_valid = err == OK;
2423
2435
2424
2436
if (ResourceUID::get_singleton ()->has_id (uid)) {
@@ -3119,6 +3131,7 @@ void EditorFileSystem::_update_extensions() {
3119
3131
valid_extensions.clear ();
3120
3132
import_extensions.clear ();
3121
3133
textfile_extensions.clear ();
3134
+ other_file_extensions.clear ();
3122
3135
3123
3136
List<String> extensionsl;
3124
3137
ResourceLoader::get_recognized_extensions_for_type (" " , &extensionsl);
@@ -3134,6 +3147,14 @@ void EditorFileSystem::_update_extensions() {
3134
3147
valid_extensions.insert (E);
3135
3148
textfile_extensions.insert (E);
3136
3149
}
3150
+ const Vector<String> other_file_ext = ((String)(EDITOR_GET (" docks/filesystem/other_file_extensions" ))).split (" ," , false );
3151
+ for (const String &E : other_file_ext) {
3152
+ if (valid_extensions.has (E)) {
3153
+ continue ;
3154
+ }
3155
+ valid_extensions.insert (E);
3156
+ other_file_extensions.insert (E);
3157
+ }
3137
3158
3138
3159
extensionsl.clear ();
3139
3160
ResourceFormatImporter::get_singleton ()->get_recognized_extensions (&extensionsl);
0 commit comments