idk
This commit is contained in:
1 parent
1cf1d1988e
commit
40fdf2a04e
714 files changed
+3
-3
No files matched your search
@@ -0,0 +1,2 @@
|
||||
var gdjs;(function(a){const d=new a.Logger("Game manager"),h=(o,e,t)=>{if(o.startsWith("data:")||o.startsWith("blob:"))return o;const s=o.indexOf("?")===-1?"?":"&";return o+s+e+"="+t},l=o=>o.startsWith("https://project-resources.gdevelop.io/")||o.startsWith("https://project-resources-dev.gdevelop.io/");class c{constructor(e){this._runtimeGame=e}getFullUrl(e){const{gdevelopResourceToken:t}=this._runtimeGame._options;return!t||!l(e)?e:h(e,"gd_resource_token",encodeURIComponent(t))}checkIfCredentialsRequired(e){return this._runtimeGame._options.gdevelopResourceToken?!1:!!l(e)}}a.RuntimeGameResourcesLoader=c;class _{constructor(e,t){this._notifyScenesForGameResolutionResize=!1;this._paused=!1;this._hasJustResumed=!1;this._sessionMetricsInitialized=!1;this._disableMetrics=!1;this.loadAllAssetsAsync=async e=>{try{const t=new a.LoadingScreenRenderer(this.getRenderer(),this._imageManager,this._data.properties.loadingScreen),s=this._data.resources.resources.length;let i=0;const n=(r,u)=>{const g=Math.floor(100*(i+r)/s);t.setPercent(g),e&&e(g)};i+=await this._imageManager.loadTextures(n),i+=await this._soundManager.preloadAudio(n),i+=await this._fontManager.loadFonts(n),i+=await this._jsonManager.preloadJsons(n),i+=await this._model3DManager.loadModels(n),await this._bitmapFontManager.loadBitmapFontData(n),await t.unload(),await a.getAllAsynchronouslyLoadingLibraryPromise()}catch(t){throw this._debuggerClient&&this._debuggerClient.onUncaughtException(t),t}};this._options=t||{},this._variables=new a.VariablesContainer(e.variables),this._data=e,this._resourcesLoader=new a.RuntimeGameResourcesLoader(this);const s=this._data.resources.resources;this._imageManager=new a.ImageManager(s,this._resourcesLoader),this._soundManager=new a.SoundManager(s,this._resourcesLoader),this._fontManager=new a.FontManager(s,this._resourcesLoader),this._jsonManager=new a.JsonManager(s,this._resourcesLoader),this._bitmapFontManager=new a.BitmapFontManager(s,this._resourcesLoader,this._imageManager),this._model3DManager=new a.Model3DManager(s,this._resourcesLoader),this._effectsManager=new a.EffectsManager,this._maxFPS=this._data.properties.maxFPS,this._minFPS=this._data.properties.minFPS,this._gameResolutionWidth=this._data.properties.windowWidth,this._gameResolutionHeight=this._data.properties.windowHeight,this._originalWidth=this._gameResolutionWidth,this._originalHeight=this._gameResolutionHeight,this._resizeMode=this._data.properties.sizeOnStartupMode,this._adaptGameResolutionAtRuntime=this._data.properties.adaptGameResolutionAtRuntime,this._scaleMode=e.properties.scaleMode||"linear",this._pixelsRounding=this._data.properties.pixelsRounding,this._antialiasingMode=this._data.properties.antialiasingMode,this._isAntialisingEnabledOnMobile=this._data.properties.antialisingEnabledOnMobile,this._renderer=new a.RuntimeGameRenderer(this,this._options.forceFullscreen||!1),this._watermark=new a.watermark.RuntimeWatermark(this,e.properties.authorUsernames,this._data.properties.watermark),this._sceneStack=new a.SceneStack(this),this._inputManager=new a.InputManager,this._injectExternalLayout=this._options.injectExternalLayout||"",this._debuggerClient=a.DebuggerClient?new a.DebuggerClient(this):null,this._isPreview=this._options.isPreview||!1,this._sessionId=null,this._playerId=null,this._embeddedResourcesMappings=new Map;for(const i of this._data.resources.resources)if(i.metadata)try{const n=JSON.parse(i.metadata);n?.embeddedResourcesMapping&&this._embeddedResourcesMappings.set(i.name,n.embeddedResourcesMapping)}catch{d.error("Some metadata of resources can not be successfully parsed.")}if(this._eventsBasedObjectDatas=new Map,this._data.eventsFunctionsExtensions)for(const i of this._data.eventsFunctionsExtensions)for(const n of i.eventsBasedObjects)this._eventsBasedObjectDatas.set(i.name+"::"+n.name,n);this.isUsingGDevelopDevelopmentEnvironment()&&d.info("This game will run on the development version of GDevelop APIs.")}setProjectData(e){this._data=e,this._imageManager.setResources(this._data.resources.resources),this._soundManager.setResources(this._data.resources.resources),this._fontManager.setResources(this._data.resources.resources),this._jsonManager.setResources(this._data.resources.resources),this._bitmapFontManager.setResources(this._data.resources.resources),this._model3DManager.setResources(this._data.resources.resources)}getAdditionalOptions(){return this._options}getRenderer(){return this._renderer}getVariables(){return this._variables}getSoundManager(){return this._soundManager}getImageManager(){return this._imageManager}getFontManager(){return this._fontManager}getBitmapFontManager(){return this._bitmapFontManager}getInputManager(){return this._inputManager}getJsonManager(){return this._jsonManager}getModel3DManager(){return this._model3DManager}getEffectsManager(){return this._effectsManager}getGameData(){return this._data}getEventsBasedObjectData(e){const t=this._eventsBasedObjectDatas.get(e);return t||(d.error('The game has no evenLine truncated
|
||||
//# sourceMappingURL=runtimegame.js.map
|
||||
Reference in new issue
Block a user