Rendering how I want for now

This commit is contained in:
2025-11-28 15:11:58 -06:00
parent d532a9ab21
commit 5573ad815f
15 changed files with 199 additions and 376 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