Trade-Winds/minified/loadPrefabs.js

1 line
No EOL
721 B
JavaScript

function loadPrefabs(){OS.AddScript("prefabs/shipPrefab.js"),OS.AddScript("prefabs/islandPrefab.js"),OS.AddScript("prefabs/oceanTilePrefab.js"),OS.AddScript("prefabs/wavePrefab.js"),WaitForPrefabsToLoad(),Oversimplified.DEBUG.showMessages&&console.log("Ran loadPrefabs()")}var prefabsLoaded=0,prefabsToLoad=4;WaitForPrefabsToLoad=function(){console.log("waiting for "+(prefabsToLoad-prefabsLoaded).toString()+" prefabs to load"),prefabsToLoad>prefabsLoaded||!window.oceanRoom?setTimeout(function(){WaitForPrefabsToLoad()},.1):(G.player=rm_Ocean.AddObject(OS.P.Ship),G.oceanParticle=rm_Ocean.AddObject(OS.P["Ocean Particle"]),G.player.xBound?rm_Ocean.SetAsCurrentRoom():setTimeout(function(){WaitForPrefabsToLoad()},.1))};