MCPcopy
hub / github.com/4ian/GDevelop / loadResources

Method loadResources

GDJS/Runtime/ResourceLoader.ts:306–326  ·  view source on GitHub ↗
(
      resourceNames: Array<string>,
      onProgress: (loadingCount: integer, totalCount: integer) => void
    )

Source from the content-addressed store, hash-verified

304 }
305
306 async loadResources(
307 resourceNames: Array<string>,
308 onProgress: (loadingCount: integer, totalCount: integer) => void
309 ): Promise<void> {
310 let loadedCount = 0;
311 await ResourceLoader.processAndRetryIfNeededWithPromisePool(
312 resourceNames,
313 ResourceLoader.maxForegroundConcurrency,
314 ResourceLoader.maxAttempt,
315 async (resourceName) => {
316 const resource =
317 this.privateResourceManager._resources.get(resourceName);
318 if (resource) {
319 await this.privateResourceManager._loadResource(resource);
320 await this.privateResourceManager._processResource(resource);
321 }
322 loadedCount++;
323 onProgress(loadedCount, this.privateResourceManager._resources.size);
324 }
325 );
326 }
327
328 /**
329 * Load the resources that are needed to launch the first scene.

Callers 1

Calls 4

_loadResourceMethod · 0.80
_processResourceMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected