@@ -13,8 +13,6 @@ signal max_steps_changed
1313
1414const Host = preload ("config.gd" ).Host
1515
16- const GVersion = preload ("gversion.gd" )
17-
1816const headers = ["User-Agent: Pirulo/1.0 (Godot)" ,"Accept: */*" ]
1917
2018# Debugger is not capable of debugging thread process.
@@ -125,8 +123,8 @@ func _init(object, new_host: Host = null) -> void:
125123 _thread = Thread .new ()
126124 if object is Array :
127125 _init_queue (object )
128- elif object is GVersion :
129- object .connect ("request" , self , "_on_request " )
126+ else :
127+ object .connect ("request" , self , "_on_init_queue " )
130128
131129
132130func _init_queue (files : Array ) -> void :
@@ -146,11 +144,10 @@ func _init_queue(files: Array) -> void:
146144 file .set_meta ("path" , info [0 ])
147145 file .set_meta ("id" , info [1 ])
148146 file .set_meta ("sheet" , info [2 ])
149- file .open (info [0 ], File .READ )
150147 _files .push_back (file )
151148
152149
153- func _on_request (outdated : Array , bytes : int ):
150+ func _on_init_queue (outdated : Array , bytes : int ):
154151 _init_queue (outdated )
155152
156153
@@ -170,9 +167,10 @@ func _load_process() -> void:
170167 self .max_steps = 1 if _files .empty () else _files .size ()
171168 while not _files .empty ():
172169 var file : File = _files [0 ]
170+ var path = file .get_meta ("path" )
171+ file .open (path , File .READ )
173172 var buffer : String = file .get_as_text ()
174173 var json = JSON .parse (buffer )
175- var path = file .get_meta ("path" )
176174 self .steps += 1
177175 call_deferred ("emit_signal" , "complete" , path , json .result )
178176 print ("INFO: Read %s : %s " % [path ,
0 commit comments