File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33name =" UID Refresh"
44description =" Quick way to refresh UIDs of your TSCN dependencies if the UID's become mismatched."
55author =" shout64"
6- version =" 1.0.2 "
6+ version =" 1.0.3 "
77script =" uid_refresh.gd"
Original file line number Diff line number Diff line change @@ -61,19 +61,19 @@ func fix_broken_dependencies():
6161 var correct_asset_UID = ResourceUID .id_to_text (asset_UID_text )
6262
6363 # Open affected TSCN
64- var tscn = FileAccess .open (affected_tscn , FileAccess .READ_WRITE )
64+ var tscn = FileAccess .open (affected_tscn , FileAccess .READ )
6565 var tscn_content_old = tscn .get_as_text ()
66-
66+ tscn . close ()
6767 # Fix the mismatched UID, and don't try to overwrite if it's already been fixed
6868 if tscn_content_old .contains (invalid_uid ) == true :
6969 var tscn_content_new = tscn_content_old .replacen (invalid_uid , correct_asset_UID )
70+ tscn = FileAccess .open (affected_tscn , FileAccess .WRITE )
7071 tscn .store_string (tscn_content_new )
71- print ("Fixed broken UID for " + asset_path + " in the TSCN " + affected_tscn )
72+ tscn .close ()
73+ print ("Fixed broken UID in the TSCN " + affected_tscn + " for asset " + asset_path )
7274 else :
7375 print ("First broken dependency is already fixed." )
7476 print ("Run game to get a new copy of the error log." )
75- return
76- tscn .close ()
7777
7878 log .close ()
7979 else :
You can’t perform that action at this time.
0 commit comments