Skip to content

Commit b89b1ba

Browse files
committed
Add preLoad function to instance copy
1 parent 5681f86 commit b89b1ba

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/instance-copy.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ export async function copyInstance(
272272
s: InstanceinatorInstance,
273273
name?: string,
274274
display?: boolean,
275-
forceDraw?: boolean
275+
forceDraw?: boolean,
276+
preLoad?: (inst: InstanceinatorInstance) => void
276277
): Promise<InstanceinatorInstance> {
277278
if (!classes) initClasses()
278279

@@ -293,6 +294,8 @@ export async function copyInstance(
293294

294295
ig.initGameAddons = () => gameAddons
295296

297+
if (preLoad) preLoad(ns)
298+
296299
ig.ready = true
297300
ig.mainLoader = new sc.StartLoader(classes.CrossCode)
298301
ig.mainLoader.load()

0 commit comments

Comments
 (0)