Godot 4.5.1

This commit is contained in:
2025-12-14 22:43:11 +10:00
parent 5805ac2260
commit 4dd1ce64f5
433 changed files with 2922 additions and 585 deletions

View File

@@ -8,25 +8,25 @@ signal loadProgress(scenePath:String, loadId:int, progress:float)
var watchingIds:Array[int] = []
func _process(delta: float) -> void:
var wIds = watchingIds.duplicate()
for watchId in wIds:
var status = ResourceLoader.load_threaded_get_status(watchId)
if status == ResourceLoader.ThreadLoadStatus.THREAD_LOAD_LOADED:
watchingIds.erase(watchId)
var resource = ResourceLoader.load_threaded_get(watchId)
loadEnd.emit(watchId, resource)
elif status == ResourceLoader.ThreadLoadStatus.THREAD_LOAD_FAILED:
watchingIds.erase(watchId)
loadError.emit(watchId, "Error loading resource.")
elif status == ResourceLoader.ThreadLoadStatus.THREAD_LOAD_INVALID_RESOURCE:
watchingIds.erase(watchId)
loadError.emit(watchId, "Invalid Resource.")
elif status == ResourceLoader.ThreadLoadStatus.THREAD_LOAD_IN_PROGRESS:
loadProgress.emit(watchId, 0.0)
pass
var wIds = watchingIds.duplicate()
for watchId in wIds:
var status = ResourceLoader.load_threaded_get_status(watchId)
if status == ResourceLoader.ThreadLoadStatus.THREAD_LOAD_LOADED:
watchingIds.erase(watchId)
var resource = ResourceLoader.load_threaded_get(watchId)
loadEnd.emit(watchId, resource)
elif status == ResourceLoader.ThreadLoadStatus.THREAD_LOAD_FAILED:
watchingIds.erase(watchId)
loadError.emit(watchId, "Error loading resource.")
elif status == ResourceLoader.ThreadLoadStatus.THREAD_LOAD_INVALID_RESOURCE:
watchingIds.erase(watchId)
loadError.emit(watchId, "Invalid Resource.")
elif status == ResourceLoader.ThreadLoadStatus.THREAD_LOAD_IN_PROGRESS:
loadProgress.emit(watchId, 0.0)
pass
func load(scenePath:String) -> int:
var loadId = ResourceLoader.load_threaded_request(scenePath)
watchingIds.append(loadId)
loadStart.emit(scenePath, loadId)
return loadId
var loadId = ResourceLoader.load_threaded_request(scenePath)
watchingIds.append(loadId)
loadStart.emit(scenePath, loadId)
return loadId