Files
GdevelopMMOTestv1/Export/runtimegame.js
T

3 lines
19 KiB
JavaScript
Raw Normal View History

2026-07-28 10:47:32 -04:00
var gdjs;(function(n){const c=new n.Logger("Game manager"),h=u=>new Promise(e=>setTimeout(e,u)),g=u=>u.usedResources.map(e=>e.name);let l=null;const m=()=>{if(l)return l;l=[];try{new CompressionStream("gzip"),l.push("cs:gzip")}catch{}try{new CompressionStream("deflate"),l.push("cs:deflate")}catch{}return l},p=()=>{try{const e=new URL(location.href).searchParams.get("runtimeGameStatus");if(!e)return null;const t=JSON.parse(e);return{isPaused:!!t.isPaused,isInGameEdition:!!t.isInGameEdition,sceneName:""+t.sceneName,injectedExternalLayoutName:""+t.injectedExternalLayoutName,skipCreatingInstancesFromScene:!!t.skipCreatingInstancesFromScene,eventsBasedObjectType:t.eventsBasedObjectType,eventsBasedObjectVariantName:t.eventsBasedObjectVariantName,editorId:t.editorId,editorCamera3D:t.editorCamera3D}}catch{return null}};class _{constructor(e,t){this._sceneAndExtensionsData=[];this._displayedLoadingScreen=null;this._notifyScenesForGameResolutionResize=!1;this._paused=!1;this._hasJustResumed=!1;this._sessionMetricsInitialized=!1;this._disableMetrics=!1;this._wasDisposed=!1;this.getPlatformInfo=()=>({isCordova:!!window.cordova,devicePlatform:typeof device!="undefined"&&device.platform||"",navigatorPlatform:typeof navigator!="undefined"?navigator.platform:"",hasTouch:typeof navigator!="undefined"?!!navigator.maxTouchPoints&&navigator.maxTouchPoints>2:!1,supportedCompressionMethods:m()});if(this._options=t||{},this._isPreview=this._options.isPreview||!1,this._isPreview){const s=p();s&&(this._options.initialRuntimeGameStatus=s)}this._isInGameEdition=this._options.initialRuntimeGameStatus?.isInGameEdition||!1,this._variables=new n.VariablesContainer(e.variables),this._variablesByExtensionName=new Map;for(const s of e.eventsFunctionsExtensions)s.globalVariables.length>0&&this._variablesByExtensionName.set(s.name,new n.VariablesContainer(s.globalVariables));this._eventsBasedObjectDatas=new Map,this._data=e,this._updateSceneAndExtensionsData(),n.Variable.useDeprecatedZeroAsDefaultStringVariable=!!e.properties.useDeprecatedZeroAsDefaultStringVariable,this._sceneResourcesPreloading=this._data.properties.sceneResourcesPreloading||"at-startup",this._sceneResourcesUnloading=this._data.properties.sceneResourcesUnloading||"never",this._resourcesLoader=new n.ResourceLoader(this,e.resources.resources,g(e),e.layouts),this._inGameEditor=this._isInGameEdition?new n.InGameEditor(this,e,this._options.inGameEditorSettings||null):null,this._debuggerClient=n.DebuggerClient?new n.DebuggerClient(this):null,this._effectsManager=new n.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 n.RuntimeGameRenderer(this,this._options.forceFullscreen||!1),this._watermark=new n.watermark.RuntimeWatermark(this,e.properties.authorUsernames,this._data.properties.watermark),this._sceneStack=new n.SceneStack(this),this._inputManager=new n.InputManager,this._captureManager=n.CaptureManager?new n.CaptureManager(this._renderer,this._options.captureOptions||{}):null,this._sessionId=null,this._playerId=null,this._embeddedResourcesMappings=new Map,this._updateEmbeddedResourcesMappings(),this.isUsingGDevelopDevelopmentEnvironment()&&c.info("This game will run on the development version of GDevelop APIs.")}setProjectData(e){this._inGameEditor&&this._inGameEditor.onProjectDataChange(e),this._data=e,this._updateEmbeddedResourcesMappings(),this._updateSceneAndExtensionsData(),this._resourcesLoader.setResources(e.resourc
//# sourceMappingURL=runtimegame.js.map