Fix constant refresh on edit

If not all files are of same resource type
This commit is contained in:
don-tnowe 2023-05-01 11:20:12 +03:00
parent d188711697
commit f31466fb80
2 changed files with 4 additions and 3 deletions

View File

@ -56,7 +56,7 @@ func _on_filesystem_changed():
else:
for k in remembered_paths:
if remembered_paths[k] == null:
if !is_instance_valid(remembered_paths[k]):
continue
if remembered_paths[k].resource_path != k:

View File

@ -64,8 +64,9 @@ func import_from_path(folderpath : String, insert_func : Callable, sort_by : Str
var res : Resource
while filepath != "":
res = null
filepath = folderpath + filepath
if filepath.ends_with(".tres"):
filepath = folderpath + filepath
res = load(filepath)
if !is_instance_valid(cur_dir_script):
editor_view.fill_property_data(res)
@ -75,8 +76,8 @@ func import_from_path(folderpath : String, insert_func : Callable, sort_by : Str
if res.get_script() == cur_dir_script:
insert_func.call(res, rows, sort_by, sort_reverse)
editor_view.remembered_paths[res.resource_path] = res
editor_view.remembered_paths[filepath] = res
filepath = dir.get_next()
return rows