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

Method registerCallback

GDJS/Runtime/ResourceLoader.ts:54–66  ·  view source on GitHub ↗
(
      onFinish: () => void,
      onProgress?: (count: number, total: number) => void
    )

Source from the content-addressed store, hash-verified

52 }
53
54 registerCallback(
55 onFinish: () => void,
56 onProgress?: (count: number, total: number) => void
57 ) {
58 if (this.isFinished) {
59 onFinish();
60 return;
61 }
62 this.onFinishCallbacks.push(onFinish);
63 if (onProgress) {
64 this.onProgressCallbacks.push(onProgress);
65 }
66 }
67
68 onProgress(count: number, total: number) {
69 for (const onProgress of this.onProgressCallbacks) {

Callers 2

loadSceneResourcesMethod · 0.80
loadObjectResourcesMethod · 0.80

Calls 1

pushMethod · 0.65

Tested by

no test coverage detected