diff --git a/assets/fonts/jetbrains/JetBrains_Mono.zip b/assets/fonts/jetbrains/JetBrains_Mono.zip new file mode 100644 index 0000000..fa4c785 Binary files /dev/null and b/assets/fonts/jetbrains/JetBrains_Mono.zip differ diff --git a/desktop/apps/dezunkrr/9patch_Orange leaves_all_128.png b/desktop/apps/dezunkrr/9patch_Orange leaves_all_128.png new file mode 100644 index 0000000..de4336f Binary files /dev/null and b/desktop/apps/dezunkrr/9patch_Orange leaves_all_128.png differ diff --git a/desktop/apps/dezunkrr/AsyncTasksManager.js b/desktop/apps/dezunkrr/AsyncTasksManager.js new file mode 100644 index 0000000..b50fd9b --- /dev/null +++ b/desktop/apps/dezunkrr/AsyncTasksManager.js @@ -0,0 +1,5 @@ +var gdjs;(function(n){class o{constructor(){this.tasksWithCallback=new Array}processTasks(e){for(let s=0;s{r.error(`A promise error has not been handled, this should never happen! +If you are using JavaScript promises in an asynchronous action, make sure to add a .catch(). +Otherwise, report this as a bug on the GDevelop forums! +${s?"The following error was thrown: "+s:""}`)}).then(()=>{this.isResolved=!0})}update(){return this.isResolved}}n.PromiseTask=h;class k extends t{constructor(){super(...arguments);this.isResolved=!1}resolve(){this.isResolved=!0}update(){return this.isResolved}}n.ManuallyResolvableTask=k})(gdjs||(gdjs={})); +//# sourceMappingURL=AsyncTasksManager.js.map diff --git a/desktop/apps/dezunkrr/Black.png b/desktop/apps/dezunkrr/Black.png new file mode 100644 index 0000000..0619da1 Binary files /dev/null and b/desktop/apps/dezunkrr/Black.png differ diff --git a/desktop/apps/dezunkrr/Bullet 1.png b/desktop/apps/dezunkrr/Bullet 1.png new file mode 100644 index 0000000..184c7d0 Binary files /dev/null and b/desktop/apps/dezunkrr/Bullet 1.png differ diff --git a/desktop/apps/dezunkrr/CantoraOne-Regular.ttf b/desktop/apps/dezunkrr/CantoraOne-Regular.ttf new file mode 100644 index 0000000..57446a2 Binary files /dev/null and b/desktop/apps/dezunkrr/CantoraOne-Regular.ttf differ diff --git a/desktop/apps/dezunkrr/CantoraOne-Regular2.ttf b/desktop/apps/dezunkrr/CantoraOne-Regular2.ttf new file mode 100644 index 0000000..57446a2 Binary files /dev/null and b/desktop/apps/dezunkrr/CantoraOne-Regular2.ttf differ diff --git a/desktop/apps/dezunkrr/CustomRuntimeObject.js b/desktop/apps/dezunkrr/CustomRuntimeObject.js new file mode 100644 index 0000000..2ef72e9 --- /dev/null +++ b/desktop/apps/dezunkrr/CustomRuntimeObject.js @@ -0,0 +1,2 @@ +var gdjs;(function(n){class o extends n.RuntimeObject{constructor(t,e){super(t,e);this._isUntransformedHitBoxesDirty=!0;this._untransformedHitBoxes=[];this._unrotatedAABB={min:[0,0],max:[0,0]};this._scaleX=1;this._scaleY=1;this._flippedX=!1;this._flippedY=!1;this.opacity=255;this._customCenter=null;this._localTransformation=new n.AffineTransformation;this._localInverseTransformation=new n.AffineTransformation;this._isLocalTransformationDirty=!0;this._instanceContainer=new n.CustomRuntimeObjectInstanceContainer(t,this),this._instanceContainer.loadFrom(e),this.getRenderer().reinitialize(this,t)}reinitialize(t){super.reinitialize(t),this._instanceContainer.loadFrom(t),this.getRenderer().reinitialize(this,this.getParent()),this.onCreated()}updateFromObjectData(t,e){return this._instanceContainer.updateFrom(t,e)}extraInitializationFromInitialInstance(t){t.customSize&&(this.setWidth(t.width),this.setHeight(t.height))}onDestroyFromScene(t){this.onDestroy(t),super.onDestroyFromScene(t),this._instanceContainer.onDestroyFromScene(t)}update(t){this._instanceContainer._updateObjectsPreEvents(),this.doStepPreEvents(t);const e=this.getRuntimeScene().getProfiler();e&&e.begin(this.type),this.doStepPostEvents(t),e&&e.end(this.type),this._instanceContainer._updateObjectsPostEvents()}onHotReloading(t){}doStepPreEvents(t){}doStepPostEvents(t){}onDestroy(t){}updatePreRender(t){this._instanceContainer._updateObjectsPreRender(),this.getRenderer().ensureUpToDate()}getRendererObject(){return this.getRenderer().getRendererObject()}getRenderer(){return this._instanceContainer.getRenderer()}onChildrenLocationChanged(){this._isUntransformedHitBoxesDirty=!0,this.invalidateHitboxes(),this.getRenderer().update()}updateHitBoxes(){this._isUntransformedHitBoxesDirty&&this._updateUntransformedHitBoxes();const t=this.getLocalTransformation();for(let e=0;e=this.hitBoxes.length&&this.hitBoxes.push(new n.Polygon);for(let i=0;i=this.hitBoxes[e].vertices.length&&this.hitBoxes[e].vertices.push([0,0]),t.transform(this._untransformedHitBoxes[e].vertices[i],this.hitBoxes[e].vertices[i]);this.hitBoxes[e].vertices.length=this._untransformedHitBoxes[e].vertices.length}}_updateUntransformedHitBoxes(){if(this._isUntransformedHitBoxesDirty=!1,this._untransformedHitBoxes.length=0,this._instanceContainer.getAdhocListOfAllInstances().length===0)this._unrotatedAABB.min[0]=0,this._unrotatedAABB.min[1]=0,this._unrotatedAABB.max[0]=0,this._unrotatedAABB.max[1]=0;else{let t=Number.MAX_VALUE,e=Number.MAX_VALUE,i=-Number.MAX_VALUE,s=-Number.MAX_VALUE;for(const a of this._instanceContainer.getAdhocListOfAllInstances()){if(!a.isIncludedInParentCollisionMask())continue;Array.prototype.push.apply(this._untransformedHitBoxes,a.getHitBoxes());const r=a.getAABB();t=Math.min(t,r.min[0]),e=Math.min(e,r.min[1]),i=Math.max(i,r.max[0]),s=Math.max(s,r.max[1])}for(this._unrotatedAABB.min[0]=t,this._unrotatedAABB.min[1]=e,this._unrotatedAABB.max[0]=i,this._unrotatedAABB.max[1]=s;this.hitBoxes.length255&&(t=255),this.opacity=t,this.getRenderer().updateOpacity()}getOpacity(){return this.opacity}hide(t){t===void 0&&(t=!0),this.hidden=t,this.getRenderer().updateVisibility()}flipX(t){t!==this._flippedX&&(this._scaleX*=-1,this._flippedX=t,this.invalidateHitboxes(),this.getRenderer().update())}flipY(t){t!==this._flippedY&&(this._scaleY*=-1,this._flippedY=t,this.invalidateHitboxes(),this.getRenderer().update())}isFlippedX(){return this._flippedX}isFlippedY(){return this._flippedY}}n.CustomRuntimeObject=o,o.supportsReinitialization=!1})(gdjs||(gdjs={})); +//# sourceMappingURL=CustomRuntimeObject.js.map diff --git a/desktop/apps/dezunkrr/CustomRuntimeObjectInstanceContainer.js b/desktop/apps/dezunkrr/CustomRuntimeObjectInstanceContainer.js new file mode 100644 index 0000000..d8979af --- /dev/null +++ b/desktop/apps/dezunkrr/CustomRuntimeObjectInstanceContainer.js @@ -0,0 +1,2 @@ +var gdjs;(function(i){const c=new i.Logger("CustomRuntimeObject");class h extends i.RuntimeInstanceContainer{constructor(n,t){super();this._isLoaded=!1;this._parent=n,this._customObject=t,this._runtimeScene=n.getScene(),this._renderer=new i.CustomObjectRenderer(t,this,n),this._debuggerRenderer=new i.DebuggerRenderer(this)}addLayer(n){const t=new i.RuntimeCustomObjectLayer(n,this);this._layers.put(n.name,t),this._orderedLayers.push(t)}createObject(n){const t=super.createObject(n);return this._customObject.onChildrenLocationChanged(),t}loadFrom(n){this._isLoaded&&this.onDestroyFromScene(this._parent);const t=this._runtimeScene.getGame().getEventsBasedObjectData(n.type);if(!t){c.error("loadFrom was called without an events-based object");return}for(let s=0,e=t.objects.length;s{const e=n.getGame().getRenderer().getElectronRemote();return e?e.getCurrentWindow():null};s.focus=function(n,e){const o=t(e);o&&(n?o.focus():o.blur())},s.isFocused=function(n){const e=t(n);return e?e.isFocused():!1},s.show=function(n,e){const o=t(e);o&&(n?o.showInactive():o.hide())},s.isVisible=function(n){const e=t(n);return e?e.isVisible():!1},s.maximize=function(n,e){const o=t(e);o&&(n?o.maximize():o.unmaximize())},s.isMaximized=function(n){const e=t(n);return e?e.isMaximized():!1},s.minimize=function(n,e){const o=t(e);o&&(n?o.minimize():o.restore())},s.isMinimized=function(n){const e=t(n);return e?e.isMinimized():!1},s.enable=function(n,e){const o=t(e);o&&o.setEnabled(n)},s.isEnabled=function(n){const e=t(n);return e?e.isEnabled():!1},s.setResizable=function(n,e){const o=t(e);o&&o.setResizable(n)},s.isResizable=function(n){const e=t(n);return e?e.isResizable():!1},s.setMovable=function(n,e){const o=t(e);o&&o.setMovable(n)},s.isMovable=function(n){const e=t(n);return e?e.isMovable():!1},s.setMaximizable=function(n,e){const o=t(e);o&&o.setMaximizable(n)},s.isMaximizable=function(n){const e=t(n);return e?e.isMaximizable():!1},s.setMinimizable=function(n,e){const o=t(e);o&&o.setMinimizable(n)},s.isMinimizable=function(n){const e=t(n);return e?e.isMinimizable():!1},s.setFullScreenable=function(n,e){const o=t(e);o&&o.setFullScreenable(n)},s.isFullScreenable=function(n){const e=t(n);return e?e.isFullScreenable():!1},s.setClosable=function(n,e){const o=t(e);o&&o.setClosable(n)},s.isClosable=function(n){const e=t(n);return e?e.isClosable():!1},s.setAlwaysOnTop=function(n,e,o){const r=t(o);r&&r.setAlwaysOnTop(n,e)},s.isAlwaysOnTop=function(n){const e=t(n);return e?e.isAlwaysOnTop():!1},s.setPosition=function(n,e,o){const r=t(o);r&&r.setPosition(~~n,~~e)},s.getPositionX=function(n){const e=t(n);return e?e.getPosition()[0]:0},s.getPositionY=function(n){const e=t(n);return e?e.getPosition()[1]:0},s.setKiosk=function(n,e){const o=t(e);o&&o.setKiosk(n)},s.isKiosk=function(n){const e=t(n);return e?e.isKiosk():!1},s.flash=function(n,e){const o=t(e);o&&o.flashFrame(n)},s.setHasShadow=function(n,e){const o=t(e);o&&o.setHasShadow(n)},s.hasShadow=function(n){const e=t(n);return e?e.hasShadow():!1},s.setOpacity=function(n,e){const o=t(e);o&&o.setOpacity(n)},s.getOpacity=function(n){const e=t(n);return e?e.getOpacity():1},s.setContentProtection=function(n,e){const o=t(e);o&&o.setContentProtection(n)},s.setFocusable=function(n,e){const o=t(e);o&&o.setFocusable(n)}})(u=c.advancedWindow||(c.advancedWindow={}))})(l=i.evtTools||(i.evtTools={}))})(gdjs||(gdjs={})); +//# sourceMappingURL=electron-advancedwindowtools.js.map diff --git a/desktop/apps/dezunkrr/Extensions/AnchorBehavior/anchorruntimebehavior.js b/desktop/apps/dezunkrr/Extensions/AnchorBehavior/anchorruntimebehavior.js new file mode 100644 index 0000000..06c656b --- /dev/null +++ b/desktop/apps/dezunkrr/Extensions/AnchorBehavior/anchorruntimebehavior.js @@ -0,0 +1,2 @@ +var gdjs;(function(c){const t=class extends c.RuntimeBehavior{constructor(o,e,s){super(o,e,s);this._invalidDistances=!0;this._leftEdgeDistance=0;this._rightEdgeDistance=0;this._topEdgeDistance=0;this._bottomEdgeDistance=0;this._useLegacyBottomAndRightAnchors=!1;this._relativeToOriginalWindowSize=!!e.relativeToOriginalWindowSize,this._leftEdgeAnchor=e.leftEdgeAnchor,this._rightEdgeAnchor=e.rightEdgeAnchor,this._topEdgeAnchor=e.topEdgeAnchor,this._bottomEdgeAnchor=e.bottomEdgeAnchor,this._useLegacyBottomAndRightAnchors=e.useLegacyBottomAndRightAnchors===void 0?!0:e.useLegacyBottomAndRightAnchors}updateFromBehaviorData(o,e){return o.leftEdgeAnchor!==e.leftEdgeAnchor&&(this._leftEdgeAnchor=e.leftEdgeAnchor),o.rightEdgeAnchor!==e.rightEdgeAnchor&&(this._rightEdgeAnchor=e.rightEdgeAnchor),o.topEdgeAnchor!==e.topEdgeAnchor&&(this._topEdgeAnchor=e.topEdgeAnchor),o.bottomEdgeAnchor!==e.bottomEdgeAnchor&&(this._bottomEdgeAnchor=e.bottomEdgeAnchor),o.useLegacyTrajectory!==e.useLegacyTrajectory&&(this._useLegacyBottomAndRightAnchors=e.useLegacyBottomAndRightAnchors),o.relativeToOriginalWindowSize===e.relativeToOriginalWindowSize}onActivate(){this._invalidDistances=!0}doStepPreEvents(o){const e=c.staticArray(c.AnchorRuntimeBehavior.prototype.doStepPreEvents),s=o.getGame();let r=s.getGameResolutionWidth(),h=s.getGameResolutionHeight();const A=o.getLayer(this.owner.getLayer());if(this._invalidDistances){this._relativeToOriginalWindowSize&&(r=s.getOriginalWidth(),h=s.getOriginalHeight());const i=A.convertCoords(this.owner.getDrawableX(),this.owner.getDrawableY(),0,e);this._leftEdgeAnchor===t.HorizontalAnchor.WINDOW_LEFT?this._leftEdgeDistance=i[0]:this._leftEdgeAnchor===t.HorizontalAnchor.WINDOW_RIGHT?this._leftEdgeDistance=r-i[0]:this._leftEdgeAnchor===t.HorizontalAnchor.PROPORTIONAL&&(this._leftEdgeDistance=i[0]/r),this._topEdgeAnchor===t.VerticalAnchor.WINDOW_TOP?this._topEdgeDistance=i[1]:this._topEdgeAnchor===t.VerticalAnchor.WINDOW_BOTTOM?this._topEdgeDistance=h-i[1]:this._topEdgeAnchor===t.VerticalAnchor.PROPORTIONAL&&(this._topEdgeDistance=i[1]/h);const n=A.convertCoords(this.owner.getDrawableX()+this.owner.getWidth(),this.owner.getDrawableY()+this.owner.getHeight(),0,e);this._rightEdgeAnchor===t.HorizontalAnchor.WINDOW_LEFT?this._rightEdgeDistance=n[0]:this._rightEdgeAnchor===t.HorizontalAnchor.WINDOW_RIGHT?this._rightEdgeDistance=r-n[0]:this._rightEdgeAnchor===t.HorizontalAnchor.PROPORTIONAL&&(this._rightEdgeDistance=n[0]/r),this._bottomEdgeAnchor===t.VerticalAnchor.WINDOW_TOP?this._bottomEdgeDistance=n[1]:this._bottomEdgeAnchor===t.VerticalAnchor.WINDOW_BOTTOM?this._bottomEdgeDistance=h-n[1]:this._bottomEdgeAnchor===t.VerticalAnchor.PROPORTIONAL&&(this._bottomEdgeDistance=n[1]/h),this._invalidDistances=!1}else{let i=0,n=0,d=0,E=0;this._leftEdgeAnchor===t.HorizontalAnchor.WINDOW_LEFT?i=this._leftEdgeDistance:this._leftEdgeAnchor===t.HorizontalAnchor.WINDOW_RIGHT?i=r-this._leftEdgeDistance:this._leftEdgeAnchor===t.HorizontalAnchor.PROPORTIONAL&&(i=this._leftEdgeDistance*r),this._topEdgeAnchor===t.VerticalAnchor.WINDOW_TOP?n=this._topEdgeDistance:this._topEdgeAnchor===t.VerticalAnchor.WINDOW_BOTTOM?n=h-this._topEdgeDistance:this._topEdgeAnchor===t.VerticalAnchor.PROPORTIONAL&&(n=this._topEdgeDistance*h),this._rightEdgeAnchor===t.HorizontalAnchor.WINDOW_LEFT?d=this._rightEdgeDistance:this._rightEdgeAnchor===t.HorizontalAnchor.WINDOW_RIGHT?d=r-this._rightEdgeDistance:this._rightEdgeAnchor===t.HorizontalAnchor.PROPORTIONAL&&(d=this._rightEdgeDistance*r),this._bottomEdgeAnchor===t.VerticalAnchor.WINDOW_TOP?E=this._bottomEdgeDistance:this._bottomEdgeAnchor===t.VerticalAnchor.WINDOW_BOTTOM?E=h-this._bottomEdgeDistance:this._bottomEdgeAnchor===t.VerticalAnchor.PROPORTIONAL&&(E=this._bottomEdgeDistance*h);const _=A.convertInverseCoords(i,n,0,e),g=_[0],l=_[1],N=A.convertInverseCoords(d,E,0,e),O=N[0],f=N[1];this._useLegacyBottomAndRightAnchors?(this._rightEdgeAnchor!==t.HorizontalAnchor.NONE&&this.owner.setWidth(O-g),this._bottomEdgeAnchor!==t.VerticalAnchor.NONE&&this.owner.setHeight(f-l),this._leftEdgeAnchor!==t.HorizontalAnchor.NONE&&this.owner.setX(g+this.owner.getX()-this.owner.getDrawableX()),this._topEdgeAnchor!==t.VerticalAnchor.NONE&&this.owner.setY(l+this.owner.getY()-this.owner.getDrawableY())):(this._rightEdgeAnchor!==t.HorizontalAnchor.NONE&&this._leftEdgeAnchor!==t.HorizontalAnchor.NONE?(this.owner.setWidth(O-g),this.owner.setX(g)):(this._leftEdgeAnchor!==t.HorizontalAnchor.NONE&&this.owner.setX(g+this.owner.getX()-this.owner.getDrawableX()),this._rightEdgeAnchor!==t.HorizontalAnchor.NONE&&this.owner.setX(O+this.owner.getX()-this.owner.getDrawableX()-this.owner.getWidth())),this._bottomEdgeAnchor!==t.VerticalAnchor.NONE&&this._topEdgeAnchor!==t.VerticalAnchor.NONE?(this.owner.setHeight(f-l),this.owner.setY(l)):(this._topEdgeAnchor!==t.VerticalAnchor.NONE&&this.owner.setY(l+this.owner.getY()-this.owner.getDrawableY()),this._bottomEdgeAnchor!==t.VerticalAnchor.NONE&&this.owner.setY(f+this.owner.getY()-this.owner.getDrawableY()-this.owner.getHeight())))}}doStepPostEvents(o){}};let a=t;a.HorizontalAnchor={NONE:0,WINDOW_LEFT:1,WINDOW_RIGHT:2,PROPORTIONAL:3},a.VerticalAnchor={NONE:0,WINDOW_TOP:1,WINDOW_BOTTOM:2,PROPORTIONAL:3},c.AnchorRuntimeBehavior=a,c.registerBehavior("AnchorBehavior::AnchorBehavior",c.AnchorRuntimeBehavior)})(gdjs||(gdjs={})); +//# sourceMappingURL=anchorruntimebehavior.js.map diff --git a/desktop/apps/dezunkrr/Extensions/DebuggerTools/debuggertools.js b/desktop/apps/dezunkrr/Extensions/DebuggerTools/debuggertools.js new file mode 100644 index 0000000..cd051a4 --- /dev/null +++ b/desktop/apps/dezunkrr/Extensions/DebuggerTools/debuggertools.js @@ -0,0 +1,2 @@ +var gdjs;(function(e){let c;(function(r){let i;(function(a){a.pause=function(n){n.getGame().pause(!0)},a.log=function(n,t,o){e.Logger.getLoggerOutput().log(o,n,t,!1)},a.enableDebugDraw=function(n,t,o,p,u){n.enableDebugDraw(t,o,p,u)}})(i=r.debuggerTools||(r.debuggerTools={}))})(c=e.evtTools||(e.evtTools={}))})(gdjs||(gdjs={})); +//# sourceMappingURL=debuggertools.js.map diff --git a/desktop/apps/dezunkrr/Extensions/DraggableBehavior/draggableruntimebehavior.js b/desktop/apps/dezunkrr/Extensions/DraggableBehavior/draggableruntimebehavior.js new file mode 100644 index 0000000..cad6ac1 --- /dev/null +++ b/desktop/apps/dezunkrr/Extensions/DraggableBehavior/draggableruntimebehavior.js @@ -0,0 +1,2 @@ +var gdjs;(function(n){class s extends n.RuntimeBehavior{constructor(e,t,a){super(e,t,a);this._draggedByDraggableManager=null;this._justDropped=!1;this._checkCollisionMask=!!t.checkCollisionMask}updateFromBehaviorData(e,t){return!0}onDeActivate(){this._endDrag()}onDestroy(){this.onDeActivate()}_endDrag(){this._draggedByDraggableManager&&(this._draggedByDraggableManager.endDrag(),this._justDropped=!0),this._draggedByDraggableManager=null}_dismissDrag(){this._draggedByDraggableManager=null}_tryBeginDrag(e){if(this._draggedByDraggableManager)return!1;const a=e.getGame().getInputManager().getStartedTouchIdentifiers();for(let r=0;r0)for(var i=e,o=e/t,n=1;n0?(this._kernels=e,this._quality=e.length,this._blur=Math.max.apply(Math,e)):(this._kernels=[0],this._quality=1)},l.clamp.get=function(){return this._clamp},l.pixelSize.set=function(e){"number"==typeof e?(this._pixelSize.x=e,this._pixelSize.y=e):Array.isArray(e)?(this._pixelSize.x=e[0],this._pixelSize.y=e[1]):e instanceof r.Point?(this._pixelSize.x=e.x,this._pixelSize.y=e.y):(this._pixelSize.x=1,this._pixelSize.y=1)},l.pixelSize.get=function(){return this._pixelSize},l.quality.get=function(){return this._quality},l.quality.set=function(e){this._quality=Math.max(1,Math.round(e)),this._generateKernels()},l.blur.get=function(){return this._blur},l.blur.set=function(e){this._blur=e,this._generateKernels()},Object.defineProperties(t.prototype,l),t}(t.Filter);return e.KawaseBlurFilter=l,e}({},PIXI,PIXI);Object.assign(PIXI.filters,__filters); diff --git a/desktop/apps/dezunkrr/Extensions/LinkedObjects/linkedobjects.js b/desktop/apps/dezunkrr/Extensions/LinkedObjects/linkedobjects.js new file mode 100644 index 0000000..f05cdfd --- /dev/null +++ b/desktop/apps/dezunkrr/Extensions/LinkedObjects/linkedobjects.js @@ -0,0 +1,2 @@ +var gdjs;(function(r){class f{constructor(){this._links=new Map}static getManager(e){return e.linkedObjectsManager||(e.linkedObjectsManager=new r.LinksManager),e.linkedObjectsManager}_getMapOfObjectsLinkedWith(e){return this._links.has(e.id)||this._links.set(e.id,new k),this._links.get(e.id).linkedObjectMap}getObjectsLinkedWith(e){return this._links.has(e.id)||this._links.set(e.id,new k),this._links.get(e.id)}getObjectsLinkedWithAndNamed(e,t){let n=this._getMapOfObjectsLinkedWith(e).get(t);return n||(n=r.staticArray(f.prototype.getObjectsLinkedWithAndNamed)),n}linkObjects(e,t){const n=this._getMapOfObjectsLinkedWith(e);n.has(t.getName())||n.set(t.getName(),[]);const i=n.get(t.getName());i.indexOf(t)===-1&&i.push(t);const c=this._getMapOfObjectsLinkedWith(t);c.has(e.getName())||c.set(e.getName(),[]);const g=c.get(e.getName());g.indexOf(e)===-1&&g.push(e)}removeAllLinksOf(e){const t=this._links.get(e.id);if(!!t){for(const n of t.linkedObjectMap.values())for(let i=0;i{let n=t.next();for(;n.done;){const i=e.next();if(i.done)return n;t=i.value[Symbol.iterator](),n=t.next()}return n}}}};let k=h;k.emptyItr={next:()=>({value:void 0,done:!0})};let R;(function(e){let x;(function(g){r.registerObjectDeletedFromSceneCallback(function(a,s){f.getManager(a).removeAllLinksOf(s)}),g.linkObjects=function(a,s,O){s===null||O===null||f.getManager(a).linkObjects(s,O)},g.removeLinkBetween=function(a,s,O){s===null||O===null||f.getManager(a).removeLinkBetween(s,O)},g.removeAllLinksOf=function(a,s){s!==null&&f.getManager(a).removeAllLinksOf(s)},g.pickObjectsLinkedTo=function(a,s,O,L){if(O===null)return!1;const j=f.getManager(a)._getMapOfObjectsLinkedWith(O);let m=!1;for(const p in s.items)if(s.containsKey(p)){const d=s.items[p];if(d.length===0)continue;const u=r.staticArray2(r.evtTools.linkedObjects.pickObjectsLinkedTo);if(u.length=0,L)for(const l of d)u.indexOf(l.getName())<0&&u.push(l.getName());else u.push(p);let b=0;for(const l of u)b+=a.getObjects(l).length;if(d.length===b){d.length=0;for(const l of u)if(j.has(l)){const o=j.get(l);m=m||o.length>0,d.push.apply(d,o)}}else{const l=r.staticArray(r.evtTools.linkedObjects.pickObjectsLinkedTo);l.length=0;for(const o of u)if(j.has(o)){const N=j.get(o);for(const M of N)d.indexOf(M)>=0&&l.push(M)}m=m||l.length>0,d.length=0,d.push.apply(d,l),l.length=0}u.length=0}return m}})(x=e.linkedObjects||(e.linkedObjects={}))})(R=r.evtTools||(r.evtTools={}))})(gdjs||(gdjs={})); +//# sourceMappingURL=linkedobjects.js.map diff --git a/desktop/apps/dezunkrr/Extensions/PanelSpriteObject/panelspriteruntimeobject-pixi-renderer.js b/desktop/apps/dezunkrr/Extensions/PanelSpriteObject/panelspriteruntimeobject-pixi-renderer.js new file mode 100644 index 0000000..9ee4838 --- /dev/null +++ b/desktop/apps/dezunkrr/Extensions/PanelSpriteObject/panelspriteruntimeobject-pixi-renderer.js @@ -0,0 +1,2 @@ +var gdjs;(function(n){const r=GlobalPIXIModule.PIXI;class _{constructor(e,h,t,i){this._wasRendered=!1;this._textureWidth=0;this._textureHeight=0;this._object=e;const s=h.getGame().getImageManager().getPIXITexture(t),o=i?r.TilingSprite:r.Sprite;this._spritesContainer=new r.Container,this._wrapperContainer=new r.Container,this._centerSprite=new o(new r.Texture(s.baseTexture)),this._borderSprites=[new o(new r.Texture(s.baseTexture)),new r.Sprite(s),new o(new r.Texture(s.baseTexture)),new r.Sprite(s),new o(new r.Texture(s.baseTexture)),new r.Sprite(s),new o(new r.Texture(s.baseTexture)),new r.Sprite(s)],this.setTexture(t,h),this._spritesContainer.removeChildren(),this._spritesContainer.addChild(this._centerSprite);for(let d=0;di.width&&(o.x=i.width),o.y>i.height&&(o.y=i.height),o.x+o.width>i.width&&(o.width=i.width-o.x),o.y+o.height>i.height&&(o.height=i.height-o.y),o}this._centerSprite.texture=new r.Texture(i,s(new r.Rectangle(t._lBorder,t._tBorder,i.width-t._lBorder-t._rBorder,i.height-t._tBorder-t._bBorder))),this._borderSprites[0].texture=new r.Texture(i,s(new r.Rectangle(i.width-t._rBorder,t._tBorder,t._rBorder,i.height-t._tBorder-t._bBorder))),this._borderSprites[2].texture=new r.Texture(i,s(new r.Rectangle(t._lBorder,0,i.width-t._lBorder-t._rBorder,t._tBorder))),this._borderSprites[4].texture=new r.Texture(i,s(new r.Rectangle(0,t._tBorder,t._lBorder,i.height-t._tBorder-t._bBorder))),this._borderSprites[6].texture=new r.Texture(i,s(new r.Rectangle(t._lBorder,i.height-t._bBorder,i.width-t._lBorder-t._rBorder,t._bBorder))),this._borderSprites[1].texture=new r.Texture(i,s(new r.Rectangle(i.width-t._rBorder,0,t._rBorder,t._tBorder))),this._borderSprites[3].texture=new r.Texture(i,s(new r.Rectangle(0,0,t._lBorder,t._tBorder))),this._borderSprites[5].texture=new r.Texture(i,s(new r.Rectangle(0,i.height-t._bBorder,t._lBorder,t._bBorder))),this._borderSprites[7].texture=new r.Texture(i,s(new r.Rectangle(i.width-t._rBorder,i.height-t._bBorder,t._rBorder,t._bBorder))),this._updateSpritesAndTexturesSize(),this._updateLocalPositions(),this.updatePosition(),this._wrapperContainer.pivot.x=this._object._width/2,this._wrapperContainer.pivot.y=this._object._height/2}updateWidth(){this._wrapperContainer.pivot.x=this._object._width/2,this._updateSpritesAndTexturesSize(),this._updateLocalPositions(),this.updatePosition()}updateHeight(){this._wrapperContainer.pivot.y=this._object._height/2,this._updateSpritesAndTexturesSize(),this._updateLocalPositions(),this.updatePosition()}setColor(e){const h=e.split(";");if(!(h.length<3)){this._centerSprite.tint=n.rgbToHexNumber(parseInt(h[0],10),parseInt(h[1],10),parseInt(h[2],10));for(let t=0;t255&&(e=255),this.opacity=e,this._renderer.updateOpacity()}getOpacity(){return this.opacity}setColor(e){this._renderer.setColor(e)}getColor(){return this._renderer.getColor()}getScale(){return(this.getScaleX()+this.getScaleY())/2}getScaleX(){return this._width/this._renderer.getTextureWidth()}getScaleY(){return this._height/this._renderer.getTextureHeight()}setScale(e){this.setWidth(this._renderer.getTextureWidth()*e),this.setHeight(this._renderer.getTextureHeight()*e)}setScaleX(e){this.setWidth(this._renderer.getTextureWidth()*e)}setScaleY(e){this.setHeight(this._renderer.getTextureHeight()*e)}}i.PanelSpriteRuntimeObject=s,i.registerObject("PanelSpriteObject::PanelSprite",i.PanelSpriteRuntimeObject)})(gdjs||(gdjs={})); +//# sourceMappingURL=panelspriteruntimeobject.js.map diff --git a/desktop/apps/dezunkrr/Extensions/PathfindingBehavior/PathTools.js b/desktop/apps/dezunkrr/Extensions/PathfindingBehavior/PathTools.js new file mode 100644 index 0000000..2e40a28 --- /dev/null +++ b/desktop/apps/dezunkrr/Extensions/PathfindingBehavior/PathTools.js @@ -0,0 +1,2 @@ +var gdjs;(function(q){let D;(function(f){f.simplifyPath=(o,h,t=[],S=[])=>{if(o.length<=2)return t.length=0,t.push.apply(t,o),t;const r=h*h;let n=S;n.length=0,n.push(o[0]),n.push(o[o.length-1]);do{t.length=0,t.push(n[0]);let l=0;for(let a=0;a+1v&&(v=A,x=F)}x&&t.push(x),t.push(u)}const P=n;n=t,t=P}while(t.length!==n.length);return t},f.getPointSegmentDistanceSq=(o,h,t,S,r,n)=>{const l=r-t,P=n-S,a=o-t,e=h-S,u=l*l+P*P;if(u===0)return a*a+e*e;const g=(a*l+e*P)/u;if(g<0)return a*a+e*e;if(g>1)return(o-r)*(o-r)+(h-n)*(h-n);const s=t+g*l-o,c=S+g*P-h;return s*s+c*c}})(D=q.pathfinding||(q.pathfinding={}))})(gdjs||(gdjs={})); +//# sourceMappingURL=PathTools.js.map diff --git a/desktop/apps/dezunkrr/Extensions/PathfindingBehavior/pathfindingobstacleruntimebehavior.js b/desktop/apps/dezunkrr/Extensions/PathfindingBehavior/pathfindingobstacleruntimebehavior.js new file mode 100644 index 0000000..7ee675e --- /dev/null +++ b/desktop/apps/dezunkrr/Extensions/PathfindingBehavior/pathfindingobstacleruntimebehavior.js @@ -0,0 +1,2 @@ +var gdjs;(function(s){class n{constructor(e){this._obstaclesRBush=new rbush}static getManager(e){return e.pathfindingObstaclesManager||(e.pathfindingObstaclesManager=new s.PathfindingObstaclesManager(e)),e.pathfindingObstaclesManager}addObstacle(e){e.currentRBushAABB?e.currentRBushAABB.updateAABBFromOwner():e.currentRBushAABB=new s.BehaviorRBushAABB(e),this._obstaclesRBush.insert(e.currentRBushAABB)}removeObstacle(e){this._obstaclesRBush.remove(e.currentRBushAABB)}getAllObstaclesAround(e,t,a,r){const i=s.staticObject(n.prototype.getAllObstaclesAround);i.minX=e-a,i.minY=t-a,i.maxX=e+a,i.maxY=t+a;const h=this._obstaclesRBush.search(i);r.length=0,h.forEach(o=>r.push(o.behavior))}}s.PathfindingObstaclesManager=n;class g extends s.RuntimeBehavior{constructor(e,t,a){super(e,t,a);this._oldX=0;this._oldY=0;this._oldWidth=0;this._oldHeight=0;this._registeredInManager=!1;this.currentRBushAABB=null;this._impassable=t.impassable,this._cost=t.cost,this._manager=n.getManager(e)}updateFromBehaviorData(e,t){return e.impassable!==t.impassable&&this.setImpassable(t.impassable),e.cost!==t.cost&&this.setCost(t.cost),!0}onDestroy(){this._manager&&this._registeredInManager&&this._manager.removeObstacle(this)}doStepPreEvents(e){!this.activated()&&this._registeredInManager?(this._manager.removeObstacle(this),this._registeredInManager=!1):this.activated()&&!this._registeredInManager&&(this._manager.addObstacle(this),this._registeredInManager=!0),(this._oldX!==this.owner.getX()||this._oldY!==this.owner.getY()||this._oldWidth!==this.owner.getWidth()||this._oldHeight!==this.owner.getHeight())&&(this._registeredInManager&&(this._manager.removeObstacle(this),this._manager.addObstacle(this)),this._oldX=this.owner.getX(),this._oldY=this.owner.getY(),this._oldWidth=this.owner.getWidth(),this._oldHeight=this.owner.getHeight())}doStepPostEvents(e){}getAABB(){return this.owner.getAABB()}onActivate(){this._registeredInManager||(this._manager.addObstacle(this),this._registeredInManager=!0)}onDeActivate(){!this._registeredInManager||(this._manager.removeObstacle(this),this._registeredInManager=!1)}getCost(){return this._cost}setCost(e){this._cost=e}isImpassable(){return this._impassable}setImpassable(e){this._impassable=e}}s.PathfindingObstacleRuntimeBehavior=g,s.registerBehavior("PathfindingBehavior::PathfindingObstacleBehavior",s.PathfindingObstacleRuntimeBehavior)})(gdjs||(gdjs={})); +//# sourceMappingURL=pathfindingobstacleruntimebehavior.js.map diff --git a/desktop/apps/dezunkrr/Extensions/PathfindingBehavior/pathfindingruntimebehavior.js b/desktop/apps/dezunkrr/Extensions/PathfindingBehavior/pathfindingruntimebehavior.js new file mode 100644 index 0000000..29605a7 --- /dev/null +++ b/desktop/apps/dezunkrr/Extensions/PathfindingBehavior/pathfindingruntimebehavior.js @@ -0,0 +1,2 @@ +var gdjs;(function(l){const p=new l.Logger("Pathfinding behavior");class f extends l.RuntimeBehavior{constructor(s,e,o){super(s,e,o);this._path=[];this._pathFound=!1;this._speed=0;this._angularSpeed=0;this._distanceOnSegment=0;this._totalSegmentDistance=0;this._currentSegment=0;this._reachedEnd=!1;this._movementAngle=0;this._path===void 0||(this._path.length=0),this._allowDiagonals=e.allowDiagonals,this._acceleration=e.acceleration,this._maxSpeed=e.maxSpeed,this._angularMaxSpeed=e.angularMaxSpeed,this._rotateObject=e.rotateObject,this._angleOffset=e.angleOffset,this._cellWidth=e.cellWidth,this._cellHeight=e.cellHeight,this._gridOffsetX=e.gridOffsetX||0,this._gridOffsetY=e.gridOffsetY||0,this._extraBorder=e.extraBorder,this._smoothingMaxCellGap=e.smoothingMaxCellGap||0,this._manager=l.PathfindingObstaclesManager.getManager(s),this._searchContext=new l.PathfindingRuntimeBehavior.SearchContext(this._manager)}updateFromBehaviorData(s,e){return s.allowDiagonals!==e.allowDiagonals&&this.allowDiagonals(e.allowDiagonals),s.acceleration!==e.acceleration&&this.setAcceleration(e.acceleration),s.maxSpeed!==e.maxSpeed&&this.setMaxSpeed(e.maxSpeed),s.angularMaxSpeed!==e.angularMaxSpeed&&this.setAngularMaxSpeed(e.angularMaxSpeed),s.rotateObject!==e.rotateObject&&this.setRotateObject(e.rotateObject),s.angleOffset!==e.angleOffset&&this.setAngleOffset(e.angleOffset),s.cellWidth!==e.cellWidth&&this.setCellWidth(e.cellWidth),s.cellHeight!==e.cellHeight&&this.setCellHeight(e.cellHeight),s.gridOffsetX!==e.gridOffsetX&&(this._gridOffsetX=e.gridOffsetX),s.gridOffsetY!==e.gridOffsetY&&(this._gridOffsetY=e.gridOffsetY),s.extraBorder!==e.extraBorder&&this.setExtraBorder(e.extraBorder),s.smoothingMaxCellGap!==e.smoothingMaxCellGap&&(this._smoothingMaxCellGap=e.smoothingMaxCellGap),!0}setCellWidth(s){this._cellWidth=s}getCellWidth(){return this._cellWidth}setCellHeight(s){this._cellHeight=s}getCellHeight(){return this._cellHeight}setGridOffsetX(s){this._gridOffsetX=s}getGridOffsetX(){return this._gridOffsetX}setGridOffsetY(s){this._gridOffsetY=s}getGridOffsetY(){return this._gridOffsetY}setAcceleration(s){this._acceleration=s}getAcceleration(){return this._acceleration}setMaxSpeed(s){this._maxSpeed=s}getMaxSpeed(){return this._maxSpeed}setSpeed(s){this._speed=s}getSpeed(){return this._speed}getMovementAngle(){return this._movementAngle}movementAngleIsAround(s,e){return Math.abs(l.evtTools.common.angleDifference(this._movementAngle,s))<=e}setAngularMaxSpeed(s){this._angularMaxSpeed=s}getAngularMaxSpeed(){return this._angularMaxSpeed}setAngleOffset(s){this._angleOffset=s}getAngleOffset(){return this._angleOffset}setExtraBorder(s){this._extraBorder=s}getExtraBorder(){return this._extraBorder}allowDiagonals(s){this._allowDiagonals=s}diagonalsAllowed(){return this._allowDiagonals}setRotateObject(s){this._rotateObject=s}isObjectRotated(){return this._rotateObject}getNodeX(s){return s0){l.pathfinding.simplifyPath(this._path,this._smoothingMaxCellGap*Math.min(this._cellWidth,this._cellHeight),l.PathfindingRuntimeBehavior._smoothingResultVertices,l.PathfindingRuntimeBehavior._smoothingWorkingVertices);let g=this._path;this._path=l.PathfindingRuntimeBehavior._smoothingResultVertices,l.PathfindingRuntimeBehavior._smoothingResultVertices=g}this._enterSegment(0),this._pathFound=!0;return}this._pathFound=!1}_enterSegment(s){if(this._path.length!==0)if(this._currentSegment=s,this._currentSegmentthis._maxSpeed&&(this._speed=this._maxSpeed)),this._angularSpeed=this._angularMaxSpeed,this._distanceOnSegment+=(this._speed+o)/2*e;const t=this._totalSegmentDistance-this._distanceOnSegment;t<=0&&this._currentSegmentn)return console.warn(`No path was found after covering ${n} cells.`),!1;const a=this._openNodes.shift();if(a.open=!1,a.pos[0]==this._destination[0]&&a.pos[1]==this._destination[1])return this._finalNode=a,!0;this._insertNeighbors(a)}return!1}_freeAllNodes(){if(this._nodeCache.length<=32e3){for(const t in this._allNodes)if(this._allNodes.hasOwnProperty(t)){const i=this._allNodes[t];for(const h in i)i.hasOwnProperty(h)&&this._nodeCache.push(i[h])}}this._allNodes=[]}_insertNeighbors(t){this._addOrUpdateNode(t.pos[0]+1,t.pos[1],t,1),this._addOrUpdateNode(t.pos[0]-1,t.pos[1],t,1),this._addOrUpdateNode(t.pos[0],t.pos[1]+1,t,1),this._addOrUpdateNode(t.pos[0],t.pos[1]-1,t,1),this._allowDiagonals&&(this._addOrUpdateNode(t.pos[0]+1,t.pos[1]+1,t,1.414213562),this._addOrUpdateNode(t.pos[0]+1,t.pos[1]-1,t,1.414213562),this._addOrUpdateNode(t.pos[0]-1,t.pos[1]-1,t,1.414213562),this._addOrUpdateNode(t.pos[0]-1,t.pos[1]+1,t,1.414213562))}_getNode(t,i){if(this._allNodes.hasOwnProperty(t)){if(this._allNodes[t].hasOwnProperty(i))return this._allNodes[t][i]}else this._allNodes[t]=[];let h;this._nodeCache.length!==0?(h=this._nodeCache.shift(),h.reinitialize(t,i)):h=new c(t,i);const r=t*this._cellWidth+this._gridOffsetX,n=i*this._cellHeight+this._gridOffsetY;let a=!1;const _=this._cellHeight>this._cellWidth?this._cellHeight*2:this._cellWidth*2;this._obstacles.getAllObstaclesAround(r,n,_,this._closeObstacles);for(let g=0;gh.smallestCost+(h.cost+n.cost)/2*r)){if(n.smallestCost!=-1){for(let a=0;a=n.estimateCost){this._openNodes.splice(a,0,n);break}}}}e.SearchContext=s}(f=l.PathfindingRuntimeBehavior||(l.PathfindingRuntimeBehavior={}))})(gdjs||(gdjs={})); +//# sourceMappingURL=pathfindingruntimebehavior.js.map diff --git a/desktop/apps/dezunkrr/Extensions/PlayerAuthentication/playerauthenticationcomponents.js b/desktop/apps/dezunkrr/Extensions/PlayerAuthentication/playerauthenticationcomponents.js new file mode 100644 index 0000000..44696f0 --- /dev/null +++ b/desktop/apps/dezunkrr/Extensions/PlayerAuthentication/playerauthenticationcomponents.js @@ -0,0 +1,5 @@ +var gdjs;(function(y){const d=new y.Logger("Player Authentication");let m;(function(s){const u=({platform:o,isGameRegistered:t})=>t?{title:"Logging in...",text1:o==="cordova"?"One moment, we're opening a window for you to log in.":"One moment, we're opening a new page with your web browser for you to log in.",text2:"If the window did not open, please check your pop-up blocker and click the button below to try again."}:{title:"Publish your game!",text1:"GDevelop's player accounts are only available for published games.",text2:"Click the button below to learn how to publish your game then try again."};s.computeAuthenticationContainer=function(o){const t=document.createElement("div");t.id="authentication-root-container",t.style.position="relative",t.style.backgroundColor="rgba(14, 6, 45, 0.5)",t.style.opacity="1",t.style.width="100%",t.style.height="100%",t.style.zIndex="2",t.style.pointerEvents="all";const i=document.createElement("div");i.id="authentication-frame-container",i.style.backgroundColor="#FFFFFF",i.style.position="absolute",i.style.top="16px",i.style.bottom="16px",i.style.left="16px",i.style.right="16px",i.style.borderRadius="8px",i.style.boxShadow="0px 4px 4px rgba(0, 0, 0, 0.25)",i.style.padding="16px";const l=document.createElement("div");l.style.cursor="pointer",l.style.display="flex",l.style.justifyContent="right",l.style.alignItems="center",l.style.zIndex="3",r(l,o);const e=document.createElement("img");e.setAttribute("width","15px"),e.setAttribute("src","data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiB2aWV3Qm94PSIwIDAgOCA4IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcuODUzNTUgMC4xNDY0NDdDOC4wNDg4MiAwLjM0MTcwOSA4LjA0ODgyIDAuNjU4MjkxIDcuODUzNTUgMC44NTM1NTNMMC44NTM1NTMgNy44NTM1NUMwLjY1ODI5MSA4LjA0ODgyIDAuMzQxNzA5IDguMDQ4ODIgMC4xNDY0NDcgNy44NTM1NUMtMC4wNDg4MTU1IDcuNjU4MjkgLTAuMDQ4ODE1NSA3LjM0MTcxIDAuMTQ2NDQ3IDcuMTQ2NDVMNy4xNDY0NSAwLjE0NjQ0N0M3LjM0MTcxIC0wLjA0ODgxNTUgNy42NTgyOSAtMC4wNDg4MTU1IDcuODUzNTUgMC4xNDY0NDdaIiBmaWxsPSIjMUQxRDI2Ii8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMC4xNDY0NDcgMC4xNDY0NDdDMC4zNDE3MDkgLTAuMDQ4ODE1NSAwLjY1ODI5MSAtMC4wNDg4MTU1IDAuODUzNTUzIDAuMTQ2NDQ3TDcuODUzNTUgNy4xNDY0NUM4LjA0ODgyIDcuMzQxNzEgOC4wNDg4MiA3LjY1ODI5IDcuODUzNTUgNy44NTM1NUM3LjY1ODI5IDguMDQ4ODIgNy4zNDE3MSA4LjA0ODgyIDcuMTQ2NDUgNy44NTM1NUwwLjE0NjQ0NyAwLjg1MzU1M0MtMC4wNDg4MTU1IDAuNjU4MjkxIC0wLjA0ODgxNTUgMC4zNDE3MDkgMC4xNDY0NDcgMC4xNDY0NDdaIiBmaWxsPSIjMUQxRDI2Ii8+Cjwvc3ZnPgo="),l.appendChild(e);const n=document.createElement("div");n.id="authentication-container-loader",n.style.display="flex",n.style.flexDirection="column",n.style.height="100%",n.style.width="100%",n.style.justifyContent="center",n.style.alignItems="center";const c=document.createElement("img");c.setAttribute("width","28px"),c.setAttribute("src","data:image/svg+xml;base64,PHN2ZyBjbGFzcz0iYW5pbWF0ZS1zcGluIC1tbC0xIG1yLTMgaC01IHctNSB0ZXh0LXdoaXRlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyNCAyNCI+CjxjaXJjbGUgb3BhY2l0eT0nMC4yNScgY3g9IjEyIiBjeT0iMTIiIHI9IjEwIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSI0Ij48L2NpcmNsZT4KPHBhdGggb3BhY2l0eT0nMC43NScgZmlsbD0iY3VycmVudENvbG9yIiBkPSJNNCAxMmE4IDggMCAwMTgtOFYwQzUuMzczIDAgMCA1LjM3MyAwIDEyaDR6bTIgNS4yOTFBNy45NjIgNy45NjIgMCAwMTQgMTJIMGMwIDMuMDQyIDEuMTM1IDUuODI0IDMgNy45MzhsMy0yLjY0N3oiPjwvcGF0aD4KPC9zdmc+"),c.style.marginTop="50px";try{c.animate([{transform:"rotate(0deg)"},{transform:"rotate(359deg)"}],{duration:3e3,iterations:1/0})}catch{d.warn("Animation not supported, loader will be fixed.")}n.appendChild(c);const a=document.createElement("div");return a.style.display="flex",a.style.flexDirection="column",a.style.height="100%",a.style.width="100%",a.style.justifyContent="stretch",a.style.alignItems="stretch",a.style.display="none",i.appendChild(l),i.appendChild(n),i.appendChild(a),t.appendChild(i),{rootContainer:t,loaderContainer:n,iframeContainer:a}},s.displayIframeInsideAuthenticationContainer=(o,t,i,l)=>{const e=document.createElement("iframe");e.setAttribute("sandbox","allow-forms allow-modals allow-orientation-lock allow-popups allow-same-origin allow-scripts"),e.addEventListener("load",()=>{o.style.display="flex",t.style.display="none"}),e.addEventListener("loaderror",()=>{s.addAuthenticationUrlToTextsContainer(()=>{o.removeChild(e),o.style.display="none",t.style.display="flex",s.displayIframeInsideAuthenticationContainer(o,t,i,l)},i)}),e.src=l,e.style.flex="1",e.style.border="0",o.appendChild(e)},s.addAuthenticationTextsToLoadingContainer=(o,t,i,l)=>{const e=document.createElement("div");e.id="authentication-container-texts",e.style.display="flex",e.style.flexDirection="column",e.style.width="100%",e.style.justifyContent="center",e.style.alignItems="center",e.style.position="relative",e.style.zIndex="3",e.style.fontSize="11pt",e.style.fontFamily='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';const n=u({platform:t,isGameRegistered:i}),c=document.createElement("h1");c.innerText=n.title,c.style.fontSize="20pt",c.style.fontWeight="bold";const a=document.createElement("p");a.innerText=n.text1;const D=document.createElement("p");if(D.innerText=n.text2,e.appendChild(c),e.appendChild(a),e.appendChild(D),!i&&(o.innerHTML="",l)){const M=document.createElement("a");r(M,l),M.innerText="How to publish my game",M.style.color="#0078d4",M.style.textDecoration="none",M.style.textDecoration="underline",M.style.cursor="pointer",e.appendChild(M)}return o.prepend(e),e},s.addAuthenticationUrlToTextsContainer=(o,t)=>{const i=document.createElement("a");r(i,o),i.innerText="Try again",i.style.color="#0078d4",i.style.textDecoration="none",i.style.textDecoration="underline",i.style.cursor="pointer",t.appendChild(i)},s.computeDismissableBanner=function(o){const t=document.createElement("div");t.id="authenticated-banner",t.style.position="absolute",t.style.pointerEvents="all",t.style.backgroundColor="#0E062D",t.style.top="0px",t.style.height="48px",t.style.left="0px",t.style.width="100%",t.style.padding="6px 16px",t.style.zIndex="1",t.style.display="flex",t.style.flexDirection="row-reverse",t.style.justifyContent="space-between",t.style.alignItems="center",t.style.boxShadow="0px 4px 4px rgba(0, 0, 0, 0.25)",t.style.fontSize="11pt",t.style.color="#FFFFFF",t.style.fontFamily='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';const i=document.createElement("div");i.style.cursor="pointer",i.style.display="flex",i.style.justifyContent="center",i.style.alignItems="center",i.style.zIndex="3",i.style.marginRight="32px",i.style.height="100%",r(i,o);const l=document.createElement("img");return l.setAttribute("width","30px"),l.setAttribute("src","data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAzMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIzLjc1IDguMDEyNUwyMS45ODc1IDYuMjVMMTUgMTMuMjM3NUw4LjAxMjUgNi4yNUw2LjI1IDguMDEyNUwxMy4yMzc1IDE1TDYuMjUgMjEuOTg3NUw4LjAxMjUgMjMuNzVMMTUgMTYuNzYyNUwyMS45ODc1IDIzLjc1TDIzLjc1IDIxLjk4NzVMMTYuNzYyNSAxNUwyMy43NSA4LjAxMjVaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K"),i.appendChild(l),t.appendChild(i),t},s.computeAuthenticatedBanner=function(o,t,i){const l=s.computeDismissableBanner(t),e=i||"Anonymous",n=document.createElement("div"),c=document.createElement("p");c.id="loggedText",c.innerHTML=` + Logged as ${e}`,c.style.margin="0px";const a=document.createElement("p");return a.id="changeAccountText",a.innerText="Click here to switch to another account.",a.style.margin="0px",a.style.marginTop="4px",a.style.textDecoration="underline",a.style.cursor="pointer",r(a,o),n.appendChild(c),n.appendChild(a),l.appendChild(n),l},s.computeNotAuthenticatedBanner=function(o,t){const i=s.computeDismissableBanner(t),l=document.createElement("div"),e=document.createElement("p");e.id="loggedText",e.innerHTML="You are not authenticated.",e.style.margin="0px";const n=document.createElement("p");return n.id="changeAccountText",n.innerText="Click here to log in.",n.style.margin="0px",n.style.marginTop="4px",n.style.textDecoration="underline",n.style.cursor="pointer",r(n,o),l.appendChild(e),l.appendChild(n),i.appendChild(l),i},s.displayLoggedInNotification=function(o,t){s.showNotification(o,"authenticated-notification",` + Logged as ${t}`,"success")},s.displayLoggedOutNotification=function(o){s.showNotification(o,"authenticated-notification",` + Logged out`,"success")},s.displayErrorNotification=function(o){s.showNotification(o,"error-notification","An error occurred while authenticating, please try again.","error")},s.showNotification=function(o,t,i,l){const e=document.createElement("div");e.id=t,e.style.position="absolute",e.style.pointerEvents="all",e.style.backgroundColor=l==="success"?"#0E062D":"red",e.style.top="12px",e.style.right="16px",e.style.padding="6px 32px 6px 6px",e.style.zIndex="1",e.style.display="flex",e.style.flexDirection="row-reverse",e.style.justifyContent="space-between",e.style.alignItems="center",e.style.boxShadow="0px 4px 4px rgba(0, 0, 0, 0.25)",e.style.borderRadius="4px",e.style.fontSize="11pt",e.style.color="#FFFFFF",e.style.fontFamily='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';try{e.animate([{transform:"translateY(-30px)",opacity:0},{transform:"translateY(0px)",opacity:1}],{duration:700,easing:"ease-out"})}catch{d.warn("Animation not supported, div will be fixed.")}const n=document.createElement("p");n.id="loggedText",n.innerHTML=i,n.style.margin="0px",e.appendChild(n),o.appendChild(e);const c=700,a=5e3;setTimeout(()=>{try{e.animate([{transform:"translateY(0px)",opacity:1},{transform:"translateY(-30px)",opacity:0}],{duration:c,easing:"ease-in"})}catch{d.warn("Animation not supported, div will be fixed.")}},a),setTimeout(()=>{e.remove()},a+c)};const r=function(o,t){o.addEventListener("touchstart",i=>{t()}),o.addEventListener("click",i=>{t()})}})(m=y.playerAuthenticationComponents||(y.playerAuthenticationComponents={}))})(gdjs||(gdjs={})); +//# sourceMappingURL=playerauthenticationcomponents.js.map diff --git a/desktop/apps/dezunkrr/Extensions/PlayerAuthentication/playerauthenticationtools.js b/desktop/apps/dezunkrr/Extensions/PlayerAuthentication/playerauthenticationtools.js new file mode 100644 index 0000000..2adeae5 --- /dev/null +++ b/desktop/apps/dezunkrr/Extensions/PlayerAuthentication/playerauthenticationtools.js @@ -0,0 +1,2 @@ +var gdjs;(function(d){const a=new d.Logger("Player Authentication"),c=d.playerAuthenticationComponents;let S;(function(i){let f=null,T=null,p=null,M=!1,w=!1,G=null,b=null,E=null,C=null,D=null,h=null,l=null,x=null,W=null,u=null,_=null,g=null;d.registerRuntimeScenePostEventsCallback(()=>{M=!1}),d.registerFirstRuntimeSceneLoadedCallback(e=>{B(e)==="web"&&(L(),u=t=>{j(e,t,{checkOrigin:!0})},window.addEventListener("message",u,!0),a.info("Notifying parent window that player authentication is ready."),window.parent.postMessage({id:"playerAuthReady"},"*"),x=setTimeout(()=>{a.info("Removing initial authentication listener."),L()},3e3))});const O=e=>`${e}_authenticatedUser`,U=({runtimeGame:e,gameId:t,connectionId:n})=>`https://gd.games/auth?gameId=${t}${n?`&connectionId=${n}`:""}${e.isUsingGDevelopDevelopmentEnvironment()?"&dev=true":""}`,B=e=>e.getGame().getRenderer().getElectron()?"electron":typeof cordova!="undefined"?"cordova":"web",q=e=>{const t=e.getGame().getAdditionalOptions();return t&&t.isPreview&&t.allowAuthenticationUsingIframeForPreview};i.isAuthenticated=()=>(w||R(),p!==null),i.hasLoggedIn=()=>M,i.getUsername=()=>(w||R(),f||""),i.getUserToken=()=>(w||R(),p||null),i.getUserId=()=>(w||R(),T||null);const P=(e,t,n=0)=>{const r=`${e.isUsingGDevelopDevelopmentEnvironment()?"https://api-dev.gdevelop.io":"https://api.gdevelop.io"}/game/public-game/${t}`;return fetch(r,{method:"HEAD"}).then(s=>s.status!==200?(a.warn(`Error while fetching the game: ${s.status} ${s.statusText}`),s.status===404||n>2?!1:P(e,t,n+1)):!0,s=>(a.error("Error while fetching game:",s),!1))};i.logout=e=>{f=null,p=null,T=null;const t=d.projectData.properties.projectUuid;if(!t){a.error("Missing game id in project properties.");return}window.localStorage.removeItem(O(t)),k(e),i.removeAuthenticationBanner(e);const n=e.getGame().getRenderer().getDomElementContainer();if(!n){m(e,"The div element covering the game couldn't be found, the authentication banner cannot be displayed.");return}c.displayLoggedOutNotification(n)};const R=()=>{const e=d.projectData.properties.projectUuid;if(!e){a.error("Missing game id in project properties.");return}try{const t=window.localStorage.getItem(O(e));if(!t){w=!0;return}const n=JSON.parse(t);f=n.username,T=n.userId,p=n.userToken,w=!0}catch(t){a.warn("Unable to read authentication details from localStorage. Player authentication will not be available.",t)}},k=e=>{i.removeAuthenticationContainer(e),J(),g&&(g.close(),g=null),G&&(G.close(),G=null),b&&(b.close(),b=null)},F=({username:e,userId:t,userToken:n})=>{e||a.warn("The authenticated player does not have a username"),f=e,T=t,p=n,M=!0;const o=d.projectData.properties.projectUuid;if(!o){a.error("Missing game id in project properties.");return}try{window.localStorage.setItem(O(o),JSON.stringify({username:f,userId:T,userToken:p}))}catch(r){a.warn("Unable to save the authentication details to localStorage. Player authentication will not be available.",r)}},H=function(e,t,n,o){F({userId:t,username:n,userToken:o}),k(e),i.removeAuthenticationBanner(e);const r=e.getGame().getRenderer().getDomElementContainer();if(!r){m(e,"The div element covering the game couldn't be found, the authentication banner cannot be displayed.");return}c.displayLoggedInNotification(r,f||"Anonymous"),$(e)},j=function(e,t,{checkOrigin:n}){if(n&&!["https://liluo.io","https://gd.games"].includes(t.origin))throw new Error(`Unexpected origin: ${t.origin}`);if(!t.data.id)throw new Error("Malformed message");switch(t.data.id){case"authenticationResult":{if(!(t.data.body&&t.data.body.token))throw new Error("Malformed message.");H(e,t.data.body.userId,t.data.body.username,t.data.body.token);break}case"alreadyAuthenticated":{if(!(t.data.body&&t.data.body.token))throw new Error("Malformed message.");F({userId:t.data.body.userId,username:t.data.body.username,userToken:t.data.body.token}),L(),V(e);break}}},m=function(e,t){a.error(t),k(e);const n=e.getGame().getRenderer().getDomElementContainer();if(!n){m(e,"The div element covering the game couldn't be found, the authentication banner cannot be displayed.");return}c.displayErrorNotification(n),$(e)},z=e=>{J();const t=12*60*1e3;W=setTimeout(()=>{a.info("Authentication window did not send message in time. Closing it."),k(e),$(e)},t)},J=()=>{x&&clearTimeout(x),W&&clearTimeout(W)},K=function(e){const t=()=>{i.removeAuthenticationBanner(e)},n=()=>{i.openAuthenticationWindow(e)};return p?c.computeAuthenticatedBanner(n,t,f):c.computeNotAuthenticatedBanner(n,t)};i.displayAuthenticationBanner=function(e){if(l){l.style.opacity="1";return}w||R();const t=e.getGame().getRenderer().getDomElementContainer();if(!t){m(e,"The div element covering the game couldn't be found, the authentication banner cannot be displayed.");return}l=K(e),t.appendChild(l)};const V=function(e){if(!l)return;const t=e.getGame().getRenderer().getDomElementContainer();if(!t){m(e,"The div element covering the game couldn't be found, the authentication banner cannot be displayed.");return}const n=l;l=K(e),t.replaceChild(l,n)},X=(e,t)=>{const n=e.getGame().isUsingGDevelopDevelopmentEnvironment()?"wss://api-ws-dev.gdevelop.io/play":"wss://api-ws.gdevelop.io/play";g=new WebSocket(n),g.onopen=()=>{g&&g.send(JSON.stringify({action:"getConnectionId"}))},g.onerror=()=>{m(e,"Error while connecting to the authentication server.")},g.onmessage=o=>{if(o.data){const r=JSON.parse(o.data);switch(r.type){case"authenticationResult":{const s=r.data;H(e,s.userId,s.username,s.token);break}case"connectionId":{const v=r.data.connectionId;if(!v){a.error("No connectionId received");return}const y=U({runtimeGame:e.getGame(),gameId:t,connectionId:v}),I=e.getGame().getRenderer().getElectron(),A=()=>I.shell.openExternal(y);A(),h&&c.addAuthenticationUrlToTextsContainer(A,h);break}}}}},Y=(e,t)=>{const n=U({runtimeGame:e.getGame(),gameId:t});b=cordova.InAppBrowser.open(n,"authentication","location=yes"),b&&(_=o=>{j(e,o,{checkOrigin:!1})},b.addEventListener("message",_,!0))},Z=(e,t)=>{const n=U({runtimeGame:e.getGame(),gameId:t});u=y=>{j(e,y,{checkOrigin:!0})},window.addEventListener("message",u,!0);const o=screen.width/2-500/2,r=screen.height/2-600/2,s=`left=${o},top=${r},width=500,height=600`,v=()=>window.open(n,"authentication",s);G=v(),h&&c.addAuthenticationUrlToTextsContainer(v,h)},ee=(e,t)=>{if(!D||!C||!h){console.error("Can't open an authentication iframe - no iframe container, loader container or text container was opened for it.");return}const n=U({runtimeGame:e.getGame(),gameId:t});u=o=>{j(e,o,{checkOrigin:!0})},window.addEventListener("message",u,!0),c.displayIframeInsideAuthenticationContainer(D,C,h,n)};i.openAuthenticationWindow=function(e){const t=e.getGame().getRenderer().getDomElementContainer();if(!t){m(e,"The div element covering the game couldn't be found, the authentication window cannot be displayed.");return}const n=()=>{k(e),i.displayAuthenticationBanner(e)},o=d.projectData.properties.projectUuid;if(!o){m(e,"The game ID is missing, the authentication window cannot be opened.");return}l&&(l.style.opacity="0");const r=B(e),{rootContainer:s,loaderContainer:v,iframeContainer:y}=c.computeAuthenticationContainer(n);E=s,C=v,D=y,t.appendChild(E),P(e.getGame(),o).then(I=>{if(C){const A=e.getGame().getRenderer().getElectron(),oe=A?()=>A.shell.openExternal("https://wiki.gdevelop.io/gdevelop5/publishing/web"):null;h=c.addAuthenticationTextsToLoadingContainer(C,r,I,oe)}if(I)switch(z(e),r){case"electron":X(e,o);break;case"cordova":Y(e,o);break;case"web":default:q(e)?ee(e,o):Z(e,o);break}}).catch(I=>{m(e,"Error while checking if the game is registered."),a.error(I)})},i.isAuthenticationWindowOpen=function(){return!!E},i.removeAuthenticationContainer=function(e){L();const t=e.getGame().getRenderer().getDomElementContainer();if(!t){a.info("The div element covering the game couldn't be found, the authentication must be already closed.");return}E&&t.removeChild(E),E=null,C=null,D=null,h=null};const L=function(){u&&(window.removeEventListener("message",u,!0),u=null,_=null)};i.removeAuthenticationBanner=function(e){if(!l){a.info("The authentication banner couldn't be found, the authentication banner must be already closed.");return}const t=e.getGame().getRenderer().getDomElementContainer();if(!t){a.info("The div element covering the game couldn't be found, the authentication must be already closed.");return}t.removeChild(l),l=null};const $=function(e){const t=e.getGame().getRenderer().getCanvas();t&&t.focus()}})(S=d.playerAuthentication||(d.playerAuthentication={}))})(gdjs||(gdjs={})); +//# sourceMappingURL=playerauthenticationtools.js.map diff --git a/desktop/apps/dezunkrr/Extensions/SystemInfo/systeminfotools.js b/desktop/apps/dezunkrr/Extensions/SystemInfo/systeminfotools.js new file mode 100644 index 0000000..b9932b7 --- /dev/null +++ b/desktop/apps/dezunkrr/Extensions/SystemInfo/systeminfotools.js @@ -0,0 +1,2 @@ +var gdjs;(function(t){let r;(function(a){let c;(function(e){let n=null,i=null;const s=()=>{if(typeof cc!="undefined"&&cc.sys)return cc.sys.isMobile;if(typeof Cocoon!="undefined"&&Cocoon.App)return!0;if(typeof window!="undefined"&&window.cordova)return!0;if(typeof window!="undefined"){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))||/iPad|iPhone|iPod/.test(navigator.platform))return!0;if(/MacIntel/.test(navigator.platform))return!!navigator.maxTouchPoints&&navigator.maxTouchPoints>2}return!1};e.isMobile=()=>n!==null?n:n=s(),e.isNativeMobileApp=()=>typeof window!="undefined"&&window.cordova,e.isNativeDesktopApp=o=>!!o.getGame().getRenderer().getElectron();const l=()=>e.isMobile()?!0:!!navigator.maxTouchPoints&&navigator.maxTouchPoints>2;e.hasTouchScreen=()=>i!==null?i:i=l(),e.isWebGLSupported=o=>o.getGame().getRenderer().isWebGLSupported(),e.isPreview=o=>o.getGame().isPreview()})(c=a.systemInfo||(a.systemInfo={}))})(r=t.evtTools||(t.evtTools={}))})(gdjs||(gdjs={})); +//# sourceMappingURL=systeminfotools.js.map diff --git a/desktop/apps/dezunkrr/Extensions/TextObject/textruntimeobject-pixi-renderer.js b/desktop/apps/dezunkrr/Extensions/TextObject/textruntimeobject-pixi-renderer.js new file mode 100644 index 0000000..1531127 --- /dev/null +++ b/desktop/apps/dezunkrr/Extensions/TextObject/textruntimeobject-pixi-renderer.js @@ -0,0 +1,2 @@ +var gdjs;(function(i){const o=GlobalPIXIModule.PIXI;class s{constructor(e,t){this._justCreated=!0;this._object=e,this._fontManager=t.getGame().getFontManager(),this._text=new o.Text(" ",{align:"left"}),this._text.anchor.x=.5,this._text.anchor.y=.5,t.getLayer("").getRenderer().addRendererObject(this._text,e.getZOrder()),this._text.text=e._str.length===0?" ":e._str,this.updateStyle(),this.updatePosition()}getRendererObject(){return this._text}ensureUpToDate(){this._justCreated&&(this._text.updateText(!1),this.updatePosition(),this._justCreated=!1)}updateStyle(){const e='"'+this._fontManager.getFontFamily(this._object._fontName)+'"',t=this._text.style;t.fontStyle=this._object._italic?"italic":"normal",t.fontWeight=this._object._bold?"bold":"normal",t.fontSize=this._object._characterSize,t.fontFamily=e,this._object._useGradient?t.fill=this._getGradientHex():t.fill=this._getColorHex(),this._object._gradientType==="LINEAR_VERTICAL"?t.fillGradientType=o.TEXT_GRADIENT.LINEAR_VERTICAL:t.fillGradientType=o.TEXT_GRADIENT.LINEAR_HORIZONTAL,t.align=this._object._textAlign,t.wordWrap=this._object._wrapping,t.wordWrapWidth=this._object._wrappingWidth,t.breakWords=!0,t.stroke=i.rgbToHexNumber(this._object._outlineColor[0],this._object._outlineColor[1],this._object._outlineColor[2]),t.strokeThickness=this._object._outlineThickness,t.dropShadow=this._object._shadow,t.dropShadowColor=i.rgbToHexNumber(this._object._shadowColor[0],this._object._shadowColor[1],this._object._shadowColor[2]),t.dropShadowBlur=this._object._shadowBlur,t.dropShadowAngle=this._object._shadowAngle,t.dropShadowDistance=this._object._shadowDistance,t.padding=this._object._padding,t.miterLimit=3,this.updatePosition(),this._text.dirty=!0}updatePosition(){if(this._object.isWrapping()){const e=this._object._textAlign==="right"?1:this._object._textAlign==="center"?.5:0,t=this._object.getWrappingWidth(),_=(t-this._text.width)*(e-.5);this._text.position.x=this._object.x+t/2,this._text.anchor.x=.5-_/this._text.width}else this._text.position.x=this._object.x+this._text.width/2,this._text.anchor.x=.5;this._text.position.y=this._object.y+this._text.height/2}updateAngle(){this._text.rotation=i.toRad(this._object.angle)}updateOpacity(){this._text.alpha=this._object.opacity/255}updateString(){this._text.text=this._object._str.length===0?" ":this._object._str,this._text.updateText(!1)}getWidth(){return this._text.width}getHeight(){return this._text.height}_getColorHex(){return i.rgbToHexNumber(this._object._color[0],this._object._color[1],this._object._color[2])}_getGradientHex(){const e=[];for(let t=0;t255&&(t=255),this.opacity=t,this._renderer.updateOpacity()}getOpacity(){return this.opacity}getString(){return this._str}setString(t){t!==this._str&&(this._str=t,this._renderer.updateString(),this._updateTextPosition())}getCharacterSize(){return this._characterSize}setCharacterSize(t){t<=1&&(t=1),this._characterSize=t,this._renderer.updateStyle()}setFontName(t){this._fontName=t,this._renderer.updateStyle()}isBold(){return this._bold}setBold(t){this._bold=t,this._renderer.updateStyle()}isItalic(){return this._italic}setItalic(t){this._italic=t,this._renderer.updateStyle()}getWidth(){return this._wrapping?this._wrappingWidth:this._renderer.getWidth()}getHeight(){return this._renderer.getHeight()}getScale(){return(Math.abs(this._scaleX)+Math.abs(this._scaleY))/2}getScaleX(){return this._scaleX}getScaleY(){return this._scaleY}setScale(t){this._scaleX===t&&this._scaleY===t||(this._scaleX=t,this._scaleY=t,this._renderer.setScale(t),this.invalidateHitboxes())}setScaleX(t){this._scaleX!==t&&(this._scaleX=t,this._renderer.setScaleX(t),this.invalidateHitboxes())}setScaleY(t){this._scaleY!==t&&(this._scaleY=t,this._renderer.setScaleY(t),this.invalidateHitboxes())}setColor(t){const e=t.split(";");e.length<3||(this._color[0]=parseInt(e[0],10),this._color[1]=parseInt(e[1],10),this._color[2]=parseInt(e[2],10),this._useGradient=!1,this._renderer.updateStyle())}getColor(){return this._color[0]+";"+this._color[1]+";"+this._color[2]}setTextAlignment(t){this._textAlign=t,this._renderer.updateStyle()}getTextAlignment(){return this._textAlign}isWrapping(){return this._wrapping}setWrapping(t){this._wrapping!==t&&(this._wrapping=t,this._renderer.updateStyle(),this.invalidateHitboxes())}getWrappingWidth(){return this._wrappingWidth}setWrappingWidth(t){t<=1&&(t=1),this._wrappingWidth!==t&&(this._wrappingWidth=t,this._renderer.updateStyle(),this.invalidateHitboxes())}setOutline(t,e){const i=t.split(";");i.length<3||(this._outlineColor[0]=parseInt(i[0],10),this._outlineColor[1]=parseInt(i[1],10),this._outlineColor[2]=parseInt(i[2],10),this._outlineThickness=e,this._renderer.updateStyle())}setShadow(t,e,i,a){const r=t.split(";");r.length<3||(this._shadowColor[0]=parseInt(r[0],10),this._shadowColor[1]=parseInt(r[1],10),this._shadowColor[2]=parseInt(r[2],10),this._shadowDistance=e,this._shadowBlur=i,this._shadowAngle=a,this._shadow=!0,this._renderer.updateStyle())}setGradient(t,e,i,a,r){const n=e.split(";"),o=i.split(";"),l=a.split(";"),h=r.split(";");this._gradient=[],n.length==3&&this._gradient.push([parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10)]),o.length==3&&this._gradient.push([parseInt(o[0],10),parseInt(o[1],10),parseInt(o[2],10)]),l.length==3&&this._gradient.push([parseInt(l[0],10),parseInt(l[1],10),parseInt(l[2],10)]),h.length==3&&this._gradient.push([parseInt(h[0],10),parseInt(h[1],10),parseInt(h[2],10)]),this._gradientType=t,this._useGradient=this._gradient.length>1,this._renderer.updateStyle()}showShadow(t){this._shadow=t,this._renderer.updateStyle()}getPadding(){return this._padding}setPadding(t){this._padding=t,this._renderer.updateStyle()}}s.TextRuntimeObject=d,s.registerObject("TextObject::Text",s.TextRuntimeObject)})(gdjs||(gdjs={})); +//# sourceMappingURL=textruntimeobject.js.map diff --git a/desktop/apps/dezunkrr/Extensions/TiledSpriteObject/tiledspriteruntimeobject-pixi-renderer.js b/desktop/apps/dezunkrr/Extensions/TiledSpriteObject/tiledspriteruntimeobject-pixi-renderer.js new file mode 100644 index 0000000..f65e5bb --- /dev/null +++ b/desktop/apps/dezunkrr/Extensions/TiledSpriteObject/tiledspriteruntimeobject-pixi-renderer.js @@ -0,0 +1,2 @@ +var gdjs;(function(i){const s=GlobalPIXIModule.PIXI;class d{constructor(t,e,r){this._object=t;const o=e.getGame().getImageManager().getPIXITexture(r);this._tiledSprite=new s.TilingSprite(o,1024,1024),e.getLayer("").getRenderer().addRendererObject(this._tiledSprite,t.getZOrder()),this.updatePosition(),this.updateAngle(),this.updateXOffset(),this.updateYOffset()}getRendererObject(){return this._tiledSprite}updateOpacity(){this._tiledSprite.alpha=this._object.opacity/255}updatePosition(){this._tiledSprite.position.x=this._object.x+this._tiledSprite.width/2,this._tiledSprite.position.y=this._object.y+this._tiledSprite.height/2}setTexture(t,e){const r=e.getGame().getImageManager().getPIXITexture(t);this._tiledSprite.texture=r,this.updatePosition()}updateAngle(){this._tiledSprite.rotation=i.toRad(this._object.angle)}getWidth(){return this._tiledSprite.width}getHeight(){return this._tiledSprite.height}setWidth(t){this._tiledSprite.width=t,this._tiledSprite.pivot.x=t/2,this.updatePosition()}setHeight(t){this._tiledSprite.height=t,this._tiledSprite.pivot.y=t/2,this.updatePosition()}updateXOffset(){this._tiledSprite.tilePosition.x=-this._object._xOffset%this._tiledSprite.texture.width}updateYOffset(){this._tiledSprite.tilePosition.y=-this._object._yOffset%this._tiledSprite.texture.height}setColor(t){const e=t.split(";");e.length<3||(this._tiledSprite.tint="0x"+i.rgbToHex(parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10)))}getColor(){const t=s.utils.hex2rgb(this._tiledSprite.tint);return Math.floor(t[0]*255)+";"+Math.floor(t[1]*255)+";"+Math.floor(t[2]*255)}getTextureWidth(){return this._tiledSprite.texture.width}getTextureHeight(){return this._tiledSprite.texture.height}}i.TiledSpriteRuntimeObjectRenderer=d})(gdjs||(gdjs={})); +//# sourceMappingURL=tiledspriteruntimeobject-pixi-renderer.js.map diff --git a/desktop/apps/dezunkrr/Extensions/TiledSpriteObject/tiledspriteruntimeobject.js b/desktop/apps/dezunkrr/Extensions/TiledSpriteObject/tiledspriteruntimeobject.js new file mode 100644 index 0000000..cdbb265 --- /dev/null +++ b/desktop/apps/dezunkrr/Extensions/TiledSpriteObject/tiledspriteruntimeobject.js @@ -0,0 +1,2 @@ +var gdjs;(function(i){class r extends i.RuntimeObject{constructor(e,t){super(e,t);this._xOffset=0;this._yOffset=0;this.opacity=255;this._renderer=new i.TiledSpriteRuntimeObjectRenderer(this,e,t.texture),this._width=0,this._height=0,this.setWidth(t.width),this.setHeight(t.height),this.onCreated()}updateFromObjectData(e,t){return e.texture!==t.texture&&this.setTexture(t.texture,this.getRuntimeScene()),e.width!==t.width&&this.setWidth(t.width),e.height!==t.height&&this.setHeight(t.height),!0}getRendererObject(){return this._renderer.getRendererObject()}onDestroyFromScene(e){super.onDestroyFromScene(e),this._renderer.onDestroy&&this._renderer.onDestroy()}extraInitializationFromInitialInstance(e){e.customSize&&(this.setWidth(e.width),this.setHeight(e.height))}setX(e){super.setX(e),this._renderer.updatePosition()}setY(e){super.setY(e),this._renderer.updatePosition()}setTexture(e,t){this._renderer.setTexture(e,t)}setAngle(e){super.setAngle(e),this._renderer.updateAngle()}getWidth(){return this._width}getHeight(){return this._height}setWidth(e){this._width!==e&&(this._width=e,this._renderer.setWidth(e),this.invalidateHitboxes())}setHeight(e){this._height!==e&&(this._height=e,this._renderer.setHeight(e),this.invalidateHitboxes())}setSize(e,t){this.setWidth(e),this.setHeight(t)}setXOffset(e){this._xOffset=e,this._renderer.updateXOffset()}setYOffset(e){this._yOffset=e,this._renderer.updateYOffset()}getXOffset(){return this._xOffset}getYOffset(){return this._yOffset}setOpacity(e){e<0&&(e=0),e>255&&(e=255),this.opacity=e,this._renderer.updateOpacity()}getOpacity(){return this.opacity}setColor(e){this._renderer.setColor(e)}getColor(){return this._renderer.getColor()}getScale(){return(this.getScaleX()+this.getScaleY())/2}getScaleX(){return this._width/this._renderer.getTextureWidth()}getScaleY(){return this._height/this._renderer.getTextureHeight()}setScale(e){this.setWidth(this._renderer.getTextureWidth()*e),this.setHeight(this._renderer.getTextureHeight()*e)}setScaleX(e){this.setWidth(this._renderer.getTextureWidth()*e)}setScaleY(e){this.setHeight(this._renderer.getTextureHeight()*e)}}i.TiledSpriteRuntimeObject=r,i.registerObject("TiledSpriteObject::TiledSprite",i.TiledSpriteRuntimeObject)})(gdjs||(gdjs={})); +//# sourceMappingURL=tiledspriteruntimeobject.js.map diff --git a/desktop/apps/dezunkrr/Extensions/TweenBehavior/shifty.js b/desktop/apps/dezunkrr/Extensions/TweenBehavior/shifty.js new file mode 100644 index 0000000..08bf14e --- /dev/null +++ b/desktop/apps/dezunkrr/Extensions/TweenBehavior/shifty.js @@ -0,0 +1,5 @@ +/*! For license information please see shifty.js.LICENSE.txt */ +/* v2.20.4 */ +!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("shifty",[],n):"object"==typeof exports?exports.shifty=n():t.shifty=n()}(self,(function(){return function(){"use strict";var t={720:function(t,n,e){e.r(n),e.d(n,{Scene:function(){return sn},Tweenable:function(){return kt},interpolate:function(){return nn},processTweens:function(){return dt},setBezierFunction:function(){return $},shouldScheduleUpdate:function(){return bt},tween:function(){return Pt},unsetBezierFunction:function(){return L}});var r={};e.r(r),e.d(r,{bounce:function(){return D},bouncePast:function(){return q},easeFrom:function(){return B},easeFromTo:function(){return Q},easeInBack:function(){return E},easeInCirc:function(){return j},easeInCubic:function(){return c},easeInExpo:function(){return w},easeInOutBack:function(){return T},easeInOutCirc:function(){return P},easeInOutCubic:function(){return l},easeInOutExpo:function(){return S},easeInOutQuad:function(){return s},easeInOutQuart:function(){return v},easeInOutQuint:function(){return d},easeInOutSine:function(){return b},easeInQuad:function(){return u},easeInQuart:function(){return h},easeInQuint:function(){return y},easeInSine:function(){return g},easeOutBack:function(){return A},easeOutBounce:function(){return M},easeOutCirc:function(){return k},easeOutCubic:function(){return f},easeOutExpo:function(){return O},easeOutQuad:function(){return a},easeOutQuart:function(){return p},easeOutQuint:function(){return _},easeOutSine:function(){return m},easeTo:function(){return N},elastic:function(){return I},linear:function(){return o},swingFrom:function(){return x},swingFromTo:function(){return F},swingTo:function(){return C}});var i={};e.r(i),e.d(i,{afterTween:function(){return Jt},beforeTween:function(){return Ht},doesApply:function(){return Wt},tweenCreated:function(){return Gt}});var o=function(t){return t},u=function(t){return Math.pow(t,2)},a=function(t){return-(Math.pow(t-1,2)-1)},s=function(t){return(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2)},c=function(t){return Math.pow(t,3)},f=function(t){return Math.pow(t-1,3)+1},l=function(t){return(t/=.5)<1?.5*Math.pow(t,3):.5*(Math.pow(t-2,3)+2)},h=function(t){return Math.pow(t,4)},p=function(t){return-(Math.pow(t-1,4)-1)},v=function(t){return(t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},y=function(t){return Math.pow(t,5)},_=function(t){return Math.pow(t-1,5)+1},d=function(t){return(t/=.5)<1?.5*Math.pow(t,5):.5*(Math.pow(t-2,5)+2)},g=function(t){return 1-Math.cos(t*(Math.PI/2))},m=function(t){return Math.sin(t*(Math.PI/2))},b=function(t){return-.5*(Math.cos(Math.PI*t)-1)},w=function(t){return 0===t?0:Math.pow(2,10*(t-1))},O=function(t){return 1===t?1:1-Math.pow(2,-10*t)},S=function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},j=function(t){return-(Math.sqrt(1-t*t)-1)},k=function(t){return Math.sqrt(1-Math.pow(t-1,2))},P=function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},M=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},E=function(t){var n=1.70158;return t*t*((n+1)*t-n)},A=function(t){var n=1.70158;return(t-=1)*t*((n+1)*t+n)+1},T=function(t){var n=1.70158;return(t/=.5)<1?t*t*((1+(n*=1.525))*t-n)*.5:.5*((t-=2)*t*((1+(n*=1.525))*t+n)+2)},I=function(t){return-1*Math.pow(4,-8*t)*Math.sin((6*t-1)*(2*Math.PI)/2)+1},F=function(t){var n=1.70158;return(t/=.5)<1?t*t*((1+(n*=1.525))*t-n)*.5:.5*((t-=2)*t*((1+(n*=1.525))*t+n)+2)},x=function(t){var n=1.70158;return t*t*((n+1)*t-n)},C=function(t){var n=1.70158;return(t-=1)*t*((n+1)*t+n)+1},D=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},q=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?2-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?2-(7.5625*(t-=2.25/2.75)*t+.9375):2-(7.5625*(t-=2.625/2.75)*t+.984375)},Q=function(t){return(t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},B=function(t){return Math.pow(t,4)},N=function(t){return Math.pow(t,.25)};function R(t,n,e,r,i,o){var u,a,s,c,f,l=0,h=0,p=0,v=function(t){return((l*t+h)*t+p)*t},y=function(t){return(3*l*t+2*h)*t+p},_=function(t){return t>=0?t:0-t};return l=1-(p=3*n)-(h=3*(r-n)-p),s=1-(f=3*e)-(c=3*(i-e)-f),u=t,a=function(t){return 1/(200*t)}(o),function(t){return((s*t+c)*t+f)*t}(function(t,n){var e,r,i,o,u,a;for(i=t,a=0;a<8;a++){if(o=v(i)-t,_(o)(r=1))return r;for(;eo?e=i:r=i,i=.5*(r-e)+e}return i}(u,a))}var z,U=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.25,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.25,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.75,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.75;return function(i){return R(i,t,n,e,r,1)}},$=function(t,n,e,r,i){var o=U(n,e,r,i);return o.displayName=t,o.x1=n,o.y1=e,o.x2=r,o.y2=i,kt.formulas[t]=o},L=function(t){return delete kt.formulas[t]};function V(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function W(t,n){for(var e=0;et.length)&&(n=t.length);for(var e=0,r=new Array(n);ea?a:n;t._hasEnded=s>=a;var c=o-(a-s),f=t._filters.length>0;if(t._hasEnded)return t._render(u,t._data,c),t.stop(!0);f&&t._applyFilter(ut),s1&&void 0!==arguments[1]?arguments[1]:et,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Array.isArray(n)){var r=U.apply(void 0,H(n));return r}var i=G(n);if(vt[n])return vt[n];if(i===ct||i===st)for(var o in t)e[o]=n;else for(var u in t)e[u]=n[u]||et;return e},St=function(t){t===ht?(ht=t._next)?ht._previous=null:pt=null:t===pt?(pt=t._previous)?pt._next=null:ht=null:(tt=t._previous,nt=t._next,tt._next=nt,nt._previous=tt),t._previous=t._next=null},jt="function"==typeof Promise?Promise:null;z=Symbol.toStringTag;var kt=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;V(this,t),Y(this,z,"Promise"),this._config={},this._data={},this._delay=0,this._filters=[],this._next=null,this._previous=null,this._timestamp=null,this._hasEnded=!1,this._resolve=null,this._reject=null,this._currentState=n||{},this._originalState={},this._targetState={},this._start=lt,this._render=lt,this._promiseCtor=jt,e&&this.setConfig(e)}var n,e;return n=t,e=[{key:"_applyFilter",value:function(t){for(var n=this._filters.length;n>0;n--){var e=this._filters[n-n][t];e&&e(this)}}},{key:"tween",value:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return this._isPlaying&&this.stop(),!n&&this._config||this.setConfig(n),this._pausedAtTime=null,this._timestamp=t.now(),this._start(this.get(),this._data),this._delay&&this._render(this._currentState,this._data,0),this._resume(this._timestamp)}},{key:"setConfig",value:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this._config;for(var r in n)e[r]=n[r];var i=e.promise,o=void 0===i?this._promiseCtor:i,u=e.start,a=void 0===u?lt:u,s=e.finish,c=e.render,f=void 0===c?this._config.step||lt:c,l=e.step,h=void 0===l?lt:l;this._data=e.data||e.attachment||this._data,this._isPlaying=!1,this._pausedAtTime=null,this._scheduleId=null,this._delay=n.delay||0,this._start=a,this._render=f||h,this._duration=e.duration||500,this._promiseCtor=o,s&&(this._resolve=s);var p=n.from,v=n.to,y=void 0===v?{}:v,_=this._currentState,d=this._originalState,g=this._targetState;for(var m in p)_[m]=p[m];var b=!1;for(var w in _){var O=_[w];b||G(O)!==ct||(b=!0),d[w]=O,g[w]=y.hasOwnProperty(w)?y[w]:O}if(this._easing=Ot(this._currentState,e.easing,this._easing),this._filters.length=0,b){for(var S in t.filters)t.filters[S].doesApply(this)&&this._filters.push(t.filters[S]);this._applyFilter(at)}return this}},{key:"then",value:function(t,n){var e=this;return this._promise=new this._promiseCtor((function(t,n){e._resolve=t,e._reject=n})),this._promise.then(t,n)}},{key:"catch",value:function(t){return this.then().catch(t)}},{key:"finally",value:function(t){return this.then().finally(t)}},{key:"get",value:function(){return X({},this._currentState)}},{key:"set",value:function(t){this._currentState=t}},{key:"pause",value:function(){if(this._isPlaying)return this._pausedAtTime=t.now(),this._isPlaying=!1,St(this),this}},{key:"resume",value:function(){return this._resume()}},{key:"_resume",value:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.now();return null===this._timestamp?this.tween():this._isPlaying?this._promise:(this._pausedAtTime&&(this._timestamp+=n-this._pausedAtTime,this._pausedAtTime=null),this._isPlaying=!0,null===ht?(ht=this,pt=this):(this._previous=pt,pt._next=this,pt=this),this)}},{key:"seek",value:function(n){n=Math.max(n,0);var e=t.now();return this._timestamp+n===0||(this._timestamp=e-n,_t(this,e)),this}},{key:"stop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._isPlaying)return this;this._isPlaying=!1,St(this);var n=this._filters.length>0;return t&&(n&&this._applyFilter(ut),yt(1,this._currentState,this._originalState,this._targetState,1,0,this._easing),n&&(this._applyFilter(it),this._applyFilter(ot))),this._resolve&&this._resolve({data:this._data,state:this._currentState,tweenable:this}),this._resolve=null,this._reject=null,this}},{key:"cancel",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this._currentState,e=this._data,r=this._isPlaying;return r?(this._reject&&this._reject({data:e,state:n,tweenable:this}),this._resolve=null,this._reject=null,this.stop(t)):this}},{key:"isPlaying",value:function(){return this._isPlaying}},{key:"hasEnded",value:function(){return this._hasEnded}},{key:"setScheduleFunction",value:function(n){t.setScheduleFunction(n)}},{key:"data",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t&&(this._data=X({},t)),this._data}},{key:"dispose",value:function(){for(var t in this)delete this[t]}}],e&&W(n.prototype,e),t}();function Pt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=new kt;return n.tween(t),n.tweenable=n,n}Y(kt,"now",(function(){return Z})),Y(kt,"setScheduleFunction",(function(t){return ft=t})),Y(kt,"filters",{}),Y(kt,"formulas",vt),bt(!0);var Mt,Et,At=/(\d|-|\.)/,Tt=/([^\-0-9.]+)/g,It=/[0-9.-]+/g,Ft=(Mt=It.source,Et=/,\s*/.source,new RegExp("rgba?\\(".concat(Mt).concat(Et).concat(Mt).concat(Et).concat(Mt,"(").concat(Et).concat(Mt,")?\\)"),"g")),xt=/^.*\(/,Ct=/#([0-9]|[a-f]){3,6}/gi,Dt="VAL",qt=function(t,n){return t.map((function(t,e){return"_".concat(n,"_").concat(e)}))};function Qt(t){return parseInt(t,16)}var Bt=function(t){return"rgb(".concat((n=t,3===(n=n.replace(/#/,"")).length&&(n=(n=n.split(""))[0]+n[0]+n[1]+n[1]+n[2]+n[2]),[Qt(n.substr(0,2)),Qt(n.substr(2,2)),Qt(n.substr(4,2))]).join(","),")");var n},Nt=function(t,n,e){var r=n.match(t),i=n.replace(t,Dt);return r&&r.forEach((function(t){return i=i.replace(Dt,e(t))})),i},Rt=function(t){for(var n in t){var e=t[n];"string"==typeof e&&e.match(Ct)&&(t[n]=Nt(Ct,e,Bt))}},zt=function(t){var n=t.match(It),e=n.slice(0,3).map(Math.floor),r=t.match(xt)[0];if(3===n.length)return"".concat(r).concat(e.join(","),")");if(4===n.length)return"".concat(r).concat(e.join(","),",").concat(n[3],")");throw new Error("Invalid rgbChunk: ".concat(t))},Ut=function(t){return t.match(It)},$t=function(t,n){var e={};return n.forEach((function(n){e[n]=t[n],delete t[n]})),e},Lt=function(t,n){return n.map((function(n){return t[n]}))},Vt=function(t,n){return n.forEach((function(n){return t=t.replace(Dt,+n.toFixed(4))})),t},Wt=function(t){for(var n in t._currentState)if("string"==typeof t._currentState[n])return!0;return!1};function Gt(t){var n=t._currentState;[n,t._originalState,t._targetState].forEach(Rt),t._tokenData=function(t){var n,e,r={};for(var i in t){var o=t[i];"string"==typeof o&&(r[i]={formatString:(n=o,e=void 0,e=n.match(Tt),e?(1===e.length||n.charAt(0).match(At))&&e.unshift(""):e=["",""],e.join(Dt)),chunkNames:qt(Ut(o),i)})}return r}(n)}function Ht(t){var n=t._currentState,e=t._originalState,r=t._targetState,i=t._easing,o=t._tokenData;!function(t,n){var e=function(e){var r=n[e].chunkNames,i=t[e];if("string"==typeof i){var o=i.split(" "),u=o[o.length-1];r.forEach((function(n,e){return t[n]=o[e]||u}))}else r.forEach((function(n){return t[n]=i}));delete t[e]};for(var r in n)e(r)}(i,o),[n,e,r].forEach((function(t){return function(t,n){var e=function(e){Ut(t[e]).forEach((function(r,i){return t[n[e].chunkNames[i]]=+r})),delete t[e]};for(var r in n)e(r)}(t,o)}))}function Jt(t){var n=t._currentState,e=t._originalState,r=t._targetState,i=t._easing,o=t._tokenData;[n,e,r].forEach((function(t){return function(t,n){for(var e in n){var r=n[e],i=r.chunkNames,o=r.formatString,u=Vt(o,Lt($t(t,i),i));t[e]=Nt(Ft,u,zt)}}(t,o)})),function(t,n){for(var e in n){var r=n[e].chunkNames,i=t[r[0]];t[e]="string"==typeof i?r.map((function(n){var e=t[n];return delete t[n],e})).join(" "):i}}(i,o)}function Kt(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function Xt(t){for(var n=1;n4&&void 0!==arguments[4]?arguments[4]:0,o=Xt({},t),u=Ot(t,r);for(var a in Zt._filters.length=0,Zt.set({}),Zt._currentState=o,Zt._originalState=t,Zt._targetState=n,Zt._easing=u,tn)tn[a].doesApply(Zt)&&Zt._filters.push(tn[a]);Zt._applyFilter("tweenCreated"),Zt._applyFilter("beforeTween");var s=yt(e,o,t,n,1,i,u);return Zt._applyFilter("afterTween"),s};function en(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);et-n*Math.max(Math.min(i-3,9-i,1),-1);return[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)]}const f=class extends l.RuntimeBehavior{constructor(e,t,n){super(e,t,n);this._tweens={};this._isActive=!0;this._runtimeScene=e.getScene()}updateFromBehaviorData(e,t){return!0}onDestroy(){const e=this._runtimeScene.shiftyJsScene;if(!!e)for(const t in this._tweens)this._tweens[t].instance.stop(),e.remove(this._tweens[t].instance)}_addTween(e,t,n,s,r,i){if(!this._isActive||!!f.easings[t])return;this._tweenExists(e)&&this.removeTween(e);const o=new shifty.Tweenable;this._tweens[e]=new f.TweenInstance(o,!1,s,r),this._runtimeScene.shiftyJsScene||(this._runtimeScene.shiftyJsScene=new shifty.Scene),this._runtimeScene.shiftyJsScene.add(o),o.tween(n).then(()=>{this._tweens[e]&&(this._tweens[e].hasFinished=!0),i&&this.owner.deleteFromScene(this._runtimeScene)}).catch(c=>{})}_tweenExists(e){return!!this._tweens[e]}_tweenIsPlaying(e){return this._tweens[e]&&this._tweens[e].instance.isPlaying()}_pauseTween(e){const t=this._tweens[e];t.instance.pause();const n=this._runtimeScene.shiftyJsScene;n&&n.remove(t.instance)}_resumeTween(e){const t=this._tweens[e];t.instance.resume();const n=this._runtimeScene.shiftyJsScene;n&&n.add(t.instance)}_stopTween(e,t){this._tweens[e].instance.stop(t)}_tweenHasFinished(e){return this._tweens[e].hasFinished}addVariableTween(e,t,n,s,r,i,o){this._addTween(e,r,{from:{value:n},to:{value:s},duration:i,easing:r,render:c=>t.setNumber(c.value)},this._runtimeScene.getTimeManager().getTimeFromStart(),i,o)}addVariableTween2(e,t,n,s,r,i){this._addTween(e,s,{from:{value:t.getValue()},to:{value:n},duration:r,easing:s,render:o=>t.setNumber(o.value)},this._runtimeScene.getTimeManager().getTimeFromStart(),r,i)}addObjectPositionTween(e,t,n,s,r,i){this._addTween(e,s,{from:{x:this.owner.getX(),y:this.owner.getY()},to:{x:t,y:n},duration:r,easing:s,render:o=>{this.owner.setX(o.x),this.owner.setY(o.y)}},this._runtimeScene.getTimeManager().getTimeFromStart(),r,i)}addObjectPositionXTween(e,t,n,s,r){this._addTween(e,n,{from:{x:this.owner.getX()},to:{x:t},duration:s,easing:n,render:i=>this.owner.setX(i.x)},this._runtimeScene.getTimeManager().getTimeFromStart(),s,r)}addObjectPositionZTween(e,t,n,s,r){const{owner:i}=this;i instanceof l.Cube3DRuntimeObject&&this._addTween(e,n,{from:{z:i.getZ()},to:{z:t},duration:s,easing:n,render:o=>i.setZ(o.z)},this._runtimeScene.getTimeManager().getTimeFromStart(),s,r)}addObjectPositionYTween(e,t,n,s,r){this._addTween(e,n,{from:{y:this.owner.getY()},to:{y:t},duration:s,easing:n,render:i=>this.owner.setY(i.y)},this._runtimeScene.getTimeManager().getTimeFromStart(),s,r)}addObjectAngleTween(e,t,n,s,r){this._addTween(e,n,{from:{angle:this.owner.getAngle()},to:{angle:t},duration:s,easing:n,render:i=>{this.owner.setAngle(i.angle)}},this._runtimeScene.getTimeManager().getTimeFromStart(),s,r)}addObjectScaleTween(e,t,n,s,r,i,o){if(!T(this.owner))return;const c=this.owner;t<0&&(t=0),n<0&&(n=0);const h=o?m=>{const g=c.getCenterXInScene(),u=c.getCenterYInScene();c.setScaleX(m.scaleX),c.setScaleY(m.scaleY),c.setCenterPositionInScene(g,u)}:m=>{c.setScaleX(m.scaleX),c.setScaleY(m.scaleY)};this._addTween(e,s,{from:{scaleX:c.getScaleX(),scaleY:c.getScaleY()},to:{scaleX:t,scaleY:n},duration:r,easing:s,render:h},this._runtimeScene.getTimeManager().getTimeFromStart(),r,i)}addObjectScaleXTween(e,t,n,s,r,i){if(!T(this.owner))return;const o=this.owner,c=i?h=>{const m=o.getCenterXInScene();o.setScaleX(h.scaleX),o.setCenterXInScene(m)}:h=>o.setScaleX(h.scaleX);this._addTween(e,n,{from:{scaleX:o.getScaleX()},to:{scaleX:t},duration:s,easing:n,render:c},this._runtimeScene.getTimeManager().getTimeFromStart(),s,r)}addObjectScaleYTween(e,t,n,s,r,i){if(!T(this.owner))return;const o=this.owner,c=i?h=>{const m=o.getCenterYInScene();o.setScaleY(h.scaleY),o.setCenterYInScene(m)}:h=>o.setScaleY(h.scaleY);this._addTween(e,n,{from:{scaleY:o.getScaleY()},to:{scaleY:t},duration:s,easing:n,render:c},this._runtimeScene.getTimeManager().getTimeFromStart(),s,r)}addObjectOpacityTween(e,t,n,s,r){if(!F(this.owner))return;const i=this.owner;this._addTween(e,n,{from:{opacity:i.getOpacity()},to:{opacity:t},duration:s,easing:n,render:o=>{i.setOpacity(o.opacity)}},this._runtimeScene.getTimeManager().getTimeFromStart(),s,r)}addObjectColorTween(e,t,n,s,r,i){if(!O(this.owner)||!t.match("^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]);){2}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"))return;const o=this.owner,c=this.owner.getColor().split(";"),h=t.split(";");if(h.length!==3)return;let m;if(i){const g=S(parseFloat(c[0]),parseFloat(c[1]),parseFloat(c[2])),u=S(parseFloat(h[0]),parseFloat(h[1]),parseFloat(h[2]));m={from:{hue:g[0],saturation:g[1],lightness:g[2]},to:{hue:u[0],saturation:u[1],lightness:u[2]},duration:s,easing:n,render:d=>{const b=v(d.hue,d.saturation,d.lightness);o.setColor(Math.floor(b[0])+";"+Math.floor(b[1])+";"+Math.floor(b[2]))}}}else m={from:{red:c[0],green:c[1],blue:c[2]},to:{red:h[0],green:h[1],blue:h[2]},duration:s,easing:n,render:g=>{o.setColor(Math.floor(g.red)+";"+Math.floor(g.green)+";"+Math.floor(g.blue))}};this._addTween(e,n,m,this._runtimeScene.getTimeManager().getTimeFromStart(),s,r)}addObjectColorHSLTween(e,t,n,s,r,i,o,c){if(!O(this.owner))return;const h=this.owner,m=h.getColor().split(";");if(m.length<3)return;const g=S(parseFloat(m[0]),parseFloat(m[1]),parseFloat(m[2])),u=n?t:g[0],d=s===-1?g[1]:Math.min(Math.max(s,0),100),b=r===-1?g[2]:Math.min(Math.max(r,0),100);this._addTween(e,i,{from:{hue:g[0],saturation:g[1],lightness:g[2]},to:{hue:u,saturation:d,lightness:b},duration:o,easing:i,render:_=>{const p=v(_.hue,_.saturation,_.lightness);h.setColor(Math.floor(p[0])+";"+Math.floor(p[1])+";"+Math.floor(p[2]))}},this._runtimeScene.getTimeManager().getTimeFromStart(),o,c)}addTextObjectCharacterSizeTween(e,t,n,s,r){if(!y(this.owner))return;const i=this.owner;this._addTween(e,n,{from:{size:i.getCharacterSize()},to:{size:t},duration:s,easing:n,render:function(c){i.setCharacterSize(c.size)}},this._runtimeScene.getTimeManager().getTimeFromStart(),s,r)}addObjectWidthTween(e,t,n,s,r){this._addTween(e,n,{from:{width:this.owner.getWidth()},to:{width:t},duration:s,easing:n,render:i=>{this.owner.setWidth(i.width)}},this._runtimeScene.getTimeManager().getTimeFromStart(),s,r)}addObjectHeightTween(e,t,n,s,r){this._addTween(e,n,{from:{height:this.owner.getHeight()},to:{height:t},duration:s,easing:n,render:i=>{this.owner.setHeight(i.height)}},this._runtimeScene.getTimeManager().getTimeFromStart(),s,r)}addObjectDepthTween(e,t,n,s,r){const{owner:i}=this;i instanceof l.Cube3DRuntimeObject&&this._addTween(e,n,{from:{depth:i.getDepth()},to:{depth:t},duration:s,easing:n,render:o=>{i.setDepth(o.depth)}},this._runtimeScene.getTimeManager().getTimeFromStart(),s,r)}isPlaying(e){return this._tweenExists(e)&&this._tweenIsPlaying(e)}exists(e){return this._tweenExists(e)}hasFinished(e){return this._tweenExists(e)&&this._tweenHasFinished(e)}pauseTween(e){this._isActive&&this._tweenExists(e)&&this._tweenIsPlaying(e)&&this._pauseTween(e)}stopTween(e,t){this._isActive&&this._tweenExists(e)&&this._tweenIsPlaying(e)&&this._stopTween(e,t)}resumeTween(e){this._isActive&&this._tweenExists(e)&&!this._tweenIsPlaying(e)&&this._resumeTween(e)}removeTween(e){!this._tweenExists(e)||(this._tweens[e].instance.stop(),this._runtimeScene.shiftyJsScene&&this._runtimeScene.shiftyJsScene.remove(this._tweens[e].instance),delete this._tweens[e])}getProgress(e){const t=this._tweens[e];if(t){const n=this._runtimeScene.getTimeManager().getTimeFromStart();return n>=t.startTime+t.totalDuration?1:(n-t.startTime)/t.totalDuration}else return 0}onDeActivate(){if(!!this._isActive){for(const e in this._tweens)if(this._tweens.hasOwnProperty(e)){const t=this._tweens[e];t.instance.isPlaying()&&(t.resumeOnActivate=!0,this._pauseTween(e))}this._isActive=!1}}onActivate(){if(!this._isActive){for(const e in this._tweens)if(this._tweens.hasOwnProperty(e)){const t=this._tweens[e];t.resumeOnActivate&&(t.resumeOnActivate=!1,this._resumeTween(e))}this._isActive=!0}}};let w=f;w.easings=["linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easeInSine","easeOutSine","easeInOutSine","easeInExpo","easeOutExpo","easeInOutExpo","easeInCirc","easeOutCirc","easeInOutCirc","easeOutBounce","easeInBack","easeOutBack","easeInOutBack","elastic","swingFromTo","swingFrom","swingTo","bounce","bouncePast","easeFromTo","easeFrom","easeTo"],w._currentTweenTime=0,l.TweenRuntimeBehavior=w,l.registerBehavior("Tween::TweenBehavior",l.TweenRuntimeBehavior),function(e){class a{constructor(n,s,r,i){this.resumeOnActivate=!1;this.instance=n,this.hasFinished=s,this.startTime=r,this.totalDuration=i}}e.TweenInstance=a}(w=l.TweenRuntimeBehavior||(l.TweenRuntimeBehavior={}))})(gdjs||(gdjs={})); +//# sourceMappingURL=tweenruntimebehavior.js.map diff --git a/desktop/apps/dezunkrr/Extensions/TweenBehavior/tweentools.js b/desktop/apps/dezunkrr/Extensions/TweenBehavior/tweentools.js new file mode 100644 index 0000000..036b58e --- /dev/null +++ b/desktop/apps/dezunkrr/Extensions/TweenBehavior/tweentools.js @@ -0,0 +1,2 @@ +var gdjs;(function(c){let y;(function(w){let h;(function(r){const b={linear:shifty.Tweenable.formulas.linear,easeInQuad:shifty.Tweenable.formulas.easeInQuad,easeOutQuad:shifty.Tweenable.formulas.easeOutQuad,easeInOutQuad:shifty.Tweenable.formulas.easeInOutQuad,easeInCubic:shifty.Tweenable.formulas.easeInCubic,easeOutCubic:shifty.Tweenable.formulas.easeOutCubic,easeInOutCubic:shifty.Tweenable.formulas.easeInOutCubic,easeInQuart:shifty.Tweenable.formulas.easeInQuart,easeOutQuart:shifty.Tweenable.formulas.easeOutQuart,easeInOutQuart:shifty.Tweenable.formulas.easeInOutQuart,easeInQuint:shifty.Tweenable.formulas.easeInQuint,easeOutQuint:shifty.Tweenable.formulas.easeOutQuint,easeInOutQuint:shifty.Tweenable.formulas.easeInOutQuint,easeInSine:shifty.Tweenable.formulas.easeInSine,easeOutSine:shifty.Tweenable.formulas.easeOutSine,easeInOutSine:shifty.Tweenable.formulas.easeInOutSine,easeInExpo:shifty.Tweenable.formulas.easeInExpo,easeOutExpo:shifty.Tweenable.formulas.easeOutExpo,easeInOutExpo:shifty.Tweenable.formulas.easeInOutExpo,easeInCirc:shifty.Tweenable.formulas.easeInCirc,easeOutCirc:shifty.Tweenable.formulas.easeOutCirc,easeInOutCirc:shifty.Tweenable.formulas.easeInOutCirc,easeOutBounce:shifty.Tweenable.formulas.easeOutBounce,easeInBack:shifty.Tweenable.formulas.easeInBack,easeOutBack:shifty.Tweenable.formulas.easeOutBack,easeInOutBack:shifty.Tweenable.formulas.easeInOutBack,elastic:shifty.Tweenable.formulas.elastic,swingFromTo:shifty.Tweenable.formulas.swingFromTo,swingFrom:shifty.Tweenable.formulas.swingFrom,swingTo:shifty.Tweenable.formulas.swingTo,bounce:shifty.Tweenable.formulas.bounce,bouncePast:shifty.Tweenable.formulas.bouncePast,easeFromTo:shifty.Tweenable.formulas.easeFromTo,easeFrom:shifty.Tweenable.formulas.easeFrom,easeTo:shifty.Tweenable.formulas.easeTo};r.ease=(e,n,s,t)=>{const a=b.hasOwnProperty(e)?b[e]:shifty.Tweenable.formulas.linear;return n+(s-n)*a(t)};const i=e=>e._tweens||(e._tweens=new Map),f=e=>e.shiftyJsScene||(e.shiftyJsScene=new shifty.Scene);r.sceneTweenExists=(e,n)=>i(e).has(n),r.sceneTweenIsPlaying=(e,n)=>{const t=i(e).get(n);return!!t&&t.isPlaying()},r.sceneTweenHasFinished=(e,n)=>{const t=i(e).get(n);return!!t&&t.hasEnded()},r.resumeSceneTween=(e,n)=>{const t=i(e).get(n);!t||(t.resume(),f(e).add(t))},r.pauseSceneTween=(e,n)=>{const t=i(e).get(n);!t||(t.pause(),f(e).remove(t))},r.stopSceneTween=(e,n,s)=>{const a=i(e).get(n);!a||(a.stop(s),f(e).remove(a))},r.removeSceneTween=(e,n)=>{const s=i(e),t=s.get(n);!t||(s.delete(n),f(e).remove(t),t.stop().dispose())},r.tweenVariableNumber=(e,n,s,t,a,l,u)=>{const o=shifty.tween({from:{value:t},to:{value:a},easing:u,duration:l,render:({value:m})=>s.setNumber(m)});i(e).set(n,o),f(e).add(o)},r.tweenVariableNumber2=(e,n,s,t,a,l)=>{const u=shifty.tween({from:{value:s.getValue()},to:{value:t},easing:l,duration:a,render:({value:o})=>s.setNumber(o)});i(e).set(n,u),f(e).add(u)},r.tweenCamera=(e,n,s,t,a,l,u)=>{const o=e.getLayer(a),m=shifty.tween({from:{x:o.getCameraX(),y:o.getCameraY()},to:{x:s,y:t},easing:u,duration:l,render:({x:T,y:g})=>{o.setCameraX(T),o.setCameraY(g)}});i(e).set(n,m),f(e).add(m)},r.tweenCameraZoom=(e,n,s,t,a,l)=>{const u=e.getLayer(t),o=shifty.tween({from:{zoom:u.getCameraZoom()},to:{zoom:s},easing:l,duration:a,render:({zoom:m})=>{u.setCameraZoom(m)}});i(e).set(n,o),f(e).add(o)},r.tweenCameraRotation=(e,n,s,t,a,l)=>{const u=e.getLayer(t),o=shifty.tween({from:{rotation:u.getCameraRotation()},to:{rotation:s},easing:l,duration:a,render:({rotation:m})=>{u.setCameraRotation(m)}});i(e).set(n,o),f(e).add(o)}})(h=w.tween||(w.tween={}))})(y=c.evtTools||(c.evtTools={}))})(gdjs||(gdjs={})); +//# sourceMappingURL=tweentools.js.map diff --git a/desktop/apps/dezunkrr/Fire round button.png b/desktop/apps/dezunkrr/Fire round button.png new file mode 100644 index 0000000..9099e46 Binary files /dev/null and b/desktop/apps/dezunkrr/Fire round button.png differ diff --git a/desktop/apps/dezunkrr/Flat Bar Red Fill Bar2.png b/desktop/apps/dezunkrr/Flat Bar Red Fill Bar2.png new file mode 100644 index 0000000..ed4af9e Binary files /dev/null and b/desktop/apps/dezunkrr/Flat Bar Red Fill Bar2.png differ diff --git a/desktop/apps/dezunkrr/Flat Bar White Border2.png b/desktop/apps/dezunkrr/Flat Bar White Border2.png new file mode 100644 index 0000000..14782eb Binary files /dev/null and b/desktop/apps/dezunkrr/Flat Bar White Border2.png differ diff --git a/desktop/apps/dezunkrr/Model3DManager.js b/desktop/apps/dezunkrr/Model3DManager.js new file mode 100644 index 0000000..4a318f6 --- /dev/null +++ b/desktop/apps/dezunkrr/Model3DManager.js @@ -0,0 +1,2 @@ +var gdjs;(function(i){const d=new i.Logger("Model3DManager");class c{constructor(o,t){this._loadedThreeModels=new Map;this._loader=null;this._invalidModel=null;if(this._resources=o,this._resourcesLoader=t,typeof THREE!="undefined"){this._loader=new THREE_ADDONS.GLTFLoader;const n=new THREE.BoxGeometry(1,1,1);this._invalidModel=new THREE.Mesh(n)}}setResources(o){this._resources=o}loadModels(o,t){const e=this._resources.filter(function(l){return l.kind==="model3D"});if(e.length===0||!this._loader)return t(e.length);let r=0;for(let l=0;l{s.scene.rotation.order="ZYX",this._loadedThreeModels.set(a.name,s.scene),r++,r===e.length?t(e.length):o(r,e.length)},void 0,s=>{d.error(s),r++,r===e.length?t(e.length):o(r,e.length)})}}getModel(o){return this._loadedThreeModels.get(o)||this._invalidModel}}i.Model3DManager=c})(gdjs||(gdjs={})); +//# sourceMappingURL=Model3DManager.js.map diff --git a/desktop/apps/dezunkrr/PTSans-Bold.ttf b/desktop/apps/dezunkrr/PTSans-Bold.ttf new file mode 100644 index 0000000..7f2bddb Binary files /dev/null and b/desktop/apps/dezunkrr/PTSans-Bold.ttf differ diff --git a/desktop/apps/dezunkrr/Pause button.png b/desktop/apps/dezunkrr/Pause button.png new file mode 100644 index 0000000..f46a1c3 Binary files /dev/null and b/desktop/apps/dezunkrr/Pause button.png differ diff --git a/desktop/apps/dezunkrr/Red Button With Shadow_Hovered.png b/desktop/apps/dezunkrr/Red Button With Shadow_Hovered.png new file mode 100644 index 0000000..1a424b2 Binary files /dev/null and b/desktop/apps/dezunkrr/Red Button With Shadow_Hovered.png differ diff --git a/desktop/apps/dezunkrr/Red Button With Shadow_Idle.png b/desktop/apps/dezunkrr/Red Button With Shadow_Idle.png new file mode 100644 index 0000000..6107ccc Binary files /dev/null and b/desktop/apps/dezunkrr/Red Button With Shadow_Idle.png differ diff --git a/desktop/apps/dezunkrr/Red Button With Shadow_Pressed.png b/desktop/apps/dezunkrr/Red Button With Shadow_Pressed.png new file mode 100644 index 0000000..9cf180c Binary files /dev/null and b/desktop/apps/dezunkrr/Red Button With Shadow_Pressed.png differ diff --git a/desktop/apps/dezunkrr/RuntimeCustomObjectLayer.js b/desktop/apps/dezunkrr/RuntimeCustomObjectLayer.js new file mode 100644 index 0000000..61737b9 --- /dev/null +++ b/desktop/apps/dezunkrr/RuntimeCustomObjectLayer.js @@ -0,0 +1,2 @@ +var gdjs;(function(o){class n extends o.RuntimeLayer{constructor(e,a){super(e,a);this._renderer.onCreated()}onGameResolutionResized(e,a){}getCameraX(e){return 0}getCameraY(e){return 0}setCameraX(e,a){}setCameraY(e,a){}getCameraWidth(e){return 0}getCameraHeight(e){return 0}setCameraZoom(e,a){}getCameraZoom(e){return 1}setCameraZ(e,a,r){}getCameraZ(e=45,a){return 0}getCameraRotation(e){return 0}setCameraRotation(e,a){}convertCoords(e,a,r,t){return this._runtimeScene.convertCoords(e,a,t||[0,0])}convertInverseCoords(e,a,r,t){return this._runtimeScene.convertInverseCoords(e,a,t||[0,0])}applyLayerInverseTransformation(e,a,r,t){return t[0]=e,t[1]=a,t}applyLayerTransformation(e,a,r,t){return t[0]=e,t[1]=a,t}}o.RuntimeCustomObjectLayer=n})(gdjs||(gdjs={})); +//# sourceMappingURL=RuntimeCustomObjectLayer.js.map diff --git a/desktop/apps/dezunkrr/RuntimeInstanceContainer.js b/desktop/apps/dezunkrr/RuntimeInstanceContainer.js new file mode 100644 index 0000000..3b3befc --- /dev/null +++ b/desktop/apps/dezunkrr/RuntimeInstanceContainer.js @@ -0,0 +1,2 @@ +var gdjs;(function(c){const l=new c.Logger("RuntimeInstanceContainer");class d{constructor(){this._allInstancesList=[];this._allInstancesListIsUpToDate=!0;this._instancesRemoved=[];this._layersCameraCoordinates={};this._debugDrawEnabled=!1;this._debugDrawShowHiddenInstances=!1;this._debugDrawShowPointsNames=!1;this._debugDrawShowCustomPoints=!1;this._initialBehaviorSharedData=new Hashtable,this._instances=new Hashtable,this._instancesCache=new Hashtable,this._objects=new Hashtable,this._objectsCtor=new Hashtable,this._layers=new Hashtable,this._orderedLayers=[]}enableDebugDraw(e,t,s,a){this._debugDrawEnabled&&!e&&this.getDebuggerRenderer().clearDebugDraw(),this._debugDrawEnabled=e,this._debugDrawShowHiddenInstances=t,this._debugDrawShowPointsNames=s,this._debugDrawShowCustomPoints=a}isObjectRegistered(e){return this._objects.containsKey(e)&&this._instances.containsKey(e)&&this._objectsCtor.containsKey(e)}registerObject(e){this._objects.put(e.name,e),this._instances.put(e.name,[]);const t=c.getObjectConstructor(e.type);this._objectsCtor.put(e.name,t),t.supportsReinitialization&&this._instancesCache.put(e.name,[])}updateObject(e){this.isObjectRegistered(e.name)||l.warn("Tried to call updateObject for an object that was not registered ("+e.name+"). Call registerObject first."),this._objects.put(e.name,e)}unregisterObject(e){const t=this._instances.get(e);if(t){const s=t.slice();for(let a=0;ai==="3d"?1:i==="2d+3d"||i===""?2:0;class o{constructor(e,a){this._timeScale=1;this._defaultZOrder=0;this._rendererEffects={};this._name=e.name,this._renderingType=s(e.renderingType),this._hidden=!e.visibility,this._initialCamera3DFieldOfView=e.camera3DFieldOfView||45,this._initialCamera3DFarPlaneDistance=e.camera3DFarPlaneDistance||.1,this._initialCamera3DNearPlaneDistance=e.camera3DNearPlaneDistance||2e3,this._initialEffectsData=e.effects||[],this._runtimeScene=a,this._effectsManager=a.getGame().getEffectsManager(),this._isLightingLayer=e.isLightingLayer,this._followBaseLayerCamera=e.followBaseLayerCamera,this._clearColor=[e.ambientLightColorR/255,e.ambientLightColorG/255,e.ambientLightColorB/255,1],this._renderer=new n.LayerRenderer(this,a.getRenderer(),a.getGame().getRenderer()),this.show(!this._hidden);for(let t=0;t=0&&(this._timeScale=e)}getTimeScale(){return this._timeScale}getElapsedTime(e){return(e||this._runtimeScene).getElapsedTime()*this._timeScale}followBaseLayer(){const e=this._runtimeScene.getLayer("");this.setCameraX(e.getCameraX()),this.setCameraY(e.getCameraY()),this.setCameraRotation(e.getCameraRotation()),this.setCameraZoom(e.getCameraZoom())}getClearColor(){return this._clearColor}setClearColor(e,a,t){this._clearColor[0]=e/255,this._clearColor[1]=a/255,this._clearColor[2]=t/255,this._renderer.updateClearColor()}setFollowBaseLayerCamera(e){this._followBaseLayerCamera=e}isLightingLayer(){return this._isLightingLayer}}n.RuntimeLayer=o})(gdjs||(gdjs={})); +//# sourceMappingURL=RuntimeLayer.js.map diff --git a/desktop/apps/dezunkrr/Shotgun Vertical_Aiming.png b/desktop/apps/dezunkrr/Shotgun Vertical_Aiming.png new file mode 100644 index 0000000..8b223ac Binary files /dev/null and b/desktop/apps/dezunkrr/Shotgun Vertical_Aiming.png differ diff --git a/desktop/apps/dezunkrr/Shotgun Vertical_Firing.png b/desktop/apps/dezunkrr/Shotgun Vertical_Firing.png new file mode 100644 index 0000000..c29920c Binary files /dev/null and b/desktop/apps/dezunkrr/Shotgun Vertical_Firing.png differ diff --git a/desktop/apps/dezunkrr/Square Blue Slider Border.png b/desktop/apps/dezunkrr/Square Blue Slider Border.png new file mode 100644 index 0000000..e8f39e2 Binary files /dev/null and b/desktop/apps/dezunkrr/Square Blue Slider Border.png differ diff --git a/desktop/apps/dezunkrr/Square Blue Slider Fill Bar.png b/desktop/apps/dezunkrr/Square Blue Slider Fill Bar.png new file mode 100644 index 0000000..416fcd6 Binary files /dev/null and b/desktop/apps/dezunkrr/Square Blue Slider Fill Bar.png differ diff --git a/desktop/apps/dezunkrr/Square Blue Slider Thumb.png b/desktop/apps/dezunkrr/Square Blue Slider Thumb.png new file mode 100644 index 0000000..d30fd77 Binary files /dev/null and b/desktop/apps/dezunkrr/Square Blue Slider Thumb.png differ diff --git a/desktop/apps/dezunkrr/Square Blue Toggle_Off.png b/desktop/apps/dezunkrr/Square Blue Toggle_Off.png new file mode 100644 index 0000000..04cd0fc Binary files /dev/null and b/desktop/apps/dezunkrr/Square Blue Toggle_Off.png differ diff --git a/desktop/apps/dezunkrr/Square Blue Toggle_On.png b/desktop/apps/dezunkrr/Square Blue Toggle_On.png new file mode 100644 index 0000000..b4b2f8f Binary files /dev/null and b/desktop/apps/dezunkrr/Square Blue Toggle_On.png differ diff --git a/desktop/apps/dezunkrr/Square Green Toggle_Off.png b/desktop/apps/dezunkrr/Square Green Toggle_Off.png new file mode 100644 index 0000000..d6ac687 Binary files /dev/null and b/desktop/apps/dezunkrr/Square Green Toggle_Off.png differ diff --git a/desktop/apps/dezunkrr/Square Green Toggle_On.png b/desktop/apps/dezunkrr/Square Green Toggle_On.png new file mode 100644 index 0000000..5332b94 Binary files /dev/null and b/desktop/apps/dezunkrr/Square Green Toggle_On.png differ diff --git a/desktop/apps/dezunkrr/Top arrow button.png b/desktop/apps/dezunkrr/Top arrow button.png new file mode 100644 index 0000000..7e5dc75 Binary files /dev/null and b/desktop/apps/dezunkrr/Top arrow button.png differ diff --git a/desktop/apps/dezunkrr/Transparent dark joystick border.png b/desktop/apps/dezunkrr/Transparent dark joystick border.png new file mode 100644 index 0000000..e3607f1 Binary files /dev/null and b/desktop/apps/dezunkrr/Transparent dark joystick border.png differ diff --git a/desktop/apps/dezunkrr/Transparent dark joystick thumb.png b/desktop/apps/dezunkrr/Transparent dark joystick thumb.png new file mode 100644 index 0000000..369cffe Binary files /dev/null and b/desktop/apps/dezunkrr/Transparent dark joystick thumb.png differ diff --git a/desktop/apps/dezunkrr/affinetransformation.js b/desktop/apps/dezunkrr/affinetransformation.js new file mode 100644 index 0000000..916c620 --- /dev/null +++ b/desktop/apps/dezunkrr/affinetransformation.js @@ -0,0 +1,2 @@ +var gdjs;(function(c){class y{constructor(){this.matrix=new Float32Array([1,0,0,1,0,0])}setToIdentity(){const o=this.matrix;o[0]=1,o[1]=0,o[2]=0,o[3]=1,o[4]=0,o[5]=0}isIdentity(){const o=this.matrix;return o[0]===1&&o[1]===0&&o[2]===0&&o[3]===1&&o[4]===0&&o[5]===0}equals(o){const t=this.matrix,a=o.matrix;return this===o||t[0]===a[0]&&t[1]===a[1]&&t[2]===a[2]&&t[3]===a[3]&&t[4]===a[4]&&t[5]===a[5]}nearlyEquals(o,t){const a=this.matrix,s=o.matrix;return this===o||c.nearlyEqual(a[0],s[0],t)&&c.nearlyEqual(a[1],s[1],t)&&c.nearlyEqual(a[2],s[2],t)&&c.nearlyEqual(a[3],s[3],t)&&c.nearlyEqual(a[4],s[4],t)&&c.nearlyEqual(a[5],s[5],t)}copyFrom(o){const t=this.matrix,a=o.matrix;return t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t[4]=a[4],t[5]=a[5],this}setToTranslation(o,t){const a=this.matrix;a[0]=1,a[1]=0,a[2]=0,a[3]=1,a[4]=o,a[5]=t}translate(o,t){var a=this.matrix;a[4]=a[0]*o+a[2]*t+a[4],a[5]=a[1]*o+a[3]*t+a[5]}setToScale(o,t){const a=this.matrix;a[0]=o,a[1]=0,a[2]=0,a[3]=t,a[4]=0,a[5]=0}scale(o,t){const a=this.matrix;a[0]*=o,a[1]*=o,a[2]*=t,a[3]*=t}setToRotation(o){const t=this.matrix;let a=Math.cos(o),s=Math.sin(o);(a===-1||a===1)&&(s=0),(s===-1||s===1)&&(a=0),t[0]=a,t[1]=s,t[2]=-s,t[3]=a,t[4]=0,t[5]=0}rotate(o){const t=this.matrix;let a=Math.cos(o),s=Math.sin(o);(a===-1||a===1)&&(s=0),(s===-1||s===1)&&(a=0);const i=t[0],n=t[1],m=t[2],r=t[3];t[0]=i*a+m*s,t[1]=n*a+r*s,t[2]=i*-s+m*a,t[3]=n*-s+r*a}setToRotationAround(o,t,a){const s=this.matrix;let i=Math.cos(o),n=Math.sin(o);(i===-1||i===1)&&(n=0),(n===-1||n===1)&&(i=0),s[0]=i,s[1]=n,s[2]=-n,s[3]=i,s[4]=t-t*i+a*n,s[5]=a-t*n+a*i}rotateAround(o,t,a){this.translate(t,a),this.rotate(o),this.translate(-t,-a)}setToFlipX(o){const t=this.matrix;t[0]=-1,t[1]=0,t[2]=0,t[3]=1,t[4]=2*o,t[5]=0}flipX(o){this.translate(o,0),this.scale(-1,1),this.translate(-o,0)}setToFlipY(o){const t=this.matrix;t[0]=-1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=2*o}flipY(o){this.translate(0,o),this.scale(1,-1),this.translate(0,-o)}concatenate(o){const t=this.matrix,a=o.matrix,s=t[0],i=t[1],n=t[2],m=t[3],r=t[4],h=t[5],l=a[0],e=a[1],x=a[2],f=a[3],u=a[4],T=a[5];t[0]=l*s+e*n,t[1]=l*i+e*m,t[2]=x*s+f*n,t[3]=x*i+f*m,t[4]=u*s+T*n+r,t[5]=u*i+T*m+h}preConcatenate(o){const t=this.matrix,a=o.matrix,s=t[0],i=t[1],n=t[2],m=t[3],r=t[4],h=t[5],l=a[0],e=a[1],x=a[2],f=a[3],u=a[4],T=a[5];t[0]=s*l+i*x,t[1]=s*e+i*f,t[2]=n*l+m*x,t[3]=n*e+m*f,t[4]=r*l+h*x+u,t[5]=r*e+h*f+T}transform(o,t){const a=this.matrix,s=a[0]*o[0]+a[2]*o[1]+a[4],i=a[1]*o[0]+a[3]*o[1]+a[5];t[0]=s,t[1]=i}invert(){const o=this.matrix,t=o[0],a=o[1],s=o[2],i=o[3],n=o[4],m=o[5],r=t*i-a*s;return o[0]=i/r,o[1]=-a/r,o[2]=-s/r,o[3]=t/r,o[4]=(s*m-i*n)/r,o[5]=-(t*m-a*n)/r,this}toString(){const o=this.matrix;return`[[${o[0]} ${o[1]}] [${o[2]} ${o[3]}] [${o[4]} ${o[5]}]]`}}c.AffineTransformation=y})(gdjs||(gdjs={})); +//# sourceMappingURL=affinetransformation.js.map diff --git a/desktop/apps/dezunkrr/android-icon-144.png b/desktop/apps/dezunkrr/android-icon-144.png new file mode 100644 index 0000000..72752ad Binary files /dev/null and b/desktop/apps/dezunkrr/android-icon-144.png differ diff --git a/desktop/apps/dezunkrr/android-icon-192.png b/desktop/apps/dezunkrr/android-icon-192.png new file mode 100644 index 0000000..9e45762 Binary files /dev/null and b/desktop/apps/dezunkrr/android-icon-192.png differ diff --git a/desktop/apps/dezunkrr/android-icon-36.png b/desktop/apps/dezunkrr/android-icon-36.png new file mode 100644 index 0000000..427356f Binary files /dev/null and b/desktop/apps/dezunkrr/android-icon-36.png differ diff --git a/desktop/apps/dezunkrr/android-icon-48.png b/desktop/apps/dezunkrr/android-icon-48.png new file mode 100644 index 0000000..6bfc5eb Binary files /dev/null and b/desktop/apps/dezunkrr/android-icon-48.png differ diff --git a/desktop/apps/dezunkrr/android-icon-72.png b/desktop/apps/dezunkrr/android-icon-72.png new file mode 100644 index 0000000..0e4b70f Binary files /dev/null and b/desktop/apps/dezunkrr/android-icon-72.png differ diff --git a/desktop/apps/dezunkrr/android-icon-96.png b/desktop/apps/dezunkrr/android-icon-96.png new file mode 100644 index 0000000..6356edb Binary files /dev/null and b/desktop/apps/dezunkrr/android-icon-96.png differ diff --git a/desktop/apps/dezunkrr/android-windowSplashScreenAnimatedIcon.png b/desktop/apps/dezunkrr/android-windowSplashScreenAnimatedIcon.png new file mode 100644 index 0000000..efbf256 Binary files /dev/null and b/desktop/apps/dezunkrr/android-windowSplashScreenAnimatedIcon.png differ diff --git a/desktop/apps/dezunkrr/assets_GreyboxTextures_greybox_dark_grid.png2.png b/desktop/apps/dezunkrr/assets_GreyboxTextures_greybox_dark_grid.png2.png new file mode 100644 index 0000000..73cad84 Binary files /dev/null and b/desktop/apps/dezunkrr/assets_GreyboxTextures_greybox_dark_grid.png2.png differ diff --git a/desktop/apps/dezunkrr/assets_GreyboxTextures_greybox_green_grid.png2.png b/desktop/apps/dezunkrr/assets_GreyboxTextures_greybox_green_grid.png2.png new file mode 100644 index 0000000..b216dd3 Binary files /dev/null and b/desktop/apps/dezunkrr/assets_GreyboxTextures_greybox_green_grid.png2.png differ diff --git a/desktop/apps/dezunkrr/assets_GreyboxTextures_greybox_green_grid.png3.png b/desktop/apps/dezunkrr/assets_GreyboxTextures_greybox_green_grid.png3.png new file mode 100644 index 0000000..6a785f7 Binary files /dev/null and b/desktop/apps/dezunkrr/assets_GreyboxTextures_greybox_green_grid.png3.png differ diff --git a/desktop/apps/dezunkrr/assets_GreyboxTextures_greybox_lime_grid.png2.png b/desktop/apps/dezunkrr/assets_GreyboxTextures_greybox_lime_grid.png2.png new file mode 100644 index 0000000..58beede Binary files /dev/null and b/desktop/apps/dezunkrr/assets_GreyboxTextures_greybox_lime_grid.png2.png differ diff --git a/desktop/apps/dezunkrr/assets_GreyboxTextures_greybox_orange_grid.png2.png b/desktop/apps/dezunkrr/assets_GreyboxTextures_greybox_orange_grid.png2.png new file mode 100644 index 0000000..14e4ad9 Binary files /dev/null and b/desktop/apps/dezunkrr/assets_GreyboxTextures_greybox_orange_grid.png2.png differ diff --git a/desktop/apps/dezunkrr/assets_GreyboxTextures_greybox_purple_solid.png2.png b/desktop/apps/dezunkrr/assets_GreyboxTextures_greybox_purple_solid.png2.png new file mode 100644 index 0000000..c102bb0 Binary files /dev/null and b/desktop/apps/dezunkrr/assets_GreyboxTextures_greybox_purple_solid.png2.png differ diff --git a/desktop/apps/dezunkrr/assets_GreyboxTextures_greybox_red_grid.png2.png b/desktop/apps/dezunkrr/assets_GreyboxTextures_greybox_red_grid.png2.png new file mode 100644 index 0000000..4437400 Binary files /dev/null and b/desktop/apps/dezunkrr/assets_GreyboxTextures_greybox_red_grid.png2.png differ diff --git a/desktop/apps/dezunkrr/assets_texture_12.png2.png b/desktop/apps/dezunkrr/assets_texture_12.png2.png new file mode 100644 index 0000000..7c713af Binary files /dev/null and b/desktop/apps/dezunkrr/assets_texture_12.png2.png differ diff --git a/desktop/apps/dezunkrr/assets_texture_13.png.png b/desktop/apps/dezunkrr/assets_texture_13.png.png new file mode 100644 index 0000000..2025f23 Binary files /dev/null and b/desktop/apps/dezunkrr/assets_texture_13.png.png differ diff --git a/desktop/apps/dezunkrr/blip.wav b/desktop/apps/dezunkrr/blip.wav new file mode 100644 index 0000000..df624e5 Binary files /dev/null and b/desktop/apps/dezunkrr/blip.wav differ diff --git a/desktop/apps/dezunkrr/clock.glb b/desktop/apps/dezunkrr/clock.glb new file mode 100644 index 0000000..01202af Binary files /dev/null and b/desktop/apps/dezunkrr/clock.glb differ diff --git a/desktop/apps/dezunkrr/clockImage.png b/desktop/apps/dezunkrr/clockImage.png new file mode 100644 index 0000000..103e05a Binary files /dev/null and b/desktop/apps/dezunkrr/clockImage.png differ diff --git a/desktop/apps/dezunkrr/code0.js b/desktop/apps/dezunkrr/code0.js new file mode 100644 index 0000000..eea494d --- /dev/null +++ b/desktop/apps/dezunkrr/code0.js @@ -0,0 +1,592 @@ +gdjs.menuCode = {}; +gdjs.menuCode.GDcamObjects1= []; +gdjs.menuCode.GDcamObjects2= []; +gdjs.menuCode.GDcamObjects3= []; +gdjs.menuCode.GDgroundObjects1= []; +gdjs.menuCode.GDgroundObjects2= []; +gdjs.menuCode.GDgroundObjects3= []; +gdjs.menuCode.GDcreditObjects1= []; +gdjs.menuCode.GDcreditObjects2= []; +gdjs.menuCode.GDcreditObjects3= []; +gdjs.menuCode.GDplayObjects1= []; +gdjs.menuCode.GDplayObjects2= []; +gdjs.menuCode.GDplayObjects3= []; +gdjs.menuCode.GDsettingsObjects1= []; +gdjs.menuCode.GDsettingsObjects2= []; +gdjs.menuCode.GDsettingsObjects3= []; +gdjs.menuCode.GDmedalsObjects1= []; +gdjs.menuCode.GDmedalsObjects2= []; +gdjs.menuCode.GDmedalsObjects3= []; +gdjs.menuCode.GDsettingstitleObjects1= []; +gdjs.menuCode.GDsettingstitleObjects2= []; +gdjs.menuCode.GDsettingstitleObjects3= []; +gdjs.menuCode.GDmusictitleObjects1= []; +gdjs.menuCode.GDmusictitleObjects2= []; +gdjs.menuCode.GDmusictitleObjects3= []; +gdjs.menuCode.GDsoundtitleObjects1= []; +gdjs.menuCode.GDsoundtitleObjects2= []; +gdjs.menuCode.GDsoundtitleObjects3= []; +gdjs.menuCode.GDskyboxtitleObjects1= []; +gdjs.menuCode.GDskyboxtitleObjects2= []; +gdjs.menuCode.GDskyboxtitleObjects3= []; +gdjs.menuCode.GDmedalsittleObjects1= []; +gdjs.menuCode.GDmedalsittleObjects2= []; +gdjs.menuCode.GDmedalsittleObjects3= []; +gdjs.menuCode.GDtitleObjects1= []; +gdjs.menuCode.GDtitleObjects2= []; +gdjs.menuCode.GDtitleObjects3= []; +gdjs.menuCode.GDmsliderObjects1= []; +gdjs.menuCode.GDmsliderObjects2= []; +gdjs.menuCode.GDmsliderObjects3= []; +gdjs.menuCode.GDssliderObjects1= []; +gdjs.menuCode.GDssliderObjects2= []; +gdjs.menuCode.GDssliderObjects3= []; +gdjs.menuCode.GDskyboxObjects1= []; +gdjs.menuCode.GDskyboxObjects2= []; +gdjs.menuCode.GDskyboxObjects3= []; +gdjs.menuCode.GDaccountbtnObjects1= []; +gdjs.menuCode.GDaccountbtnObjects2= []; +gdjs.menuCode.GDaccountbtnObjects3= []; +gdjs.menuCode.GDnbObjects1= []; +gdjs.menuCode.GDnbObjects2= []; +gdjs.menuCode.GDnbObjects3= []; + + +gdjs.menuCode.asyncCallback25366244 = function (runtimeScene, asyncObjectsList) { +gdjs.copyArray(asyncObjectsList.getObjects("title"), gdjs.menuCode.GDtitleObjects2); + +{for(var i = 0, len = gdjs.menuCode.GDtitleObjects2.length ;i < len;++i) { + gdjs.menuCode.GDtitleObjects2[i].playAnimation(); +} +}} +gdjs.menuCode.eventsList0 = function(runtimeScene) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +for (const obj of gdjs.menuCode.GDtitleObjects1) asyncObjectsList.addObject("title", obj); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtTools.runtimeScene.wait(1), (runtimeScene) => (gdjs.menuCode.asyncCallback25366244(runtimeScene, asyncObjectsList))); +} +} + +} + + +};gdjs.menuCode.asyncCallback25368316 = function (runtimeScene, asyncObjectsList) { +{gdjs.evtTools.variable.setVariableBoolean(runtimeScene.getScene().getVariables().getFromIndex(0), false); +}} +gdjs.menuCode.eventsList1 = function(runtimeScene, asyncObjectsList) { + +{ + + +{ +const parentAsyncObjectsList = asyncObjectsList; +{ +const asyncObjectsList = gdjs.LongLivedObjectsList.from(parentAsyncObjectsList); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtTools.runtimeScene.wait(2), (runtimeScene) => (gdjs.menuCode.asyncCallback25368316(runtimeScene, asyncObjectsList))); +} +} + +} + + +};gdjs.menuCode.asyncCallback25367908 = function (runtimeScene, asyncObjectsList) { +gdjs.copyArray(asyncObjectsList.getObjects("cam"), gdjs.menuCode.GDcamObjects2); + +{for(var i = 0, len = gdjs.menuCode.GDcamObjects2.length ;i < len;++i) { + gdjs.menuCode.GDcamObjects2[i].getBehavior("TweenZOrder").TweenZOrder("down", (gdjs.menuCode.GDcamObjects2[i].getZOrder()) - 100, "easeInOutQuad", 2000, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +} +{ //Subevents +gdjs.menuCode.eventsList1(runtimeScene, asyncObjectsList);} //End of subevents +} +gdjs.menuCode.eventsList2 = function(runtimeScene) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +for (const obj of gdjs.menuCode.GDcamObjects1) asyncObjectsList.addObject("cam", obj); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtTools.runtimeScene.wait(2), (runtimeScene) => (gdjs.menuCode.asyncCallback25367908(runtimeScene, asyncObjectsList))); +} +} + +} + + +};gdjs.menuCode.mapOfGDgdjs_46menuCode_46GDplayObjects2Objects = Hashtable.newFrom({"play": gdjs.menuCode.GDplayObjects2}); +gdjs.menuCode.mapOfGDgdjs_46menuCode_46GDsettingsObjects2Objects = Hashtable.newFrom({"settings": gdjs.menuCode.GDsettingsObjects2}); +gdjs.menuCode.mapOfGDgdjs_46menuCode_46GDmedalsObjects2Objects = Hashtable.newFrom({"medals": gdjs.menuCode.GDmedalsObjects2}); +gdjs.menuCode.mapOfGDgdjs_46menuCode_46GDaccountbtnObjects2Objects = Hashtable.newFrom({"accountbtn": gdjs.menuCode.GDaccountbtnObjects2}); +gdjs.menuCode.mapOfGDgdjs_46menuCode_46GDsettingstitleObjects2Objects = Hashtable.newFrom({"settingstitle": gdjs.menuCode.GDsettingstitleObjects2}); +gdjs.menuCode.mapOfGDgdjs_46menuCode_46GDmedalsittleObjects1Objects = Hashtable.newFrom({"medalsittle": gdjs.menuCode.GDmedalsittleObjects1}); +gdjs.menuCode.eventsList3 = function(runtimeScene) { + +{ + +gdjs.copyArray(runtimeScene.getObjects("play"), gdjs.menuCode.GDplayObjects2); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.input.cursorOnObject(gdjs.menuCode.mapOfGDgdjs_46menuCode_46GDplayObjects2Objects, runtimeScene, true, false); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.camera.layerIsVisible(runtimeScene, "UI"); +} +if (isConditionTrue_0) { +{gdjs.evtTools.runtimeScene.replaceScene(runtimeScene, "tutorial", false); +}} + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("settings"), gdjs.menuCode.GDsettingsObjects2); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.input.cursorOnObject(gdjs.menuCode.mapOfGDgdjs_46menuCode_46GDsettingsObjects2Objects, runtimeScene, true, false); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.camera.layerIsVisible(runtimeScene, "UI"); +} +if (isConditionTrue_0) { +{gdjs.evtTools.camera.hideLayer(runtimeScene, "UI"); +}{gdjs.evtTools.camera.showLayer(runtimeScene, "settings"); +}} + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("medals"), gdjs.menuCode.GDmedalsObjects2); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.input.cursorOnObject(gdjs.menuCode.mapOfGDgdjs_46menuCode_46GDmedalsObjects2Objects, runtimeScene, true, false); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.camera.layerIsVisible(runtimeScene, "UI"); +} +if (isConditionTrue_0) { +{gdjs.evtTools.camera.hideLayer(runtimeScene, "UI"); +}{gdjs.evtTools.camera.showLayer(runtimeScene, "medals"); +}} + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("accountbtn"), gdjs.menuCode.GDaccountbtnObjects2); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.input.cursorOnObject(gdjs.menuCode.mapOfGDgdjs_46menuCode_46GDaccountbtnObjects2Objects, runtimeScene, true, false); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtTools.camera.layerIsVisible(runtimeScene, "UI")); +} +if (isConditionTrue_0) { +{gdjs.playerAuthentication.openAuthenticationWindow(runtimeScene); +}} + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("settingstitle"), gdjs.menuCode.GDsettingstitleObjects2); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.input.cursorOnObject(gdjs.menuCode.mapOfGDgdjs_46menuCode_46GDsettingstitleObjects2Objects, runtimeScene, true, false); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtTools.camera.layerIsVisible(runtimeScene, "UI")); +} +if (isConditionTrue_0) { +{gdjs.evtTools.camera.hideLayer(runtimeScene, "settings"); +}{gdjs.evtTools.camera.showLayer(runtimeScene, "UI"); +}} + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("medalsittle"), gdjs.menuCode.GDmedalsittleObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.input.cursorOnObject(gdjs.menuCode.mapOfGDgdjs_46menuCode_46GDmedalsittleObjects1Objects, runtimeScene, true, false); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtTools.camera.layerIsVisible(runtimeScene, "UI")); +} +if (isConditionTrue_0) { +{gdjs.evtTools.camera.hideLayer(runtimeScene, "medals"); +}{gdjs.evtTools.camera.showLayer(runtimeScene, "UI"); +}} + +} + + +};gdjs.menuCode.eventsList4 = function(runtimeScene) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.runtimeScene.sceneJustBegins(runtimeScene); +if (isConditionTrue_0) { +gdjs.copyArray(runtimeScene.getObjects("credit"), gdjs.menuCode.GDcreditObjects1); +gdjs.copyArray(runtimeScene.getObjects("title"), gdjs.menuCode.GDtitleObjects1); +{for(var i = 0, len = gdjs.menuCode.GDtitleObjects1.length ;i < len;++i) { + gdjs.menuCode.GDtitleObjects1[i].pauseAnimation(); +} +}{gdjs.evtsExt__Physics3dExtension__LoadGLTFLoaderLibrary.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__Physics3dExtension__LoadLighting.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{for(var i = 0, len = gdjs.menuCode.GDtitleObjects1.length ;i < len;++i) { + gdjs.menuCode.GDtitleObjects1[i].setAnimationFrame(0); +} +}{gdjs.evtTools.camera.showLayer(runtimeScene, "UI"); +}{gdjs.evtTools.camera.hideLayer(runtimeScene, "settings"); +}{gdjs.evtTools.camera.hideLayer(runtimeScene, "medals"); +}{gdjs.evtTools.advancedWindow.setFullScreenable(true, runtimeScene); +}{gdjs.evtsExt__WithThreeJS__Create3DScene.func(runtimeScene, 100, "74;144;226", "assets\\skybox.jpg", "80;227;194", 1, 1000, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__WithThreeJS__Rotate3DCamera.func(runtimeScene, "=", -(30), 0, 0, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{for(var i = 0, len = gdjs.menuCode.GDcreditObjects1.length ;i < len;++i) { + gdjs.menuCode.GDcreditObjects1[i].setString("Created by ItsIceCreeperPE Dev for GDevelop's First 3D Game Jam!\nVersion " + gdjs.evtsExt__CurrentGameVersion__ReturnCurrentGameVersion.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))); +} +} +{ //Subevents +gdjs.menuCode.eventsList0(runtimeScene);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtsExt__WithThreeJS__Rotate3DCamera.func(runtimeScene, "+", 0, 0.2, 0.1, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.getVariableBoolean(runtimeScene.getScene().getVariables().getFromIndex(0), false); +if (isConditionTrue_0) { +gdjs.copyArray(runtimeScene.getObjects("cam"), gdjs.menuCode.GDcamObjects1); +{gdjs.evtTools.variable.setVariableBoolean(runtimeScene.getScene().getVariables().getFromIndex(0), true); +}{for(var i = 0, len = gdjs.menuCode.GDcamObjects1.length ;i < len;++i) { + gdjs.menuCode.GDcamObjects1[i].getBehavior("TweenZOrder").TweenZOrder("up", (gdjs.menuCode.GDcamObjects1[i].getZOrder()) + 100, "easeInOutQuad", 2000, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +} +{ //Subevents +gdjs.menuCode.eventsList2(runtimeScene);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.input.isMouseButtonReleased(runtimeScene, "Left"); +if (isConditionTrue_0) { + +{ //Subevents +gdjs.menuCode.eventsList3(runtimeScene);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtTools.storage.elementExistsInJSONFile("Account", "Banner")); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +{isConditionTrue_0 = runtimeScene.getOnceTriggers().triggerOnce(21813044); +} +} +if (isConditionTrue_0) { +{gdjs.playerAuthentication.displayAuthenticationBanner(runtimeScene); +}{gdjs.evtTools.storage.writeNumberInJSONFile("Account", "Banner", 1); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtTools.camera.layerIsVisible(runtimeScene, "settings")); +if (isConditionTrue_0) { +gdjs.copyArray(runtimeScene.getObjects("accountbtn"), gdjs.menuCode.GDaccountbtnObjects1); +gdjs.copyArray(runtimeScene.getObjects("mslider"), gdjs.menuCode.GDmsliderObjects1); +gdjs.copyArray(runtimeScene.getObjects("skybox"), gdjs.menuCode.GDskyboxObjects1); +gdjs.copyArray(runtimeScene.getObjects("sslider"), gdjs.menuCode.GDssliderObjects1); +{for(var i = 0, len = gdjs.menuCode.GDmsliderObjects1.length ;i < len;++i) { + gdjs.menuCode.GDmsliderObjects1[i].Activate(false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}{for(var i = 0, len = gdjs.menuCode.GDssliderObjects1.length ;i < len;++i) { + gdjs.menuCode.GDssliderObjects1[i].Activate(false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}{for(var i = 0, len = gdjs.menuCode.GDskyboxObjects1.length ;i < len;++i) { + gdjs.menuCode.GDskyboxObjects1[i].Activate(false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}{for(var i = 0, len = gdjs.menuCode.GDaccountbtnObjects1.length ;i < len;++i) { + gdjs.menuCode.GDaccountbtnObjects1[i].Activate(false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.camera.layerIsVisible(runtimeScene, "settings"); +if (isConditionTrue_0) { +gdjs.copyArray(runtimeScene.getObjects("accountbtn"), gdjs.menuCode.GDaccountbtnObjects1); +gdjs.copyArray(runtimeScene.getObjects("mslider"), gdjs.menuCode.GDmsliderObjects1); +gdjs.copyArray(runtimeScene.getObjects("skybox"), gdjs.menuCode.GDskyboxObjects1); +gdjs.copyArray(runtimeScene.getObjects("sslider"), gdjs.menuCode.GDssliderObjects1); +{for(var i = 0, len = gdjs.menuCode.GDmsliderObjects1.length ;i < len;++i) { + gdjs.menuCode.GDmsliderObjects1[i].Activate(true, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}{for(var i = 0, len = gdjs.menuCode.GDssliderObjects1.length ;i < len;++i) { + gdjs.menuCode.GDssliderObjects1[i].Activate(true, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}{for(var i = 0, len = gdjs.menuCode.GDskyboxObjects1.length ;i < len;++i) { + gdjs.menuCode.GDskyboxObjects1[i].Activate(true, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}{for(var i = 0, len = gdjs.menuCode.GDaccountbtnObjects1.length ;i < len;++i) { + gdjs.menuCode.GDaccountbtnObjects1[i].Activate(true, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("mslider"), gdjs.menuCode.GDmsliderObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.menuCode.GDmsliderObjects1.length;i (gdjs.tutorialCode.asyncCallback25670884(runtimeScene, asyncObjectsList))); +} +} + +} + + +};gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDTopArrowButtonObjects2Objects = Hashtable.newFrom({"TopArrowButton": gdjs.tutorialCode.GDTopArrowButtonObjects2}); +gdjs.tutorialCode.asyncCallback25673884 = function (runtimeScene, asyncObjectsList) { +gdjs.copyArray(asyncObjectsList.getObjects("player"), gdjs.tutorialCode.GDplayerObjects4); + +{for(var i = 0, len = gdjs.tutorialCode.GDplayerObjects4.length ;i < len;++i) { + gdjs.tutorialCode.GDplayerObjects4[i].returnVariable(gdjs.tutorialCode.GDplayerObjects4[i].getVariables().getFromIndex(0)).setNumber(0); +} +}} +gdjs.tutorialCode.eventsList1 = function(runtimeScene, asyncObjectsList) { + +{ + + +{ +const parentAsyncObjectsList = asyncObjectsList; +{ +const asyncObjectsList = gdjs.LongLivedObjectsList.from(parentAsyncObjectsList); +for (const obj of gdjs.tutorialCode.GDplayerObjects3) asyncObjectsList.addObject("player", obj); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtTools.runtimeScene.wait(0.2), (runtimeScene) => (gdjs.tutorialCode.asyncCallback25673884(runtimeScene, asyncObjectsList))); +} +} + +} + + +};gdjs.tutorialCode.asyncCallback25673196 = function (runtimeScene, asyncObjectsList) { +gdjs.copyArray(asyncObjectsList.getObjects("player"), gdjs.tutorialCode.GDplayerObjects3); + +{for(var i = 0, len = gdjs.tutorialCode.GDplayerObjects3.length ;i < len;++i) { + gdjs.tutorialCode.GDplayerObjects3[i].getBehavior("TweenZOrder").TweenZOrder("jump", (gdjs.tutorialCode.GDplayerObjects3[i].getZOrder()) + 32, "easeOutQuad", 200, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +} +{ //Subevents +gdjs.tutorialCode.eventsList1(runtimeScene, asyncObjectsList);} //End of subevents +} +gdjs.tutorialCode.eventsList2 = function(runtimeScene) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +for (const obj of gdjs.tutorialCode.GDplayerObjects2) asyncObjectsList.addObject("player", obj); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtTools.runtimeScene.wait(0.1), (runtimeScene) => (gdjs.tutorialCode.asyncCallback25673196(runtimeScene, asyncObjectsList))); +} +} + +} + + +};gdjs.tutorialCode.eventsList3 = function(runtimeScene) { + +{ + +gdjs.copyArray(runtimeScene.getObjects("FireRoundButton"), gdjs.tutorialCode.GDFireRoundButtonObjects3); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.input.cursorOnObject(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDFireRoundButtonObjects3Objects, runtimeScene, true, false); +if (isConditionTrue_0) { +gdjs.copyArray(runtimeScene.getObjects("Bullet"), gdjs.tutorialCode.GDBulletObjects3); +gdjs.copyArray(runtimeScene.getObjects("player"), gdjs.tutorialCode.GDplayerObjects3); +gdjs.copyArray(runtimeScene.getObjects("shotgun"), gdjs.tutorialCode.GDshotgunObjects3); +{for(var i = 0, len = gdjs.tutorialCode.GDshotgunObjects3.length ;i < len;++i) { + gdjs.tutorialCode.GDshotgunObjects3[i].getBehavior("Tween").addObjectPositionYTween("up", (gdjs.tutorialCode.GDshotgunObjects3[i].getPointY("")) - 15, "easeInOutQuad", 80, false); +} +}{for(var i = 0, len = gdjs.tutorialCode.GDplayerObjects3.length ;i < len;++i) { + gdjs.tutorialCode.GDplayerObjects3[i].getBehavior("FireBullet").Fire((gdjs.tutorialCode.GDplayerObjects3[i].getPointX("")), (gdjs.tutorialCode.GDplayerObjects3[i].getPointY("")), gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDBulletObjects3Objects, gdjs.evtsExt__WithThreeJS__CameraAngle.func(runtimeScene, "Y", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) - 90, 900, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}{for(var i = 0, len = gdjs.tutorialCode.GDshotgunObjects3.length ;i < len;++i) { + gdjs.tutorialCode.GDshotgunObjects3[i].setAnimation(1); +} +} +{ //Subevents +gdjs.tutorialCode.eventsList0(runtimeScene);} //End of subevents +} + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("TopArrowButton"), gdjs.tutorialCode.GDTopArrowButtonObjects2); +gdjs.copyArray(runtimeScene.getObjects("player"), gdjs.tutorialCode.GDplayerObjects2); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.tutorialCode.GDplayerObjects2.length;i (gdjs.tutorialCode.asyncCallback25574860(runtimeScene, asyncObjectsList))); +} +} + +} + + +};gdjs.tutorialCode.eventsList10 = function(runtimeScene) { + +{ + +gdjs.copyArray(runtimeScene.getObjects("player"), gdjs.tutorialCode.GDplayerObjects3); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{let isConditionTrue_1 = false; +isConditionTrue_0 = false; +{ +isConditionTrue_1 = gdjs.evtTools.input.isKeyPressed(runtimeScene, "w"); +if(isConditionTrue_1) { + isConditionTrue_0 = true; +} +} +{ +isConditionTrue_1 = gdjs.evtTools.input.isKeyPressed(runtimeScene, "Up"); +if(isConditionTrue_1) { + isConditionTrue_0 = true; +} +} +{ +isConditionTrue_1 = gdjs.evtTools.input.isKeyPressed(runtimeScene, "a"); +if(isConditionTrue_1) { + isConditionTrue_0 = true; +} +} +{ +isConditionTrue_1 = gdjs.evtTools.input.isKeyPressed(runtimeScene, "Left"); +if(isConditionTrue_1) { + isConditionTrue_0 = true; +} +} +{ +isConditionTrue_1 = gdjs.evtTools.input.isKeyPressed(runtimeScene, "s"); +if(isConditionTrue_1) { + isConditionTrue_0 = true; +} +} +{ +isConditionTrue_1 = gdjs.evtTools.input.isKeyPressed(runtimeScene, "Down"); +if(isConditionTrue_1) { + isConditionTrue_0 = true; +} +} +{ +isConditionTrue_1 = gdjs.evtTools.input.isKeyPressed(runtimeScene, "d"); +if(isConditionTrue_1) { + isConditionTrue_0 = true; +} +} +{ +isConditionTrue_1 = gdjs.evtTools.input.isKeyPressed(runtimeScene, "Right"); +if(isConditionTrue_1) { + isConditionTrue_0 = true; +} +} +{ +} +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.tutorialCode.GDplayerObjects3.length;i (gdjs.tutorialCode.asyncCallback25591196(runtimeScene, asyncObjectsList))); +} +} + +} + + +};gdjs.tutorialCode.asyncCallback25590220 = function (runtimeScene, asyncObjectsList) { +gdjs.copyArray(asyncObjectsList.getObjects("player"), gdjs.tutorialCode.GDplayerObjects4); + +{for(var i = 0, len = gdjs.tutorialCode.GDplayerObjects4.length ;i < len;++i) { + gdjs.tutorialCode.GDplayerObjects4[i].getBehavior("TweenZOrder").TweenZOrder("jump", (gdjs.tutorialCode.GDplayerObjects4[i].getZOrder()) + 64, "easeOutQuad", 200, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +} +{ //Subevents +gdjs.tutorialCode.eventsList12(runtimeScene, asyncObjectsList);} //End of subevents +} +gdjs.tutorialCode.eventsList13 = function(runtimeScene) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +for (const obj of gdjs.tutorialCode.GDplayerObjects3) asyncObjectsList.addObject("player", obj); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtTools.runtimeScene.wait(0.1), (runtimeScene) => (gdjs.tutorialCode.asyncCallback25590220(runtimeScene, asyncObjectsList))); +} +} + +} + + +};gdjs.tutorialCode.eventsList14 = function(runtimeScene) { + +{ + +gdjs.copyArray(runtimeScene.getObjects("player"), gdjs.tutorialCode.GDplayerObjects3); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.tutorialCode.GDplayerObjects3.length;i (gdjs.tutorialCode.asyncCallback25596420(runtimeScene, asyncObjectsList))); +} +} + +} + + +};gdjs.tutorialCode.asyncCallback25595996 = function (runtimeScene, asyncObjectsList) { +gdjs.copyArray(asyncObjectsList.getObjects("player"), gdjs.tutorialCode.GDplayerObjects3); + +{for(var i = 0, len = gdjs.tutorialCode.GDplayerObjects3.length ;i < len;++i) { + gdjs.tutorialCode.GDplayerObjects3[i].getBehavior("TweenZOrder").TweenZOrder("jump", (gdjs.tutorialCode.GDplayerObjects3[i].getZOrder()) + 128, "easeOutQuad", 200, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +} +{ //Subevents +gdjs.tutorialCode.eventsList15(runtimeScene, asyncObjectsList);} //End of subevents +} +gdjs.tutorialCode.eventsList16 = function(runtimeScene) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +for (const obj of gdjs.tutorialCode.GDplayerObjects2) asyncObjectsList.addObject("player", obj); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtTools.runtimeScene.wait(0.1), (runtimeScene) => (gdjs.tutorialCode.asyncCallback25595996(runtimeScene, asyncObjectsList))); +} +} + +} + + +};gdjs.tutorialCode.eventsList17 = function(runtimeScene) { + +{ + +gdjs.copyArray(runtimeScene.getObjects("player"), gdjs.tutorialCode.GDplayerObjects2); +gdjs.copyArray(runtimeScene.getObjects("wall"), gdjs.tutorialCode.GDwallObjects2); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.object.hitBoxesCollisionTest(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects2Objects, gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDwallObjects2Objects, false, runtimeScene, false); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.input.wasKeyReleased(runtimeScene, "Space"); +} +if (isConditionTrue_0) { +/* Reuse gdjs.tutorialCode.GDplayerObjects2 */ +{for(var i = 0, len = gdjs.tutorialCode.GDplayerObjects2.length ;i < len;++i) { + gdjs.tutorialCode.GDplayerObjects2[i].returnVariable(gdjs.tutorialCode.GDplayerObjects2[i].getVariables().getFromIndex(0)).setNumber(1); +} +}{for(var i = 0, len = gdjs.tutorialCode.GDplayerObjects2.length ;i < len;++i) { + gdjs.tutorialCode.GDplayerObjects2[i].getBehavior("TweenZOrder").TweenZOrder("jump", (gdjs.tutorialCode.GDplayerObjects2[i].getZOrder()) + 64, "swingFrom", 100, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +} +{ //Subevents +gdjs.tutorialCode.eventsList16(runtimeScene);} //End of subevents +} + +} + + +};gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDtargetObjects2Objects = Hashtable.newFrom({"target": gdjs.tutorialCode.GDtargetObjects2}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects2Objects = Hashtable.newFrom({"player": gdjs.tutorialCode.GDplayerObjects2}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDtargetObjects2Objects = Hashtable.newFrom({"target": gdjs.tutorialCode.GDtargetObjects2}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects2Objects = Hashtable.newFrom({"player": gdjs.tutorialCode.GDplayerObjects2}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDportalObjects2Objects = Hashtable.newFrom({"portal": gdjs.tutorialCode.GDportalObjects2}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects2Objects = Hashtable.newFrom({"player": gdjs.tutorialCode.GDplayerObjects2}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDboxObjects2Objects = Hashtable.newFrom({"box": gdjs.tutorialCode.GDboxObjects2}); +gdjs.tutorialCode.eventsList18 = function(runtimeScene) { + +{ + + +gdjs.tutorialCode.eventsList10(runtimeScene); +} + + +{ + + +gdjs.tutorialCode.eventsList11(runtimeScene); +} + + +{ + + +gdjs.tutorialCode.eventsList14(runtimeScene); +} + + +{ + + +gdjs.tutorialCode.eventsList17(runtimeScene); +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("player"), gdjs.tutorialCode.GDplayerObjects2); +gdjs.copyArray(runtimeScene.getObjects("target"), gdjs.tutorialCode.GDtargetObjects2); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.object.hitBoxesCollisionTest(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDtargetObjects2Objects, gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects2Objects, false, runtimeScene, false); +if (isConditionTrue_0) { +/* Reuse gdjs.tutorialCode.GDplayerObjects2 */ +/* Reuse gdjs.tutorialCode.GDtargetObjects2 */ +{for(var i = 0, len = gdjs.tutorialCode.GDplayerObjects2.length ;i < len;++i) { + gdjs.tutorialCode.GDplayerObjects2[i].separateFromObjectsList(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDtargetObjects2Objects, false); +} +}} + +} + + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(runtimeScene.getObjects("healthbar"), gdjs.tutorialCode.GDhealthbarObjects2); +gdjs.copyArray(runtimeScene.getObjects("player"), gdjs.tutorialCode.GDplayerObjects2); +{for(var i = 0, len = gdjs.tutorialCode.GDhealthbarObjects2.length ;i < len;++i) { + gdjs.tutorialCode.GDhealthbarObjects2[i].SetValue((( gdjs.tutorialCode.GDplayerObjects2.length === 0 ) ? 0 :gdjs.tutorialCode.GDplayerObjects2[0].getBehavior("Health").Health((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("player"), gdjs.tutorialCode.GDplayerObjects2); +gdjs.copyArray(runtimeScene.getObjects("portal"), gdjs.tutorialCode.GDportalObjects2); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.object.hitBoxesCollisionTest(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects2Objects, gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDportalObjects2Objects, false, runtimeScene, false); +if (isConditionTrue_0) { +/* Reuse gdjs.tutorialCode.GDplayerObjects2 */ +gdjs.copyArray(runtimeScene.getObjects("portal2"), gdjs.tutorialCode.GDportal2Objects2); +{for(var i = 0, len = gdjs.tutorialCode.GDplayerObjects2.length ;i < len;++i) { + gdjs.tutorialCode.GDplayerObjects2[i].setPosition((( gdjs.tutorialCode.GDportal2Objects2.length === 0 ) ? 0 :gdjs.tutorialCode.GDportal2Objects2[0].getX()),(( gdjs.tutorialCode.GDportal2Objects2.length === 0 ) ? 0 :gdjs.tutorialCode.GDportal2Objects2[0].getY()) + 10); +} +}} + +} + + +{ + + + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("box"), gdjs.tutorialCode.GDboxObjects2); +gdjs.copyArray(runtimeScene.getObjects("clockImage"), gdjs.tutorialCode.GDclockImageObjects2); +gdjs.copyArray(runtimeScene.getObjects("player"), gdjs.tutorialCode.GDplayerObjects2); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.object.hitBoxesCollisionTest(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects2Objects, gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDboxObjects2Objects, false, runtimeScene, false); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.tutorialCode.GDboxObjects2.length;i (gdjs.tutorialCode.asyncCallback25603164(runtimeScene, asyncObjectsList))); +} +} + +} + + +};gdjs.tutorialCode.asyncCallback25605060 = function (runtimeScene, asyncObjectsList) { +gdjs.copyArray(runtimeScene.getObjects("Bullet"), gdjs.tutorialCode.GDBulletObjects3); +{for(var i = 0, len = gdjs.tutorialCode.GDBulletObjects3.length ;i < len;++i) { + gdjs.tutorialCode.GDBulletObjects3[i].deleteFromScene(runtimeScene); +} +}} +gdjs.tutorialCode.eventsList20 = function(runtimeScene) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtTools.runtimeScene.wait(5), (runtimeScene) => (gdjs.tutorialCode.asyncCallback25605060(runtimeScene, asyncObjectsList))); +} +} + +} + + +};gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDBulletObjects3Objects = Hashtable.newFrom({"Bullet": gdjs.tutorialCode.GDBulletObjects3}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDwallObjects3Objects = Hashtable.newFrom({"wall": gdjs.tutorialCode.GDwallObjects3}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDexplosionObjects3Objects = Hashtable.newFrom({"explosion": gdjs.tutorialCode.GDexplosionObjects3}); +gdjs.tutorialCode.asyncCallback25610820 = function (runtimeScene, asyncObjectsList) { +gdjs.copyArray(asyncObjectsList.getObjects("explosion"), gdjs.tutorialCode.GDexplosionObjects5); + +{for(var i = 0, len = gdjs.tutorialCode.GDexplosionObjects5.length ;i < len;++i) { + gdjs.tutorialCode.GDexplosionObjects5[i].getBehavior("Tween").addObjectOpacityTween("fadeh", 0, "linear", 200, true); +} +}} +gdjs.tutorialCode.eventsList21 = function(runtimeScene) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +for (const obj of gdjs.tutorialCode.GDexplosionObjects3) asyncObjectsList.addObject("explosion", obj); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtTools.runtimeScene.wait(0.5), (runtimeScene) => (gdjs.tutorialCode.asyncCallback25610820(runtimeScene, asyncObjectsList))); +} +} + +} + + +};gdjs.tutorialCode.eventsList22 = function(runtimeScene) { + +{ + +gdjs.copyArray(runtimeScene.getObjects("Bullet"), gdjs.tutorialCode.GDBulletObjects3); +gdjs.copyArray(runtimeScene.getObjects("wall"), gdjs.tutorialCode.GDwallObjects3); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.object.hitBoxesCollisionTest(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDBulletObjects3Objects, gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDwallObjects3Objects, false, runtimeScene, false); +if (isConditionTrue_0) { +/* Reuse gdjs.tutorialCode.GDBulletObjects3 */ +gdjs.tutorialCode.GDexplosionObjects3.length = 0; + +{gdjs.evtTools.object.createObjectOnScene((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : runtimeScene), gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDexplosionObjects3Objects, (( gdjs.tutorialCode.GDBulletObjects3.length === 0 ) ? 0 :gdjs.tutorialCode.GDBulletObjects3[0].getPointX("")), (( gdjs.tutorialCode.GDBulletObjects3.length === 0 ) ? 0 :gdjs.tutorialCode.GDBulletObjects3[0].getPointY("")), ""); +}{for(var i = 0, len = gdjs.tutorialCode.GDexplosionObjects3.length ;i < len;++i) { + gdjs.tutorialCode.GDexplosionObjects3[i].setZOrder((( gdjs.tutorialCode.GDBulletObjects3.length === 0 ) ? 0 :gdjs.tutorialCode.GDBulletObjects3[0].getZOrder())); +} +}{for(var i = 0, len = gdjs.tutorialCode.GDBulletObjects3.length ;i < len;++i) { + gdjs.tutorialCode.GDBulletObjects3[i].deleteFromScene(runtimeScene); +} +}} + +} + + +{ + + + +} + + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(runtimeScene.getObjects("explosion"), gdjs.tutorialCode.GDexplosionObjects3); +{for(var i = 0, len = gdjs.tutorialCode.GDexplosionObjects3.length ;i < len;++i) { + gdjs.tutorialCode.GDexplosionObjects3[i].setAnimationFrame(gdjs.tutorialCode.GDexplosionObjects3[i].getAnimationFrame() + (1)); +} +}} + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("explosion"), gdjs.tutorialCode.GDexplosionObjects3); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.tutorialCode.GDexplosionObjects3.length;i (gdjs.tutorialCode.asyncCallback25614452(runtimeScene, asyncObjectsList))); +} +} + +} + + +};gdjs.tutorialCode.eventsList24 = function(runtimeScene) { + +{ + +gdjs.copyArray(runtimeScene.getObjects("Bullet"), gdjs.tutorialCode.GDBulletObjects3); +gdjs.copyArray(runtimeScene.getObjects("enemy"), gdjs.tutorialCode.GDenemyObjects3); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.object.hitBoxesCollisionTest(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDBulletObjects3Objects, gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDenemyObjects3Objects, false, runtimeScene, false); +if (isConditionTrue_0) { +/* Reuse gdjs.tutorialCode.GDBulletObjects3 */ +/* Reuse gdjs.tutorialCode.GDenemyObjects3 */ +gdjs.tutorialCode.GDdedEnemyObjects3.length = 0; + +{gdjs.evtTools.object.createObjectOnScene((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : runtimeScene), gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDdedEnemyObjects3Objects, (( gdjs.tutorialCode.GDBulletObjects3.length === 0 ) ? 0 :gdjs.tutorialCode.GDBulletObjects3[0].getPointX("")), (( gdjs.tutorialCode.GDBulletObjects3.length === 0 ) ? 0 :gdjs.tutorialCode.GDBulletObjects3[0].getPointY("")), ""); +}{for(var i = 0, len = gdjs.tutorialCode.GDdedEnemyObjects3.length ;i < len;++i) { + gdjs.tutorialCode.GDdedEnemyObjects3[i].setZOrder((( gdjs.tutorialCode.GDBulletObjects3.length === 0 ) ? 0 :gdjs.tutorialCode.GDBulletObjects3[0].getZOrder())); +} +}{for(var i = 0, len = gdjs.tutorialCode.GDBulletObjects3.length ;i < len;++i) { + gdjs.tutorialCode.GDBulletObjects3[i].deleteFromScene(runtimeScene); +} +}{for(var i = 0, len = gdjs.tutorialCode.GDenemyObjects3.length ;i < len;++i) { + gdjs.tutorialCode.GDenemyObjects3[i].deleteFromScene(runtimeScene); +} +}{gdjs.evtTools.sound.playSoundOnChannel(runtimeScene, "dedEnemy", 0, false, 50, 1); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(runtimeScene.getObjects("dedEnemy"), gdjs.tutorialCode.GDdedEnemyObjects3); +{for(var i = 0, len = gdjs.tutorialCode.GDdedEnemyObjects3.length ;i < len;++i) { + gdjs.tutorialCode.GDdedEnemyObjects3[i].setAnimationFrame(gdjs.tutorialCode.GDdedEnemyObjects3[i].getAnimationFrame() + (1)); +} +}} + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("dedEnemy"), gdjs.tutorialCode.GDdedEnemyObjects3); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.tutorialCode.GDdedEnemyObjects3.length;i= (( gdjs.tutorialCode.GDplatformObjects3.length === 0 ) ? 0 :gdjs.tutorialCode.GDplatformObjects3[0].getZOrder()) - 37 ) { + isConditionTrue_0 = true; + gdjs.tutorialCode.GDplayerObjects3[k] = gdjs.tutorialCode.GDplayerObjects3[i]; + ++k; + } +} +gdjs.tutorialCode.GDplayerObjects3.length = k; +} +} +if (isConditionTrue_0) { +/* Reuse gdjs.tutorialCode.GDplatformObjects3 */ +/* Reuse gdjs.tutorialCode.GDplayerObjects3 */ +{for(var i = 0, len = gdjs.tutorialCode.GDplayerObjects3.length ;i < len;++i) { + gdjs.tutorialCode.GDplayerObjects3[i].setZOrder((( gdjs.tutorialCode.GDplatformObjects3.length === 0 ) ? 0 :gdjs.tutorialCode.GDplatformObjects3[0].getZOrder()) + 37); +} +}} + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("platform2"), gdjs.tutorialCode.GDplatform2Objects3); +gdjs.copyArray(runtimeScene.getObjects("player"), gdjs.tutorialCode.GDplayerObjects3); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.object.hitBoxesCollisionTest(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects3Objects, gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplatform2Objects3Objects, false, runtimeScene, false); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.tutorialCode.GDplayerObjects3.length;i= (( gdjs.tutorialCode.GDplatform2Objects3.length === 0 ) ? 0 :gdjs.tutorialCode.GDplatform2Objects3[0].getZOrder()) - 37 ) { + isConditionTrue_0 = true; + gdjs.tutorialCode.GDplayerObjects3[k] = gdjs.tutorialCode.GDplayerObjects3[i]; + ++k; + } +} +gdjs.tutorialCode.GDplayerObjects3.length = k; +} +} +if (isConditionTrue_0) { +/* Reuse gdjs.tutorialCode.GDplatform2Objects3 */ +/* Reuse gdjs.tutorialCode.GDplayerObjects3 */ +{for(var i = 0, len = gdjs.tutorialCode.GDplayerObjects3.length ;i < len;++i) { + gdjs.tutorialCode.GDplayerObjects3[i].setZOrder((( gdjs.tutorialCode.GDplatform2Objects3.length === 0 ) ? 0 :gdjs.tutorialCode.GDplatform2Objects3[0].getZOrder()) + 37); +} +}} + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("finish"), gdjs.tutorialCode.GDfinishObjects3); +gdjs.copyArray(runtimeScene.getObjects("player"), gdjs.tutorialCode.GDplayerObjects3); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.object.hitBoxesCollisionTest(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects3Objects, gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDfinishObjects3Objects, false, runtimeScene, false); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.tutorialCode.GDplayerObjects3.length;i= (( gdjs.tutorialCode.GDfinishObjects3.length === 0 ) ? 0 :gdjs.tutorialCode.GDfinishObjects3[0].getZOrder()) - 37 ) { + isConditionTrue_0 = true; + gdjs.tutorialCode.GDplayerObjects3[k] = gdjs.tutorialCode.GDplayerObjects3[i]; + ++k; + } +} +gdjs.tutorialCode.GDplayerObjects3.length = k; +} +} +if (isConditionTrue_0) { +/* Reuse gdjs.tutorialCode.GDfinishObjects3 */ +/* Reuse gdjs.tutorialCode.GDplayerObjects3 */ +{for(var i = 0, len = gdjs.tutorialCode.GDplayerObjects3.length ;i < len;++i) { + gdjs.tutorialCode.GDplayerObjects3[i].setZOrder((( gdjs.tutorialCode.GDfinishObjects3.length === 0 ) ? 0 :gdjs.tutorialCode.GDfinishObjects3[0].getZOrder()) + 37); +} +}} + +} + + +{ + + + +} + + +{ + + + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("box"), gdjs.tutorialCode.GDboxObjects3); +gdjs.copyArray(runtimeScene.getObjects("player"), gdjs.tutorialCode.GDplayerObjects3); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.object.hitBoxesCollisionTest(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects3Objects, gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDboxObjects3Objects, false, runtimeScene, false); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.tutorialCode.GDplayerObjects3.length;i= (( gdjs.tutorialCode.GDplatformObjects3.length === 0 ) ? 0 :gdjs.tutorialCode.GDplatformObjects3[0].getZOrder()) - 37 ) { + isConditionTrue_0 = true; + gdjs.tutorialCode.GDenemyObjects3[k] = gdjs.tutorialCode.GDenemyObjects3[i]; + ++k; + } +} +gdjs.tutorialCode.GDenemyObjects3.length = k; +} +} +if (isConditionTrue_0) { +/* Reuse gdjs.tutorialCode.GDenemyObjects3 */ +gdjs.copyArray(runtimeScene.getObjects("platform2"), gdjs.tutorialCode.GDplatform2Objects3); +{for(var i = 0, len = gdjs.tutorialCode.GDenemyObjects3.length ;i < len;++i) { + gdjs.tutorialCode.GDenemyObjects3[i].setZOrder((( gdjs.tutorialCode.GDplatform2Objects3.length === 0 ) ? 0 :gdjs.tutorialCode.GDplatform2Objects3[0].getZOrder()) + 37); +} +}} + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("enemy"), gdjs.tutorialCode.GDenemyObjects3); +gdjs.copyArray(runtimeScene.getObjects("platform2"), gdjs.tutorialCode.GDplatform2Objects3); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.object.hitBoxesCollisionTest(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDenemyObjects3Objects, gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplatform2Objects3Objects, false, runtimeScene, false); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.tutorialCode.GDenemyObjects3.length;i= (( gdjs.tutorialCode.GDplatform2Objects3.length === 0 ) ? 0 :gdjs.tutorialCode.GDplatform2Objects3[0].getZOrder()) - 37 ) { + isConditionTrue_0 = true; + gdjs.tutorialCode.GDenemyObjects3[k] = gdjs.tutorialCode.GDenemyObjects3[i]; + ++k; + } +} +gdjs.tutorialCode.GDenemyObjects3.length = k; +} +} +if (isConditionTrue_0) { +/* Reuse gdjs.tutorialCode.GDenemyObjects3 */ +/* Reuse gdjs.tutorialCode.GDplatform2Objects3 */ +{for(var i = 0, len = gdjs.tutorialCode.GDenemyObjects3.length ;i < len;++i) { + gdjs.tutorialCode.GDenemyObjects3[i].setZOrder((( gdjs.tutorialCode.GDplatform2Objects3.length === 0 ) ? 0 :gdjs.tutorialCode.GDplatform2Objects3[0].getZOrder()) + 37); +} +}} + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("box"), gdjs.tutorialCode.GDboxObjects3); +gdjs.copyArray(runtimeScene.getObjects("enemy"), gdjs.tutorialCode.GDenemyObjects3); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.object.hitBoxesCollisionTest(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDenemyObjects3Objects, gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDboxObjects3Objects, false, runtimeScene, false); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.tutorialCode.GDenemyObjects3.length;i (gdjs.tutorialCode.asyncCallback25629676(runtimeScene, asyncObjectsList))); +} +} + +} + + +};gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDBulletObjects1Objects = Hashtable.newFrom({"Bullet": gdjs.tutorialCode.GDBulletObjects1}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDwallObjects1Objects = Hashtable.newFrom({"wall": gdjs.tutorialCode.GDwallObjects1}); +gdjs.tutorialCode.eventsList30 = function(runtimeScene) { + +{ + +gdjs.copyArray(runtimeScene.getObjects("Bullet"), gdjs.tutorialCode.GDBulletObjects2); +gdjs.copyArray(runtimeScene.getObjects("target"), gdjs.tutorialCode.GDtargetObjects2); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.object.hitBoxesCollisionTest(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDBulletObjects2Objects, gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDtargetObjects2Objects, false, runtimeScene, false); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.tutorialCode.GDBulletObjects2.length;i= (( gdjs.tutorialCode.GDtargetObjects2.length === 0 ) ? 0 :gdjs.tutorialCode.GDtargetObjects2[0].getZOrder()) - 70 ) { + isConditionTrue_0 = true; + gdjs.tutorialCode.GDBulletObjects2[k] = gdjs.tutorialCode.GDBulletObjects2[i]; + ++k; + } +} +gdjs.tutorialCode.GDBulletObjects2.length = k; +if (isConditionTrue_0) { +isConditionTrue_0 = false; +{isConditionTrue_0 = runtimeScene.getOnceTriggers().triggerOnce(25629332); +} +} +} +} +if (isConditionTrue_0) { +/* Reuse gdjs.tutorialCode.GDtargetObjects2 */ +{for(var i = 0, len = gdjs.tutorialCode.GDtargetObjects2.length ;i < len;++i) { + gdjs.tutorialCode.GDtargetObjects2[i].getBehavior("TweenZOrder").TweenZOrder("hittarget", -(300), "swingFrom", 1000, true, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +} +{ //Subevents +gdjs.tutorialCode.eventsList29(runtimeScene);} //End of subevents +} + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("Bullet"), gdjs.tutorialCode.GDBulletObjects1); +gdjs.copyArray(runtimeScene.getObjects("wall"), gdjs.tutorialCode.GDwallObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.object.hitBoxesCollisionTest(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDBulletObjects1Objects, gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDwallObjects1Objects, false, runtimeScene, false); +if (isConditionTrue_0) { +/* Reuse gdjs.tutorialCode.GDBulletObjects1 */ +{for(var i = 0, len = gdjs.tutorialCode.GDBulletObjects1.length ;i < len;++i) { + gdjs.tutorialCode.GDBulletObjects1[i].deleteFromScene(runtimeScene); +} +}} + +} + + +};gdjs.tutorialCode.eventsList31 = function(runtimeScene) { + +{ + + +gdjs.tutorialCode.eventsList27(runtimeScene); +} + + +{ + + +gdjs.tutorialCode.eventsList28(runtimeScene); +} + + +{ + + +gdjs.tutorialCode.eventsList30(runtimeScene); +} + + +};gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects3Objects = Hashtable.newFrom({"player": gdjs.tutorialCode.GDplayerObjects3}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplatformObjects3Objects = Hashtable.newFrom({"platform": gdjs.tutorialCode.GDplatformObjects3}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects3Objects = Hashtable.newFrom({"player": gdjs.tutorialCode.GDplayerObjects3}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplatform2Objects3Objects = Hashtable.newFrom({"platform2": gdjs.tutorialCode.GDplatform2Objects3}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects3Objects = Hashtable.newFrom({"player": gdjs.tutorialCode.GDplayerObjects3}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDboxObjects3Objects = Hashtable.newFrom({"box": gdjs.tutorialCode.GDboxObjects3}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects3Objects = Hashtable.newFrom({"player": gdjs.tutorialCode.GDplayerObjects3}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDgroundObjects3Objects = Hashtable.newFrom({"ground": gdjs.tutorialCode.GDgroundObjects3}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects3Objects = Hashtable.newFrom({"player": gdjs.tutorialCode.GDplayerObjects3}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDfinishObjects3Objects = Hashtable.newFrom({"finish": gdjs.tutorialCode.GDfinishObjects3}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDboxObjects3Objects = Hashtable.newFrom({"box": gdjs.tutorialCode.GDboxObjects3}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplatformObjects3Objects = Hashtable.newFrom({"platform": gdjs.tutorialCode.GDplatformObjects3}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDboxObjects3Objects = Hashtable.newFrom({"box": gdjs.tutorialCode.GDboxObjects3}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplatform2Objects3Objects = Hashtable.newFrom({"platform2": gdjs.tutorialCode.GDplatform2Objects3}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDboxObjects3Objects = Hashtable.newFrom({"box": gdjs.tutorialCode.GDboxObjects3}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDboxObjects3Objects = Hashtable.newFrom({"box": gdjs.tutorialCode.GDboxObjects3}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDboxObjects3Objects = Hashtable.newFrom({"box": gdjs.tutorialCode.GDboxObjects3}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDgroundObjects3Objects = Hashtable.newFrom({"ground": gdjs.tutorialCode.GDgroundObjects3}); +gdjs.tutorialCode.eventsList32 = function(runtimeScene) { + +{ + + + +} + + +{ + +gdjs.tutorialCode.GDboxObjects2.length = 0; + +gdjs.tutorialCode.GDfinishObjects2.length = 0; + +gdjs.tutorialCode.GDgroundObjects2.length = 0; + +gdjs.tutorialCode.GDplatformObjects2.length = 0; + +gdjs.tutorialCode.GDplatform2Objects2.length = 0; + +gdjs.tutorialCode.GDplayerObjects2.length = 0; + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{gdjs.tutorialCode.GDboxObjects2_1final.length = 0; +gdjs.tutorialCode.GDfinishObjects2_1final.length = 0; +gdjs.tutorialCode.GDgroundObjects2_1final.length = 0; +gdjs.tutorialCode.GDplatformObjects2_1final.length = 0; +gdjs.tutorialCode.GDplatform2Objects2_1final.length = 0; +gdjs.tutorialCode.GDplayerObjects2_1final.length = 0; +let isConditionTrue_1 = false; +isConditionTrue_0 = false; +{ +gdjs.copyArray(runtimeScene.getObjects("platform"), gdjs.tutorialCode.GDplatformObjects3); +gdjs.copyArray(runtimeScene.getObjects("player"), gdjs.tutorialCode.GDplayerObjects3); +isConditionTrue_1 = gdjs.evtTools.object.hitBoxesCollisionTest(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects3Objects, gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplatformObjects3Objects, true, runtimeScene, false); +if(isConditionTrue_1) { + isConditionTrue_0 = true; + for (let j = 0, jLen = gdjs.tutorialCode.GDplatformObjects3.length; j < jLen ; ++j) { + if ( gdjs.tutorialCode.GDplatformObjects2_1final.indexOf(gdjs.tutorialCode.GDplatformObjects3[j]) === -1 ) + gdjs.tutorialCode.GDplatformObjects2_1final.push(gdjs.tutorialCode.GDplatformObjects3[j]); + } + for (let j = 0, jLen = gdjs.tutorialCode.GDplayerObjects3.length; j < jLen ; ++j) { + if ( gdjs.tutorialCode.GDplayerObjects2_1final.indexOf(gdjs.tutorialCode.GDplayerObjects3[j]) === -1 ) + gdjs.tutorialCode.GDplayerObjects2_1final.push(gdjs.tutorialCode.GDplayerObjects3[j]); + } +} +} +{ +gdjs.copyArray(runtimeScene.getObjects("platform2"), gdjs.tutorialCode.GDplatform2Objects3); +gdjs.copyArray(runtimeScene.getObjects("player"), gdjs.tutorialCode.GDplayerObjects3); +isConditionTrue_1 = gdjs.evtTools.object.hitBoxesCollisionTest(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects3Objects, gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplatform2Objects3Objects, true, runtimeScene, false); +if(isConditionTrue_1) { + isConditionTrue_0 = true; + for (let j = 0, jLen = gdjs.tutorialCode.GDplatform2Objects3.length; j < jLen ; ++j) { + if ( gdjs.tutorialCode.GDplatform2Objects2_1final.indexOf(gdjs.tutorialCode.GDplatform2Objects3[j]) === -1 ) + gdjs.tutorialCode.GDplatform2Objects2_1final.push(gdjs.tutorialCode.GDplatform2Objects3[j]); + } + for (let j = 0, jLen = gdjs.tutorialCode.GDplayerObjects3.length; j < jLen ; ++j) { + if ( gdjs.tutorialCode.GDplayerObjects2_1final.indexOf(gdjs.tutorialCode.GDplayerObjects3[j]) === -1 ) + gdjs.tutorialCode.GDplayerObjects2_1final.push(gdjs.tutorialCode.GDplayerObjects3[j]); + } +} +} +{ +gdjs.copyArray(runtimeScene.getObjects("box"), gdjs.tutorialCode.GDboxObjects3); +gdjs.copyArray(runtimeScene.getObjects("player"), gdjs.tutorialCode.GDplayerObjects3); +isConditionTrue_1 = gdjs.evtTools.object.hitBoxesCollisionTest(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects3Objects, gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDboxObjects3Objects, true, runtimeScene, false); +if(isConditionTrue_1) { + isConditionTrue_0 = true; + for (let j = 0, jLen = gdjs.tutorialCode.GDboxObjects3.length; j < jLen ; ++j) { + if ( gdjs.tutorialCode.GDboxObjects2_1final.indexOf(gdjs.tutorialCode.GDboxObjects3[j]) === -1 ) + gdjs.tutorialCode.GDboxObjects2_1final.push(gdjs.tutorialCode.GDboxObjects3[j]); + } + for (let j = 0, jLen = gdjs.tutorialCode.GDplayerObjects3.length; j < jLen ; ++j) { + if ( gdjs.tutorialCode.GDplayerObjects2_1final.indexOf(gdjs.tutorialCode.GDplayerObjects3[j]) === -1 ) + gdjs.tutorialCode.GDplayerObjects2_1final.push(gdjs.tutorialCode.GDplayerObjects3[j]); + } +} +} +{ +gdjs.copyArray(runtimeScene.getObjects("ground"), gdjs.tutorialCode.GDgroundObjects3); +gdjs.copyArray(runtimeScene.getObjects("player"), gdjs.tutorialCode.GDplayerObjects3); +isConditionTrue_1 = gdjs.evtTools.object.hitBoxesCollisionTest(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects3Objects, gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDgroundObjects3Objects, true, runtimeScene, false); +if(isConditionTrue_1) { + isConditionTrue_0 = true; + for (let j = 0, jLen = gdjs.tutorialCode.GDgroundObjects3.length; j < jLen ; ++j) { + if ( gdjs.tutorialCode.GDgroundObjects2_1final.indexOf(gdjs.tutorialCode.GDgroundObjects3[j]) === -1 ) + gdjs.tutorialCode.GDgroundObjects2_1final.push(gdjs.tutorialCode.GDgroundObjects3[j]); + } + for (let j = 0, jLen = gdjs.tutorialCode.GDplayerObjects3.length; j < jLen ; ++j) { + if ( gdjs.tutorialCode.GDplayerObjects2_1final.indexOf(gdjs.tutorialCode.GDplayerObjects3[j]) === -1 ) + gdjs.tutorialCode.GDplayerObjects2_1final.push(gdjs.tutorialCode.GDplayerObjects3[j]); + } +} +} +{ +gdjs.copyArray(runtimeScene.getObjects("finish"), gdjs.tutorialCode.GDfinishObjects3); +gdjs.copyArray(runtimeScene.getObjects("player"), gdjs.tutorialCode.GDplayerObjects3); +isConditionTrue_1 = gdjs.evtTools.object.hitBoxesCollisionTest(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects3Objects, gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDfinishObjects3Objects, true, runtimeScene, false); +if(isConditionTrue_1) { + isConditionTrue_0 = true; + for (let j = 0, jLen = gdjs.tutorialCode.GDfinishObjects3.length; j < jLen ; ++j) { + if ( gdjs.tutorialCode.GDfinishObjects2_1final.indexOf(gdjs.tutorialCode.GDfinishObjects3[j]) === -1 ) + gdjs.tutorialCode.GDfinishObjects2_1final.push(gdjs.tutorialCode.GDfinishObjects3[j]); + } + for (let j = 0, jLen = gdjs.tutorialCode.GDplayerObjects3.length; j < jLen ; ++j) { + if ( gdjs.tutorialCode.GDplayerObjects2_1final.indexOf(gdjs.tutorialCode.GDplayerObjects3[j]) === -1 ) + gdjs.tutorialCode.GDplayerObjects2_1final.push(gdjs.tutorialCode.GDplayerObjects3[j]); + } +} +} +{ +gdjs.copyArray(gdjs.tutorialCode.GDboxObjects2_1final, gdjs.tutorialCode.GDboxObjects2); +gdjs.copyArray(gdjs.tutorialCode.GDfinishObjects2_1final, gdjs.tutorialCode.GDfinishObjects2); +gdjs.copyArray(gdjs.tutorialCode.GDgroundObjects2_1final, gdjs.tutorialCode.GDgroundObjects2); +gdjs.copyArray(gdjs.tutorialCode.GDplatformObjects2_1final, gdjs.tutorialCode.GDplatformObjects2); +gdjs.copyArray(gdjs.tutorialCode.GDplatform2Objects2_1final, gdjs.tutorialCode.GDplatform2Objects2); +gdjs.copyArray(gdjs.tutorialCode.GDplayerObjects2_1final, gdjs.tutorialCode.GDplayerObjects2); +} +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.tutorialCode.GDplayerObjects2.length;i 32 ) { + isConditionTrue_0 = true; + gdjs.tutorialCode.GDplayerObjects2[k] = gdjs.tutorialCode.GDplayerObjects2[i]; + ++k; + } +} +gdjs.tutorialCode.GDplayerObjects2.length = k; +if (isConditionTrue_0) { +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.tutorialCode.GDplayerObjects2.length;i 25 ) { + isConditionTrue_0 = true; + gdjs.tutorialCode.GDboxObjects2[k] = gdjs.tutorialCode.GDboxObjects2[i]; + ++k; + } +} +gdjs.tutorialCode.GDboxObjects2.length = k; +} +if (isConditionTrue_0) { +/* Reuse gdjs.tutorialCode.GDboxObjects2 */ +{for(var i = 0, len = gdjs.tutorialCode.GDboxObjects2.length ;i < len;++i) { + gdjs.tutorialCode.GDboxObjects2[i].setZOrder(gdjs.tutorialCode.GDboxObjects2[i].getZOrder() - (5)); +} +}} + +} + + +{ + + + +} + + +{ + + + +} + + +};gdjs.tutorialCode.asyncCallback25642388 = function (runtimeScene, asyncObjectsList) { +} +gdjs.tutorialCode.eventsList33 = function(runtimeScene, asyncObjectsList) { + +{ + + +{ +const parentAsyncObjectsList = asyncObjectsList; +{ +const asyncObjectsList = gdjs.LongLivedObjectsList.from(parentAsyncObjectsList); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtTools.runtimeScene.wait(1.5), (runtimeScene) => (gdjs.tutorialCode.asyncCallback25642388(runtimeScene, asyncObjectsList))); +} +} + +} + + +};gdjs.tutorialCode.asyncCallback25641676 = function (runtimeScene, asyncObjectsList) { +gdjs.copyArray(asyncObjectsList.getObjects("enemy"), gdjs.tutorialCode.GDenemyObjects3); + +{gdjs.evtTools.tween.tweenVariableNumber2(runtimeScene, "edown", runtimeScene.getScene().getVariables().getFromIndex(6), (( gdjs.tutorialCode.GDenemyObjects3.length === 0 ) ? 0 :gdjs.tutorialCode.GDenemyObjects3[0].getZOrder()) - 10, 1000, "easeInOutQuad"); +} +{ //Subevents +gdjs.tutorialCode.eventsList33(runtimeScene, asyncObjectsList);} //End of subevents +} +gdjs.tutorialCode.eventsList34 = function(runtimeScene) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +for (const obj of gdjs.tutorialCode.GDenemyObjects2) asyncObjectsList.addObject("enemy", obj); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtTools.runtimeScene.wait(1.5), (runtimeScene) => (gdjs.tutorialCode.asyncCallback25641676(runtimeScene, asyncObjectsList))); +} +} + +} + + +};gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDenemyObjects2Objects = Hashtable.newFrom({"enemy": gdjs.tutorialCode.GDenemyObjects2}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects2Objects = Hashtable.newFrom({"player": gdjs.tutorialCode.GDplayerObjects2}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDenemyObjects2Objects = Hashtable.newFrom({"enemy": gdjs.tutorialCode.GDenemyObjects2}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects2Objects = Hashtable.newFrom({"player": gdjs.tutorialCode.GDplayerObjects2}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDenemyObjects2Objects = Hashtable.newFrom({"enemy": gdjs.tutorialCode.GDenemyObjects2}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDenemyObjects2Objects = Hashtable.newFrom({"enemy": gdjs.tutorialCode.GDenemyObjects2}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDenemyObjects2Objects = Hashtable.newFrom({"enemy": gdjs.tutorialCode.GDenemyObjects2}); +gdjs.tutorialCode.eventsList35 = function(runtimeScene) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{let isConditionTrue_1 = false; +isConditionTrue_0 = false; +{ +isConditionTrue_1 = gdjs.evtTools.runtimeScene.sceneJustBegins(runtimeScene); +if(isConditionTrue_1) { + isConditionTrue_0 = true; +} +} +{ +isConditionTrue_1 = gdjs.evtsExt__RepeatEveryXSeconds__Repeat.func(runtimeScene, "efloat", 3, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if(isConditionTrue_1) { + isConditionTrue_0 = true; +} +} +{ +} +} +if (isConditionTrue_0) { +gdjs.copyArray(runtimeScene.getObjects("enemy"), gdjs.tutorialCode.GDenemyObjects2); +{gdjs.evtTools.tween.tweenVariableNumber2(runtimeScene, "eup", runtimeScene.getScene().getVariables().getFromIndex(6), (( gdjs.tutorialCode.GDenemyObjects2.length === 0 ) ? 0 :gdjs.tutorialCode.GDenemyObjects2[0].getZOrder()) + 10, 1000, "easeInOutQuad"); +} +{ //Subevents +gdjs.tutorialCode.eventsList34(runtimeScene);} //End of subevents +} + +} + + +{ + + + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("enemy"), gdjs.tutorialCode.GDenemyObjects2); +gdjs.copyArray(runtimeScene.getObjects("player"), gdjs.tutorialCode.GDplayerObjects2); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.object.distanceTest(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDenemyObjects2Objects, gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects2Objects, 500, false); +if (isConditionTrue_0) { +/* Reuse gdjs.tutorialCode.GDenemyObjects2 */ +/* Reuse gdjs.tutorialCode.GDplayerObjects2 */ +{for(var i = 0, len = gdjs.tutorialCode.GDenemyObjects2.length ;i < len;++i) { + gdjs.tutorialCode.GDenemyObjects2[i].getBehavior("PhysicsEngine3DGLTFModel").SetPosition((gdjs.tutorialCode.GDenemyObjects2[i].getX()), "x", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}{for(var i = 0, len = gdjs.tutorialCode.GDenemyObjects2.length ;i < len;++i) { + gdjs.tutorialCode.GDenemyObjects2[i].getBehavior("PhysicsEngine3DGLTFModel").SetPosition(gdjs.evtTools.variable.getVariableNumber(runtimeScene.getScene().getVariables().getFromIndex(6)), "y", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}{for(var i = 0, len = gdjs.tutorialCode.GDenemyObjects2.length ;i < len;++i) { + gdjs.tutorialCode.GDenemyObjects2[i].getBehavior("PhysicsEngine3DGLTFModel").SetPosition((gdjs.tutorialCode.GDenemyObjects2[i].getY()), "z", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}{for(var i = 0, len = gdjs.tutorialCode.GDenemyObjects2.length ;i < len;++i) { + gdjs.tutorialCode.GDenemyObjects2[i].getBehavior("Pathfinding").moveTo(runtimeScene, (( gdjs.tutorialCode.GDplayerObjects2.length === 0 ) ? 0 :gdjs.tutorialCode.GDplayerObjects2[0].getCenterXInScene()), (( gdjs.tutorialCode.GDplayerObjects2.length === 0 ) ? 0 :gdjs.tutorialCode.GDplayerObjects2[0].getCenterYInScene())); +} +}{for(var i = 0, len = gdjs.tutorialCode.GDenemyObjects2.length ;i < len;++i) { + gdjs.tutorialCode.GDenemyObjects2[i].getBehavior("PhysicsEngine3DGLTFModel").LookAtCamera((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("enemy"), gdjs.tutorialCode.GDenemyObjects2); +gdjs.copyArray(runtimeScene.getObjects("player"), gdjs.tutorialCode.GDplayerObjects2); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.object.hitBoxesCollisionTest(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDenemyObjects2Objects, gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects2Objects, false, runtimeScene, false); +if (isConditionTrue_0) { +/* Reuse gdjs.tutorialCode.GDplayerObjects2 */ +{for(var i = 0, len = gdjs.tutorialCode.GDplayerObjects2.length ;i < len;++i) { + gdjs.tutorialCode.GDplayerObjects2[i].getBehavior("Health").Hit(5, true, true, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("enemy"), gdjs.tutorialCode.GDenemyObjects2); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.object.hitBoxesCollisionTest(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDenemyObjects2Objects, gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDenemyObjects2Objects, false, runtimeScene, false); +if (isConditionTrue_0) { +/* Reuse gdjs.tutorialCode.GDenemyObjects2 */ +{for(var i = 0, len = gdjs.tutorialCode.GDenemyObjects2.length ;i < len;++i) { + gdjs.tutorialCode.GDenemyObjects2[i].separateFromObjectsList(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDenemyObjects2Objects, false); +} +}} + +} + + +{ + + + +} + + +};gdjs.tutorialCode.eventsList36 = function(runtimeScene) { + +{ + + + +} + + +{ + + + +} + + +{ + + + +} + + +{ + + + +} + + +{ + + + +} + + +{ + + + +} + + +{ + + + +} + + +{ + + +let isConditionTrue_0 = false; +{ +} + +} + + +};gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDy1Objects3Objects = Hashtable.newFrom({"y1": gdjs.tutorialCode.GDy1Objects3}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDy2Objects3Objects = Hashtable.newFrom({"y2": gdjs.tutorialCode.GDy2Objects3}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDy3Objects3Objects = Hashtable.newFrom({"y3": gdjs.tutorialCode.GDy3Objects3}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDy1Objects3Objects = Hashtable.newFrom({"y1": gdjs.tutorialCode.GDy1Objects3}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDy2Objects3Objects = Hashtable.newFrom({"y2": gdjs.tutorialCode.GDy2Objects3}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDy3Objects2Objects = Hashtable.newFrom({"y3": gdjs.tutorialCode.GDy3Objects2}); +gdjs.tutorialCode.eventsList37 = function(runtimeScene) { + +{ + +gdjs.copyArray(runtimeScene.getObjects("y1"), gdjs.tutorialCode.GDy1Objects3); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.input.cursorOnObject(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDy1Objects3Objects, runtimeScene, true, false); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.getVariableNumber(runtimeScene.getGame().getVariables().getFromIndex(2)) == 0; +} +if (isConditionTrue_0) { +gdjs.copyArray(runtimeScene.getObjects("sign78"), gdjs.tutorialCode.GDsign78Objects3); +{gdjs.evtTools.camera.hideLayer(runtimeScene, "Timeline"); +}{for(var i = 0, len = gdjs.tutorialCode.GDsign78Objects3.length ;i < len;++i) { + gdjs.tutorialCode.GDsign78Objects3[i].getBehavior("PhysicsEngine3DGLTFModel").SetFileName("sign7.glb", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}{for(var i = 0, len = gdjs.tutorialCode.GDsign78Objects3.length ;i < len;++i) { + gdjs.tutorialCode.GDsign78Objects3[i].getBehavior("PhysicsEngine3DGLTFModel").SetVIsibility(true, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("y2"), gdjs.tutorialCode.GDy2Objects3); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.input.cursorOnObject(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDy2Objects3Objects, runtimeScene, true, false); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.getVariableNumber(runtimeScene.getGame().getVariables().getFromIndex(2)) == 1; +} +if (isConditionTrue_0) { +gdjs.copyArray(runtimeScene.getObjects("sign78"), gdjs.tutorialCode.GDsign78Objects3); +{gdjs.evtTools.camera.hideLayer(runtimeScene, "Timeline"); +}{for(var i = 0, len = gdjs.tutorialCode.GDsign78Objects3.length ;i < len;++i) { + gdjs.tutorialCode.GDsign78Objects3[i].getBehavior("PhysicsEngine3DGLTFModel").SetFileName("sign7.glb", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}{for(var i = 0, len = gdjs.tutorialCode.GDsign78Objects3.length ;i < len;++i) { + gdjs.tutorialCode.GDsign78Objects3[i].getBehavior("PhysicsEngine3DGLTFModel").SetVIsibility(true, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("y3"), gdjs.tutorialCode.GDy3Objects3); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.input.cursorOnObject(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDy3Objects3Objects, runtimeScene, true, false); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.getVariableNumber(runtimeScene.getGame().getVariables().getFromIndex(2)) == 2; +} +if (isConditionTrue_0) { +gdjs.copyArray(runtimeScene.getObjects("sign78"), gdjs.tutorialCode.GDsign78Objects3); +{gdjs.evtTools.camera.hideLayer(runtimeScene, "Timeline"); +}{for(var i = 0, len = gdjs.tutorialCode.GDsign78Objects3.length ;i < len;++i) { + gdjs.tutorialCode.GDsign78Objects3[i].getBehavior("PhysicsEngine3DGLTFModel").SetFileName("sign7.glb", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}{for(var i = 0, len = gdjs.tutorialCode.GDsign78Objects3.length ;i < len;++i) { + gdjs.tutorialCode.GDsign78Objects3[i].getBehavior("PhysicsEngine3DGLTFModel").SetVIsibility(true, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("y1"), gdjs.tutorialCode.GDy1Objects3); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.input.cursorOnObject(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDy1Objects3Objects, runtimeScene, true, false); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtTools.variable.getVariableNumber(runtimeScene.getGame().getVariables().getFromIndex(2)) == 0); +} +if (isConditionTrue_0) { +gdjs.copyArray(runtimeScene.getObjects("sign78"), gdjs.tutorialCode.GDsign78Objects3); +{gdjs.evtTools.camera.hideLayer(runtimeScene, "Timeline"); +}{for(var i = 0, len = gdjs.tutorialCode.GDsign78Objects3.length ;i < len;++i) { + gdjs.tutorialCode.GDsign78Objects3[i].getBehavior("PhysicsEngine3DGLTFModel").SetFileName("sign8.glb", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}{for(var i = 0, len = gdjs.tutorialCode.GDsign78Objects3.length ;i < len;++i) { + gdjs.tutorialCode.GDsign78Objects3[i].getBehavior("PhysicsEngine3DGLTFModel").SetVIsibility(true, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("y2"), gdjs.tutorialCode.GDy2Objects3); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.input.cursorOnObject(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDy2Objects3Objects, runtimeScene, true, false); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtTools.variable.getVariableNumber(runtimeScene.getGame().getVariables().getFromIndex(2)) == 1); +} +if (isConditionTrue_0) { +gdjs.copyArray(runtimeScene.getObjects("sign78"), gdjs.tutorialCode.GDsign78Objects3); +{gdjs.evtTools.camera.hideLayer(runtimeScene, "Timeline"); +}{for(var i = 0, len = gdjs.tutorialCode.GDsign78Objects3.length ;i < len;++i) { + gdjs.tutorialCode.GDsign78Objects3[i].getBehavior("PhysicsEngine3DGLTFModel").SetFileName("sign8.glb", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}{for(var i = 0, len = gdjs.tutorialCode.GDsign78Objects3.length ;i < len;++i) { + gdjs.tutorialCode.GDsign78Objects3[i].getBehavior("PhysicsEngine3DGLTFModel").SetVIsibility(true, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("y3"), gdjs.tutorialCode.GDy3Objects2); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.input.cursorOnObject(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDy3Objects2Objects, runtimeScene, true, false); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtTools.variable.getVariableNumber(runtimeScene.getGame().getVariables().getFromIndex(2)) == 2); +} +if (isConditionTrue_0) { +gdjs.copyArray(runtimeScene.getObjects("sign78"), gdjs.tutorialCode.GDsign78Objects2); +{gdjs.evtTools.camera.hideLayer(runtimeScene, "Timeline"); +}{for(var i = 0, len = gdjs.tutorialCode.GDsign78Objects2.length ;i < len;++i) { + gdjs.tutorialCode.GDsign78Objects2[i].getBehavior("PhysicsEngine3DGLTFModel").SetFileName("sign8.glb", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}{for(var i = 0, len = gdjs.tutorialCode.GDsign78Objects2.length ;i < len;++i) { + gdjs.tutorialCode.GDsign78Objects2[i].getBehavior("PhysicsEngine3DGLTFModel").SetVIsibility(true, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +};gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects2Objects = Hashtable.newFrom({"player": gdjs.tutorialCode.GDplayerObjects2}); +gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDfinishObjects2Objects = Hashtable.newFrom({"finish": gdjs.tutorialCode.GDfinishObjects2}); +gdjs.tutorialCode.eventsList38 = function(runtimeScene) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.input.isMouseButtonReleased(runtimeScene, "Left"); +if (isConditionTrue_0) { + +{ //Subevents +gdjs.tutorialCode.eventsList37(runtimeScene);} //End of subevents +} + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("finish"), gdjs.tutorialCode.GDfinishObjects2); +gdjs.copyArray(runtimeScene.getObjects("player"), gdjs.tutorialCode.GDplayerObjects2); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.object.hitBoxesCollisionTest(gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDplayerObjects2Objects, gdjs.tutorialCode.mapOfGDgdjs_46tutorialCode_46GDfinishObjects2Objects, false, runtimeScene, false); +if (isConditionTrue_0) { +{gdjs.evtTools.runtimeScene.replaceScene(runtimeScene, "menu", false); +}} + +} + + +{ + +gdjs.copyArray(runtimeScene.getObjects("clockImage"), gdjs.tutorialCode.GDclockImageObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.input.wasKeyReleased(runtimeScene, "c"); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.tutorialCode.GDclockImageObjects1.length;i (gdjs.loseCode.asyncCallback10108948(runtimeScene, asyncObjectsList))); +} +} + +} + + +};gdjs.loseCode.mapOfGDgdjs_46loseCode_46GDtitleObjects1Objects = Hashtable.newFrom({"title": gdjs.loseCode.GDtitleObjects1}); +gdjs.loseCode.mapOfGDgdjs_46loseCode_46GDgoObjects1Objects = Hashtable.newFrom({"go": gdjs.loseCode.GDgoObjects1}); +gdjs.loseCode.mapOfGDgdjs_46loseCode_46GDmenuObjects1Objects = Hashtable.newFrom({"menu": gdjs.loseCode.GDmenuObjects1}); +gdjs.loseCode.asyncCallback9529172 = function (runtimeScene, asyncObjectsList) { +{gdjs.evtTools.variable.setVariableBoolean(runtimeScene.getScene().getVariables().getFromIndex(0), false); +}} +gdjs.loseCode.eventsList1 = function(runtimeScene, asyncObjectsList) { + +{ + + +{ +const parentAsyncObjectsList = asyncObjectsList; +{ +const asyncObjectsList = gdjs.LongLivedObjectsList.from(parentAsyncObjectsList); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtTools.runtimeScene.wait(2), (runtimeScene) => (gdjs.loseCode.asyncCallback9529172(runtimeScene, asyncObjectsList))); +} +} + +} + + +};gdjs.loseCode.asyncCallback13558604 = function (runtimeScene, asyncObjectsList) { +gdjs.copyArray(asyncObjectsList.getObjects("cam"), gdjs.loseCode.GDcamObjects2); + +{for(var i = 0, len = gdjs.loseCode.GDcamObjects2.length ;i < len;++i) { + gdjs.loseCode.GDcamObjects2[i].getBehavior("TweenZOrder").TweenZOrder("down", (gdjs.loseCode.GDcamObjects2[i].getZOrder()) - 100, "easeInOutQuad", 2000, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +} +{ //Subevents +gdjs.loseCode.eventsList1(runtimeScene, asyncObjectsList);} //End of subevents +} +gdjs.loseCode.eventsList2 = function(runtimeScene) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +for (const obj of gdjs.loseCode.GDcamObjects1) asyncObjectsList.addObject("cam", obj); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtTools.runtimeScene.wait(2), (runtimeScene) => (gdjs.loseCode.asyncCallback13558604(runtimeScene, asyncObjectsList))); +} +} + +} + + +};gdjs.loseCode.mapOfGDgdjs_46loseCode_46GDmenuObjects1Objects = Hashtable.newFrom({"menu": gdjs.loseCode.GDmenuObjects1}); +gdjs.loseCode.eventsList3 = function(runtimeScene) { + +{ + +gdjs.copyArray(runtimeScene.getObjects("menu"), gdjs.loseCode.GDmenuObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.input.cursorOnObject(gdjs.loseCode.mapOfGDgdjs_46loseCode_46GDmenuObjects1Objects, runtimeScene, true, false); +if (isConditionTrue_0) { +{gdjs.evtTools.runtimeScene.replaceScene(runtimeScene, "menu", false); +}} + +} + + +};gdjs.loseCode.eventsList4 = function(runtimeScene) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.runtimeScene.sceneJustBegins(runtimeScene); +if (isConditionTrue_0) { +gdjs.copyArray(runtimeScene.getObjects("credit"), gdjs.loseCode.GDcreditObjects1); +gdjs.copyArray(runtimeScene.getObjects("title"), gdjs.loseCode.GDtitleObjects1); +{for(var i = 0, len = gdjs.loseCode.GDtitleObjects1.length ;i < len;++i) { + gdjs.loseCode.GDtitleObjects1[i].pauseAnimation(); +} +}{for(var i = 0, len = gdjs.loseCode.GDtitleObjects1.length ;i < len;++i) { + gdjs.loseCode.GDtitleObjects1[i].setAnimationFrame(0); +} +}{gdjs.evtsExt__WithThreeJS__Create3DScene.func(runtimeScene, 100, "74;144;226", "assets\\skybox.jpg", "80;227;194", 1, 1000, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__WithThreeJS__Rotate3DCamera.func(runtimeScene, "=", -(30), 0, 0, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{for(var i = 0, len = gdjs.loseCode.GDcreditObjects1.length ;i < len;++i) { + gdjs.loseCode.GDcreditObjects1[i].setString("Created by ItsIceCreeperPE Dev for GDevelop's First 3D Game Jam!\nVersion " + gdjs.evtsExt__CurrentGameVersion__ReturnCurrentGameVersion.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))); +} +} +{ //Subevents +gdjs.loseCode.eventsList0(runtimeScene);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(runtimeScene.getObjects("go"), gdjs.loseCode.GDgoObjects1); +gdjs.copyArray(runtimeScene.getObjects("menu"), gdjs.loseCode.GDmenuObjects1); +gdjs.copyArray(runtimeScene.getObjects("title"), gdjs.loseCode.GDtitleObjects1); +{gdjs.evtsExt__WithThreeJS__Rotate3DCamera.func(runtimeScene, "+", 0, 0.2, 0.1, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__AlignObject__ToSceneCenter.func(runtimeScene, gdjs.loseCode.mapOfGDgdjs_46loseCode_46GDtitleObjects1Objects, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__AlignObject__ToSceneCenter.func(runtimeScene, gdjs.loseCode.mapOfGDgdjs_46loseCode_46GDgoObjects1Objects, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__AlignObject__ToSceneCenter.func(runtimeScene, gdjs.loseCode.mapOfGDgdjs_46loseCode_46GDmenuObjects1Objects, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.getVariableBoolean(runtimeScene.getScene().getVariables().getFromIndex(0), false); +if (isConditionTrue_0) { +gdjs.copyArray(runtimeScene.getObjects("cam"), gdjs.loseCode.GDcamObjects1); +{gdjs.evtTools.variable.setVariableBoolean(runtimeScene.getScene().getVariables().getFromIndex(0), true); +}{for(var i = 0, len = gdjs.loseCode.GDcamObjects1.length ;i < len;++i) { + gdjs.loseCode.GDcamObjects1[i].getBehavior("TweenZOrder").TweenZOrder("up", (gdjs.loseCode.GDcamObjects1[i].getZOrder()) + 100, "easeInOutQuad", 2000, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +} +{ //Subevents +gdjs.loseCode.eventsList2(runtimeScene);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.input.isMouseButtonReleased(runtimeScene, "Left"); +if (isConditionTrue_0) { + +{ //Subevents +gdjs.loseCode.eventsList3(runtimeScene);} //End of subevents +} + +} + + +{ + + + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtTools.sound.isMusicOnChannelPlaying(runtimeScene, 0)); +if (isConditionTrue_0) { +{gdjs.evtTools.storage.readNumberFromJSONFile("Config", "Muzik", runtimeScene, runtimeScene.getScene().getVariables().get("audio").getChild("muzik")); +}{gdjs.evtTools.storage.readNumberFromJSONFile("Config", "Sound", runtimeScene, runtimeScene.getScene().getVariables().get("audio").getChild("sound")); +}{gdjs.evtTools.sound.setSoundOnChannelVolume(runtimeScene, 0, gdjs.evtTools.variable.getVariableNumber(runtimeScene.getScene().getVariables().get("audio").getChild("sound"))); +}{/* Unknown object - skipped. */}{/* Unknown object - skipped. */}{gdjs.evtTools.sound.playMusicOnChannel(runtimeScene, "assets\\audio\\dz1.mp3", 0, true, gdjs.evtTools.variable.getVariableNumber(runtimeScene.getScene().getVariables().get("audio").getChild("muzik")), 1); +}} + +} + + +}; + +gdjs.loseCode.func = function(runtimeScene) { +runtimeScene.getOnceTriggers().startNewFrame(); + +gdjs.loseCode.GDcamObjects1.length = 0; +gdjs.loseCode.GDcamObjects2.length = 0; +gdjs.loseCode.GDcamObjects3.length = 0; +gdjs.loseCode.GDgroundObjects1.length = 0; +gdjs.loseCode.GDgroundObjects2.length = 0; +gdjs.loseCode.GDgroundObjects3.length = 0; +gdjs.loseCode.GDcreditObjects1.length = 0; +gdjs.loseCode.GDcreditObjects2.length = 0; +gdjs.loseCode.GDcreditObjects3.length = 0; +gdjs.loseCode.GDgoObjects1.length = 0; +gdjs.loseCode.GDgoObjects2.length = 0; +gdjs.loseCode.GDgoObjects3.length = 0; +gdjs.loseCode.GDmenuObjects1.length = 0; +gdjs.loseCode.GDmenuObjects2.length = 0; +gdjs.loseCode.GDmenuObjects3.length = 0; +gdjs.loseCode.GDtitleObjects1.length = 0; +gdjs.loseCode.GDtitleObjects2.length = 0; +gdjs.loseCode.GDtitleObjects3.length = 0; +gdjs.loseCode.GDnbObjects1.length = 0; +gdjs.loseCode.GDnbObjects2.length = 0; +gdjs.loseCode.GDnbObjects3.length = 0; + +gdjs.loseCode.eventsList4(runtimeScene); + +return; + +} + +gdjs['loseCode'] = gdjs.loseCode; diff --git a/desktop/apps/dezunkrr/confused.wav b/desktop/apps/dezunkrr/confused.wav new file mode 100644 index 0000000..e25b48f Binary files /dev/null and b/desktop/apps/dezunkrr/confused.wav differ diff --git a/desktop/apps/dezunkrr/crosshair046.png b/desktop/apps/dezunkrr/crosshair046.png new file mode 100644 index 0000000..20771b4 Binary files /dev/null and b/desktop/apps/dezunkrr/crosshair046.png differ diff --git a/desktop/apps/dezunkrr/data.js b/desktop/apps/dezunkrr/data.js new file mode 100644 index 0000000..3698965 --- /dev/null +++ b/desktop/apps/dezunkrr/data.js @@ -0,0 +1,2 @@ +gdjs.projectData = {"firstLayout":"","gdVersion":{"build":99,"major":4,"minor":0,"revision":0},"properties":{"adaptGameResolutionAtRuntime":true,"folderProject":true,"orientation":"landscape","packageName":"com.dezunkrr.itsicecreeperpe","pixelsRounding":false,"projectUuid":"9ddf58bf-086b-4143-a0c9-efca41751a40","scaleMode":"linear","sizeOnStartupMode":"adaptWidth","templateSlug":"","useExternalSourceFiles":false,"version":"0.1.1","name":"Dezunkrr","description":"Fast pace game where you gotta shoot down enemies with your epic lil gun and use your magic timeline watch to navigate between timelines in order to complete levels!\nSubmission to GDevelop's First 3D Game Jam #1 - Theme : Navigation\nHow did I get during game jam: I only made the tutorial and many things are broken :p\nhttps://itsicecreeperpe.itch.io/dezunkrr\n\nNo gamepad support yet, mobile broken.","author":"ItsIceCreeperPE Dev","windowWidth":1920,"windowHeight":1080,"latestCompilationDirectory":"C:\\Users\\Lesego\\OneDrive\\Documents\\phenyo\\GD Stuff\\Exports\\dezunkrr","maxFPS":0,"minFPS":20,"verticalSync":false,"platformSpecificAssets":{"android-icon-144":"android-icon-144.png","android-icon-192":"android-icon-192.png","android-icon-36":"android-icon-36.png","android-icon-48":"android-icon-48.png","android-icon-72":"android-icon-72.png","android-icon-96":"android-icon-96.png","android-windowSplashScreenAnimatedIcon":"android-windowSplashScreenAnimatedIcon.png","desktop-icon-512":"desktop-icon-512.png","ios-icon-100":"ios-icon-100.png","ios-icon-1024":"ios-icon-1024.png","ios-icon-114":"ios-icon-114.png","ios-icon-120":"ios-icon-120.png","ios-icon-144":"ios-icon-144.png","ios-icon-152":"ios-icon-152.png","ios-icon-167":"ios-icon-167.png","ios-icon-180":"ios-icon-180.png","ios-icon-20":"ios-icon-20.png","ios-icon-29":"ios-icon-29.png","ios-icon-40":"ios-icon-40.png","ios-icon-50":"ios-icon-50.png","ios-icon-57":"ios-icon-57.png","ios-icon-58":"ios-icon-58.png","ios-icon-60":"ios-icon-60.png","ios-icon-72":"ios-icon-72.png","ios-icon-76":"ios-icon-76.png","ios-icon-80":"ios-icon-80.png","ios-icon-87":"ios-icon-87.png","liluo-thumbnail":"assets\\thumbnail.png"},"loadingScreen":{"backgroundColor":0,"backgroundFadeInDuration":0.2,"backgroundImageResourceName":"assets\\wideThumbnail.png","gdevelopLogoStyle":"light","logoAndProgressFadeInDuration":0.2,"logoAndProgressLogoFadeInDelay":0.2,"minDuration":1.5,"progressBarColor":16777215,"progressBarHeight":20.0,"progressBarMaxWidth":800.0,"progressBarMinWidth":300.0,"progressBarWidthPercent":30.0,"showGDevelopSplash":true,"showProgressBar":true},"watermark":{"placement":"bottom","showWatermark":true},"authorIds":["wJNvBw2TGEZ09MUQUZDv8c12dig1"],"authorUsernames":["ItsIceCreeperPE"],"categories":["platformer","3d-jam","action"],"playableDevices":["keyboard","mobile"],"extensionProperties":[],"platforms":[{"name":"GDevelop JS platform"}],"currentPlatform":"GDevelop JS platform"},"resources":{"resources":[{"alwaysLoaded":false,"file":"red.png","kind":"image","metadata":"{\"extension\":\".png\"}","name":"red","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"texture_12.png","kind":"image","metadata":"","name":"assets\\texture_12.png","smoothed":true,"userAdded":false},{"alwaysLoaded":false,"file":"assets_texture_12.png2.png","kind":"image","metadata":"{\"extension\":\".png\",\"pskl\":{}}","name":"assets\\texture_12.png2","smoothed":true,"userAdded":false},{"alwaysLoaded":false,"file":"Shotgun Vertical_Aiming.png","kind":"image","metadata":"","name":"Shotgun Vertical_Aiming.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Western FPS 2D/Weapon/bd63ea37ab03d04d6f31313cc0142b7a0f097d29a82d95f0486acd40dbc18c77_Shotgun Vertical_Aiming.png","name":"Shotgun Vertical_Aiming.png"}},{"alwaysLoaded":false,"file":"Shotgun Vertical_Firing.png","kind":"image","metadata":"","name":"Shotgun Vertical_Firing.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Western FPS 2D/Weapon/6b09ce20a6835016653d3042d061b7ad69331b81231a7169ef818b56423d85da_Shotgun Vertical_Firing.png","name":"Shotgun Vertical_Firing.png"}},{"alwaysLoaded":false,"file":"Bullet 1.png","kind":"image","metadata":"","name":"Bullet 1.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Western FPS 2D/Weapon/1968c412743104e67273b5ab7dfc03190241467ab78034511f23a8ca6c01a6f6_Bullet 1.png","name":"Bullet 1.png"}},{"alwaysLoaded":false,"file":"assets_texture_13.png.png","kind":"image","metadata":"{\"extension\":\".png\",\"pskl\":{}}","name":"assets\\texture_13.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"Black.png","kind":"image","metadata":"","name":"assets\\Black.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"crosshair046.png","kind":"image","metadata":"","name":"assets\\crosshair046.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"skybox.jpg","kind":"image","metadata":"","name":"assets\\skybox.jpg","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"red.png","kind":"image","metadata":"","name":"assets\\red.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"assets_texture_12.png2.png","kind":"image","metadata":"","name":"assets\\assets_texture_12.png2.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ztitle1.png","kind":"image","metadata":"","name":"assets\\ui\\title\\ztitle1.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ztitle2.png","kind":"image","metadata":"","name":"assets\\ui\\title\\ztitle2.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ztitle3.png","kind":"image","metadata":"","name":"assets\\ui\\title\\ztitle3.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ztitle4.png","kind":"image","metadata":"","name":"assets\\ui\\title\\ztitle4.png","smoothed":true,"userAdded":false},{"alwaysLoaded":false,"file":"ztitle5.png","kind":"image","metadata":"","name":"assets\\ui\\title\\ztitle5.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ztitle6.png","kind":"image","metadata":"","name":"assets\\ui\\title\\ztitle6.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ztitle7.png","kind":"image","metadata":"","name":"assets\\ui\\title\\ztitle7.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ztitle8.png","kind":"image","metadata":"","name":"assets\\ui\\title\\ztitle8.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ztitle9.png","kind":"image","metadata":"","name":"assets\\ui\\title\\ztitle9.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ztitle10.png","kind":"image","metadata":"","name":"assets\\ui\\title\\ztitle10.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ztitle11.png","kind":"image","metadata":"","name":"assets\\ui\\title\\ztitle11.png","smoothed":true,"userAdded":false},{"alwaysLoaded":false,"file":"ztitle12.png","kind":"image","metadata":"","name":"assets\\ui\\title\\ztitle12.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ztitle13.png","kind":"image","metadata":"","name":"assets\\ui\\title\\ztitle13.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ztitle14.png","kind":"image","metadata":"","name":"assets\\ui\\title\\ztitle14.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ztitle15.png","kind":"image","metadata":"","name":"assets\\ui\\title\\ztitle15.png","smoothed":true,"userAdded":false},{"alwaysLoaded":false,"file":"ztitle16.png","kind":"image","metadata":"","name":"assets\\ui\\title\\ztitle16.png","smoothed":true,"userAdded":false},{"alwaysLoaded":false,"file":"ztitle17.png","kind":"image","metadata":"","name":"assets\\ui\\title\\ztitle17.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"gun1.png","kind":"image","metadata":"","name":"assets\\gun1.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"gun2.png","kind":"image","metadata":"","name":"assets\\gun2.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"Transparent dark joystick border.png","kind":"image","metadata":"","name":"Transparent dark joystick border.png","smoothed":true,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Multitouch joysticks/2d2dc12926c7c9d9bdc721625d067fa504c6d560f5f554bfc56ab9b7f7140244_Transparent dark joystick border.png","name":"Transparent dark joystick border.png"}},{"alwaysLoaded":false,"file":"Transparent dark joystick thumb.png","kind":"image","metadata":"","name":"Transparent dark joystick thumb.png","smoothed":true,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Multitouch joysticks/ced42a0bbf18fae399df9c45c2323454cfbed06e57b0aed47a6b036781a1bd64_Transparent dark joystick thumb.png","name":"Transparent dark joystick thumb.png"}},{"alwaysLoaded":false,"file":"Flat Bar Red Fill Bar2.png","kind":"image","metadata":"","name":"Flat Bar Red Fill Bar.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Resource bars/pixel art/212e9679eaae4753beaa5d595d7c80ea66df3235485c6a3963e88b0d936a1798_Flat Bar Red Fill Bar.png","name":"Flat Bar Red Fill Bar.png"}},{"alwaysLoaded":false,"file":"Flat Bar White Border2.png","kind":"image","metadata":"","name":"Flat Bar White Border.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Resource bars/pixel art/c090d31cafed0c8ef7bb4d5af75a7dbf7149bcc03a7d5d63ae997d59100e362e_Flat Bar White Border.png","name":"Flat Bar White Border.png"}},{"alwaysLoaded":false,"file":"Pause button.png","kind":"image","metadata":"","name":"Pause button.png","smoothed":true,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/On-Screen Controls/Sprites/Flat Dark/1e5b82f54cfea683880b3dbba50ae04747788a03bb48e8fc9544f5e7ee611539_Pause button.png","name":"Pause button.png"}},{"alwaysLoaded":false,"file":"Fire round button.png","kind":"image","metadata":"","name":"Fire round button.png","smoothed":true,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/On-Screen Controls/Sprites/Flat Dark/10332be17c5da07b263300c70d68d07ae01df8822f0ea5bc093da8d0c22c5635_Fire round button.png","name":"Fire round button.png"}},{"alwaysLoaded":false,"file":"Top arrow button.png","kind":"image","metadata":"","name":"Top arrow button.png","smoothed":true,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/On-Screen Controls/Sprites/Flat Dark/e3943e1b23ceb90f00fc5e7c0481c5147b983fdc5397fb3690e102e53ce72d4f_Top arrow button.png","name":"Top arrow button.png"}},{"alwaysLoaded":false,"file":"Square Blue Slider Border.png","kind":"image","metadata":"","name":"Square Blue Slider Border.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Settings UI/Slider/pixel art/4358a20ce4a1e83f8643b287f37cefadefc1941d23cfdc50a3836ecd0dd209f1_Square Blue Slider Border.png","name":"Square Blue Slider Border.png"}},{"alwaysLoaded":false,"file":"Square Blue Slider Fill Bar.png","kind":"image","metadata":"","name":"Square Blue Slider Fill Bar.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Settings UI/Slider/pixel art/71e7d4c8549a750e6e7b6bc6508a352176cb64a57129e96bdd8f2c5bbc187820_Square Blue Slider Fill Bar.png","name":"Square Blue Slider Fill Bar.png"}},{"alwaysLoaded":false,"file":"Square Blue Slider Thumb.png","kind":"image","metadata":"","name":"Square Blue Slider Thumb.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Settings UI/Slider/pixel art/984a68a8bbb562d3f01a8a1993720778df07d37bb3314ed6f1aaf3d4f0edede3_Square Blue Slider Thumb.png","name":"Square Blue Slider Thumb.png"}},{"alwaysLoaded":false,"file":"Square Green Toggle_Off.png","kind":"image","metadata":"","name":"Square Green Toggle_Off.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Settings UI/Toggle Switch/pixel art/d05bf00d39eb358ed6633f8fdb2b3b9180629639a659cd3b97ced4fe4cd584a2_Square Green Toggle_Off.png","name":"Square Green Toggle_Off.png"}},{"alwaysLoaded":false,"file":"Square Green Toggle_On.png","kind":"image","metadata":"","name":"Square Green Toggle_On.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Settings UI/Toggle Switch/pixel art/0663f29b1be666b216fc5c658b59a403e951ec100cbc316402495b078b83b6a0_Square Green Toggle_On.png","name":"Square Green Toggle_On.png"}},{"alwaysLoaded":false,"file":"Square Blue Toggle_Off.png","kind":"image","metadata":"","name":"Square Blue Toggle_Off.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Settings UI/Toggle Switch/pixel art/14903c264ccc32143a5dea59a53e0a9fa7c055cdff1afb7ebc4ee624a783271e_Square Blue Toggle_Off.png","name":"Square Blue Toggle_Off.png"}},{"alwaysLoaded":false,"file":"Square Blue Toggle_On.png","kind":"image","metadata":"","name":"Square Blue Toggle_On.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Settings UI/Toggle Switch/pixel art/2dda7f1aa5cac6d167f2833febbe1982b833183664653e8fac352579113982df_Square Blue Toggle_On.png","name":"Square Blue Toggle_On.png"}},{"alwaysLoaded":true,"file":"gun.glb","kind":"image","metadata":"","name":"gun.glb","smoothed":true,"userAdded":false},{"alwaysLoaded":true,"file":"enemy.glb","kind":"image","metadata":"","name":"enemy.glb","smoothed":true,"userAdded":false},{"file":"CantoraOne-Regular.ttf","kind":"font","metadata":"","name":"assets\\fonts\\CantoraOne-Regular.ttf","userAdded":true},{"file":"PTSans-Bold.ttf","kind":"font","metadata":"","name":"assets\\fonts\\PTSans-Bold.ttf","userAdded":true},{"alwaysLoaded":false,"file":"Red Button With Shadow_Hovered.png","kind":"image","metadata":"","name":"Red Button With Shadow_Hovered.png","smoothed":true,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Menu buttons/71ee2c8d8b72808c7f084252cd36c80c44bc07655a3729e5fe7459c634007e8a_Red Button With Shadow_Hovered.png","name":"Red Button With Shadow_Hovered.png"}},{"alwaysLoaded":false,"file":"Red Button With Shadow_Idle.png","kind":"image","metadata":"","name":"Red Button With Shadow_Idle.png","smoothed":true,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Menu buttons/6c6bf020fb86d99a9ecc993f8b90064d73d757bc2408050cf353c84bc36f6be2_Red Button With Shadow_Idle.png","name":"Red Button With Shadow_Idle.png"}},{"alwaysLoaded":false,"file":"Red Button With Shadow_Pressed.png","kind":"image","metadata":"","name":"Red Button With Shadow_Pressed.png","smoothed":true,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Menu buttons/b9ce526450d48adedb6875043465ae168fff1f6b01dd1ff7f43b7e7c1568cc21_Red Button With Shadow_Pressed.png","name":"Red Button With Shadow_Pressed.png"}},{"file":"CantoraOne-Regular2.ttf","kind":"font","metadata":"","name":"CantoraOne-Regular.ttf","userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Menu buttons/05b0c1364a92b436b86ca819e66b63480d1bc2fb399f6c0cf8bffbf8199ccc2a_CantoraOne-Regular.ttf","name":"CantoraOne-Regular.ttf"}},{"alwaysLoaded":false,"file":"sunburn_1.png","kind":"image","metadata":"","name":"sunburn_1.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/51df46823f6d66539b73b6d7e4244494c2495a02099e0fedb9c6fe58844ddf1c_sunburn_1.png","name":"sunburn_1.png"}},{"alwaysLoaded":false,"file":"sunburn_10.png","kind":"image","metadata":"","name":"sunburn_10.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/04e5c2ad0f4e20e7685ae0693fab2e533c8bbaa05e312c98f7ed6eed4332652a_sunburn_10.png","name":"sunburn_10.png"}},{"alwaysLoaded":false,"file":"sunburn_11.png","kind":"image","metadata":"","name":"sunburn_11.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/f260e5785fdd52c0848d93c73709205a4efcda5a4afaea225aabbf681ca2e13c_sunburn_11.png","name":"sunburn_11.png"}},{"alwaysLoaded":false,"file":"sunburn_12.png","kind":"image","metadata":"","name":"sunburn_12.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/02e7bf28deea7736295ffbbfe07eed33d637a4931cd9d9ddf194965621e92032_sunburn_12.png","name":"sunburn_12.png"}},{"alwaysLoaded":false,"file":"sunburn_13.png","kind":"image","metadata":"","name":"sunburn_13.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/3d464b69b509f2db50d010ecd2ecd2fda73b4f20a66643023632b7c9a4b36e0d_sunburn_13.png","name":"sunburn_13.png"}},{"alwaysLoaded":false,"file":"sunburn_14.png","kind":"image","metadata":"","name":"sunburn_14.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/7dde1f40f66c04ce8464c41a940b33c0b2af96c51514bcd5424f64976a9b7f23_sunburn_14.png","name":"sunburn_14.png"}},{"alwaysLoaded":false,"file":"sunburn_15.png","kind":"image","metadata":"","name":"sunburn_15.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/c5936283834f0b32636b1c02ff4d8d793886491d12248a46c4c0258691fe1c34_sunburn_15.png","name":"sunburn_15.png"}},{"alwaysLoaded":false,"file":"sunburn_16.png","kind":"image","metadata":"","name":"sunburn_16.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/41e3e1c17366fd77d50999d6121bba5dddedd7ae6c70a501a8701fa55205409f_sunburn_16.png","name":"sunburn_16.png"}},{"alwaysLoaded":false,"file":"sunburn_17.png","kind":"image","metadata":"","name":"sunburn_17.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/01e075a9141b68c05bffe1c665bd78e769fd27d2a4e8371f624ccbf34763aa11_sunburn_17.png","name":"sunburn_17.png"}},{"alwaysLoaded":false,"file":"sunburn_18.png","kind":"image","metadata":"","name":"sunburn_18.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/cb47da5390b5efbf4af76dcae5ab80c70598e2ba2f81db1ad746dfc5e2e55c3c_sunburn_18.png","name":"sunburn_18.png"}},{"alwaysLoaded":false,"file":"sunburn_19.png","kind":"image","metadata":"","name":"sunburn_19.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/69508f3293412c818f6c7dedb1dd6b5eff9dafe230964b604587c0cd661ec7e9_sunburn_19.png","name":"sunburn_19.png"}},{"alwaysLoaded":false,"file":"sunburn_2.png","kind":"image","metadata":"","name":"sunburn_2.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/a223c3bd2da6c56b320db602ddf94272668f90cd39c75c5b28bbcf75233cc11b_sunburn_2.png","name":"sunburn_2.png"}},{"alwaysLoaded":false,"file":"sunburn_20.png","kind":"image","metadata":"","name":"sunburn_20.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/dca602d4a23f34dc9715dcc4c53a98aad30c6d991fbf20c1480e257c7c3db6bb_sunburn_20.png","name":"sunburn_20.png"}},{"alwaysLoaded":false,"file":"sunburn_21.png","kind":"image","metadata":"","name":"sunburn_21.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/311aca05c9c2e872e04737aafaf04088fe34d595a9ed05d4eb2bfb6a2c52f4a7_sunburn_21.png","name":"sunburn_21.png"}},{"alwaysLoaded":false,"file":"sunburn_22.png","kind":"image","metadata":"","name":"sunburn_22.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/653273e6380750974a9222bfaf76257d71b7c9f9e7851d7b2ce2cbfbcb9dd3a9_sunburn_22.png","name":"sunburn_22.png"}},{"alwaysLoaded":false,"file":"sunburn_23.png","kind":"image","metadata":"","name":"sunburn_23.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/6b69915b8fbaa4c5a5cca53a11c300d3dcea2b6342f67e9e2736e7569358dc4a_sunburn_23.png","name":"sunburn_23.png"}},{"alwaysLoaded":false,"file":"sunburn_24.png","kind":"image","metadata":"","name":"sunburn_24.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/aad9109763a4da3ccfd9767e8061e905f135ea1000ed1d4ff38a09d3449e3256_sunburn_24.png","name":"sunburn_24.png"}},{"alwaysLoaded":false,"file":"sunburn_25.png","kind":"image","metadata":"","name":"sunburn_25.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/81dafae08704ce9efab7a966d2855af10bb418a3c49c2edbcf5537ba701f9d72_sunburn_25.png","name":"sunburn_25.png"}},{"alwaysLoaded":false,"file":"sunburn_26.png","kind":"image","metadata":"","name":"sunburn_26.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/1a302a42c054a3a85f1fa474dd1ec7349c972b28badc1bfe7f40153df7d8ee51_sunburn_26.png","name":"sunburn_26.png"}},{"alwaysLoaded":false,"file":"sunburn_27.png","kind":"image","metadata":"","name":"sunburn_27.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/1aef9077f15aa9b969a6c67fd554dd908eeb2c9cbec6b7f5d2f1d158b95deda8_sunburn_27.png","name":"sunburn_27.png"}},{"alwaysLoaded":false,"file":"sunburn_28.png","kind":"image","metadata":"","name":"sunburn_28.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/39b51fbf62fbabc62c4f41e4bc13e8b0de065ec23616b28bb39bc7e2cec3adc1_sunburn_28.png","name":"sunburn_28.png"}},{"alwaysLoaded":false,"file":"sunburn_29.png","kind":"image","metadata":"","name":"sunburn_29.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/d9dcd9458a714d0816ec0ab97fb792a4b73a88161dd233f36a7ef254ce183614_sunburn_29.png","name":"sunburn_29.png"}},{"alwaysLoaded":false,"file":"sunburn_3.png","kind":"image","metadata":"","name":"sunburn_3.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/f0aef4ebac25e479a033f7fd20bb6ccd992a5fb44eeac688441b5a3a3fccbca2_sunburn_3.png","name":"sunburn_3.png"}},{"alwaysLoaded":false,"file":"sunburn_30.png","kind":"image","metadata":"","name":"sunburn_30.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/2003258d36f55a86fb88501a7ff7ffe4d48a3681ddf45b7391ad2f3cca24b138_sunburn_30.png","name":"sunburn_30.png"}},{"alwaysLoaded":false,"file":"sunburn_31.png","kind":"image","metadata":"","name":"sunburn_31.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/b7d5c8a8de120bdc2eb1d709105e154983b7f7a87cd33459b6716bf544344f93_sunburn_31.png","name":"sunburn_31.png"}},{"alwaysLoaded":false,"file":"sunburn_32.png","kind":"image","metadata":"","name":"sunburn_32.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/ddaa7705d2dbf368aed3cdff801205651ab5bd60f80ae31f0fc02e80995d22a8_sunburn_32.png","name":"sunburn_32.png"}},{"alwaysLoaded":false,"file":"sunburn_33.png","kind":"image","metadata":"","name":"sunburn_33.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/7bdbbb0e328544a398448de6253e2b3800e3e980bfd6e7836b2f342f56e718af_sunburn_33.png","name":"sunburn_33.png"}},{"alwaysLoaded":false,"file":"sunburn_34.png","kind":"image","metadata":"","name":"sunburn_34.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/8ca5766956f4e200167334eb5eec4a333ffa18c6c6b8c41e11dfc9691f625102_sunburn_34.png","name":"sunburn_34.png"}},{"alwaysLoaded":false,"file":"sunburn_35.png","kind":"image","metadata":"","name":"sunburn_35.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/a046df1f497acf26f06490af62c4e104d5f588978057e0a756bda77ba5e1f655_sunburn_35.png","name":"sunburn_35.png"}},{"alwaysLoaded":false,"file":"sunburn_36.png","kind":"image","metadata":"","name":"sunburn_36.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/70894b3dde66f16d8017e5975dc7dde057846ce6d8c9ce0fc1e43c6ecc9e6ba0_sunburn_36.png","name":"sunburn_36.png"}},{"alwaysLoaded":false,"file":"sunburn_37.png","kind":"image","metadata":"","name":"sunburn_37.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/b5d028ce698d004d8f01ee86ffe121d69975a666be82ce0c20d1267703da11a6_sunburn_37.png","name":"sunburn_37.png"}},{"alwaysLoaded":false,"file":"sunburn_38.png","kind":"image","metadata":"","name":"sunburn_38.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/f82115c6199de349217152cbea58514cfce87df2d26a2826d69906bbb687d823_sunburn_38.png","name":"sunburn_38.png"}},{"alwaysLoaded":false,"file":"sunburn_39.png","kind":"image","metadata":"","name":"sunburn_39.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/35fe1360a7f391bd0ffa35f0b6600e11eea015e601e8ea77284dcb10f6ba8905_sunburn_39.png","name":"sunburn_39.png"}},{"alwaysLoaded":false,"file":"sunburn_4.png","kind":"image","metadata":"","name":"sunburn_4.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/92f9752b0df115d9486f58acd2bb214061207c073f3ceb7f85f74ee7236cc31f_sunburn_4.png","name":"sunburn_4.png"}},{"alwaysLoaded":false,"file":"sunburn_40.png","kind":"image","metadata":"","name":"sunburn_40.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/31de061d133a0906a7580e39bea2a54a7ca8d7950b8ab4cdad498834840a6ac1_sunburn_40.png","name":"sunburn_40.png"}},{"alwaysLoaded":false,"file":"sunburn_41.png","kind":"image","metadata":"","name":"sunburn_41.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/14720a9f3ecf4bc4a5cc44b9a4e9af2bd80dd515f847f3420cfff164b3822276_sunburn_41.png","name":"sunburn_41.png"}},{"alwaysLoaded":false,"file":"sunburn_42.png","kind":"image","metadata":"","name":"sunburn_42.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/4558e5de4c4efa2a55d4c5ad6c2a105e44a8e29e72dd5aa63326b31e54368af1_sunburn_42.png","name":"sunburn_42.png"}},{"alwaysLoaded":false,"file":"sunburn_43.png","kind":"image","metadata":"","name":"sunburn_43.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/6695f44dd7f01ca4b0e2d6653627e5721a580e2099734a0fefb36071000681cf_sunburn_43.png","name":"sunburn_43.png"}},{"alwaysLoaded":false,"file":"sunburn_44.png","kind":"image","metadata":"","name":"sunburn_44.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/05805aff3597029d2f3b7250cbbcf1f3e39aa6c202d4589c8b7a879892a2e6e8_sunburn_44.png","name":"sunburn_44.png"}},{"alwaysLoaded":false,"file":"sunburn_45.png","kind":"image","metadata":"","name":"sunburn_45.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/3d1ba9dec7f2df0c50f0b70a600b3ce32ede7885aa6cb5ebdba45543a319a6aa_sunburn_45.png","name":"sunburn_45.png"}},{"alwaysLoaded":false,"file":"sunburn_46.png","kind":"image","metadata":"","name":"sunburn_46.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/a2691f6e26c217ba95230cc1565f4e290e73800fdd0ef0317073a33a7668237c_sunburn_46.png","name":"sunburn_46.png"}},{"alwaysLoaded":false,"file":"sunburn_47.png","kind":"image","metadata":"","name":"sunburn_47.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/7142fd192421b528c846e71904da411bb896e2616c3741849b4694195ef663af_sunburn_47.png","name":"sunburn_47.png"}},{"alwaysLoaded":false,"file":"sunburn_48.png","kind":"image","metadata":"","name":"sunburn_48.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/114df680feaac7cabf7ac5f216a7bfb6ac556bfa7e3f56bd375ad9f1b560c158_sunburn_48.png","name":"sunburn_48.png"}},{"alwaysLoaded":false,"file":"sunburn_49.png","kind":"image","metadata":"","name":"sunburn_49.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/d3f06c90bd6e4fb06a422d0903ced1ded4f73b0195b3a2c331559b45f4bab38e_sunburn_49.png","name":"sunburn_49.png"}},{"alwaysLoaded":false,"file":"sunburn_5.png","kind":"image","metadata":"","name":"sunburn_5.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/fa7c60359c141776128aae22940fd4f7c29cccac2d3c7197496682ef8aefe899_sunburn_5.png","name":"sunburn_5.png"}},{"alwaysLoaded":false,"file":"sunburn_50.png","kind":"image","metadata":"","name":"sunburn_50.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/2d2c06539f329a7bb2db200fa67d8457deaaf222fddffbaa1bfca0d367898c26_sunburn_50.png","name":"sunburn_50.png"}},{"alwaysLoaded":false,"file":"sunburn_51.png","kind":"image","metadata":"","name":"sunburn_51.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/ca8b713e806596c1ed268e8ccd0749d92270e1fbc489f8651c7eb41f3a116407_sunburn_51.png","name":"sunburn_51.png"}},{"alwaysLoaded":false,"file":"sunburn_52.png","kind":"image","metadata":"","name":"sunburn_52.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/f6e076bb41f91968bd7cffc6e6c38ca5e7365b2ebdb8eb59bc655a1d8e70c3d5_sunburn_52.png","name":"sunburn_52.png"}},{"alwaysLoaded":false,"file":"sunburn_53.png","kind":"image","metadata":"","name":"sunburn_53.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/66d006e1ab3f9f1a90051c75df3794f01a7e514aa38b751540b39763b664b0ea_sunburn_53.png","name":"sunburn_53.png"}},{"alwaysLoaded":false,"file":"sunburn_54.png","kind":"image","metadata":"","name":"sunburn_54.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/197fed424cff71fcec4ef7d083ec473e19ccc3ba914faad16d25dbff78753bd2_sunburn_54.png","name":"sunburn_54.png"}},{"alwaysLoaded":false,"file":"sunburn_55.png","kind":"image","metadata":"","name":"sunburn_55.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/7171adf2c5dd9e44f9c0f13bc70eae9929c54988d6153e438bb712fdc76b0768_sunburn_55.png","name":"sunburn_55.png"}},{"alwaysLoaded":false,"file":"sunburn_56.png","kind":"image","metadata":"","name":"sunburn_56.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/a889448324719cbeb35b13108e2108472e5bd9609079ccec599e9a525a345862_sunburn_56.png","name":"sunburn_56.png"}},{"alwaysLoaded":false,"file":"sunburn_57.png","kind":"image","metadata":"","name":"sunburn_57.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/cdb7379a7619afe7ae362949bd774b0838e1d2d93f6a96c8deafec1c4502bd31_sunburn_57.png","name":"sunburn_57.png"}},{"alwaysLoaded":false,"file":"sunburn_58.png","kind":"image","metadata":"","name":"sunburn_58.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/dfd08824dc045ea4e8350c25a978ac6207fb3b91408097b922c8f0d46ac79454_sunburn_58.png","name":"sunburn_58.png"}},{"alwaysLoaded":false,"file":"sunburn_59.png","kind":"image","metadata":"","name":"sunburn_59.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/8de82ce224905eef42257e6a70e7db60b7571718f228c5fc30698234b36cf80e_sunburn_59.png","name":"sunburn_59.png"}},{"alwaysLoaded":false,"file":"sunburn_6.png","kind":"image","metadata":"","name":"sunburn_6.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/8079c75252eb7ab8f68bbe9527dfd8774624f569a22031b89b9dc5f8f549a9c9_sunburn_6.png","name":"sunburn_6.png"}},{"alwaysLoaded":false,"file":"sunburn_60.png","kind":"image","metadata":"","name":"sunburn_60.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/109ec9af5bd6df3a98646c19dff0dca7df6aa86b6a200237fd1b825a81781336_sunburn_60.png","name":"sunburn_60.png"}},{"alwaysLoaded":false,"file":"sunburn_61.png","kind":"image","metadata":"","name":"sunburn_61.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/51df46823f6d66539b73b6d7e4244494c2495a02099e0fedb9c6fe58844ddf1c_sunburn_61.png","name":"sunburn_61.png"}},{"alwaysLoaded":false,"file":"sunburn_7.png","kind":"image","metadata":"","name":"sunburn_7.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/3d6d3ae7ac4b3295dfbc31fd5b302bf2351842a694868f01e983301d8a7823ab_sunburn_7.png","name":"sunburn_7.png"}},{"alwaysLoaded":false,"file":"sunburn_8.png","kind":"image","metadata":"","name":"sunburn_8.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/3844baeafb6f097a10935cc808a4e53346c0ceb33dfda58eb0a92f843c279efc_sunburn_8.png","name":"sunburn_8.png"}},{"alwaysLoaded":false,"file":"sunburn_9.png","kind":"image","metadata":"","name":"sunburn_9.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/e0ee731ff39377a0e7d31c56afc1484ba6802d611bb5263da78ab41b20f4fb37_sunburn_9.png","name":"sunburn_9.png"}},{"alwaysLoaded":false,"file":"greybox_green_grid.png","kind":"image","metadata":"","name":"assets\\GreyboxTextures\\greybox_green_grid.png","smoothed":true,"userAdded":false},{"alwaysLoaded":false,"file":"greybox_dark_grid.png","kind":"image","metadata":"","name":"assets\\GreyboxTextures\\greybox_dark_grid.png","smoothed":true,"userAdded":false},{"alwaysLoaded":false,"file":"greybox_blue_grid.png","kind":"image","metadata":"","name":"assets\\GreyboxTextures\\greybox_blue_grid.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"greybox_orange_grid.png","kind":"image","metadata":"","name":"assets\\GreyboxTextures\\greybox_orange_grid.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"greybox_red_grid.png","kind":"image","metadata":"","name":"assets\\GreyboxTextures\\greybox_red_grid.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"greybox_purple_solid.png","kind":"image","metadata":"","name":"assets\\GreyboxTextures\\greybox_purple_solid.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"assets_GreyboxTextures_greybox_red_grid.png2.png","kind":"image","metadata":"{\"extension\":\".png\",\"pskl\":{}}","name":"assets\\GreyboxTextures\\greybox_red_grid.png2","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"assets_GreyboxTextures_greybox_orange_grid.png2.png","kind":"image","metadata":"{\"extension\":\".png\",\"pskl\":{}}","name":"assets\\GreyboxTextures\\greybox_orange_grid.png2","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"assets_GreyboxTextures_greybox_purple_solid.png2.png","kind":"image","metadata":"{\"extension\":\".png\",\"pskl\":{}}","name":"assets\\GreyboxTextures\\greybox_purple_solid.png2","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"assets_GreyboxTextures_greybox_dark_grid.png2.png","kind":"image","metadata":"{\"extension\":\".png\",\"pskl\":{}}","name":"assets\\GreyboxTextures\\greybox_dark_grid.png2","smoothed":true,"userAdded":false},{"alwaysLoaded":false,"file":"nebula_1.png","kind":"image","metadata":"","name":"nebula_1.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/c74b49dffb4fe99d355a59a4f57aa8d8be52a053ea768aeeb008387211470ff3_nebula_1.png","name":"nebula_1.png"}},{"alwaysLoaded":false,"file":"nebula_10.png","kind":"image","metadata":"","name":"nebula_10.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/b3d9a6080fde59a9b829336fc8112639736752ae9591f6564bc9b11708e4c5b3_nebula_10.png","name":"nebula_10.png"}},{"alwaysLoaded":false,"file":"nebula_11.png","kind":"image","metadata":"","name":"nebula_11.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/ef14e8b3990622cad67d6a67d320bdeb4446e6470446822a287285b78478ab95_nebula_11.png","name":"nebula_11.png"}},{"alwaysLoaded":false,"file":"nebula_12.png","kind":"image","metadata":"","name":"nebula_12.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/77cc45864fcfaa94de41931e455839b4c7c99b4bb9a8fbce7832fff7b2126101_nebula_12.png","name":"nebula_12.png"}},{"alwaysLoaded":false,"file":"nebula_13.png","kind":"image","metadata":"","name":"nebula_13.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/d7fdb18e18cc354d229977b876606a431c38bee802c6a979ef0c03ad0bf729e9_nebula_13.png","name":"nebula_13.png"}},{"alwaysLoaded":false,"file":"nebula_14.png","kind":"image","metadata":"","name":"nebula_14.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/c07275a7fb218991e4e8e8c721a0dc761a8841200a6f566c398b115e34fae3ea_nebula_14.png","name":"nebula_14.png"}},{"alwaysLoaded":false,"file":"nebula_15.png","kind":"image","metadata":"","name":"nebula_15.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/dfca9f503cd19a2e97d7e362d85c076fd63a3db98baba48f2940aa540ed8a042_nebula_15.png","name":"nebula_15.png"}},{"alwaysLoaded":false,"file":"nebula_16.png","kind":"image","metadata":"","name":"nebula_16.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/d622c410d79108f70741ef25174d8938d97e79f79c4f1fe4c6689177ec86355f_nebula_16.png","name":"nebula_16.png"}},{"alwaysLoaded":false,"file":"nebula_17.png","kind":"image","metadata":"","name":"nebula_17.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/54d9fc0e96b0594b25b050941f2c5b9e852edd005df7c23acfe8ad7ef244b1de_nebula_17.png","name":"nebula_17.png"}},{"alwaysLoaded":false,"file":"nebula_18.png","kind":"image","metadata":"","name":"nebula_18.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/33a68f5d58a8456aa2ac78e9918ed719ce47f7ea8caeb2022d5d9aa61c63c7a9_nebula_18.png","name":"nebula_18.png"}},{"alwaysLoaded":false,"file":"nebula_19.png","kind":"image","metadata":"","name":"nebula_19.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/72183837114cbb13d6de09c3fd3b306b1aeb964c7bf57688f8913688663702c5_nebula_19.png","name":"nebula_19.png"}},{"alwaysLoaded":false,"file":"nebula_2.png","kind":"image","metadata":"","name":"nebula_2.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/39b32994fb66bc8edeb3a18df615200c8a5ebab76e230b19d8b3eb8f1490dcbc_nebula_2.png","name":"nebula_2.png"}},{"alwaysLoaded":false,"file":"nebula_20.png","kind":"image","metadata":"","name":"nebula_20.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/51bda6f2d608a1a07b42b575f7064d3c2d07e922b79c84656a033875d235ef8c_nebula_20.png","name":"nebula_20.png"}},{"alwaysLoaded":false,"file":"nebula_21.png","kind":"image","metadata":"","name":"nebula_21.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/52bbc86b5ee2bba7916338421726b28196a994105cec325371a88db576470f65_nebula_21.png","name":"nebula_21.png"}},{"alwaysLoaded":false,"file":"nebula_22.png","kind":"image","metadata":"","name":"nebula_22.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/6de5c0c1b746e100644938561dfd21d4d8c53759d581c35d7dc7ded83618a4f3_nebula_22.png","name":"nebula_22.png"}},{"alwaysLoaded":false,"file":"nebula_23.png","kind":"image","metadata":"","name":"nebula_23.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/31d73b17bbfb41aaff87cdba2548ebaab6fed8f7766f93ff73955f33ae42fe88_nebula_23.png","name":"nebula_23.png"}},{"alwaysLoaded":false,"file":"nebula_24.png","kind":"image","metadata":"","name":"nebula_24.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/12d28dc613832de3673ec2300a37e41d6f2fedcca2302293a9bab6ea0a1cbbea_nebula_24.png","name":"nebula_24.png"}},{"alwaysLoaded":false,"file":"nebula_25.png","kind":"image","metadata":"","name":"nebula_25.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/963057654af344c3ea09ab110ac070b0733c7e05c5ca3f86bb0408bb75c4a806_nebula_25.png","name":"nebula_25.png"}},{"alwaysLoaded":false,"file":"nebula_26.png","kind":"image","metadata":"","name":"nebula_26.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/3abeed894098d252e03a2638b2bf758d0de4503c6d404dd4afe258d3c48780d7_nebula_26.png","name":"nebula_26.png"}},{"alwaysLoaded":false,"file":"nebula_27.png","kind":"image","metadata":"","name":"nebula_27.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/cbb1c5d37396f1cb9670b02136059379de80ff945498492fd57b25ba03aa0757_nebula_27.png","name":"nebula_27.png"}},{"alwaysLoaded":false,"file":"nebula_28.png","kind":"image","metadata":"","name":"nebula_28.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/3e8b84e5cf841688f9dcef093982b5bc7ac602a33ef4f35556b45067db07f4a8_nebula_28.png","name":"nebula_28.png"}},{"alwaysLoaded":false,"file":"nebula_29.png","kind":"image","metadata":"","name":"nebula_29.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/8e0b34093ce6f67e292e6e230d602fdcf7810f6985a191fad3f4771a03f548bb_nebula_29.png","name":"nebula_29.png"}},{"alwaysLoaded":false,"file":"nebula_3.png","kind":"image","metadata":"","name":"nebula_3.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/d68f5275f6fd8e2ffbe4dc0f6e3040275a407216e4492ca924cdaf2587b3f1a1_nebula_3.png","name":"nebula_3.png"}},{"alwaysLoaded":false,"file":"nebula_30.png","kind":"image","metadata":"","name":"nebula_30.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/232f859750ec4b1e7726254cc47663aeb8b69a294163d3e0f6760cae3848802e_nebula_30.png","name":"nebula_30.png"}},{"alwaysLoaded":false,"file":"nebula_31.png","kind":"image","metadata":"","name":"nebula_31.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/2aa44d1968ae8d07b127e80d870635787e0fe67a7c2895afc24206ccaade4a28_nebula_31.png","name":"nebula_31.png"}},{"alwaysLoaded":false,"file":"nebula_32.png","kind":"image","metadata":"","name":"nebula_32.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/e755e275995584ce49931286833bd80540b487311df66e81a33dab82b321ef38_nebula_32.png","name":"nebula_32.png"}},{"alwaysLoaded":false,"file":"nebula_33.png","kind":"image","metadata":"","name":"nebula_33.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/32ef9344ddc68e50b0180ee16ba3ca431caae1fbc8a6a02d88e351945818fefc_nebula_33.png","name":"nebula_33.png"}},{"alwaysLoaded":false,"file":"nebula_34.png","kind":"image","metadata":"","name":"nebula_34.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/c165f212462cd9eb9e45e683677bb7bce3fe02b6c729d7d11374acb9b0e8d803_nebula_34.png","name":"nebula_34.png"}},{"alwaysLoaded":false,"file":"nebula_35.png","kind":"image","metadata":"","name":"nebula_35.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/f3c20ac6c0bcfbf757e8d639d9808412a8a712798bfbd1af9646957ffc439937_nebula_35.png","name":"nebula_35.png"}},{"alwaysLoaded":false,"file":"nebula_36.png","kind":"image","metadata":"","name":"nebula_36.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/88e8f664fd33c59c0d48c597f63060d8c91b3238c0f7a155b6eb30cffbc9e88d_nebula_36.png","name":"nebula_36.png"}},{"alwaysLoaded":false,"file":"nebula_37.png","kind":"image","metadata":"","name":"nebula_37.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/29dccea1d57005ecfde6839699dac9cb390bdeb6d2b5e706009b4fc012f08473_nebula_37.png","name":"nebula_37.png"}},{"alwaysLoaded":false,"file":"nebula_38.png","kind":"image","metadata":"","name":"nebula_38.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/e8ad4164c70a79a69d164c3d833ab8b4aa4c08154fc33328042c55afab832995_nebula_38.png","name":"nebula_38.png"}},{"alwaysLoaded":false,"file":"nebula_39.png","kind":"image","metadata":"","name":"nebula_39.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/a4e35d6d75c16a30967ec13188068d765b3e66e2f1d8e5ee23db5cdb7f01fb7c_nebula_39.png","name":"nebula_39.png"}},{"alwaysLoaded":false,"file":"nebula_4.png","kind":"image","metadata":"","name":"nebula_4.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/45fb79d213b1595fb703b541eceadbb82bdb3c541667ef58e38b8f83a80653fc_nebula_4.png","name":"nebula_4.png"}},{"alwaysLoaded":false,"file":"nebula_40.png","kind":"image","metadata":"","name":"nebula_40.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/8e4a4a6666bfcee3830a0bfc5db5f29beea8d0f9a6da5e80991e39065e6e296b_nebula_40.png","name":"nebula_40.png"}},{"alwaysLoaded":false,"file":"nebula_41.png","kind":"image","metadata":"","name":"nebula_41.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/a1865324fffcdd15b25440ca45cda85279f57375278793e4bc76668244df2862_nebula_41.png","name":"nebula_41.png"}},{"alwaysLoaded":false,"file":"nebula_42.png","kind":"image","metadata":"","name":"nebula_42.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/86e2e13dc3b3557b07148b510ace38dd9e5c30cfb11bcf43642326e24d92b18d_nebula_42.png","name":"nebula_42.png"}},{"alwaysLoaded":false,"file":"nebula_43.png","kind":"image","metadata":"","name":"nebula_43.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/640ab4b69cf7ade7f73ee7133eb9b2cf03f7458d3cb9fbed41fc68ecb9a348fb_nebula_43.png","name":"nebula_43.png"}},{"alwaysLoaded":false,"file":"nebula_44.png","kind":"image","metadata":"","name":"nebula_44.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/f0c26196bd1d9412c7e7c6d0631c6df32ad89e37c3b7a16bf7013c623b388dbb_nebula_44.png","name":"nebula_44.png"}},{"alwaysLoaded":false,"file":"nebula_45.png","kind":"image","metadata":"","name":"nebula_45.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/124b1d7cb61db6c538d5bffb9e7c793e5108be803a1f6aeae8274fcb5e6776c4_nebula_45.png","name":"nebula_45.png"}},{"alwaysLoaded":false,"file":"nebula_46.png","kind":"image","metadata":"","name":"nebula_46.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/33820ecebb49dfabf28969a96cf438fe9f72a67da1bc7bccb88a4f27a4321100_nebula_46.png","name":"nebula_46.png"}},{"alwaysLoaded":false,"file":"nebula_47.png","kind":"image","metadata":"","name":"nebula_47.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/5a37f2fec91d21c9da2cca92a1a16c2d61ee3cbbdc59183bd0a3e85c44cdf609_nebula_47.png","name":"nebula_47.png"}},{"alwaysLoaded":false,"file":"nebula_48.png","kind":"image","metadata":"","name":"nebula_48.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/318665d109964fae8690e390436610cb01e35c9ac1cde5d98228bf667bb4c36a_nebula_48.png","name":"nebula_48.png"}},{"alwaysLoaded":false,"file":"nebula_49.png","kind":"image","metadata":"","name":"nebula_49.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/5e3e33dd11e81befe5809f9a26bc82b0fc9008aa35c40c2449e0953b11e90d3f_nebula_49.png","name":"nebula_49.png"}},{"alwaysLoaded":false,"file":"nebula_5.png","kind":"image","metadata":"","name":"nebula_5.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/9603cdaceb76d62f5466cb68614306c9f634ad57eea5cb7b822d3480bef8d842_nebula_5.png","name":"nebula_5.png"}},{"alwaysLoaded":false,"file":"nebula_50.png","kind":"image","metadata":"","name":"nebula_50.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/91b1dfa24b20af7eceff53d20cbe053b0e52d3d1b492ab27d23182901f14b735_nebula_50.png","name":"nebula_50.png"}},{"alwaysLoaded":false,"file":"nebula_51.png","kind":"image","metadata":"","name":"nebula_51.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/758644dbf3a57e02313c5a2497853a5d3cc57fad197961067a0d1080d86d4ebc_nebula_51.png","name":"nebula_51.png"}},{"alwaysLoaded":false,"file":"nebula_52.png","kind":"image","metadata":"","name":"nebula_52.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/11bc2bc1ea23c723000b164c999cc3ea1f86198fb47b46b22f6bb9e7ebe2f0b0_nebula_52.png","name":"nebula_52.png"}},{"alwaysLoaded":false,"file":"nebula_53.png","kind":"image","metadata":"","name":"nebula_53.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/314efd05592e5bd56fa9219816dc03c971afe7520ed5c971bf8402189811b814_nebula_53.png","name":"nebula_53.png"}},{"alwaysLoaded":false,"file":"nebula_54.png","kind":"image","metadata":"","name":"nebula_54.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/11bff9e401533ea5514b0db68c110d9941739be90f288e573018cbf7add74237_nebula_54.png","name":"nebula_54.png"}},{"alwaysLoaded":false,"file":"nebula_55.png","kind":"image","metadata":"","name":"nebula_55.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/79fa73a84d9c5b2c0cdccfc2726c71a1e406c5c3596982d581716e8ad2447b08_nebula_55.png","name":"nebula_55.png"}},{"alwaysLoaded":false,"file":"nebula_56.png","kind":"image","metadata":"","name":"nebula_56.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/a28214d082dea0785a3766d8bdfb392f3d06c09a4f4823da89b2a43350b0355d_nebula_56.png","name":"nebula_56.png"}},{"alwaysLoaded":false,"file":"nebula_57.png","kind":"image","metadata":"","name":"nebula_57.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/da58b61a9b519a65f92deeae69a2b0477f336730d4cd5fb2e1652f888e414f2c_nebula_57.png","name":"nebula_57.png"}},{"alwaysLoaded":false,"file":"nebula_58.png","kind":"image","metadata":"","name":"nebula_58.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/f38e531809ae843cb1b3e12780c1b228dd007bc9cd8692ef7fb0e25cc33c8da7_nebula_58.png","name":"nebula_58.png"}},{"alwaysLoaded":false,"file":"nebula_59.png","kind":"image","metadata":"","name":"nebula_59.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/2c5852a07c3ae7780b9481fe703e673a12dd9fd55a43fc1426bf3acb7dd243cd_nebula_59.png","name":"nebula_59.png"}},{"alwaysLoaded":false,"file":"nebula_6.png","kind":"image","metadata":"","name":"nebula_6.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/edd5178e40a882bcf96aa284e1b45b968327a2558ff01267c885e7bb9a822577_nebula_6.png","name":"nebula_6.png"}},{"alwaysLoaded":false,"file":"nebula_60.png","kind":"image","metadata":"","name":"nebula_60.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/4dacd988b7a1e2c0a77ec3acab9f73c120d9600ce86644e694cc18baed5d23f2_nebula_60.png","name":"nebula_60.png"}},{"alwaysLoaded":false,"file":"nebula_61.png","kind":"image","metadata":"","name":"nebula_61.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/c74b49dffb4fe99d355a59a4f57aa8d8be52a053ea768aeeb008387211470ff3_nebula_61.png","name":"nebula_61.png"}},{"alwaysLoaded":false,"file":"nebula_7.png","kind":"image","metadata":"","name":"nebula_7.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/05effb21edeaaf4cb390f21c5cad00349314354f612dd49dbb2ee2b5e5ab1724_nebula_7.png","name":"nebula_7.png"}},{"alwaysLoaded":false,"file":"nebula_8.png","kind":"image","metadata":"","name":"nebula_8.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/5ff69f44520b77fb1817fc66d85780502c530cf6b3cfdcb776bea02e9d601dca_nebula_8.png","name":"nebula_8.png"}},{"alwaysLoaded":false,"file":"nebula_9.png","kind":"image","metadata":"","name":"nebula_9.png","smoothed":false,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Pixel Effects Pack/c61a4201a4a081b2fb019c13f9e8688b02754f3c99b5e80f96e4b02989ad6b16_nebula_9.png","name":"nebula_9.png"}},{"file":"dz1.mp3","kind":"audio","metadata":"","name":"assets\\audio\\dz1.mp3","preloadAsMusic":false,"preloadAsSound":false,"preloadInCache":false,"userAdded":true},{"file":"confused.wav","kind":"audio","metadata":"{\"extension\":\".wav\",\"jfxr\":{\"data\":\"{\\\"_version\\\":1,\\\"_name\\\":\\\"Random 4\\\",\\\"_locked\\\":[],\\\"sampleRate\\\":44100,\\\"attack\\\":0,\\\"sustain\\\":0.08,\\\"sustainPunch\\\":20,\\\"decay\\\":2.0300000000000002,\\\"tremoloDepth\\\":37,\\\"tremoloFrequency\\\":826,\\\"frequency\\\":2600,\\\"frequencySweep\\\":0,\\\"frequencyDeltaSweep\\\":0,\\\"repeatFrequency\\\":2.2,\\\"frequencyJump1Onset\\\":33,\\\"frequencyJump1Amount\\\":0,\\\"frequencyJump2Onset\\\":66,\\\"frequencyJump2Amount\\\":0,\\\"harmonics\\\":4,\\\"harmonicsFalloff\\\":0.02,\\\"waveform\\\":\\\"sawtooth\\\",\\\"interpolateNoise\\\":false,\\\"vibratoDepth\\\":440,\\\"vibratoFrequency\\\":414,\\\"squareDuty\\\":50,\\\"squareDutySweep\\\":0,\\\"flangerOffset\\\":6,\\\"flangerOffsetSweep\\\":0,\\\"bitCrush\\\":16,\\\"bitCrushSweep\\\":0,\\\"lowPassCutoff\\\":1500,\\\"lowPassCutoffSweep\\\":0,\\\"highPassCutoff\\\":1100,\\\"highPassCutoffSweep\\\":2700,\\\"compression\\\":1.8,\\\"normalization\\\":true,\\\"amplification\\\":100}\",\"name\":\"confused\"}}","name":"confused","preloadAsMusic":false,"preloadAsSound":false,"preloadInCache":false,"userAdded":true},{"file":"dedEnemy.wav","kind":"audio","metadata":"{\"extension\":\".wav\",\"jfxr\":{\"data\":\"{\\\"_version\\\":1,\\\"_name\\\":\\\"Hit/hurt 23\\\",\\\"_locked\\\":[],\\\"sampleRate\\\":44100,\\\"attack\\\":0,\\\"sustain\\\":0.07,\\\"sustainPunch\\\":0,\\\"decay\\\":0.05,\\\"tremoloDepth\\\":0,\\\"tremoloFrequency\\\":10,\\\"frequency\\\":600,\\\"frequencySweep\\\":-1000,\\\"frequencyDeltaSweep\\\":-300,\\\"repeatFrequency\\\":0,\\\"frequencyJump1Onset\\\":33,\\\"frequencyJump1Amount\\\":0,\\\"frequencyJump2Onset\\\":66,\\\"frequencyJump2Amount\\\":0,\\\"harmonics\\\":0,\\\"harmonicsFalloff\\\":0.5,\\\"waveform\\\":\\\"sawtooth\\\",\\\"interpolateNoise\\\":true,\\\"vibratoDepth\\\":0,\\\"vibratoFrequency\\\":10,\\\"squareDuty\\\":50,\\\"squareDutySweep\\\":0,\\\"flangerOffset\\\":0,\\\"flangerOffsetSweep\\\":0,\\\"bitCrush\\\":16,\\\"bitCrushSweep\\\":0,\\\"lowPassCutoff\\\":22050,\\\"lowPassCutoffSweep\\\":-12100,\\\"highPassCutoff\\\":0,\\\"highPassCutoffSweep\\\":0,\\\"compression\\\":1,\\\"normalization\\\":true,\\\"amplification\\\":100}\",\"name\":\"dedEnemy\"},\"localFilePath\":\"assets/dedEnemy.wav\"}","name":"dedEnemy","preloadAsMusic":false,"preloadAsSound":false,"preloadInCache":false,"userAdded":true},{"file":"blip.wav","kind":"audio","metadata":"{\"extension\":\".wav\",\"jfxr\":{\"data\":\"{\\\"_version\\\":1,\\\"_name\\\":\\\"Random 7\\\",\\\"_locked\\\":[],\\\"sampleRate\\\":44100,\\\"attack\\\":0,\\\"sustain\\\":0.05,\\\"sustainPunch\\\":0,\\\"decay\\\":0.01,\\\"tremoloDepth\\\":0,\\\"tremoloFrequency\\\":10,\\\"frequency\\\":2400,\\\"frequencySweep\\\":0,\\\"frequencyDeltaSweep\\\":0,\\\"repeatFrequency\\\":0,\\\"frequencyJump1Onset\\\":33,\\\"frequencyJump1Amount\\\":0,\\\"frequencyJump2Onset\\\":66,\\\"frequencyJump2Amount\\\":0,\\\"harmonics\\\":0,\\\"harmonicsFalloff\\\":0.5,\\\"waveform\\\":\\\"sine\\\",\\\"interpolateNoise\\\":true,\\\"vibratoDepth\\\":0,\\\"vibratoFrequency\\\":10,\\\"squareDuty\\\":80,\\\"squareDutySweep\\\":0,\\\"flangerOffset\\\":0,\\\"flangerOffsetSweep\\\":0,\\\"bitCrush\\\":16,\\\"bitCrushSweep\\\":0,\\\"lowPassCutoff\\\":22050,\\\"lowPassCutoffSweep\\\":0,\\\"highPassCutoff\\\":0,\\\"highPassCutoffSweep\\\":0,\\\"compression\\\":1,\\\"normalization\\\":true,\\\"amplification\\\":100}\",\"name\":\"blip\"}}","name":"blip","preloadAsMusic":false,"preloadAsSound":false,"preloadInCache":false,"userAdded":true},{"file":"shoot.wav","kind":"audio","metadata":"{\"extension\":\".wav\",\"jfxr\":{\"data\":\"{\\\"_version\\\":1,\\\"_name\\\":\\\"Random 7\\\",\\\"_locked\\\":[],\\\"sampleRate\\\":44100,\\\"attack\\\":0,\\\"sustain\\\":0.06914225548978736,\\\"sustainPunch\\\":100,\\\"decay\\\":0.06914225548978736,\\\"tremoloDepth\\\":0,\\\"tremoloFrequency\\\":10,\\\"frequency\\\":710.0666391248931,\\\"frequencySweep\\\":16.93679955180551,\\\"frequencyDeltaSweep\\\":-1300,\\\"repeatFrequency\\\":0,\\\"frequencyJump1Onset\\\":33,\\\"frequencyJump1Amount\\\":0,\\\"frequencyJump2Onset\\\":66,\\\"frequencyJump2Amount\\\":0,\\\"harmonics\\\":0,\\\"harmonicsFalloff\\\":0.5,\\\"waveform\\\":\\\"triangle\\\",\\\"interpolateNoise\\\":true,\\\"vibratoDepth\\\":0,\\\"vibratoFrequency\\\":0,\\\"squareDuty\\\":25,\\\"squareDutySweep\\\":-65,\\\"flangerOffset\\\":0,\\\"flangerOffsetSweep\\\":0,\\\"bitCrush\\\":16,\\\"bitCrushSweep\\\":0,\\\"lowPassCutoff\\\":22050,\\\"lowPassCutoffSweep\\\":0,\\\"highPassCutoff\\\":0,\\\"highPassCutoffSweep\\\":0,\\\"compression\\\":1,\\\"normalization\\\":true,\\\"amplification\\\":100}\",\"name\":\"shoot\"}}","name":"shoot","preloadAsMusic":false,"preloadAsSound":false,"preloadInCache":false,"userAdded":true},{"alwaysLoaded":false,"file":"assets_GreyboxTextures_greybox_green_grid.png2.png","kind":"image","metadata":"{\"extension\":\".png\",\"pskl\":{}}","name":"assets\\GreyboxTextures\\greybox_green_grid.png2","smoothed":true,"userAdded":false},{"alwaysLoaded":false,"file":"assets_GreyboxTextures_greybox_green_grid.png3.png","kind":"image","metadata":"{\"extension\":\".png\",\"pskl\":{}}","name":"assets\\GreyboxTextures\\greybox_green_grid.png3","smoothed":true,"userAdded":true},{"file":"portal.glb","kind":"model3D","metadata":"","name":"assets\\models\\portal.glb","userAdded":true},{"alwaysLoaded":false,"file":"thumbnail.png","kind":"image","metadata":"","name":"assets\\thumbnail.png","smoothed":true,"userAdded":true},{"file":"clock.glb","kind":"model3D","metadata":"","name":"assets\\models\\clock.glb","userAdded":false},{"alwaysLoaded":false,"file":"clockImage.png","kind":"image","metadata":"","name":"assets\\clockImage.png","smoothed":true,"userAdded":true},{"file":"sign1.glb","kind":"model3D","metadata":"","name":"assets\\models\\sign1.glb","userAdded":true},{"file":"sign2.glb","kind":"model3D","metadata":"","name":"assets\\models\\sign2.glb","userAdded":true},{"file":"sign3.glb","kind":"model3D","metadata":"","name":"assets\\models\\sign3.glb","userAdded":true},{"file":"sign4.glb","kind":"model3D","metadata":"","name":"assets\\models\\sign4.glb","userAdded":false},{"file":"sign5.glb","kind":"model3D","metadata":"","name":"assets\\models\\sign5.glb","userAdded":false},{"file":"sign6.glb","kind":"model3D","metadata":"","name":"assets\\models\\sign6.glb","userAdded":true},{"alwaysLoaded":false,"file":"9patch_Orange leaves_all_128.png","kind":"image","metadata":"","name":"9patch_Orange leaves_all_128.png","smoothed":true,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Foliage Pack (100 assets)/PNG/Retina/a0876f79b74f1010a87c1dffc3cd4fbdd306d42d713dabb21d257857a5065966_9patch_Orange leaves_all_128.png","name":"9patch_Orange leaves_all_128.png"}},{"alwaysLoaded":false,"file":"tiled_dark purple space.png","kind":"image","metadata":"","name":"tiled_dark purple space.png","smoothed":true,"userAdded":false,"origin":{"identifier":"https://asset-resources.gdevelop.io/public-resources/Space Shooter/Backgrounds/59a7d361a270a586a7079a0b2b074758f56d5a1d9f9b83811686cfe95fdfce9a_tiled_dark purple space.png","name":"tiled_dark purple space.png"}},{"file":"sign7.glb","kind":"model3D","metadata":"","name":"assets\\models\\sign7.glb","userAdded":true},{"file":"sign8.glb","kind":"model3D","metadata":"","name":"assets\\models\\sign8.glb","userAdded":true},{"alwaysLoaded":false,"file":"greybox_lime_grid.png","kind":"image","metadata":"","name":"assets\\GreyboxTextures\\greybox_lime_grid.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"assets_GreyboxTextures_greybox_lime_grid.png2.png","kind":"image","metadata":"{\"extension\":\".png\",\"pskl\":{}}","name":"assets\\GreyboxTextures\\greybox_lime_grid.png2","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"wideThumbnail.png","kind":"image","metadata":"","name":"assets\\wideThumbnail.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"desktop-icon-512.png","kind":"image","metadata":"","name":"desktop-icon-512.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"android-icon-192.png","kind":"image","metadata":"","name":"android-icon-192.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"android-icon-144.png","kind":"image","metadata":"","name":"android-icon-144.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"android-icon-96.png","kind":"image","metadata":"","name":"android-icon-96.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"android-icon-72.png","kind":"image","metadata":"","name":"android-icon-72.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"android-icon-48.png","kind":"image","metadata":"","name":"android-icon-48.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"android-icon-36.png","kind":"image","metadata":"","name":"android-icon-36.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"android-windowSplashScreenAnimatedIcon.png","kind":"image","metadata":"","name":"android-windowSplashScreenAnimatedIcon.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ios-icon-1024.png","kind":"image","metadata":"","name":"ios-icon-1024.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ios-icon-180.png","kind":"image","metadata":"","name":"ios-icon-180.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ios-icon-167.png","kind":"image","metadata":"","name":"ios-icon-167.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ios-icon-152.png","kind":"image","metadata":"","name":"ios-icon-152.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ios-icon-144.png","kind":"image","metadata":"","name":"ios-icon-144.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ios-icon-120.png","kind":"image","metadata":"","name":"ios-icon-120.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ios-icon-114.png","kind":"image","metadata":"","name":"ios-icon-114.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ios-icon-100.png","kind":"image","metadata":"","name":"ios-icon-100.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ios-icon-87.png","kind":"image","metadata":"","name":"ios-icon-87.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ios-icon-80.png","kind":"image","metadata":"","name":"ios-icon-80.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ios-icon-76.png","kind":"image","metadata":"","name":"ios-icon-76.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ios-icon-72.png","kind":"image","metadata":"","name":"ios-icon-72.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ios-icon-60.png","kind":"image","metadata":"","name":"ios-icon-60.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ios-icon-58.png","kind":"image","metadata":"","name":"ios-icon-58.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ios-icon-57.png","kind":"image","metadata":"","name":"ios-icon-57.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ios-icon-50.png","kind":"image","metadata":"","name":"ios-icon-50.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ios-icon-40.png","kind":"image","metadata":"","name":"ios-icon-40.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ios-icon-29.png","kind":"image","metadata":"","name":"ios-icon-29.png","smoothed":true,"userAdded":true},{"alwaysLoaded":false,"file":"ios-icon-20.png","kind":"image","metadata":"","name":"ios-icon-20.png","smoothed":true,"userAdded":true},{"file":"CantoraOne-Regular2.ttf","kind":"font","metadata":"","name":"CantoraOne-Regular2.ttf","userAdded":true},{"file":"PTSans-Bold.ttf","kind":"font","metadata":"","name":"PTSans-Bold.ttf","userAdded":true}],"resourceFolders":[]},"objects":[],"objectsGroups":[],"variables":[{"folded":true,"name":"fullscreen","type":"boolean","value":false},{"folded":true,"name":"Settings","type":"structure","children":[{"name":"Sprint","type":"number","value":0.0}]},{"folded":true,"name":"realYear","type":"number","value":0.0}],"layouts":[{"b":209,"disableInputWhenNotFocused":true,"mangledName":"menu","name":"menu","r":209,"standardSortMethod":true,"stopSoundsOnStartup":false,"title":"","v":209,"uiSettings":{"grid":false,"gridType":"rectangular","gridWidth":32.0,"gridHeight":32.0,"gridOffsetX":0.0,"gridOffsetY":0.0,"gridColor":10401023.0,"gridAlpha":0.8,"snap":false,"zoomFactor":0.33432439075170308,"windowMask":false},"objectsGroups":[],"variables":[{"folded":true,"name":"floater","type":"boolean","value":false},{"folded":true,"name":"tempLoad","type":"number","value":0.0},{"name":"audio","type":"structure","children":[{"folded":true,"name":"muzik","type":"number","value":0.0},{"folded":true,"name":"sound","type":"number","value":0.0}]}],"instances":[{"angle":0.0,"customSize":false,"height":0.0,"layer":"","name":"cam","persistentUuid":"336cad89-3c00-468e-b48e-33b3e9bcdd7c","width":0.0,"x":916.0,"y":490.0,"zOrder":300,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":2188.0,"layer":"","locked":true,"name":"ground","persistentUuid":"2bfd55b9-bdad-4075-8d93-6cd6354e1868","sealed":true,"width":3164.0,"x":-587.0,"y":-512.0,"zOrder":0,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"UI","name":"credit","persistentUuid":"5245df24-c385-4af7-96b3-eb825d8d7c10","width":0.0,"x":13.0,"y":918.0,"zOrder":301,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"UI","name":"play","persistentUuid":"cf584c49-1017-40fe-9562-3967e8b8c9be","width":0.0,"x":122.0,"y":383.0,"zOrder":302,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"UI","name":"settings","persistentUuid":"564ce4df-40e1-4a0c-a032-3742b4acb3b2","width":0.0,"x":122.0,"y":543.0,"zOrder":303,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"UI","name":"medals","persistentUuid":"1c3796ce-75ce-4da8-b08e-7aab6945bd6c","width":0.0,"x":122.0,"y":705.0,"zOrder":304,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"settings","name":"settingstitle","persistentUuid":"969d47e0-ec28-42d3-a6ff-f221ba8528cd","width":0.0,"x":1315.0,"y":-1563.0,"zOrder":305,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"settings","name":"settingstitle","persistentUuid":"38dba097-d2ae-4cba-b2fc-093b820f18de","width":0.0,"x":66.0,"y":48.0,"zOrder":306,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"settings","name":"musictitle","persistentUuid":"2296b4de-1a9b-4c80-b47d-a6a0d5e9f29a","width":0.0,"x":113.0,"y":205.0,"zOrder":307,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"settings","name":"soundtitle","persistentUuid":"54cfee94-f89e-4914-83bf-4737a451a6b1","width":0.0,"x":113.0,"y":414.0,"zOrder":308,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"settings","name":"skyboxtitle","persistentUuid":"12094ab0-f343-409b-8608-84b187252ab2","width":0.0,"x":113.0,"y":628.0,"zOrder":309,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"medals","name":"medalsittle","persistentUuid":"c96b7fa2-2531-492c-99ae-c4b7ca339099","width":0.0,"x":66.0,"y":48.0,"zOrder":311,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":868.0,"layer":"UI","name":"title","persistentUuid":"aa9a2d7f-9242-4fa8-8a18-1ff0e6ea1073","width":868.0,"x":70.0,"y":-212.0,"zOrder":312,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":68.0,"layer":"settings","name":"mslider","persistentUuid":"0fe44432-79df-4ca6-a122-3128619f52e0","width":624.0,"x":122.0,"y":315.0,"zOrder":313,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":68.0,"layer":"settings","name":"sslider","persistentUuid":"359f48d4-3687-42d6-a47c-fd8c1c13172b","width":624.0,"x":122.0,"y":528.0,"zOrder":314,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":68.0,"layer":"settings","name":"skybox","persistentUuid":"82ca0e66-f0ae-4049-8182-7cf159af70b4","width":68.0,"x":122.0,"y":727.0,"zOrder":315,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":154.0,"layer":"settings","name":"accountbtn","persistentUuid":"bf04830f-23c6-4e94-9e2b-1fcc5227afd5","width":448.0,"x":1141.0,"y":455.0,"zOrder":316,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"UI","name":"nb","persistentUuid":"4ced680e-36d6-4090-aa93-41406e78a156","width":0.0,"x":26.0,"y":26.0,"zOrder":317,"numberProperties":[],"stringProperties":[],"initialVariables":[]}],"objects":[{"assetStoreId":"","name":"cam","tags":"","type":"Sprite","updateIfNotVisible":false,"variables":[],"effects":[],"behaviors":[{"name":"LinkedCamera","type":"WithThreeJS::LinkedCamera","ProjectionScale":0.01,"LinkAngle":false,"ViewMode":"Top Down","Hide":true},{"name":"PathfindingObstacle","type":"PathfindingBehavior::PathfindingObstacleBehavior","cost":2.0,"impassable":true},{"name":"Tween","type":"Tween::TweenBehavior"},{"name":"TweenZOrder","type":"TweenZOrder::TweenZOrder","Tween":"Tween"}],"animations":[{"name":"","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.08,"sprites":[{"hasCustomCollisionMask":false,"image":"assets\\red.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]}]},{"assetStoreId":"","height":32.0,"name":"ground","tags":"","texture":"assets\\GreyboxTextures\\greybox_dark_grid.png","type":"TiledSpriteObject::TiledSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"PlaneProjectionFromTiled","type":"WithThreeJS::PlaneProjectionFromTiled","Id":"","FirstFrame":true,"ProjectionScale":0.01,"ViewMode":"Top Down","Hide":true,"AlphaTest":0.0,"AntiAliasing":true,"Blend":"Normal","Rotate90":false,"Depth":0.0,"TextureId":"","OffsetV":0.0}]},{"assetStoreId":"","bold":false,"italic":false,"name":"credit","smoothed":true,"tags":"","type":"TextObject::Text","underlined":false,"variables":[],"effects":[],"behaviors":[],"string":"Created by ItsIceCreeperPE Dev for GDevelop's First 3D Game Jam!\nVersion ","font":"assets\\fonts\\PTSans-Bold.ttf","textAlignment":"left","characterSize":50.0,"color":{"b":255,"g":255,"r":255}},{"assetStoreId":"","bold":false,"italic":false,"name":"play","smoothed":true,"tags":"","type":"TextObject::Text","underlined":false,"variables":[],"effects":[],"behaviors":[],"string":"Play","font":"assets\\fonts\\PTSans-Bold.ttf","textAlignment":"left","characterSize":100.0,"color":{"b":255,"g":255,"r":255}},{"assetStoreId":"","bold":false,"italic":false,"name":"settings","smoothed":true,"tags":"","type":"TextObject::Text","underlined":false,"variables":[],"effects":[],"behaviors":[],"string":"Settings","font":"assets\\fonts\\PTSans-Bold.ttf","textAlignment":"left","characterSize":100.0,"color":{"b":255,"g":255,"r":255}},{"assetStoreId":"","bold":false,"italic":false,"name":"medals","smoothed":true,"tags":"","type":"TextObject::Text","underlined":false,"variables":[],"effects":[],"behaviors":[],"string":"Achievements","font":"assets\\fonts\\PTSans-Bold.ttf","textAlignment":"left","characterSize":100.0,"color":{"b":255,"g":255,"r":255}},{"assetStoreId":"","bold":false,"italic":false,"name":"settingstitle","smoothed":true,"tags":"","type":"TextObject::Text","underlined":false,"variables":[],"effects":[],"behaviors":[],"string":"Settings","font":"assets\\fonts\\CantoraOne-Regular.ttf","textAlignment":"left","characterSize":100.0,"color":{"b":255,"g":255,"r":255}},{"assetStoreId":"","bold":false,"italic":false,"name":"musictitle","smoothed":true,"tags":"","type":"TextObject::Text","underlined":false,"variables":[],"effects":[],"behaviors":[],"string":"Music: ","font":"assets\\fonts\\PTSans-Bold.ttf","textAlignment":"left","characterSize":80.0,"color":{"b":255,"g":255,"r":255}},{"assetStoreId":"","bold":false,"italic":false,"name":"soundtitle","smoothed":true,"tags":"","type":"TextObject::Text","underlined":false,"variables":[],"effects":[],"behaviors":[],"string":"Sound:","font":"assets\\fonts\\CantoraOne-Regular.ttf","textAlignment":"left","characterSize":80.0,"color":{"b":255,"g":255,"r":255}},{"assetStoreId":"","bold":false,"italic":false,"name":"skyboxtitle","smoothed":true,"tags":"","type":"TextObject::Text","underlined":false,"variables":[],"effects":[],"behaviors":[],"string":"Skybox: ","font":"assets\\fonts\\CantoraOne-Regular.ttf","textAlignment":"left","characterSize":80.0,"color":{"b":255,"g":255,"r":255}},{"assetStoreId":"","bold":false,"italic":false,"name":"medalsittle","smoothed":true,"tags":"","type":"TextObject::Text","underlined":false,"variables":[],"effects":[],"behaviors":[],"string":"Achievements","font":"assets\\fonts\\CantoraOne-Regular.ttf","textAlignment":"left","characterSize":100.0,"color":{"b":255,"g":255,"r":255}},{"assetStoreId":"","name":"title","tags":"","type":"Sprite","updateIfNotVisible":false,"variables":[],"effects":[],"behaviors":[],"animations":[{"name":"","useMultipleDirections":false,"directions":[{"looping":true,"timeBetweenFrames":0.0333,"sprites":[{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle1.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle2.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle3.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle4.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle5.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle6.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle7.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle8.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle9.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle10.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle11.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle12.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle13.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle14.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle15.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle16.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]}]},{"assetStoreId":"d32eb2703c5acb4488d36fef28164ddf46d8f5b2f3f7a97fa11640cf8d1d91e9","name":"mslider","tags":"","type":"PanelSpriteSlider::PanelSpriteSlider","variables":[],"effects":[],"behaviors":[],"content":{"BarTopPadding":3.0,"BarLeftPadding":3.0,"BarRightPadding":3.0,"BarBottomPadding":4.0,"LabelMargin":4.0,"InitialValue":100.0},"childrenContent":{"Background":{"bottomMargin":4.0,"height":18.0,"leftMargin":2.0,"rightMargin":2.0,"texture":"Square Blue Slider Border.png","tiled":false,"topMargin":4.0,"width":215.0},"FillBar":{"bottomMargin":1.0,"height":11.0,"leftMargin":1.0,"rightMargin":1.0,"texture":"Square Blue Slider Fill Bar.png","tiled":false,"topMargin":1.0,"width":11.0},"Label":{"bold":false,"italic":false,"smoothed":true,"underlined":false,"string":"It displays the value when it changes.","font":"assets\\fonts\\CantoraOne-Regular.ttf","textAlignment":"","characterSize":30.0,"color":{"b":0,"g":0,"r":0}},"Thumb":{"bottomMargin":3.0,"height":80.0,"leftMargin":3.0,"rightMargin":3.0,"texture":"Square Blue Slider Thumb.png","tiled":false,"topMargin":3.0,"width":80.0}}},{"assetStoreId":"d32eb2703c5acb4488d36fef28164ddf46d8f5b2f3f7a97fa11640cf8d1d91e9","name":"sslider","tags":"","type":"PanelSpriteSlider::PanelSpriteSlider","variables":[],"effects":[],"behaviors":[],"content":{"BarTopPadding":3.0,"BarLeftPadding":3.0,"BarRightPadding":3.0,"BarBottomPadding":4.0,"LabelMargin":4.0,"InitialValue":100.0},"childrenContent":{"Background":{"bottomMargin":4.0,"height":18.0,"leftMargin":2.0,"rightMargin":2.0,"texture":"Square Blue Slider Border.png","tiled":false,"topMargin":4.0,"width":215.0},"FillBar":{"bottomMargin":1.0,"height":11.0,"leftMargin":1.0,"rightMargin":1.0,"texture":"Square Blue Slider Fill Bar.png","tiled":false,"topMargin":1.0,"width":11.0},"Label":{"bold":false,"italic":false,"smoothed":true,"underlined":false,"string":"It displays the value when it changes.","font":"assets\\fonts\\CantoraOne-Regular.ttf","textAlignment":"","characterSize":30.0,"color":{"b":0,"g":0,"r":0}},"Thumb":{"bottomMargin":3.0,"height":80.0,"leftMargin":3.0,"rightMargin":3.0,"texture":"Square Blue Slider Thumb.png","tiled":false,"topMargin":3.0,"width":80.0}}},{"assetStoreId":"f11fadb1e240832514853591d6cc0b2acb655ff9421422b1b28e658ace1f0845","name":"skybox","tags":"","type":"SpriteToggleSwitch::SpriteToggleSwitch","variables":[],"effects":[],"behaviors":[],"content":{},"childrenContent":{"State":{"updateIfNotVisible":false,"animations":[{"name":"Unchecked","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.08,"sprites":[{"hasCustomCollisionMask":false,"image":"Square Blue Toggle_Off.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]},{"name":"Checked","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.08,"sprites":[{"hasCustomCollisionMask":false,"image":"Square Blue Toggle_On.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]}]}}},{"assetStoreId":"5faf2b0415c271fa6e747283ed36297a95f04d2b6c477a7b011775fa6fb444ee","name":"accountbtn","tags":"","type":"PanelSpriteButton::PanelSpriteButton","variables":[],"effects":[],"behaviors":[{"name":"Anchor","type":"AnchorBehavior::AnchorBehavior","bottomEdgeAnchor":0.0,"leftEdgeAnchor":0.0,"relativeToOriginalWindowSize":true,"rightEdgeAnchor":2.0,"topEdgeAnchor":0.0,"useLegacyBottomAndRightAnchors":false}],"content":{"LeftPadding":16.0,"RightPadding":16.0,"PressedLabelOffsetY":3.0,"BottomPadding":32.0,"TopPadding":32.0,"HoveredFadeOutDuration":0.25},"childrenContent":{"Hovered":{"bottomMargin":16.0,"height":69.0,"leftMargin":16.0,"rightMargin":16.0,"texture":"Red Button With Shadow_Hovered.png","tiled":true,"topMargin":16.0,"width":192.0},"Idle":{"bottomMargin":16.0,"height":69.0,"leftMargin":16.0,"rightMargin":16.0,"texture":"Red Button With Shadow_Idle.png","tiled":true,"topMargin":16.0,"width":192.0},"Label":{"bold":false,"italic":false,"smoothed":true,"underlined":false,"string":"Account","font":"assets\\fonts\\PTSans-Bold.ttf","textAlignment":"center","characterSize":100.0,"color":{"b":255,"g":255,"r":255}},"Pressed":{"bottomMargin":16.0,"height":69.0,"leftMargin":16.0,"rightMargin":16.0,"texture":"Red Button With Shadow_Pressed.png","tiled":true,"topMargin":16.0,"width":192.0}}},{"assetStoreId":"","bold":false,"italic":false,"name":"nb","smoothed":true,"tags":"","type":"TextObject::Text","underlined":false,"variables":[],"effects":[],"behaviors":[],"string":"Note: This game is very much broken and i spent 10 days on it for GDevelop's First 3D Game Jam ;-;\nThis game doesn't really work on mobile yet and im currently struggling to make tons of things, \nespecially the game's main feature(Timeline Travel). Please share feedback and maybe share the game with friends :))","font":"assets\\fonts\\PTSans-Bold.ttf","textAlignment":"left","characterSize":30.0,"color":{"b":255,"g":255,"r":255}}],"events":[],"layers":[{"ambientLightColorB":0,"ambientLightColorG":2,"ambientLightColorR":134217728,"camera3DFarPlaneDistance":10000.0,"camera3DFieldOfView":45.0,"camera3DNearPlaneDistance":0.1,"followBaseLayerCamera":false,"isLightingLayer":false,"isLocked":false,"name":"","renderingType":"","visibility":true,"cameras":[{"defaultSize":true,"defaultViewport":true,"height":0.0,"viewportBottom":1.0,"viewportLeft":0.0,"viewportRight":1.0,"viewportTop":0.0,"width":0.0}],"effects":[]},{"ambientLightColorB":1651340654,"ambientLightColorG":13881208,"ambientLightColorR":16777216,"camera3DFarPlaneDistance":10000.0,"camera3DFieldOfView":45.0,"camera3DNearPlaneDistance":0.1,"followBaseLayerCamera":false,"isLightingLayer":false,"isLocked":false,"name":"UI","renderingType":"","visibility":true,"cameras":[],"effects":[]},{"ambientLightColorB":0,"ambientLightColorG":9413808,"ambientLightColorR":6071712,"camera3DFarPlaneDistance":10000.0,"camera3DFieldOfView":45.0,"camera3DNearPlaneDistance":0.1,"followBaseLayerCamera":false,"isLightingLayer":false,"isLocked":false,"name":"settings","renderingType":"","visibility":false,"cameras":[],"effects":[]},{"ambientLightColorB":0,"ambientLightColorG":9413808,"ambientLightColorR":6071712,"camera3DFarPlaneDistance":10000.0,"camera3DFieldOfView":45.0,"camera3DNearPlaneDistance":0.1,"followBaseLayerCamera":false,"isLightingLayer":false,"isLocked":false,"name":"medals","renderingType":"","visibility":false,"cameras":[],"effects":[]}],"behaviorsSharedData":[{"name":"Anchor","type":"AnchorBehavior::AnchorBehavior"},{"name":"LinkedCamera","type":"WithThreeJS::LinkedCamera"},{"name":"PathfindingObstacle","type":"PathfindingBehavior::PathfindingObstacleBehavior"},{"name":"PlaneProjectionFromTiled","type":"WithThreeJS::PlaneProjectionFromTiled"},{"name":"Tween","type":"Tween::TweenBehavior"},{"name":"TweenZOrder","type":"TweenZOrder::TweenZOrder"}]},{"b":209,"disableInputWhenNotFocused":true,"mangledName":"tutorial","name":"tutorial","r":209,"standardSortMethod":true,"stopSoundsOnStartup":false,"title":"","v":209,"uiSettings":{"grid":false,"gridType":"rectangular","gridWidth":32.0,"gridHeight":32.0,"gridOffsetX":0.0,"gridOffsetY":0.0,"gridColor":10401023.0,"gridAlpha":0.8,"snap":false,"zoomFactor":0.3645833333333333,"windowMask":false},"objectsGroups":[],"variables":[{"folded":true,"name":"collisionComplete","type":"boolean","value":false},{"folded":true,"name":"RTurn","type":"number","value":0.0},{"folded":true,"name":"velocity","type":"number","value":0.0},{"folded":true,"name":"camVarX","type":"number","value":0.0},{"folded":true,"name":"camVarY","type":"number","value":0.0},{"folded":true,"name":"camVarZ","type":"number","value":0.0},{"folded":true,"name":"enemyFloat","type":"number","value":0.0}],"instances":[{"angle":0.0,"customSize":true,"height":24.0,"layer":"","name":"player","persistentUuid":"2f432be1-b8eb-4866-b7e4-f1d6d91bdc32","width":24.0,"x":513.0,"y":1050.0,"zOrder":256,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":293.0,"layer":"","name":"ground","persistentUuid":"ca68732a-8606-4aa4-9c98-93848c4424e0","width":415.0,"x":326.0,"y":870.0,"zOrder":0,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":287.0,"layer":"","name":"target","persistentUuid":"f35cf728-8f3b-4da3-a86b-46e6534335b4","width":287.0,"x":391.0,"y":126.0,"zOrder":129,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":256.0,"layer":"","name":"platform","persistentUuid":"0c5b65fa-d803-473b-8156-3ff87ec2791d","width":256.0,"x":405.0,"y":617.0,"zOrder":0,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":128.0,"layer":"","name":"platform","persistentUuid":"8229d67a-42e8-458f-b3e8-0734739f8d20","width":256.0,"x":405.0,"y":617.0,"zOrder":5,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":256.0,"layer":"","name":"platform","persistentUuid":"ce68ba06-8e7f-429b-acf6-4426781feb02","width":256.0,"x":405.0,"y":367.0,"zOrder":10,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":128.0,"layer":"","name":"platform","persistentUuid":"5bf87182-58ab-4fc0-adf7-b6e47e6be396","width":256.0,"x":405.0,"y":367.0,"zOrder":15,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":16.0,"layer":"","name":"box","persistentUuid":"5582ab72-69c0-4911-9ab8-7028db23ebbe","width":16.0,"x":597.0,"y":413.0,"zOrder":30,"numberProperties":[],"stringProperties":[],"initialVariables":[{"folded":true,"name":"gun","type":"boolean","value":true}]},{"angle":0.0,"customSize":true,"height":737.0,"layer":"","name":"ground","persistentUuid":"d3eac8a4-4279-41c6-8e88-ffab05476619","width":170.0,"x":437.0,"y":-453.0,"zOrder":0,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":32.0,"layer":"","name":"wall","persistentUuid":"e208bf5b-ea63-4386-974b-8d576ec362b0","width":103.0,"x":653.0,"y":846.0,"zOrder":240,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":32.0,"layer":"","name":"wall","persistentUuid":"7aa1fe0a-aa67-406a-8989-de0d41309c04","width":129.0,"x":288.0,"y":844.0,"zOrder":240,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":319.0,"layer":"","name":"wall","persistentUuid":"2fdc4346-aa97-4721-be87-f2ef408e8187","width":27.0,"x":305.0,"y":854.0,"zOrder":240,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":27.0,"layer":"","name":"wall","persistentUuid":"9f3e0339-28a2-4bbd-baa9-70c8311ac44f","width":442.0,"x":315.0,"y":1144.0,"zOrder":240,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":319.0,"layer":"","name":"wall","persistentUuid":"faa03f7d-03bd-493e-a699-8d0d8d0ed4bb","width":27.0,"x":728.0,"y":852.0,"zOrder":240,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":24.0,"layer":"","name":"enemy","persistentUuid":"fd0964e3-9198-4873-be17-85088a164975","width":24.0,"x":-636.0,"y":-291.0,"zOrder":160,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":12.0,"layer":"","name":"gunmodel","persistentUuid":"62b813e1-9529-43a2-96fd-c53e5fe40d19","width":12.0,"x":601.0,"y":398.0,"zOrder":40,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":128.0,"layer":"","name":"platform","persistentUuid":"4aef905d-09bc-4efc-b054-471316f5a61b","width":128.0,"x":459.0,"y":-601.0,"zOrder":20,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":128.0,"layer":"","name":"platform","persistentUuid":"05e896b5-97ba-49e1-8e4e-0b9e9cd91f92","width":128.0,"x":389.0,"y":-781.0,"zOrder":20,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":128.0,"layer":"","name":"platform","persistentUuid":"1c43bc2f-6e8d-43d1-9c57-21c8dc03cd0d","width":128.0,"x":509.0,"y":-957.0,"zOrder":20,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":128.0,"layer":"","name":"platform","persistentUuid":"c2cbc573-693e-4d6b-8793-2ec7e6f067a9","width":128.0,"x":362.0,"y":-1099.0,"zOrder":20,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":128.0,"layer":"","name":"platform","persistentUuid":"b1662478-6b8e-4936-bc78-3140cf0313db","width":128.0,"x":258.0,"y":-1267.0,"zOrder":20,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":128.0,"layer":"","name":"platform","persistentUuid":"4d0de2d8-0e68-42af-89c0-a615cc77c623","width":128.0,"x":103.0,"y":-1130.0,"zOrder":20,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":128.0,"layer":"","name":"platform","persistentUuid":"fe060922-68f0-4a55-86c0-6ff8de3fd537","width":128.0,"x":-65.0,"y":-1200.0,"zOrder":20,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":128.0,"layer":"","name":"platform","persistentUuid":"f3ef191b-aaee-4eea-95da-39505846d99e","width":128.0,"x":-228.0,"y":-1283.0,"zOrder":25,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":128.0,"layer":"","name":"platform","persistentUuid":"e8d5c0a7-2bec-434c-b349-458dcb3c5333","width":128.0,"x":-387.0,"y":-1366.0,"zOrder":30,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":128.0,"layer":"","name":"platform","persistentUuid":"0208422d-98a3-4fb6-912b-50d084843c1f","width":128.0,"x":-559.0,"y":-1458.0,"zOrder":35,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":128.0,"layer":"","name":"platform","persistentUuid":"492a79bb-ce76-4078-83f9-a0cb69e30adf","width":128.0,"x":-722.0,"y":-1558.0,"zOrder":40,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":128.0,"layer":"","name":"platform","persistentUuid":"465597d2-ec90-4b94-b8aa-e83c78863e69","width":128.0,"x":-869.0,"y":-1404.0,"zOrder":50,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":128.0,"layer":"","name":"platform","persistentUuid":"27867296-7f9c-4ca2-9a8c-89e6bdd6a3ca","width":128.0,"x":-884.0,"y":-1246.0,"zOrder":70,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":128.0,"layer":"","name":"platform","persistentUuid":"07165287-7800-4e54-b4e3-3d09ceb1b490","width":128.0,"x":-878.0,"y":-1084.0,"zOrder":80,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":1153.0,"layer":"","name":"platform","persistentUuid":"a12664f9-cf65-4b02-9b6f-d41352dd9006","width":128.0,"x":-686.0,"y":-1091.0,"zOrder":100,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":287.0,"layer":"","name":"target","persistentUuid":"139d6165-ff94-4743-bfe9-6291f6c0b3bc","width":287.0,"x":-766.0,"y":-423.0,"zOrder":200,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":131.0,"layer":"","name":"platform","persistentUuid":"2ce5234a-5faf-4ac7-92b9-14f6d18d920e","width":3152.0,"x":-3834.0,"y":-68.0,"zOrder":100,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":24.0,"layer":"","name":"enemy","persistentUuid":"e3e44097-d136-4ae2-b410-0bf656ca9650","width":24.0,"x":-3796.0,"y":-40.0,"zOrder":160,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":24.0,"layer":"","name":"enemy","persistentUuid":"76ffdfe6-dba6-4613-a492-cf58afea1948","width":24.0,"x":-3759.0,"y":-18.0,"zOrder":160,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":24.0,"layer":"","name":"enemy","persistentUuid":"64840232-ba4a-4e15-9f18-544466742574","width":24.0,"x":-3797.0,"y":9.0,"zOrder":160,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":1799.0,"layer":"","name":"platform","persistentUuid":"33a7d8a4-7420-4ab3-8e44-8a1ae91a411a","width":2210.0,"x":-6041.0,"y":-670.0,"zOrder":100,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":619.0,"layer":"","name":"wall","persistentUuid":"2e5d40c9-4563-4553-8567-b6f52548070a","width":32.0,"x":-3843.0,"y":-682.0,"zOrder":350,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":1103.0,"layer":"","name":"wall","persistentUuid":"d7de5650-2a87-4626-9fa0-524b1aaa7f9f","width":32.0,"x":-3843.0,"y":54.0,"zOrder":350,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":57.0,"layer":"","name":"wall","persistentUuid":"89b2227c-4b9a-4703-b08a-7dc0e680d738","width":647.0,"x":-4716.0,"y":-574.0,"zOrder":350,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":260.0,"layer":"","name":"platform2","persistentUuid":"5e7b0c8b-47c9-4776-85c9-909275d5b102","width":507.0,"x":-4640.0,"y":-457.0,"zOrder":351,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":26.0,"layer":"","name":"portal","persistentUuid":"d9f9666d-42f7-4048-9251-ebc6bb0e6a69","width":62.0,"x":-4397.0,"y":-251.0,"zOrder":410,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":1454.0,"layer":"","name":"platform2","persistentUuid":"64a6a82c-f2e5-4c8b-8b42-46afa7ad76a7","width":507.0,"x":-5674.0,"y":-463.0,"zOrder":351,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":1840.0,"layer":"","name":"wall","persistentUuid":"aae6b410-8808-48d6-a90e-df0a2dbb68bb","width":32.0,"x":-4946.0,"y":-682.0,"zOrder":350,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":24.0,"layer":"","name":"enemy","persistentUuid":"3cff79d9-8a8f-4c71-b31b-44176277d8ba","width":24.0,"x":-5594.0,"y":434.0,"zOrder":420,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":26.0,"layer":"","name":"portal2","persistentUuid":"226d592b-53a7-48ae-8267-a5c42e9db1f4","width":62.0,"x":-5435.0,"y":-428.0,"zOrder":410,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":24.0,"layer":"","name":"enemy","persistentUuid":"57e43f0c-dd34-4da4-a85e-3c808d1b41a9","width":24.0,"x":-5522.0,"y":432.0,"zOrder":420,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":24.0,"layer":"","name":"enemy","persistentUuid":"293c1bec-6357-4c23-876a-751d9e6a0f65","width":24.0,"x":-5425.0,"y":432.0,"zOrder":420,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":24.0,"layer":"","name":"enemy","persistentUuid":"1c41081b-7941-4363-86d5-30248009082e","width":24.0,"x":-5353.0,"y":430.0,"zOrder":420,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":24.0,"layer":"","name":"enemy","persistentUuid":"06de2daf-3981-4e2b-aab6-319d56c52376","width":24.0,"x":-5297.0,"y":436.0,"zOrder":420,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"","name":"box","persistentUuid":"27c2f6ae-59d7-44a9-8da0-267b957cc96d","width":0.0,"x":-5435.0,"y":683.0,"zOrder":365,"numberProperties":[],"stringProperties":[],"initialVariables":[{"folded":true,"name":"clock","type":"boolean","value":true}]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"","name":"clock","persistentUuid":"0012ca39-5959-4c76-9378-1c9857b20144","width":0.0,"x":-5427.0,"y":673.0,"zOrder":380,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"","name":"sign1","persistentUuid":"70ff48fb-da23-44ce-91fa-536035a7c0b1","width":0.0,"x":503.0,"y":896.0,"zOrder":35,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"","name":"sign2","persistentUuid":"b04dbd4a-2b9a-40ec-b67f-d6ab28c18035","width":0.0,"x":518.0,"y":427.0,"zOrder":50,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"","name":"sign3","persistentUuid":"764a3ec7-2eac-49d3-a20c-b5fc70df8ab0","width":0.0,"x":-637.0,"y":-356.0,"zOrder":140,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"","name":"sign4","persistentUuid":"ce322a79-5dd2-4f47-9498-fb3c07d6fa1b","width":0.0,"x":-679.0,"y":-55.0,"zOrder":140,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"","name":"sign5","persistentUuid":"e2191581-737b-44e4-8abe-67b7fb1c5ff2","width":0.0,"x":-3910.0,"y":-19.0,"zOrder":140,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"","name":"sign6","persistentUuid":"a6303188-d48b-4c94-9972-7072192e14ed","width":0.0,"x":-5437.0,"y":742.0,"zOrder":386,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"","name":"sign78","persistentUuid":"7f4c4991-882d-4737-8907-fb74d0da47bb","width":0.0,"x":-5439.0,"y":811.0,"zOrder":386,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":169.0,"layer":"","name":"finish","persistentUuid":"b1291710-ae75-4c19-96b8-076c3c563cc8","width":169.0,"x":-5497.0,"y":1022.0,"zOrder":351,"numberProperties":[],"stringProperties":[],"initialVariables":[]}],"objects":[{"assetStoreId":"","name":"player","tags":"","type":"Sprite","updateIfNotVisible":false,"variables":[{"folded":true,"name":"Jump","type":"number","value":0.0},{"folded":true,"name":"Crouch","type":"boolean","value":false},{"folded":true,"name":"Sprint","type":"boolean","value":false},{"folded":true,"name":"Velocity","type":"number","value":0.0}],"effects":[],"behaviors":[{"name":"FireBullet","type":"FireBullet::FireBullet","FireCooldown":0.1,"HasJustFired":false,"FiringArc":45.0,"BulletQuantity":1.0,"AngleVariance":0.0,"RotateBullet":true,"AmmoQuantity":0.0,"ShotsPerReload":0.0,"ReloadDuration":1.0,"MaxAmmo":0.0,"ShotsBeforeNextReload":0.0,"TotalShotsFired":0.0,"TotalBulletsCreated":0.0,"StartingAmmo":0.0,"TotalReloadsCompleted":0.0,"UnlimitedAmmo":true,"ReloadInProgress":false,"HeatIncreasePerShot":0.0,"HeatLevel":0.0,"AutomaticReloading":true,"OverheatDuration":0.0,"LinearCoolingRate":0.1,"ExponentialCoolingRate":0.3,"BulletLayer":"","RandomizedAngle":0.0,"BulletSpeedVariance":0.0},{"name":"Health","type":"Health::Health","Health":100.0,"CurrentHealth":0.0,"MaxHealth":100.0,"DamageCooldown":0.0,"IsHealthJustDamaged":false,"HealthRegenRate":0.0,"HealthRegenDelay":0.0,"AllowOverHealing":false,"HitAtLeastOnce":false,"IsJustHealed":false,"CurrentShieldPoints":0.0,"MaxShieldPoints":0.0,"ShieldDuration":5.0,"ShieldRegenRate":0.0,"BlockExcessDamage":false,"ShieldRegenDelay":0.0,"IsShieldJustDamaged":false,"ChanceToDodge":0.0,"DamageToBeApplied":0.0,"FlatDamageReduction":0.0,"PercentDamageReduction":0.0,"IsJustDodged":false,"ShieldDamageTaken":0.0,"HealToBeApplied":0.0},{"name":"LinkedCamera","type":"WithThreeJS::LinkedCamera","ProjectionScale":0.01,"LinkAngle":false,"ViewMode":"Top Down","Hide":true},{"name":"LinkedCameraWithHeadMovement","type":"WithThreeJS::LinkedCameraWithHeadMovement","ProjectionScale":0.01,"LinkAngle":false,"ViewMode":"Top Down","Hide":true,"Sensitivity":10.0,"CameraZoom":1.0,"Sight":""},{"name":"ShakeObject_PositionAngle","type":"ShakeObject::ShakeObject_PositionAngle"},{"name":"Tween","type":"Tween::TweenBehavior"},{"name":"TweenZOrder","type":"TweenZOrder::TweenZOrder","Tween":"Tween"}],"animations":[{"name":"red","useMultipleDirections":false,"directions":[{"looping":false,"metadata":"{\"pskl\":{}}","timeBetweenFrames":0.08,"sprites":[{"hasCustomCollisionMask":false,"image":"red","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]}]},{"assetStoreId":"","height":32.0,"name":"ground","tags":"","texture":"assets\\GreyboxTextures\\greybox_dark_grid.png2","type":"TiledSpriteObject::TiledSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"PlaneProjectionFromTiled","type":"WithThreeJS::PlaneProjectionFromTiled","Id":"","FirstFrame":true,"ProjectionScale":0.01,"ViewMode":"Top Down","Hide":true,"AlphaTest":0.0,"AntiAliasing":false,"Blend":"Normal","Rotate90":false,"Depth":0.0,"TextureId":"","OffsetV":0.0}]},{"assetStoreId":"9657e1e903147a4841f5fe372992a5d475b9c2c33255a7905bbe2065aadf3a9d","name":"shotgun","tags":"","type":"Sprite","updateIfNotVisible":false,"variables":[],"effects":[{"effectType":"DropShadow","name":"Effect","doubleParameters":{"alpha":1.0,"blur":2.0,"distance":1.0,"padding":0.0,"quality":3.0,"rotation":0.0},"stringParameters":{"color":"0;0;0"},"booleanParameters":{"shadowOnly":false}}],"behaviors":[{"name":"Tween","type":"Tween::TweenBehavior"}],"animations":[{"name":"Aiming","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.025,"sprites":[{"hasCustomCollisionMask":false,"image":"assets\\gun1.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]},{"name":"Firing","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.025,"sprites":[{"hasCustomCollisionMask":false,"image":"assets\\gun2.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]}]},{"assetStoreId":"90cbbb3f06b52fa58138b7263671e5926346a483895cb54d56d56498941076a0","name":"Bullet","tags":"","type":"Sprite","updateIfNotVisible":false,"variables":[{"folded":true,"name":"fire","type":"boolean","value":false},{"folded":true,"name":"anglex","type":"number","value":0.0}],"effects":[],"behaviors":[{"name":"SpriteProjection","type":"WithThreeJS::SpriteProjection","Id":"","FirstFrame":true,"CurrentTextureId":"","ProjectionScale":0.01,"ViewMode":"Top Down","Hide":true,"AlphaTest":0.5,"AntiAliasing":false,"Depth":0.0}],"animations":[{"name":"","useMultipleDirections":false,"directions":[{"looping":true,"timeBetweenFrames":0.025,"sprites":[{"hasCustomCollisionMask":false,"image":"Bullet 1.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]}]},{"assetStoreId":"","name":"target","tags":"","type":"Sprite","updateIfNotVisible":false,"variables":[],"effects":[],"behaviors":[{"name":"BoardProjection","type":"WithThreeJS::BoardProjection","Id":"","FirstFrame":true,"CurrentTextureId":"","ProjectionScale":0.01,"ViewMode":"Top Down","Hide":true,"AlphaTest":0.0,"AntiAliasing":true,"AngleAxis":"Z Axis","Orientation":"Vertical","Depth":0.0},{"name":"Tween","type":"Tween::TweenBehavior"},{"name":"TweenZOrder","type":"TweenZOrder::TweenZOrder","Tween":"Tween"}],"animations":[{"name":"","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.08,"sprites":[{"hasCustomCollisionMask":true,"image":"assets\\assets_texture_12.png2.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[[{"x":0.0,"y":120.0},{"x":256.0,"y":120.0},{"x":256.0,"y":139.0},{"x":0.0,"y":139.0}]]}]}]}]},{"assetStoreId":"","name":"crosshair","tags":"","type":"Sprite","updateIfNotVisible":false,"variables":[],"effects":[],"behaviors":[],"animations":[{"name":"","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.08,"sprites":[{"hasCustomCollisionMask":false,"image":"assets\\crosshair046.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]}]},{"assetStoreId":"1c5da40d6e0b115eb17d801deff17d42023e96591641ccd8485701aa78c89844","name":"MoveJoystick","tags":"","type":"SpriteMultitouchJoystick::SpriteMultitouchJoystick","variables":[],"effects":[],"behaviors":[],"content":{},"childrenContent":{"Border":{"updateIfNotVisible":false,"animations":[{"name":"Idle","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.08,"sprites":[{"hasCustomCollisionMask":false,"image":"Transparent dark joystick border.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]}]},"Thumb":{"updateIfNotVisible":false,"animations":[{"name":"Idle","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.08,"sprites":[{"hasCustomCollisionMask":false,"image":"Transparent dark joystick thumb.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]}]}}},{"assetStoreId":"1c5da40d6e0b115eb17d801deff17d42023e96591641ccd8485701aa78c89844","name":"LookJoystick","tags":"","type":"SpriteMultitouchJoystick::SpriteMultitouchJoystick","variables":[],"effects":[],"behaviors":[{"name":"Anchor","type":"AnchorBehavior::AnchorBehavior","bottomEdgeAnchor":2.0,"leftEdgeAnchor":0.0,"relativeToOriginalWindowSize":true,"rightEdgeAnchor":2.0,"topEdgeAnchor":0.0,"useLegacyBottomAndRightAnchors":false}],"content":{},"childrenContent":{"Border":{"updateIfNotVisible":false,"animations":[{"name":"Idle","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.08,"sprites":[{"hasCustomCollisionMask":false,"image":"Transparent dark joystick border.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]}]},"Thumb":{"updateIfNotVisible":false,"animations":[{"name":"Idle","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.08,"sprites":[{"hasCustomCollisionMask":false,"image":"Transparent dark joystick thumb.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]}]}}},{"assetStoreId":"3d6c54e76a9a06cbd7629c1e78388d4ab808bbf36d644c61d6a14c9ad34d4f89","name":"healthbar","tags":"","type":"PanelSpriteContinuousBar::PanelSpriteContinuousBar","variables":[],"effects":[],"behaviors":[],"content":{"PreviousHighValueDuration":0.0,"ShowLabel":true,"BarTopPadding":4.0,"BarBottomPadding":6.0,"BarLeftPadding":4.0,"BarRightPadding":4.0,"MaxValue":100.0,"InitialValue":100.0},"childrenContent":{"Background":{"bottomMargin":6.0,"height":34.0,"leftMargin":4.0,"rightMargin":4.0,"texture":"Flat Bar White Border.png","tiled":true,"topMargin":6.0,"width":224.0},"Buffer":{"bottomMargin":0.0,"height":24.0,"leftMargin":0.0,"rightMargin":0.0,"texture":"Flat Bar Red Fill Bar.png","tiled":true,"topMargin":0.0,"width":24.0},"FillBar":{"bottomMargin":0.0,"height":24.0,"leftMargin":0.0,"rightMargin":0.0,"texture":"Flat Bar Red Fill Bar.png","tiled":true,"topMargin":0.0,"width":24.0},"Label":{"bold":false,"italic":false,"smoothed":true,"underlined":false,"string":"100 / 100","font":"assets\\fonts\\PTSans-Bold.ttf","textAlignment":"center","characterSize":40.0,"color":{"b":255,"g":255,"r":255}}}},{"assetStoreId":"05c8c095007d0ac0b0242bd0999b9af85d00f464a0eff959f55c9413ad3401e5","name":"PauseButton","tags":"","type":"Sprite","updateIfNotVisible":false,"variables":[],"effects":[],"behaviors":[{"name":"Anchor","type":"AnchorBehavior::AnchorBehavior","bottomEdgeAnchor":0.0,"leftEdgeAnchor":0.0,"relativeToOriginalWindowSize":true,"rightEdgeAnchor":2.0,"topEdgeAnchor":1.0,"useLegacyBottomAndRightAnchors":false}],"animations":[{"name":"","useMultipleDirections":false,"directions":[{"looping":true,"timeBetweenFrames":0.025,"sprites":[{"hasCustomCollisionMask":false,"image":"Pause button.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]}]},{"assetStoreId":"11521f9e3de9c1bbc2ce041a94e79b1e6c0f0415e936ec2227c12031660c1824","name":"FireRoundButton","tags":"","type":"Sprite","updateIfNotVisible":false,"variables":[],"effects":[],"behaviors":[{"name":"Anchor","type":"AnchorBehavior::AnchorBehavior","leftEdgeAnchor":0.0,"relativeToOriginalWindowSize":true,"rightEdgeAnchor":2.0,"bottomEdgeAnchor":2.0,"topEdgeAnchor":0.0,"useLegacyBottomAndRightAnchors":false}],"animations":[{"name":"","useMultipleDirections":false,"directions":[{"looping":true,"timeBetweenFrames":0.025,"sprites":[{"hasCustomCollisionMask":true,"image":"Fire round button.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[[{"x":0.0,"y":41.0},{"x":12.0,"y":12.0},{"x":40.5,"y":0.0},{"x":68.0,"y":12.0},{"x":80.0,"y":39.5},{"x":69.5,"y":67.0},{"x":39.5,"y":80.0},{"x":10.5,"y":68.0}]]}]}]}]},{"assetStoreId":"9c727020616afdd6ba786b8af206a90481f07db0ca175ed6a4cc5b7e01c66d06","name":"TopArrowButton","tags":"","type":"Sprite","updateIfNotVisible":false,"variables":[],"effects":[],"behaviors":[{"name":"Anchor","type":"AnchorBehavior::AnchorBehavior","bottomEdgeAnchor":2.0,"leftEdgeAnchor":0.0,"relativeToOriginalWindowSize":true,"rightEdgeAnchor":2.0,"topEdgeAnchor":0.0,"useLegacyBottomAndRightAnchors":false}],"animations":[{"name":"","useMultipleDirections":false,"directions":[{"looping":true,"timeBetweenFrames":0.025,"sprites":[{"hasCustomCollisionMask":true,"image":"Top arrow button.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[[{"x":0.0,"y":38.5},{"x":12.0,"y":10.5},{"x":39.5,"y":0.5},{"x":70.0,"y":12.5},{"x":80.0,"y":38.5},{"x":72.0,"y":66.5},{"x":41.0,"y":79.5},{"x":12.0,"y":69.0}]]}]}]}]},{"assetStoreId":"","height":32.0,"name":"platform","tags":"","texture":"assets\\GreyboxTextures\\greybox_red_grid.png2","type":"TiledSpriteObject::TiledSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"BoxProjectionFromTiled","type":"WithThreeJS::BoxProjectionFromTiled","Id":"","FirstFrame":true,"ProjectionScale":0.01,"ViewMode":"Top Down","Hide":true,"AlphaTest":0.0,"AntiAliasing":true,"Depth":5.0,"IsCube":false,"TBTextureId":"","LRTextureId":"","FRTextureId":"","TBOffsetV":0.0,"LROffsetV":0.0,"FROffsetV":0.0,"Blend":"Normal"}]},{"assetStoreId":"","height":32.0,"name":"platform2","tags":"","texture":"assets\\GreyboxTextures\\greybox_green_grid.png3","type":"TiledSpriteObject::TiledSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"BoxProjectionFromTiled","type":"WithThreeJS::BoxProjectionFromTiled","Id":"","FirstFrame":true,"ProjectionScale":0.01,"ViewMode":"Top Down","Hide":true,"AlphaTest":0.0,"AntiAliasing":true,"Depth":5.0,"IsCube":false,"TBTextureId":"","LRTextureId":"","FRTextureId":"","TBOffsetV":0.0,"LROffsetV":0.0,"FROffsetV":0.0,"Blend":"Normal"}]},{"assetStoreId":"","height":32.0,"name":"box","tags":"","texture":"assets\\GreyboxTextures\\greybox_orange_grid.png2","type":"TiledSpriteObject::TiledSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"BoxProjectionFromTiled","type":"WithThreeJS::BoxProjectionFromTiled","Id":"","FirstFrame":true,"ProjectionScale":0.01,"ViewMode":"Top Down","Hide":true,"AlphaTest":0.0,"AntiAliasing":true,"Depth":16.0,"IsCube":false,"TBTextureId":"","LRTextureId":"","FRTextureId":"","TBOffsetV":0.0,"LROffsetV":0.0,"FROffsetV":0.0,"Blend":"Normal"}]},{"assetStoreId":"","height":32.0,"name":"wall","tags":"","texture":"assets\\GreyboxTextures\\greybox_purple_solid.png2","type":"TiledSpriteObject::TiledSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"BoxProjectionFromTiled","type":"WithThreeJS::BoxProjectionFromTiled","Id":"","FirstFrame":true,"ProjectionScale":0.01,"ViewMode":"Top Down","Hide":true,"AlphaTest":0.0,"AntiAliasing":true,"Depth":512.0,"IsCube":false,"TBTextureId":"","LRTextureId":"","FRTextureId":"","TBOffsetV":0.0,"LROffsetV":0.0,"FROffsetV":0.0,"Blend":"Normal"}]},{"assetStoreId":"","height":32.0,"name":"enemy","tags":"","texture":"red","type":"TiledSpriteObject::TiledSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"Pathfinding","type":"PathfindingBehavior::PathfindingBehavior","acceleration":400.0,"allowDiagonals":true,"angleOffset":0.0,"angularMaxSpeed":180.0,"cellHeight":20.0,"cellWidth":20.0,"extraBorder":0.0,"gridOffsetX":0.0,"gridOffsetY":0.0,"maxSpeed":200.0,"rotateObject":true,"smoothingMaxCellGap":1.0},{"name":"PhysicsEngine3DGLTFModel","type":"Physics3dExtension::PhysicsEngine3DGLTFModel","FileName":"enemy.glb","MakeStatic":false,"Mass":1.0},{"name":"Tween","type":"Tween::TweenBehavior"},{"name":"TweenZOrder","type":"TweenZOrder::TweenZOrder","Tween":"Tween"}]},{"assetStoreId":"","bold":false,"italic":false,"name":"debug","smoothed":true,"tags":"","type":"TextObject::Text","underlined":false,"variables":[],"effects":[],"behaviors":[],"string":"debug","font":"","textAlignment":"left","characterSize":100.0,"color":{"b":255,"g":255,"r":255}},{"assetStoreId":"a1dc8b70cd2df1fe1c56c84c45f0a72ca554b20fdf1fc736d0855f27be99d5bc","name":"dedEnemy","tags":"","type":"Sprite","updateIfNotVisible":false,"variables":[],"effects":[],"behaviors":[{"name":"SpriteProjection","type":"WithThreeJS::SpriteProjection","Id":"","FirstFrame":true,"CurrentTextureId":"","ProjectionScale":0.01,"ViewMode":"Top Down","Hide":true,"AlphaTest":0.5,"AntiAliasing":false,"CollisionX":0.0,"CollisionY":0.0,"CollisionIndex":0.0,"IsHit":false,"CollisionDirection":"left"},{"name":"Tween","type":"Tween::TweenBehavior"}],"animations":[{"name":"","useMultipleDirections":false,"directions":[{"looping":true,"timeBetweenFrames":0.0164,"sprites":[{"hasCustomCollisionMask":false,"image":"sunburn_1.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_2.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_3.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_4.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_5.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_6.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_7.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_8.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_9.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_10.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_11.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_12.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_13.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_14.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_15.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_16.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_18.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_19.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_20.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_21.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_22.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_23.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_24.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_25.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_26.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_27.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_28.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_29.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_30.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_31.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_32.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_33.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_34.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_35.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_36.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_37.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_38.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_39.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_40.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_41.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_42.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_43.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_44.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_45.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_46.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_47.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_48.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_49.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_50.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_51.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_52.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_53.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_54.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_55.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_56.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_57.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_58.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_59.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_60.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"sunburn_61.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]}]},{"assetStoreId":"","height":32.0,"name":"gunmodel","tags":"","texture":"red","type":"TiledSpriteObject::TiledSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"PhysicsEngine3DGLTFModel","type":"Physics3dExtension::PhysicsEngine3DGLTFModel","FileName":"gun.glb","MakeStatic":false,"Mass":0.0}]},{"assetStoreId":"0505a40b23a72e9aa075c0a26c4c102107fae50376b50c8aa496d178a73ba756","name":"explosion","tags":"","type":"Sprite","updateIfNotVisible":false,"variables":[],"effects":[],"behaviors":[{"name":"SpriteProjection","type":"WithThreeJS::SpriteProjection","Id":"","FirstFrame":true,"CurrentTextureId":"","ProjectionScale":0.01,"ViewMode":"Top Down","Hide":true,"AlphaTest":0.5,"AntiAliasing":false,"CollisionX":0.0,"CollisionY":0.0,"CollisionIndex":0.0,"IsHit":false,"CollisionDirection":"left"},{"name":"Tween","type":"Tween::TweenBehavior"}],"animations":[{"name":"","useMultipleDirections":false,"directions":[{"looping":true,"timeBetweenFrames":0.0164,"sprites":[{"hasCustomCollisionMask":false,"image":"nebula_1.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_2.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_3.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_4.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_5.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_6.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_7.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_8.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_9.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_10.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_11.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_12.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_13.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_14.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_15.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_16.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_18.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_19.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_20.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_21.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_22.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_23.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_24.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_25.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_26.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_27.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_28.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_29.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_30.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_31.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_32.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_33.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_34.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_35.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_36.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_37.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_38.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_39.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_40.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_41.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_42.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_43.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_44.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_45.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_46.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_47.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_48.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_49.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_50.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_51.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_52.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_53.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_54.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_55.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_56.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_57.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_58.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_59.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_60.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"nebula_61.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]}]},{"assetStoreId":"","height":32.0,"name":"portal","tags":"","texture":"red","type":"TiledSpriteObject::TiledSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"PhysicsEngine3DGLTFModel","type":"Physics3dExtension::PhysicsEngine3DGLTFModel","FileName":"portal.glb","MakeStatic":false,"Mass":1.0}]},{"assetStoreId":"","height":32.0,"name":"portal2","tags":"","texture":"red","type":"TiledSpriteObject::TiledSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"PhysicsEngine3DGLTFModel","type":"Physics3dExtension::PhysicsEngine3DGLTFModel","FileName":"portal.glb","MakeStatic":false,"Mass":1.0}]},{"assetStoreId":"","height":32.0,"name":"clock","tags":"","texture":"red","type":"TiledSpriteObject::TiledSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"PhysicsEngine3DGLTFModel","type":"Physics3dExtension::PhysicsEngine3DGLTFModel","FileName":"clock.glb","MakeStatic":false,"Mass":1.0}]},{"assetStoreId":"","name":"clockImage","tags":"","type":"Sprite","updateIfNotVisible":false,"variables":[],"effects":[{"effectType":"DropShadow","name":"shadow","doubleParameters":{"alpha":1.0,"blur":2.0,"distance":1.0,"padding":0.0,"quality":3.0,"rotation":0.0},"stringParameters":{"color":"0;0;0"},"booleanParameters":{"shadowOnly":false}}],"behaviors":[{"name":"Anchor","type":"AnchorBehavior::AnchorBehavior","bottomEdgeAnchor":2.0,"leftEdgeAnchor":0.0,"relativeToOriginalWindowSize":true,"rightEdgeAnchor":2.0,"topEdgeAnchor":0.0,"useLegacyBottomAndRightAnchors":false}],"animations":[{"name":"","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.08,"sprites":[{"hasCustomCollisionMask":false,"image":"assets\\clockImage.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]}]},{"assetStoreId":"","height":32.0,"name":"sign1","tags":"","texture":"red","type":"TiledSpriteObject::TiledSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"PhysicsEngine3DGLTFModel","type":"Physics3dExtension::PhysicsEngine3DGLTFModel","FileName":"sign1.glb","MakeStatic":false,"Mass":1.0}]},{"assetStoreId":"","height":32.0,"name":"sign2","tags":"","texture":"red","type":"TiledSpriteObject::TiledSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"PhysicsEngine3DGLTFModel","type":"Physics3dExtension::PhysicsEngine3DGLTFModel","FileName":"sign2.glb","MakeStatic":false,"Mass":1.0}]},{"assetStoreId":"","height":32.0,"name":"sign3","tags":"","texture":"red","type":"TiledSpriteObject::TiledSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"PhysicsEngine3DGLTFModel","type":"Physics3dExtension::PhysicsEngine3DGLTFModel","FileName":"sign3.glb","MakeStatic":false,"Mass":1.0}]},{"assetStoreId":"","height":32.0,"name":"sign4","tags":"","texture":"red","type":"TiledSpriteObject::TiledSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"PhysicsEngine3DGLTFModel","type":"Physics3dExtension::PhysicsEngine3DGLTFModel","FileName":"sign4.glb","MakeStatic":false,"Mass":1.0}]},{"assetStoreId":"","height":32.0,"name":"sign5","tags":"","texture":"red","type":"TiledSpriteObject::TiledSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"PhysicsEngine3DGLTFModel","type":"Physics3dExtension::PhysicsEngine3DGLTFModel","FileName":"sign5.glb","MakeStatic":false,"Mass":1.0}]},{"assetStoreId":"","height":32.0,"name":"sign6","tags":"","texture":"red","type":"TiledSpriteObject::TiledSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"PhysicsEngine3DGLTFModel","type":"Physics3dExtension::PhysicsEngine3DGLTFModel","FileName":"sign6.glb","MakeStatic":false,"Mass":1.0}]},{"assetStoreId":"","height":32.0,"name":"sign78","tags":"","texture":"red","type":"TiledSpriteObject::TiledSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"PhysicsEngine3DGLTFModel","type":"Physics3dExtension::PhysicsEngine3DGLTFModel","FileName":"sign1.glb","MakeStatic":false,"Mass":1.0}]},{"assetStoreId":"13cd7e810ccf090c3a8b9df66aa427613de5271d59507471a06f9ddbbccbcbf4","height":128.0,"name":"DarkPurpleSpace","tags":"","texture":"tiled_dark purple space.png","type":"TiledSpriteObject::TiledSprite","width":128.0,"variables":[],"effects":[],"behaviors":[{"name":"Anchor","type":"AnchorBehavior::AnchorBehavior","bottomEdgeAnchor":2.0,"leftEdgeAnchor":1.0,"relativeToOriginalWindowSize":true,"rightEdgeAnchor":2.0,"topEdgeAnchor":1.0,"useLegacyBottomAndRightAnchors":false}]},{"assetStoreId":"","bold":false,"italic":false,"name":"tl","smoothed":true,"tags":"","type":"TextObject::Text","underlined":false,"variables":[],"effects":[],"behaviors":[],"string":"Timelines","font":"assets\\fonts\\CantoraOne-Regular.ttf","textAlignment":"center","characterSize":100.0,"color":{"b":255,"g":255,"r":255}},{"assetStoreId":"","bold":false,"italic":false,"name":"y1","smoothed":true,"tags":"","type":"TextObject::Text","underlined":false,"variables":[],"effects":[],"behaviors":[{"name":"Anchor","type":"AnchorBehavior::AnchorBehavior","bottomEdgeAnchor":2.0,"leftEdgeAnchor":1.0,"relativeToOriginalWindowSize":true,"rightEdgeAnchor":0.0,"topEdgeAnchor":1.0,"useLegacyBottomAndRightAnchors":false}],"string":"Year1","font":"assets\\fonts\\PTSans-Bold.ttf","textAlignment":"center","characterSize":80.0,"color":{"b":255,"g":255,"r":255}},{"assetStoreId":"","bold":false,"italic":false,"name":"y2","smoothed":true,"tags":"","type":"TextObject::Text","underlined":false,"variables":[],"effects":[],"behaviors":[{"name":"Anchor","type":"AnchorBehavior::AnchorBehavior","bottomEdgeAnchor":0.0,"leftEdgeAnchor":0.0,"rightEdgeAnchor":0.0,"topEdgeAnchor":0.0,"relativeToOriginalWindowSize":true,"useLegacyBottomAndRightAnchors":false}],"string":"Year2","font":"assets\\fonts\\PTSans-Bold.ttf","textAlignment":"center","characterSize":80.0,"color":{"b":255,"g":255,"r":255}},{"assetStoreId":"","bold":false,"italic":false,"name":"y3","smoothed":true,"tags":"","type":"TextObject::Text","underlined":false,"variables":[],"effects":[],"behaviors":[{"name":"Anchor","type":"AnchorBehavior::AnchorBehavior","rightEdgeAnchor":2.0,"bottomEdgeAnchor":2.0,"leftEdgeAnchor":1.0,"relativeToOriginalWindowSize":true,"topEdgeAnchor":1.0,"useLegacyBottomAndRightAnchors":false}],"string":"Year3","font":"assets\\fonts\\PTSans-Bold.ttf","textAlignment":"center","characterSize":80.0,"color":{"b":255,"g":255,"r":255}},{"assetStoreId":"","height":32.0,"name":"finish","tags":"","texture":"assets\\GreyboxTextures\\greybox_lime_grid.png2","type":"TiledSpriteObject::TiledSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"BoxProjectionFromTiled","type":"WithThreeJS::BoxProjectionFromTiled","Id":"","FirstFrame":true,"ProjectionScale":0.01,"ViewMode":"Top Down","Hide":true,"AlphaTest":0.0,"AntiAliasing":true,"Depth":15.0,"IsCube":false,"TBTextureId":"","LRTextureId":"","FRTextureId":"","TBOffsetV":0.0,"LROffsetV":0.0,"FROffsetV":0.0,"Blend":"Normal"}]}],"events":[],"layers":[{"ambientLightColorB":0,"ambientLightColorG":8042920,"ambientLightColorR":16,"camera3DFarPlaneDistance":10000.0,"camera3DFieldOfView":45.0,"camera3DNearPlaneDistance":0.1,"followBaseLayerCamera":false,"isLightingLayer":false,"isLocked":false,"name":"","renderingType":"","visibility":true,"cameras":[{"defaultSize":true,"defaultViewport":true,"height":0.0,"viewportBottom":1.0,"viewportLeft":0.0,"viewportRight":1.0,"viewportTop":0.0,"width":0.0}],"effects":[]},{"ambientLightColorB":19974592,"ambientLightColorG":15770736,"ambientLightColorR":-2147483616,"camera3DFarPlaneDistance":10000.0,"camera3DFieldOfView":45.0,"camera3DNearPlaneDistance":0.1,"followBaseLayerCamera":false,"isLightingLayer":false,"isLocked":false,"name":"UI","renderingType":"","visibility":true,"cameras":[],"effects":[]},{"ambientLightColorB":18773,"ambientLightColorG":83886080,"ambientLightColorR":114,"camera3DFarPlaneDistance":10000.0,"camera3DFieldOfView":45.0,"camera3DNearPlaneDistance":0.1,"followBaseLayerCamera":false,"isLightingLayer":false,"isLocked":false,"name":"Mobile","renderingType":"","visibility":true,"cameras":[],"effects":[]},{"ambientLightColorB":24829400,"ambientLightColorG":29721192,"ambientLightColorR":6071712,"camera3DFarPlaneDistance":10000.0,"camera3DFieldOfView":45.0,"camera3DNearPlaneDistance":0.1,"followBaseLayerCamera":false,"isLightingLayer":false,"isLocked":false,"name":"Timeline","renderingType":"","visibility":true,"cameras":[],"effects":[]}],"behaviorsSharedData":[{"name":"Anchor","type":"AnchorBehavior::AnchorBehavior"},{"name":"BoardProjection","type":"WithThreeJS::BoardProjection"},{"name":"BoxProjectionFromTiled","type":"WithThreeJS::BoxProjectionFromTiled"},{"name":"FireBullet","type":"FireBullet::FireBullet"},{"name":"Health","type":"Health::Health"},{"name":"LinkedCamera","type":"WithThreeJS::LinkedCamera"},{"name":"LinkedCameraWithHeadMovement","type":"WithThreeJS::LinkedCameraWithHeadMovement"},{"name":"Pathfinding","type":"PathfindingBehavior::PathfindingBehavior"},{"name":"PhysicsEngine3DGLTFModel","type":"Physics3dExtension::PhysicsEngine3DGLTFModel","Gravity":0.0},{"name":"PlaneProjectionFromTiled","type":"WithThreeJS::PlaneProjectionFromTiled"},{"name":"ShakeObject_PositionAngle","type":"ShakeObject::ShakeObject_PositionAngle"},{"name":"SpriteProjection","type":"WithThreeJS::SpriteProjection"},{"name":"Tween","type":"Tween::TweenBehavior"},{"name":"TweenZOrder","type":"TweenZOrder::TweenZOrder"}]},{"b":209,"disableInputWhenNotFocused":true,"mangledName":"lose","name":"lose","r":209,"standardSortMethod":true,"stopSoundsOnStartup":false,"title":"","v":209,"uiSettings":{"grid":false,"gridType":"rectangular","gridWidth":32.0,"gridHeight":32.0,"gridOffsetX":0.0,"gridOffsetY":0.0,"gridColor":10401023.0,"gridAlpha":0.8,"snap":false,"zoomFactor":0.33432439075170308,"windowMask":true},"objectsGroups":[],"variables":[{"folded":true,"name":"floater","type":"boolean","value":false}],"instances":[{"angle":0.0,"customSize":false,"height":0.0,"layer":"","name":"cam","persistentUuid":"336cad89-3c00-468e-b48e-33b3e9bcdd7c","width":0.0,"x":916.0,"y":490.0,"zOrder":300,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":2188.0,"layer":"","locked":true,"name":"ground","persistentUuid":"2bfd55b9-bdad-4075-8d93-6cd6354e1868","sealed":true,"width":3164.0,"x":-587.0,"y":-512.0,"zOrder":0,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"UI","name":"credit","persistentUuid":"5245df24-c385-4af7-96b3-eb825d8d7c10","width":0.0,"x":13.0,"y":918.0,"zOrder":301,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"UI","name":"go","persistentUuid":"cf584c49-1017-40fe-9562-3967e8b8c9be","width":0.0,"x":523.0,"y":440.0,"zOrder":302,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"UI","name":"menu","persistentUuid":"1c3796ce-75ce-4da8-b08e-7aab6945bd6c","width":0.0,"x":828.0,"y":556.0,"zOrder":304,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":868.0,"layer":"UI","name":"title","persistentUuid":"aa9a2d7f-9242-4fa8-8a18-1ff0e6ea1073","width":868.0,"x":519.0,"y":-212.0,"zOrder":312,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"UI","name":"nb","persistentUuid":"4ced680e-36d6-4090-aa93-41406e78a156","width":0.0,"x":26.0,"y":26.0,"zOrder":317,"numberProperties":[],"stringProperties":[],"initialVariables":[]}],"objects":[{"assetStoreId":"","name":"cam","tags":"","type":"Sprite","updateIfNotVisible":false,"variables":[],"effects":[],"behaviors":[{"name":"LinkedCamera","type":"WithThreeJS::LinkedCamera","ProjectionScale":0.01,"LinkAngle":false,"ViewMode":"Top Down","Hide":true},{"name":"PathfindingObstacle","type":"PathfindingBehavior::PathfindingObstacleBehavior","cost":2.0,"impassable":true},{"name":"Tween","type":"Tween::TweenBehavior"},{"name":"TweenZOrder","type":"TweenZOrder::TweenZOrder","Tween":"Tween"}],"animations":[{"name":"","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.08,"sprites":[{"hasCustomCollisionMask":false,"image":"assets\\red.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]}]},{"assetStoreId":"","height":32.0,"name":"ground","tags":"","texture":"assets\\GreyboxTextures\\greybox_dark_grid.png","type":"TiledSpriteObject::TiledSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"PlaneProjectionFromTiled","type":"WithThreeJS::PlaneProjectionFromTiled","Id":"","FirstFrame":true,"ProjectionScale":0.01,"ViewMode":"Top Down","Hide":true,"AlphaTest":0.0,"AntiAliasing":true,"Blend":"Normal","Rotate90":false,"Depth":0.0,"TextureId":"","OffsetV":0.0}]},{"assetStoreId":"","bold":false,"italic":false,"name":"credit","smoothed":true,"tags":"","type":"TextObject::Text","underlined":false,"variables":[],"effects":[],"behaviors":[],"string":"Created by ItsIceCreeperPE Dev for GDevelop's First 3D Game Jam!\nVersion ","font":"assets\\fonts\\PTSans-Bold.ttf","textAlignment":"left","characterSize":50.0,"color":{"b":255,"g":255,"r":255}},{"assetStoreId":"","bold":false,"italic":false,"name":"go","smoothed":true,"tags":"","type":"TextObject::Text","underlined":false,"variables":[],"effects":[],"behaviors":[],"string":"GAME OVER!1!11!!!!","font":"assets\\fonts\\PTSans-Bold.ttf","textAlignment":"left","characterSize":100.0,"color":{"b":27,"g":2,"r":208}},{"assetStoreId":"","bold":false,"italic":false,"name":"menu","smoothed":true,"tags":"","type":"TextObject::Text","underlined":false,"variables":[],"effects":[],"behaviors":[],"string":"Menu","font":"assets\\fonts\\PTSans-Bold.ttf","textAlignment":"left","characterSize":100.0,"color":{"b":255,"g":255,"r":255}},{"assetStoreId":"","name":"title","tags":"","type":"Sprite","updateIfNotVisible":false,"variables":[],"effects":[],"behaviors":[],"animations":[{"name":"","useMultipleDirections":false,"directions":[{"looping":true,"timeBetweenFrames":0.0333,"sprites":[{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle1.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle2.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle3.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle4.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle5.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle6.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle7.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle8.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle9.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle10.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle11.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle12.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle13.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle14.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle15.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle16.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]},{"hasCustomCollisionMask":false,"image":"assets\\ui\\title\\ztitle17.png","points":[],"originPoint":{"name":"origine","x":0.0,"y":0.0},"centerPoint":{"automatic":true,"name":"centre","x":0.0,"y":0.0},"customCollisionMask":[]}]}]}]},{"assetStoreId":"","bold":false,"italic":false,"name":"nb","smoothed":true,"tags":"","type":"TextObject::Text","underlined":false,"variables":[],"effects":[],"behaviors":[],"string":"Note: This game is very much broken and i spent 10 days on it for GDevelop's First 3D Game Jam ;-;\nThis game doesn't really work on mobile yet and im currently struggling to make tons of things, \nespecially the game's main feature(Timeline Travel). Please share feedback and maybe share the game with friends :))","font":"assets\\fonts\\PTSans-Bold.ttf","textAlignment":"left","characterSize":30.0,"color":{"b":255,"g":255,"r":255}}],"events":[],"layers":[{"ambientLightColorB":0,"ambientLightColorG":2,"ambientLightColorR":134217728,"camera3DFarPlaneDistance":10000.0,"camera3DFieldOfView":45.0,"camera3DNearPlaneDistance":0.1,"followBaseLayerCamera":false,"isLightingLayer":false,"isLocked":false,"name":"","renderingType":"","visibility":true,"cameras":[{"defaultSize":true,"defaultViewport":true,"height":0.0,"viewportBottom":1.0,"viewportLeft":0.0,"viewportRight":1.0,"viewportTop":0.0,"width":0.0}],"effects":[]},{"ambientLightColorB":1651340654,"ambientLightColorG":13881208,"ambientLightColorR":16777216,"camera3DFarPlaneDistance":10000.0,"camera3DFieldOfView":45.0,"camera3DNearPlaneDistance":0.1,"followBaseLayerCamera":false,"isLightingLayer":false,"isLocked":false,"name":"UI","renderingType":"","visibility":true,"cameras":[],"effects":[]}],"behaviorsSharedData":[{"name":"LinkedCamera","type":"WithThreeJS::LinkedCamera"},{"name":"PathfindingObstacle","type":"PathfindingBehavior::PathfindingObstacleBehavior"},{"name":"PlaneProjectionFromTiled","type":"WithThreeJS::PlaneProjectionFromTiled"},{"name":"Tween","type":"Tween::TweenBehavior"},{"name":"TweenZOrder","type":"TweenZOrder::TweenZOrder"}]}],"externalEvents":[],"eventsFunctionsExtensions":[{"author":"","category":"User interface","extensionNamespace":"","fullName":"Panel sprite button","helpPath":"/objects/button","iconUrl":"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTI5LDIzSDNjLTEuMSwwLTItMC45LTItMlYxMWMwLTEuMSwwLjktMiwyLTJoMjZjMS4xLDAsMiwwLjksMiwydjEwQzMxLDIyLjEsMzAuMSwyMywyOSwyM3oiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMywxOUwxMywxOWMtMS4xLDAtMi0wLjktMi0ydi0yYzAtMS4xLDAuOS0yLDItMmgwYzEuMSwwLDIsMC45LDIsMnYyQzE1LDE4LjEsMTQuMSwxOSwxMywxOXoiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIxOCIgeTE9IjEzIiB4Mj0iMTgiIHkyPSIxOSIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjIxIiB5MT0iMTMiIHgyPSIxOCIgeTI9IjE3Ii8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iMjEiIHkxPSIxOSIgeDI9IjE5IiB5Mj0iMTYiLz4NCjwvc3ZnPg0K","name":"PanelSpriteButton","previewIconUrl":"https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Interface Elements/Interface Elements_interface_ui_button_ok_cta_clock_tap.svg","shortDescription":"A button that can be customized.","version":"1.4.3","description":["The button can be customized with a background for each state and a label. It handles user interactions and a simple condition can be used to check if it is clicked.","","There are ready-to-use buttons in the asset-store [menu buttons pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=menu-buttons-menu-buttons)."],"tags":["button","ui"],"authorIds":["IWykYNRvhCZBN3vEgKEbBPOR3Oc2"],"dependencies":[],"eventsFunctions":[],"eventsBasedBehaviors":[],"eventsBasedObjects":[{"defaultName":"","description":"","fullName":"","name":"PanelSpriteButton","eventsFunctions":[],"propertyDescriptors":[],"objects":[{"assetStoreId":"","bold":false,"italic":false,"name":"Label","smoothed":true,"tags":"","type":"TextObject::Text","underlined":false,"variables":[],"effects":[],"behaviors":[],"string":"Text","font":"","textAlignment":"","characterSize":20.0,"color":{"b":0,"g":0,"r":0}},{"assetStoreId":"","bottomMargin":0.0,"height":32.0,"leftMargin":0.0,"name":"Idle","rightMargin":0.0,"tags":"","texture":"","tiled":false,"topMargin":0.0,"type":"PanelSpriteObject::PanelSprite","width":32.0,"variables":[{"folded":true,"name":"State","type":"string","value":"Idle"}],"effects":[],"behaviors":[{"name":"ButtonFSM","type":"PanelSpriteButton::ButtonFSM","ShouldCheckHovering":true}]},{"assetStoreId":"","bottomMargin":0.0,"height":32.0,"leftMargin":0.0,"name":"Hovered","rightMargin":0.0,"tags":"","texture":"","tiled":false,"topMargin":0.0,"type":"PanelSpriteObject::PanelSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"Tween","type":"Tween::TweenBehavior"}]},{"assetStoreId":"","bottomMargin":0.0,"height":32.0,"leftMargin":0.0,"name":"Pressed","rightMargin":0.0,"tags":"","texture":"","tiled":false,"topMargin":0.0,"type":"PanelSpriteObject::PanelSprite","width":32.0,"variables":[],"effects":[],"behaviors":[]}]}]},{"author":"","category":"User interface","extensionNamespace":"","fullName":"Toggle switch","helpPath":"/objects/toggle-switch","iconUrl":"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTIzLDIzSDljLTMuOSwwLTctMy4xLTctN3YwYzAtMy45LDMuMS03LDctN2gxNGMzLjksMCw3LDMuMSw3LDd2MEMzMCwxOS45LDI2LjksMjMsMjMsMjN6Ii8+DQo8Y2lyY2xlIGNsYXNzPSJzdDAiIGN4PSI5IiBjeT0iMTYiIHI9IjQiLz4NCjwvc3ZnPg0K","name":"SpriteToggleSwitch","previewIconUrl":"https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/Interface Elements/8d0cd8cd0c9318f4f6efde6ee6b4c192bd19306467f80c9970387a259300f895_Interface Elements_interface_ui_toggle_switch_on_off.svg","shortDescription":"Toggle switch that users can click or touch.","version":"1.3.0","description":["Toggle switch that users can click or touch. The switch can be customized with sprites.","","There are ready-to-use toggle switches in the asset-store [settings UI pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=settings-ui-settings-ui)."],"tags":["ui","widget","toggle","switch","check box"],"authorIds":["IWykYNRvhCZBN3vEgKEbBPOR3Oc2","gqDaZjCfevOOxBYkK6zlhtZnXCg1"],"dependencies":[],"eventsFunctions":[],"eventsBasedBehaviors":[],"eventsBasedObjects":[{"defaultName":"","description":"","fullName":"","name":"SpriteToggleSwitch","eventsFunctions":[],"propertyDescriptors":[],"objects":[{"assetStoreId":"","name":"State","tags":"","type":"Sprite","updateIfNotVisible":false,"variables":[],"effects":[],"behaviors":[{"name":"ButtonFSM","type":"SpriteToggleSwitch::ButtonFSM","ShouldCheckHovering":true,"State":"Idle","TouchId":0.0,"TouchIsInside":false,"MouseIsInside":false,"Index":0.0},{"name":"SwitchFSM","type":"SpriteToggleSwitch::SwitchFSM","ButtonFSM":"ButtonFSM","IsChecked":false,"WasChecked":false}],"animations":[{"name":"Unchecked","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.08,"sprites":[]}]},{"name":"Checked","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.08,"sprites":[]}]}]}]}]},{"author":"","category":"User interface","extensionNamespace":"","fullName":"Slider","helpPath":"/objects/slider","iconUrl":"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPGNpcmNsZSBjbGFzcz0ic3QwIiBjeD0iMjMiIGN5PSI3IiByPSIzIi8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iMyIgeTE9IjciIHgyPSIyMCIgeTI9IjciLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIyOSIgeTE9IjciIHgyPSIyNiIgeTI9IjciLz4NCjxjaXJjbGUgY2xhc3M9InN0MCIgY3g9IjEyIiBjeT0iMTYiIHI9IjMiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIzIiB5MT0iMTYiIHgyPSI5IiB5Mj0iMTYiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIyOSIgeTE9IjE2IiB4Mj0iMTUiIHkyPSIxNiIvPg0KPGNpcmNsZSBjbGFzcz0ic3QwIiBjeD0iMjMiIGN5PSIyNSIgcj0iMyIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjMiIHkxPSIyNSIgeDI9IjIwIiB5Mj0iMjUiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIyOSIgeTE9IjI1IiB4Mj0iMjYiIHkyPSIyNSIvPg0KPC9zdmc+DQo=","name":"PanelSpriteSlider","previewIconUrl":"https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/UI Essentials/1678c39a3b2bd3df4f82a8a293770db4986a6bcfd3f78e738ddfc86e39176423_UI Essentials_sliders_options.svg","shortDescription":"A draggable slider that users can move to select a numerical value.","version":"1.4.2","description":["A draggable slider that users can move to select a numerical value. The slider can be customized with sprites.","","There are ready-to-use sliders in the asset-store [settings UI pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=settings-ui-settings-ui)."],"tags":["draggable","slider","ui","widget"],"authorIds":["IWykYNRvhCZBN3vEgKEbBPOR3Oc2","gqDaZjCfevOOxBYkK6zlhtZnXCg1"],"dependencies":[],"eventsFunctions":[],"eventsBasedBehaviors":[],"eventsBasedObjects":[{"defaultName":"","description":"","fullName":"","name":"PanelSpriteSlider","eventsFunctions":[],"propertyDescriptors":[],"objects":[{"assetStoreId":"","bold":false,"italic":false,"name":"Label","smoothed":true,"tags":"","type":"TextObject::Text","underlined":false,"variables":[],"effects":[],"behaviors":[],"string":"It displays the value when it changes.","font":"","textAlignment":"","characterSize":20.0,"color":{"b":0,"g":0,"r":0}},{"assetStoreId":"","bottomMargin":0.0,"height":32.0,"leftMargin":0.0,"name":"Thumb","rightMargin":0.0,"tags":"","texture":"","tiled":false,"topMargin":0.0,"type":"PanelSpriteObject::PanelSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"Draggable","type":"DraggableBehavior::Draggable","checkCollisionMask":false}]},{"assetStoreId":"","bottomMargin":0.0,"height":32.0,"leftMargin":0.0,"name":"FillBar","rightMargin":0.0,"tags":"","texture":"","tiled":true,"topMargin":0.0,"type":"PanelSpriteObject::PanelSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"Slider","type":"PanelSpriteSlider::Slider","Value":0.0,"MinValue":0.0,"MaxValue":1.0,"StepSize":1.0}]},{"assetStoreId":"","bottomMargin":0.0,"height":32.0,"leftMargin":0.0,"name":"Background","rightMargin":0.0,"tags":"","texture":"","tiled":true,"topMargin":0.0,"type":"PanelSpriteObject::PanelSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"ButtonFSM","type":"PanelSpriteSlider::ButtonFSM","ShouldCheckHovering":true,"State":"Idle","TouchId":0.0,"TouchIsInside":false,"MouseIsInside":false,"Index":0.0}]}]}]},{"author":"","category":"User interface","extensionNamespace":"","fullName":"Resource bar (continuous)","helpPath":"/objects/resource-bar","iconUrl":"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8cGF0aCBkPSJNMjgsMTJIMTRINGMtMi4yLDAtNCwxLjgtNCw0czEuOCw0LDQsNGgxMGgxNGMyLjIsMCw0LTEuOCw0LTRTMzAuMiwxMiwyOCwxMnogTTQsMThjLTEuMSwwLTItMC45LTItMnMwLjktMiwyLTJoMTANCgljMS4xLDAsMiwwLjksMiwycy0wLjksMi0yLDJINHoiLz4NCjwvc3ZnPg0K","name":"PanelSpriteContinuousBar","previewIconUrl":"https://asset-resources.gdevelop.io/public-resources/Icons/Glyphster Pack/Master/SVG/Interface Elements/ea06363a57846caab544f536b78a952234b68d4941d41c1577852a1d61aefec3_Interface Elements_interface_ui_loading_progress_bar.svg","shortDescription":"A bar that represents a resource in the game (health, mana, ammo, etc).","version":"1.1.1","description":["A bar that represents a resource in the game (health, mana, ammo, etc).","","There are ready-to-use resource bars in the asset-store [resource bars pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=resource-bars-resource-bars)."],"tags":["resource","bar","health","mana","shield","hearts","lives","ammo"],"authorIds":["IWykYNRvhCZBN3vEgKEbBPOR3Oc2","gqDaZjCfevOOxBYkK6zlhtZnXCg1","q8ubdigLvIRXLxsJDDTaokO41mc2"],"dependencies":[],"eventsFunctions":[],"eventsBasedBehaviors":[],"eventsBasedObjects":[{"defaultName":"","description":"","fullName":"","name":"PanelSpriteContinuousBar","eventsFunctions":[],"propertyDescriptors":[],"objects":[{"assetStoreId":"","bold":false,"italic":false,"name":"Label","smoothed":true,"tags":"","type":"TextObject::Text","underlined":false,"variables":[],"effects":[],"behaviors":[],"string":"2 / 3","font":"","textAlignment":"center","characterSize":20.0,"color":{"b":0,"g":0,"r":0}},{"assetStoreId":"","bottomMargin":0.0,"height":32.0,"leftMargin":0.0,"name":"FillBar","rightMargin":0.0,"tags":"","texture":"","tiled":true,"topMargin":0.0,"type":"PanelSpriteObject::PanelSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"ResourceBar","type":"PanelSpriteContinuousBar::ResourceBar","Value":1.0,"MaxValue":3.0,"PreviousValue":0.0},{"name":"Tween","type":"Tween::TweenBehavior"}]},{"assetStoreId":"","bottomMargin":0.0,"height":32.0,"leftMargin":0.0,"name":"Buffer","rightMargin":0.0,"tags":"","texture":"","tiled":true,"topMargin":0.0,"type":"PanelSpriteObject::PanelSprite","width":32.0,"variables":[],"effects":[],"behaviors":[{"name":"Tween","type":"Tween::TweenBehavior"}]},{"assetStoreId":"","bottomMargin":0.0,"height":32.0,"leftMargin":0.0,"name":"Background","rightMargin":0.0,"tags":"","texture":"","tiled":true,"topMargin":0.0,"type":"PanelSpriteObject::PanelSprite","width":32.0,"variables":[],"effects":[],"behaviors":[]}]}]},{"author":"","category":"Input","extensionNamespace":"","fullName":"Multitouch joystick and buttons (sprite)","helpPath":"/objects/multitouch-joystick","iconUrl":"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPGNpcmNsZSBjbGFzcz0ic3QwIiBjeD0iMTYiIGN5PSIxNiIgcj0iMTMiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjI4LjQsMTIgMjAsMTIgMjAsMy42ICIvPg0KPHBvbHlsaW5lIGNsYXNzPSJzdDAiIHBvaW50cz0iMjAsMjguNCAyMCwyMCAyOC40LDIwICIvPg0KPHBvbHlsaW5lIGNsYXNzPSJzdDAiIHBvaW50cz0iMy42LDIwIDEyLDIwIDEyLDI4LjQgIi8+DQo8cG9seWxpbmUgY2xhc3M9InN0MCIgcG9pbnRzPSIxMiwzLjYgMTIsMTIgMy42LDEyICIvPg0KPHBvbHlnb24gY2xhc3M9InN0MCIgcG9pbnRzPSIxNiw2IDE2LjcsNyAxNS4zLDcgIi8+DQo8cG9seWdvbiBjbGFzcz0ic3QwIiBwb2ludHM9IjE2LDI2IDE1LjMsMjUgMTYuNywyNSAiLz4NCjxwb2x5Z29uIGNsYXNzPSJzdDAiIHBvaW50cz0iNiwxNiA3LDE1LjMgNywxNi43ICIvPg0KPHBvbHlnb24gY2xhc3M9InN0MCIgcG9pbnRzPSIyNiwxNiAyNSwxNi43IDI1LDE1LjMgIi8+DQo8L3N2Zz4NCg==","name":"SpriteMultitouchJoystick","previewIconUrl":"https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Videogames/Videogames_controller_joystick_arrows_direction.svg","shortDescription":"Joysticks or buttons for touchscreens.","version":"1.2.0","description":["Multitouch joysticks can be used the same way as physical gamepads:","- 4 or 8 directions","- Analogus pads","- Player selection","- Controls mapping for top-down movement and platformer characters","","There are ready-to-use joysticks in the asset-store [multitouch joysticks pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=multitouch-joysticks-multitouch-joysticks)."],"tags":["multitouch","joystick","thumbstick","controller","touchscreen","twin stick","shooter","virtual"],"authorIds":["gqDaZjCfevOOxBYkK6zlhtZnXCg1","1OgYzWp5UeVPbiWGJwI6vqfgZLC3","v0YRpdAnIucZFgiRCCecqVnGKno2","IWykYNRvhCZBN3vEgKEbBPOR3Oc2"],"dependencies":[],"eventsFunctions":[{"description":"Check if a button is pressed on a gamepad.","fullName":"Multitouch controller button pressed","functionType":"Condition","name":"IsButtonPressed","sentence":"Button _PARAM2_ of multitouch controller _PARAM1_ is pressed","events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarSceneTxt"},"parameters":["__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State","=","\"Pressed\""]}],"actions":[{"type":{"value":"SetReturnBoolean"},"parameters":["True"]}]}],"parameters":[{"description":"Multitouch controller identifier (1, 2, 3, 4...)","name":"ControllerIdentifier","type":"expression"},{"description":"Button name","name":"Button","supplementaryInformation":"[\"A\",\"CROSS\",\"B\",\"CIRCLE\",\"X\",\"SQUARE\",\"Y\",\"TRIANGLE\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"UP\",\"DOWN\",\"LEFT\",\"RIGHT\",\"BACK\",\"SHARE\",\"START\",\"OPTIONS\",\"CLICK_STICK_LEFT\",\"CLICK_STICK_RIGHT\",\"PS_BUTTON\",\"CLICK_TOUCHPAD\"]","type":"string"}],"objectGroups":[]},{"description":"Check if a button is released on a gamepad.","fullName":"Multitouch controller button released","functionType":"Condition","name":"IsButtonReleased","sentence":"Button _PARAM2_ of multitouch controller _PARAM1_ is released","events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"VarSceneTxt"},"parameters":["__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State","=","\"Released\""]}],"actions":[{"type":{"value":"SetReturnBoolean"},"parameters":["True"]}]}],"parameters":[{"description":"Multitouch controller identifier (1, 2, 3, 4...)","name":"ControllerIdentifier","type":"expression"},{"description":"Button name","name":"Button","supplementaryInformation":"[\"A\",\"CROSS\",\"B\",\"CIRCLE\",\"X\",\"SQUARE\",\"Y\",\"TRIANGLE\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"UP\",\"DOWN\",\"LEFT\",\"RIGHT\",\"BACK\",\"SHARE\",\"START\",\"OPTIONS\",\"CLICK_STICK_LEFT\",\"CLICK_STICK_RIGHT\",\"PS_BUTTON\",\"CLICK_TOUCHPAD\"]","type":"string"}],"objectGroups":[]},{"description":"Change a button state for a multitouch controller.","fullName":"Button state","functionType":"Action","name":"SetButtonState","private":true,"sentence":"Mark _PARAM2_ button as _PARAM3_ for multitouch controller _PARAM1_","events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarSceneTxt"},"parameters":["__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State","=","GetArgumentAsString(\"ButtonState\")"]}]}],"parameters":[{"description":"Multitouch controller identifier (1, 2, 3, 4...)","name":"ControllerIdentifier","type":"expression"},{"description":"Button name","name":"Button","type":"string"},{"description":"Button state","name":"ButtonState","supplementaryInformation":"[\"Idle\",\"Pressed\",\"Released\"]","type":"stringWithSelector"}],"objectGroups":[]},{"description":"Change the dead zone radius of a joystick. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).","fullName":"Dead zone radius","functionType":"Action","name":"SetDeadZone","private":true,"sentence":"Change the dead zone of multitouch joystick _PARAM2_ of multitouch controller _PARAM1_ to _PARAM3_","events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarScene"},"parameters":["__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].DeadZone","=","GetArgumentAsNumber(\"DeadZoneRadius\")"]}]}],"parameters":[{"description":"Multitouch controller identifier (1, 2, 3, 4...)","name":"ControllerIdentifier","type":"expression"},{"description":"Joystick name","name":"JoystickIdentifier","type":"string"},{"description":"Dead zone radius","name":"DeadZoneRadius","supplementaryInformation":"[]","type":"expression"}],"objectGroups":[]},{"description":"Return the dead zone radius of a joystick. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).","fullName":"Dead zone radius","functionType":"Expression","name":"DeadZone","private":true,"sentence":"Change multitouch joystick _PARAM2_ of multitouch controller _PARAM1_ dead zone to _PARAM3_","events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"SetReturnNumber"},"parameters":["Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].DeadZone)"]}]}],"expressionType":{"type":"expression"},"parameters":[{"description":"Multitouch controller identifier (1, 2, 3, 4...)","name":"ControllerIdentifier","type":"expression"},{"description":"Joystick name","name":"JoystickIdentifier","type":"string"}],"objectGroups":[]},{"description":"the direction index (left = 1, bottom = 1, right = 2, top = 3) for an angle (in degrees).","fullName":"Angle to 4-way index","functionType":"ExpressionAndCondition","name":"AngleTo4Way","private":true,"sentence":"The angle _PARAM1_ 4-way index","events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"SetReturnNumber"},"parameters":["mod(round(GetArgumentAsNumber(\"Angle\") * 4 / 360), 4)"]}]}],"expressionType":{"type":"expression"},"parameters":[{"description":"Angle","name":"Angle","type":"expression"}],"objectGroups":[]},{"description":"the direction index (left = 1, bottom-left = 1... top-left = 7) for an angle (in degrees).","fullName":"Angle to 8-way index","functionType":"ExpressionAndCondition","name":"AngleTo8Way","private":true,"sentence":"The angle _PARAM1_ 8-way index","events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"SetReturnNumber"},"parameters":["mod(round(GetArgumentAsNumber(\"Angle\") * 8 / 360), 8)"]}]}],"expressionType":{"type":"expression"},"parameters":[{"description":"Angle","name":"Angle","type":"expression"}],"objectGroups":[]},{"description":"Check if angle is in a given direction.","fullName":"Angle 4-way direction","functionType":"Condition","name":"IsAngleIn4WayDirection","private":true,"sentence":"The angle _PARAM1_ is the 4-way direction _PARAM2_","events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["GetArgumentAsString(\"Direction\")","=","\"Right\""]},{"type":{"value":"SpriteMultitouchJoystick::AngleTo4Way"},"parameters":["","=","0","GetArgumentAsNumber(\"Angle\")",""]}],"actions":[{"type":{"value":"SetReturnBoolean"},"parameters":["True"]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["GetArgumentAsString(\"Direction\")","=","\"Down\""]},{"type":{"value":"SpriteMultitouchJoystick::AngleTo4Way"},"parameters":["","=","1","GetArgumentAsNumber(\"Angle\")",""]}],"actions":[{"type":{"value":"SetReturnBoolean"},"parameters":["True"]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["GetArgumentAsString(\"Direction\")","=","\"Left\""]},{"type":{"value":"SpriteMultitouchJoystick::AngleTo4Way"},"parameters":["","=","2","GetArgumentAsNumber(\"Angle\")",""]}],"actions":[{"type":{"value":"SetReturnBoolean"},"parameters":["True"]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["GetArgumentAsString(\"Direction\")","=","\"Up\""]},{"type":{"value":"SpriteMultitouchJoystick::AngleTo4Way"},"parameters":["","=","3","GetArgumentAsNumber(\"Angle\")",""]}],"actions":[{"type":{"value":"SetReturnBoolean"},"parameters":["True"]}]}],"parameters":[{"description":"Angle","name":"Angle","type":"expression"},{"description":"Direction","name":"Direction","supplementaryInformation":"[\"Up\",\"Down\",\"Left\",\"Right\"]","type":"stringWithSelector"}],"objectGroups":[]},{"description":"Check if angle is in a given direction.","fullName":"Angle 8-way direction","functionType":"Condition","name":"IsAngleIn8WayDirection","private":true,"sentence":"The angle _PARAM1_ is the 8-way direction _PARAM2_","events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["GetArgumentAsString(\"Direction\")","=","\"Right\""]},{"type":{"value":"SpriteMultitouchJoystick::AngleTo8Way"},"parameters":["","=","0","GetArgumentAsNumber(\"Angle\")",""]}],"actions":[{"type":{"value":"SetReturnBoolean"},"parameters":["True"]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["GetArgumentAsString(\"Direction\")","=","\"DownRight\""]},{"type":{"value":"SpriteMultitouchJoystick::AngleTo8Way"},"parameters":["","=","1","GetArgumentAsNumber(\"Angle\")",""]}],"actions":[{"type":{"value":"SetReturnBoolean"},"parameters":["True"]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["GetArgumentAsString(\"Direction\")","=","\"Down\""]},{"type":{"value":"SpriteMultitouchJoystick::AngleTo8Way"},"parameters":["","=","2","GetArgumentAsNumber(\"Angle\")",""]}],"actions":[{"type":{"value":"SetReturnBoolean"},"parameters":["True"]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["GetArgumentAsString(\"Direction\")","=","\"DownLeft\""]},{"type":{"value":"SpriteMultitouchJoystick::AngleTo8Way"},"parameters":["","=","3","GetArgumentAsNumber(\"Angle\")",""]}],"actions":[{"type":{"value":"SetReturnBoolean"},"parameters":["True"]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["GetArgumentAsString(\"Direction\")","=","\"Left\""]},{"type":{"value":"SpriteMultitouchJoystick::AngleTo8Way"},"parameters":["","=","4","GetArgumentAsNumber(\"Angle\")",""]}],"actions":[{"type":{"value":"SetReturnBoolean"},"parameters":["True"]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["GetArgumentAsString(\"Direction\")","=","\"UpLeft\""]},{"type":{"value":"SpriteMultitouchJoystick::AngleTo8Way"},"parameters":["","=","5","GetArgumentAsNumber(\"Angle\")",""]}],"actions":[{"type":{"value":"SetReturnBoolean"},"parameters":["True"]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["GetArgumentAsString(\"Direction\")","=","\"Up\""]},{"type":{"value":"SpriteMultitouchJoystick::AngleTo8Way"},"parameters":["","=","6","GetArgumentAsNumber(\"Angle\")",""]}],"actions":[{"type":{"value":"SetReturnBoolean"},"parameters":["True"]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["GetArgumentAsString(\"Direction\")","=","\"UpRight\""]},{"type":{"value":"SpriteMultitouchJoystick::AngleTo8Way"},"parameters":["","=","7","GetArgumentAsNumber(\"Angle\")",""]}],"actions":[{"type":{"value":"SetReturnBoolean"},"parameters":["True"]}]}],"parameters":[{"description":"Angle","name":"Angle","type":"expression"},{"description":"Direction","name":"Direction","supplementaryInformation":"[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]","type":"stringWithSelector"}],"objectGroups":[]},{"description":"Check if joystick is pushed in a given direction.","fullName":"Joystick pushed in a direction (4-way)","functionType":"Condition","name":"IsDirectionPushed4Way","sentence":"Joystick _PARAM2_ of multitouch controller _PARAM1_ is pushed in direction _PARAM3_","events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Make sure the joystick has moved from center","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"SpriteMultitouchJoystick::JoystickForce"},"parameters":["",">","SpriteMultitouchJoystick::DeadZone(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))","GetArgumentAsNumber(\"ControllerIdentifier\")","GetArgumentAsString(\"JoystickIdentifier\")",""]},{"type":{"value":"SpriteMultitouchJoystick::IsAngleIn4WayDirection"},"parameters":["","SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))","GetArgumentAsString(\"Direction\")",""]}],"actions":[{"type":{"value":"SetReturnBoolean"},"parameters":["True"]}]}],"parameters":[{"description":"Multitouch controller identifier (1, 2, 3, 4...)","name":"ControllerIdentifier","type":"expression"},{"description":"Joystick name","name":"JoystickIdentifier","supplementaryInformation":"[\"Primary\",\"Secondary\"]","type":"stringWithSelector"},{"description":"Direction","name":"Direction","supplementaryInformation":"[\"Up\",\"Down\",\"Left\",\"Right\"]","type":"stringWithSelector"}],"objectGroups":[]},{"description":"Check if joystick is pushed in a given direction.","fullName":"Joystick pushed in a direction (8-way)","functionType":"Condition","name":"IsDirectionPushed8Way","sentence":"Joystick _PARAM2_ of multitouch controller _PARAM1_ is pushed in direction _PARAM3_","events":[{"type":"BuiltinCommonInstructions::Comment","color":{"b":109,"g":230,"r":255,"textB":0,"textG":0,"textR":0},"comment":"Make sure the joystick has moved from center","comment2":""},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"SpriteMultitouchJoystick::JoystickForce"},"parameters":["",">","SpriteMultitouchJoystick::DeadZone(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))","GetArgumentAsNumber(\"ControllerIdentifier\")","GetArgumentAsString(\"JoystickIdentifier\")",""]},{"type":{"value":"SpriteMultitouchJoystick::IsAngleIn8WayDirection"},"parameters":["","SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))","GetArgumentAsString(\"Direction\")",""]}],"actions":[{"type":{"value":"SetReturnBoolean"},"parameters":["True"]}]}],"parameters":[{"description":"Multitouch controller identifier (1, 2, 3, 4...)","name":"ControllerIdentifier","type":"expression"},{"description":"Joystick name","name":"JoystickIdentifier","supplementaryInformation":"[\"Primary\",\"Secondary\"]","type":"stringWithSelector"},{"description":"Direction","name":"Direction","supplementaryInformation":"[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]","type":"stringWithSelector"}],"objectGroups":[]},{"description":"the percentage the thumb has been pulled away from the joystick center (Range: 0 to 1).","fullName":"Joystick force (deprecated)","functionType":"ExpressionAndCondition","name":"JoystickForce","private":true,"sentence":"Joystick _PARAM2_ of multitouch controller _PARAM1_ force","events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"SetReturnNumber"},"parameters":["SpriteMultitouchJoystick::JoystickForce(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))"]}]}],"expressionType":{"type":"expression"},"parameters":[{"description":"Multitouch controller identifier (1, 2, 3, 4...)","name":"ControllerIdentifier","type":"expression"},{"description":"Joystick name","name":"JoystickIdentifier","supplementaryInformation":"[\"Primary\",\"Secondary\"]","type":"stringWithSelector"}],"objectGroups":[]},{"description":"the force of multitouch contoller stick (from 0 to 1).","fullName":"Stick force","functionType":"ExpressionAndCondition","name":"StickForce","sentence":"multitouch controller _PARAM1_ _PARAM2_ stick force","events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"SetReturnNumber"},"parameters":["Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Force)"]}]}],"expressionType":{"type":"expression"},"parameters":[{"description":"Multitouch controller identifier (1, 2, 3, 4...)","name":"ControllerIdentifier","type":"expression"},{"description":"Stick name","name":"JoystickIdentifier","supplementaryInformation":"[\"Primary\",\"Secondary\"]","type":"stringWithSelector"}],"objectGroups":[]},{"description":"Change the percentage the thumb has been pulled away from the joystick center (Range: 0 to 1).","fullName":"Joystick force","functionType":"Action","name":"SetJoystickForce","private":true,"sentence":"Change the force of the joystick _PARAM2_ of multitouch controller _PARAM1_ to _PARAM3_","events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarScene"},"parameters":["__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Force","=","GetArgumentAsNumber(\"Value\")"]}]}],"parameters":[{"description":"Multitouch controller identifier (1, 2, 3, 4...)","name":"ControllerIdentifier","type":"expression"},{"description":"Joystick name","name":"JoystickIdentifier","type":"string"},{"description":"Value","name":"Value","type":"expression"}],"objectGroups":[]},{"description":"Return the angle the joystick is pointing towards (Range: -180 to 180).","fullName":"Joystick angle (deprecated)","functionType":"Expression","name":"JoystickAngle","private":true,"sentence":"","events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"SetReturnNumber"},"parameters":["SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))"]}]}],"expressionType":{"type":"expression"},"parameters":[{"description":"Multitouch controller identifier (1, 2, 3, 4...)","name":"ControllerIdentifier","type":"expression"},{"description":"Joystick name","name":"JoystickIdentifier","supplementaryInformation":"[\"Primary\",\"Secondary\"]","type":"stringWithSelector"}],"objectGroups":[]},{"description":"Return the angle the multitouch controller stick is pointing towards (Range: -180 to 180).","fullName":"Stick angle","functionType":"Expression","name":"StickAngle","sentence":"","events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"SetReturnNumber"},"parameters":["Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Angle)"]}]}],"expressionType":{"type":"expression"},"parameters":[{"description":"Multitouch controller identifier (1, 2, 3, 4...)","name":"ControllerIdentifier","type":"expression"},{"description":"Joystick name","name":"JoystickIdentifier","supplementaryInformation":"[\"Primary\",\"Secondary\"]","type":"stringWithSelector"}],"objectGroups":[]},{"description":"Change the angle the joystick is pointing towards (Range: -180 to 180).","fullName":"Joystick angle","functionType":"Action","name":"SetJoystickAngle","private":true,"sentence":"Change the angle of the joystick _PARAM2_ of multitouch controller _PARAM1_ to _PARAM3_","events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"ModVarScene"},"parameters":["__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Angle","=","GetArgumentAsNumber(\"Value\")"]}]}],"parameters":[{"description":"Multitouch controller identifier (1, 2, 3, 4...)","name":"ControllerIdentifier","type":"expression"},{"description":"Joystick name","name":"JoystickIdentifier","type":"string"},{"description":"Value","name":"Value","type":"expression"}],"objectGroups":[]},{"description":"Return the multitouch contoller stick force on X axis (from -1 at the left to 1 at the right).","fullName":"Stick X force","functionType":"Expression","name":"StickForceX","sentence":"","events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"SetReturnNumber"},"parameters":["SpriteMultitouchJoystick::JoystickForce(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\")) * cos(ToRad(SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))))"]}]}],"expressionType":{"type":"expression"},"parameters":[{"description":"Multitouch controller identifier (1, 2, 3, 4...)","name":"ControllerIdentifier","type":"expression"},{"description":"Joystick name","name":"JoystickIdentifier","supplementaryInformation":"[\"Primary\",\"Secondary\"]","type":"stringWithSelector"}],"objectGroups":[]},{"description":"Return the multitouch contoller stick force on Y axis (from -1 at the top to 1 at the bottom).","fullName":"Stick Y force","functionType":"Expression","name":"StickForceY","sentence":"","events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"SetReturnNumber"},"parameters":["SpriteMultitouchJoystick::JoystickForce(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\")) * sin(ToRad(SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))))"]}]}],"expressionType":{"type":"expression"},"parameters":[{"description":"Multitouch controller identifier (1, 2, 3, 4...)","name":"ControllerIdentifier","type":"expression"},{"description":"Joystick name","name":"JoystickIdentifier","supplementaryInformation":"[\"Primary\",\"Secondary\"]","type":"stringWithSelector"}],"objectGroups":[]}],"eventsBasedBehaviors":[],"eventsBasedObjects":[{"defaultName":"","description":"","fullName":"","name":"SpriteMultitouchJoystick","eventsFunctions":[],"propertyDescriptors":[],"objects":[{"assetStoreId":"","name":"Thumb","tags":"","type":"Sprite","updateIfNotVisible":false,"variables":[],"effects":[],"behaviors":[],"animations":[{"name":"Idle","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.08,"sprites":[]}]}]},{"assetStoreId":"","name":"Border","tags":"","type":"Sprite","updateIfNotVisible":false,"variables":[],"effects":[],"behaviors":[{"name":"MultitouchJoystick","type":"SpriteMultitouchJoystick::MultitouchJoystick","ControllerIdentifier":1.0,"JoystickIdentifier":"Primary","FloatingEnabled":false,"DeadZoneRadius":0.4,"JoystickAngle":0.0,"JoystickForce":0.0,"TouchId":0.0,"TouchIndex":0.0}],"animations":[{"name":"Idle","useMultipleDirections":false,"directions":[{"looping":false,"timeBetweenFrames":0.08,"sprites":[]}]}]}]}]}],"externalLayouts":[{"associatedLayout":"tutorial","name":"ui","instances":[{"angle":0.0,"customSize":true,"height":666.0,"layer":"UI","name":"shotgun","persistentUuid":"9c1b31ff-db3e-45c6-bf91-ad3807e92e9a","width":666.0,"x":-28.0,"y":526.0,"zOrder":0,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"UI","name":"crosshair","persistentUuid":"0ea80cdc-dff6-430c-8ceb-704864eae7bb","width":0.0,"x":942.0,"y":526.0,"zOrder":0,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":63.0,"layer":"UI","name":"healthbar","persistentUuid":"7340812f-fa93-4735-8430-ac64b2039826","width":674.0,"x":44.0,"y":28.0,"zOrder":257,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":121.0,"layer":"Mobile","name":"PauseButton","persistentUuid":"9daa7ac1-12d6-490b-8d9f-cb63faddbce2","width":121.0,"x":1766.0,"y":34.0,"zOrder":258,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":200.0,"layer":"Mobile","name":"FireRoundButton","persistentUuid":"b5cac294-7deb-4aee-919e-2b310cccfd90","width":200.0,"x":1362.0,"y":446.0,"zOrder":260,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":200.0,"layer":"Mobile","name":"TopArrowButton","persistentUuid":"7f36eeba-a27b-404a-8bad-553d14361764","width":200.0,"x":1704.0,"y":446.0,"zOrder":261,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":371.0,"layer":"Mobile","name":"MoveJoystick","persistentUuid":"d2dd0bca-42e7-42cd-9028-bc1451f4437a","width":371.0,"x":288.0,"y":816.0,"zOrder":262,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":371.0,"layer":"Mobile","name":"LookJoystick","persistentUuid":"be69c53a-b299-47a7-af90-54942e54f9f1","width":371.0,"x":1637.0,"y":816.0,"zOrder":263,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":440.0,"layer":"UI","name":"clockImage","persistentUuid":"8b5646a7-7527-4a85-a9b8-9e1744d11334","width":440.0,"x":1389.0,"y":629.0,"zOrder":0,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":1080.0,"layer":"Timeline","name":"DarkPurpleSpace","persistentUuid":"1ff3d34f-7f76-489d-b3f4-6b4f9db529f9","width":1920.0,"x":0.0,"y":0.0,"zOrder":0,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":true,"height":118.0,"layer":"Timeline","name":"tl","persistentUuid":"430758b9-982b-4ac5-ae00-fd0f696b4853","width":1920.0,"x":0.0,"y":117.0,"zOrder":264,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"Timeline","name":"y1","persistentUuid":"02515c1d-429b-4c9d-a718-60875ea56b53","width":0.0,"x":285.0,"y":506.0,"zOrder":265,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"Timeline","name":"y2","persistentUuid":"c298c568-c775-4664-8fba-7b4388a34386","width":0.0,"x":867.0,"y":506.0,"zOrder":266,"numberProperties":[],"stringProperties":[],"initialVariables":[]},{"angle":0.0,"customSize":false,"height":0.0,"layer":"Timeline","name":"y3","persistentUuid":"3301937d-69d4-4a92-8c74-d163c81563b5","width":0.0,"x":1421.0,"y":506.0,"zOrder":267,"numberProperties":[],"stringProperties":[],"initialVariables":[]}],"editionSettings":{"grid":false,"gridType":"rectangular","gridWidth":32.0,"gridHeight":32.0,"gridOffsetX":0.0,"gridOffsetY":0.0,"gridColor":10401023.0,"gridAlpha":0.8,"snap":false,"zoomFactor":0.23640304381659028,"windowMask":false}}],"externalSourceFiles":[]}; +gdjs.runtimeGameOptions = {}; diff --git a/desktop/apps/dezunkrr/dedEnemy.wav b/desktop/apps/dezunkrr/dedEnemy.wav new file mode 100644 index 0000000..4617463 Binary files /dev/null and b/desktop/apps/dezunkrr/dedEnemy.wav differ diff --git a/desktop/apps/dezunkrr/desktop-icon-512.png b/desktop/apps/dezunkrr/desktop-icon-512.png new file mode 100644 index 0000000..1b9a398 Binary files /dev/null and b/desktop/apps/dezunkrr/desktop-icon-512.png differ diff --git a/desktop/apps/dezunkrr/dz1.mp3 b/desktop/apps/dezunkrr/dz1.mp3 new file mode 100644 index 0000000..76bc32f Binary files /dev/null and b/desktop/apps/dezunkrr/dz1.mp3 differ diff --git a/desktop/apps/dezunkrr/enemy.glb b/desktop/apps/dezunkrr/enemy.glb new file mode 100644 index 0000000..c18056f Binary files /dev/null and b/desktop/apps/dezunkrr/enemy.glb differ diff --git a/desktop/apps/dezunkrr/events-tools/cameratools.js b/desktop/apps/dezunkrr/events-tools/cameratools.js new file mode 100644 index 0000000..5020de7 --- /dev/null +++ b/desktop/apps/dezunkrr/events-tools/cameratools.js @@ -0,0 +1,2 @@ +var gdjs;(function(L){let I;(function(d){let b;(function(r){r.setCameraX=function(t,e,n,s){!t.hasLayer(n)||t.getLayer(n).setCameraX(e,s)},r.setCameraY=function(t,e,n,s){!t.hasLayer(n)||t.getLayer(n).setCameraY(e,s)},r.getCameraX=function(t,e,n){return t.hasLayer(e)?t.getLayer(e).getCameraX():0},r.getCameraY=function(t,e,n){return t.hasLayer(e)?t.getLayer(e).getCameraY():0},r.getCameraWidth=function(t,e,n){return t.hasLayer(e)?t.getLayer(e).getCameraWidth():0},r.getCameraHeight=function(t,e,n){return t.hasLayer(e)?t.getLayer(e).getCameraHeight():0},r.getCameraBorderLeft=function(t,e,n){return t.hasLayer(e)?r.getCameraX(t,e,n)-r.getCameraWidth(t,e,n)/2:0},r.getCameraBorderRight=function(t,e,n){return t.hasLayer(e)?r.getCameraX(t,e,n)+r.getCameraWidth(t,e,n)/2:0},r.getCameraBorderTop=function(t,e,n){return t.hasLayer(e)?r.getCameraY(t,e,n)-r.getCameraHeight(t,e,n)/2:0},r.getCameraBorderBottom=function(t,e,n){return t.hasLayer(e)?r.getCameraY(t,e,n)+r.getCameraHeight(t,e,n)/2:0},r.showLayer=function(t,e){if(!!t.hasLayer(e))return t.getLayer(e).show(!0)},r.hideLayer=function(t,e){if(!!t.hasLayer(e))return t.getLayer(e).show(!1)},r.layerIsVisible=function(t,e){return t.hasLayer(e)&&t.getLayer(e).isVisible()},r.setCameraRotation=function(t,e,n,s){if(!!t.hasLayer(n))return t.getLayer(n).setCameraRotation(e,s)},r.getCameraRotation=function(t,e,n){return t.hasLayer(e)?t.getLayer(e).getCameraRotation(n):0},r.getCameraZoom=function(t,e,n){return t.hasLayer(e)?t.getLayer(e).getCameraZoom(n):0},r.setCameraZoom=function(t,e,n,s){if(!!t.hasLayer(n))return t.getLayer(n).setCameraZoom(e,s)},r.centerCamera=function(t,e,n,s,o){if(!t.hasLayer(s)||e==null)return;let f=0,i=0;if(n&&!e.hasNoForces()){const u=e.getAverageForce(),a=e.getElapsedTime(t)/1e3;f=u.getX()*a,i=u.getY()*a}const g=t.getLayer(s);g.setCameraX(e.getCenterXInScene()+f,o),g.setCameraY(e.getCenterYInScene()+i,o)},r.centerCameraWithinLimits=function(t,e,n,s,o,f,i,g,u){r.centerCamera(t,e,i,g,u),r.clampCamera(t,n,s,o,f,g,u)},r.clampCamera=function(t,e,n,s,o,f,i){if(!t.hasLayer(f))return;const g=t.getLayer(f),u=g.getCameraWidth(i)/2,a=g.getCameraHeight(i)/2,m=e+u,c=s-u,h=n+a,p=o-a,E=m0?1:-1},r.cbrt=function(t){return Math.pow(t,1/3)},r.nthroot=function(t,n){return Math.pow(t,1/n)},r.mod=function(t,n){return t-n*Math.floor(t/n)},r.angleDifference=function(t,n){return o.evtTools.common.mod(o.evtTools.common.mod(t-n,360)+180,360)-180},r.angleBetweenPositions=function(t,n,e,u){return Math.atan2(u-n,e-t)*180/Math.PI},r.distanceBetweenPositions=function(t,n,e,u){return Math.sqrt((t-e)*(t-e)+(n-u)*(n-u))},r.lerp=function(t,n,e){return t+(n-t)*e},r.trunc=function(t){return t|0},r.getXFromAngleAndDistance=function(t,n){return n*Math.cos(o.toRad(t))},r.getYFromAngleAndDistance=function(t,n){return n*Math.sin(o.toRad(t))},r.roundTo=function(t,n){return!n||!Number.isInteger(n)?Math.round(t):Math.round(t*Math.pow(10,n))/Math.pow(10,n)},r.floorTo=function(t,n){return!n||!Number.isInteger(n)?Math.floor(t):Math.floor(t*Math.pow(10,n))/Math.pow(10,n)},r.ceilTo=function(t,n){return!n||!Number.isInteger(n)?Math.ceil(t):Math.ceil(t*Math.pow(10,n))/Math.pow(10,n)},r.pi=function(){return Math.PI},r.lerpAngle=function(t,n,e){return t+o.evtTools.common.angleDifference(n,t)*e},r.resolveAsyncEventsFunction=t=>{!!t&&!!t.task&&!!t.task.resolve&&t.task.resolve()}})(i=f.common||(f.common={}))})(s=o.evtTools||(o.evtTools={}))})(gdjs||(gdjs={})); +//# sourceMappingURL=commontools.js.map diff --git a/desktop/apps/dezunkrr/events-tools/inputtools.js b/desktop/apps/dezunkrr/events-tools/inputtools.js new file mode 100644 index 0000000..e00ebfa --- /dev/null +++ b/desktop/apps/dezunkrr/events-tools/inputtools.js @@ -0,0 +1,2 @@ +var gdjs;(function(o){let i;(function(c){let d;(function(n){n.lastTouchId=0,n.lastEndedTouchId=0,n.keysNameToCode={a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,Num0:48,Num1:49,Num2:50,Num3:51,Num4:52,Num5:53,Num6:54,Num7:55,Num8:56,Num9:57,Numpad0:96,Numpad1:97,Numpad2:98,Numpad3:99,Numpad4:100,Numpad5:101,Numpad6:102,Numpad7:103,Numpad8:104,Numpad9:105,LShift:1016,RShift:2016,LControl:1017,RControl:2017,LAlt:1018,RAlt:2018,LSystem:1091,RSystem:2091,SemiColon:186,Comma:188,Period:190,Quote:222,Slash:191,BackSlash:220,Equal:187,Dash:189,Menu:93,LBracket:219,RBracket:221,Tilde:192,Space:32,Back:8,Tab:9,Delete:46,Insert:45,Escape:27,PageUp:33,PageDown:34,End:35,Home:36,Return:13,NumpadPageUp:3033,NumpadPageDown:3034,NumpadEnd:3035,NumpadHome:3036,NumpadReturn:3013,Add:107,Subtract:109,Multiply:106,Divide:111,NumpadAdd:3107,NumpadSubtract:3109,NumpadMultiply:3106,NumpadDivide:3111,Left:37,Up:38,Right:39,Down:40,NumpadLeft:3037,NumpadUp:3038,NumpadRight:3039,NumpadDown:3040,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,Pause:19};const u={};for(const e in n.keysNameToCode)n.keysNameToCode.hasOwnProperty(e)&&(u[n.keysNameToCode[e]]=e);n.mouseButtonsNameToCode={Left:o.InputManager.MOUSE_LEFT_BUTTON,Right:o.InputManager.MOUSE_RIGHT_BUTTON,Middle:o.InputManager.MOUSE_MIDDLE_BUTTON,Back:o.InputManager.MOUSE_BACK_BUTTON,Forward:o.InputManager.MOUSE_FORWARD_BUTTON},n.isKeyPressed=function(e,t){return o.evtTools.input.keysNameToCode.hasOwnProperty(t)?e.getGame().getInputManager().isKeyPressed(o.evtTools.input.keysNameToCode[t]):!1},n.wasKeyReleased=function(e,t){return o.evtTools.input.keysNameToCode.hasOwnProperty(t)?e.getGame().getInputManager().wasKeyReleased(o.evtTools.input.keysNameToCode[t]):!1},n.lastPressedKey=function(e){const t=e.getGame().getInputManager().getLastPressedKey();return u.hasOwnProperty(t)?u[t]:""},n.anyKeyPressed=function(e){return e.getGame().getInputManager().anyKeyPressed()},n.anyKeyReleased=function(e){return e.getGame().getInputManager().anyKeyReleased()},n.isMouseButtonPressed=function(e,t){return o.evtTools.input.mouseButtonsNameToCode.hasOwnProperty(t)?e.getGame().getInputManager().isMouseButtonPressed(o.evtTools.input.mouseButtonsNameToCode[t]):!1},n.isMouseButtonReleased=function(e,t){return o.evtTools.input.mouseButtonsNameToCode.hasOwnProperty(t)?e.getGame().getInputManager().isMouseButtonReleased(o.evtTools.input.mouseButtonsNameToCode[t]):!1},n.hideCursor=function(e){e.getScene().getRenderer().hideCursor()},n.showCursor=function(e){e.getScene().getRenderer().showCursor()},n.getMouseWheelDelta=function(e){return e.getGame().getInputManager().getMouseWheelDelta()},n.isScrollingUp=function(e){return e.getGame().getInputManager().isScrollingUp()},n.isScrollingDown=function(e){return e.getGame().getInputManager().isScrollingDown()},n.getMouseX=function(e,t,r){return n.getCursorX(e,t,r)},n.getMouseY=function(e,t,r){return n.getCursorY(e,t,r)},n.getCursorX=function(e,t,r){const a=o.staticArray(o.evtTools.input.getCursorX);return e.getLayer(t).convertCoords(e.getGame().getInputManager().getCursorX(),e.getGame().getInputManager().getCursorY(),0,a)[0]},n.getCursorY=function(e,t,r){const a=o.staticArray(o.evtTools.input.getCursorY);return e.getLayer(t).convertCoords(e.getGame().getInputManager().getCursorX(),e.getGame().getInputManager().getCursorY(),0,a)[1]},n.getMouseOnlyCursorX=function(e,t,r){const a=o.staticArray(o.evtTools.input.getMouseOnlyCursorX);return e.getLayer(t).convertCoords(e.getGame().getInputManager().getMouseX(),e.getGame().getInputManager().getMouseY(),0,a)[0]},n.getMouseOnlyCursorY=function(e,t,r){const a=o.staticArray(o.evtTools.input.getMouseOnlyCursorY);return e.getLayer(t).convertCoords(e.getGame().getInputManager().getMouseX(),e.getGame().getInputManager().getMouseY(),0,a)[1]},n.isMouseInsideCanvas=function(e){return e.getGame().getInputManager().isMouseInsideCanvas()},n._cursorIsOnObject=function(e,t){return e.cursorOnObject(t)},n.cursorOnObject=function(e,t,r,a){return o.evtTools.object.pickObjectsIf(o.evtTools.input._cursorIsOnObject,e,a,t)},n.getTouchX=function(e,t,r,a){const g=o.staticArray(o.evtTools.input.getTouchX);return e.getLayer(r).convertCoords(e.getGame().getInputManager().getTouchX(t),e.getGame().getInputManager().getTouchY(t),0,g)[0]},n.getTouchY=(e,t,r,a)=>{const g=o.staticArray(o.evtTools.input.getTouchY);return e.getLayer(r).convertCoords(e.getGame().getInputManager().getTouchX(t),e.getGame().getInputManager().getTouchY(t),0,g)[1]},n.hasAnyTouchStarted=e=>{const t=e.getGame().getInputManager().getStartedTouchIdentifiers();return t.length>1||t.length>0&&t[0]!==o.InputManager.MOUSE_TOUCH_ID},n.getStartedTouchCount=e=>{const t=e.getGame().getInputManager().getStartedTouchIdentifiers();return t.length+(t.includes(o.InputManager.MOUSE_TOUCH_ID)?-1:0)},n.getStartedTouchIdentifier=(e,t)=>{const r=e.getGame().getInputManager().getStartedTouchIdentifiers(),a=r.indexOf(o.InputManager.MOUSE_TOUCH_ID);return a<0?r[t]:r[te.getGame().getInputManager().getStartedTouchIdentifiers().length>0,n.getStartedTouchOrMouseCount=e=>e.getGame().getInputManager().getStartedTouchIdentifiers().length,n.getStartedTouchOrMouseIdentifier=(e,t)=>e.getGame().getInputManager().getStartedTouchIdentifiers()[t],n.hasTouchEnded=(e,t)=>e.getGame().getInputManager().hasTouchEnded(t),n.getLastTouchId=function(){return o.evtTools.input.lastTouchId||0},n.getLastEndedTouchId=function(){return o.evtTools.input.lastEndedTouchId||0},n.popStartedTouch=function(e){const t=e.getGame().getInputManager().popStartedTouch();return t!==void 0?(o.evtTools.input.lastTouchId=t,!0):!1},n.popEndedTouch=function(e){const t=e.getGame().getInputManager().popEndedTouch();return t!==void 0?(o.evtTools.input.lastEndedTouchId=t,!0):!1},n.touchSimulateMouse=function(e,t){e.getGame().getInputManager().touchSimulateMouse(t)}})(d=c.input||(c.input={}))})(i=o.evtTools||(o.evtTools={}))})(gdjs||(gdjs={})); +//# sourceMappingURL=inputtools.js.map diff --git a/desktop/apps/dezunkrr/events-tools/networktools.js b/desktop/apps/dezunkrr/events-tools/networktools.js new file mode 100644 index 0000000..897cbdb --- /dev/null +++ b/desktop/apps/dezunkrr/events-tools/networktools.js @@ -0,0 +1,2 @@ +var gdjs;(function(u){let p;(function(l){let d;(function(r){r.sendAsyncRequest=function(n,s,i,o,c,a){const e=t=>{t instanceof ProgressEvent&&t.currentTarget&&t.currentTarget instanceof XMLHttpRequest&&t.currentTarget.status===0?a.setString("REQUEST_NOT_SENT"):a.setString(""+t)};try{const t=new XMLHttpRequest;t.onerror=e,t.ontimeout=e,t.onabort=e,t.onreadystatechange=()=>{t.readyState===4&&(t.status>=400&&e(""+t.status),c.setString(t.responseText))},t.open(i,n),t.setRequestHeader("Content-Type",o===""?"application/x-www-form-urlencoded":o),t.send(s)}catch(t){e(t)}},r.sendAwaitableAsyncRequest=(n,s,i,o,c,a)=>new u.PromiseTask(fetch(n,{body:i!=="GET"?s:void 0,method:i,headers:{"Content-Type":o||"application/x-www-form-urlencoded"}}).then(async e=>{const t=await e.text();e.status>=400&&a.setString(""+e.status),c.setString(t)},e=>{a.setString(""+e)})),r.sendDeprecatedSynchronousRequest=function(n,s,i,o,c,a){try{let e;if(typeof XMLHttpRequest!="undefined")e=new XMLHttpRequest;else{const t=["MSXML2.XmlHttp.5.0","MSXML2.XmlHttp.4.0","MSXML2.XmlHttp.3.0","MSXML2.XmlHttp.2.0","Microsoft.XmlHttp"];for(let g=0,b=t.length;g=e&&(n=e-1);let o=0,u=null;for(let i in t.items)if(t.items.hasOwnProperty(i)){let f=t.items[i];if(n-o=b&&(b=h.farSqDist,a=T,c=h.farX,l=h.farY))}}return a?(r.evtTools.object.pickOnly(s,a),u.setNumber(c),i.setNumber(l),!0):!1},g.doCreateObjectOnScene=function(s,t,e,n,o,u){const i=s.createObject(t),f=s.getLayer(u);return i!==null&&(i.setPosition(n,o),i.setLayer(u),i.setZOrder(f.getDefaultZOrder()),e.containsKey(t)&&e.get(t).push(i)),i},g.createObjectOnScene=function(s,t,e,n,o){return r.evtTools.object.doCreateObjectOnScene(s,t.firstKey(),t,e,n,o)},g.createObjectFromGroupOnScene=function(s,t,e,n,o,u){r.evtTools.object.doCreateObjectOnScene(s,e,t,n,o,u)},g.getPickedInstancesCount=s=>{let t=0;const e=r.staticArray(r.evtTools.object.getPickedInstancesCount);s.values(e);for(let n=0,o=e.length;n{let e=0;const n=r.staticArray(r.evtTools.object.getSceneInstancesCount);t.keys(n);const o=new Set(n);for(const u of o)e+=s.getInstancesCountOnScene(u);return e},g.pickedObjectsCount=g.getPickedInstancesCount})(C=p.object||(p.object={}))})(x=r.evtTools||(r.evtTools={}));class w{constructor(){this.objectsLists=new Map;this.callbacks=new Map;this.parent=null}static from(p){const j=new w;return j.parent=p,j}getOrCreateList(p){return this.objectsLists.has(p)||this.objectsLists.set(p,[]),this.objectsLists.get(p)}getObjects(p){return!this.objectsLists.has(p)&&this.parent?this.parent.getObjects(p):this.objectsLists.get(p)||[]}addObject(p,j){const m=this.getOrCreateList(p);if(m.includes(j))return;m.push(j);const v=()=>this.removeObject(p,j);this.callbacks.set(j,v),j.registerDestroyCallback(v)}removeObject(p,j){const m=this.getOrCreateList(p),v=m.indexOf(j);v!==-1&&(m.splice(v,1),j.unregisterDestroyCallback(this.callbacks.get(j)),this.callbacks.delete(j))}}r.LongLivedObjectsList=w})(gdjs||(gdjs={})); +//# sourceMappingURL=objecttools.js.map diff --git a/desktop/apps/dezunkrr/events-tools/runtimescenetools.js b/desktop/apps/dezunkrr/events-tools/runtimescenetools.js new file mode 100644 index 0000000..1ce9008 --- /dev/null +++ b/desktop/apps/dezunkrr/events-tools/runtimescenetools.js @@ -0,0 +1,2 @@ +var gdjs;(function(r){let o;(function(i){let c;(function(s){s.sceneJustBegins=function(e){return e.getScene().getTimeManager().isFirstFrame()},s.sceneJustResumed=function(e){return e.getScene().sceneJustResumed()},s.getSceneName=function(e){return e.getScene().getName()},s.setBackgroundColor=function(e,t){const n=t.split(";");n.length<3||e.getScene().setBackgroundColor(parseInt(n[0]),parseInt(n[1]),parseInt(n[2]))},s.getElapsedTimeInSeconds=function(e){return e.getScene().getTimeManager().getElapsedTime()/1e3},s.setTimeScale=function(e,t){return e.getScene().getTimeManager().setTimeScale(t)},s.getTimeScale=function(e){return e.getScene().getTimeManager().getTimeScale()},s.timerElapsedTime=function(e,t,n){const a=e.getScene().getTimeManager();return a.hasTimer(n)?a.getTimer(n).getTime()/1e3>=t:(a.addTimer(n),!1)},s.timerPaused=function(e,t){const n=e.getScene().getTimeManager();return n.hasTimer(t)?n.getTimer(t).isPaused():!1},s.resetTimer=function(e,t){const n=e.getScene().getTimeManager();n.hasTimer(t)?n.getTimer(t).reset():n.addTimer(t)},s.pauseTimer=function(e,t){const n=e.getScene().getTimeManager();n.hasTimer(t)||n.addTimer(t),n.getTimer(t).setPaused(!0)},s.unpauseTimer=function(e,t){const n=e.getScene().getTimeManager();return n.hasTimer(t)||n.addTimer(t),n.getTimer(t).setPaused(!1)},s.removeTimer=function(e,t){e.getScene().getTimeManager().removeTimer(t)};class u extends r.AsyncTask{constructor(t){super();this.timeElapsedOnScene=0;this.duration=t}update(t){return this.timeElapsedOnScene+=t.getScene().getTimeManager().getElapsedTime(),this.timeElapsedOnScene>=this.duration}}s.WaitTask=u,s.wait=e=>new u(e*1e3),s.getTimerElapsedTimeInSeconds=function(e,t){const n=e.getScene().getTimeManager();return n.hasTimer(t)?n.getTimer(t).getTime()/1e3:0},s.getTimerElapsedTimeInSecondsOrNaN=function(e,t){const n=e.getScene().getTimeManager();return n.hasTimer(t)?n.getTimer(t).getTime()/1e3:Number.NaN},s.getTimeFromStartInSeconds=function(e){return e.getScene().getTimeManager().getTimeFromStart()/1e3},s.getTime=function(e,t){if(t==="timestamp")return Date.now();const n=new Date;if(t==="hour")return n.getHours();if(t==="min")return n.getMinutes();if(t==="sec")return n.getSeconds();if(t==="mday")return n.getDate();if(t==="mon")return n.getMonth();if(t==="year")return n.getFullYear()-1900;if(t==="wday")return n.getDay();if(t==="yday"){const a=new Date(n.getFullYear(),0,0),g=n.getTime()-a.getTime(),m=1e3*60*60*24;return Math.floor(g/m)}return 0},s.replaceScene=function(e,t,n){!e.getGame().getSceneData(t)||e.getScene().requestChange(n?r.SceneChangeRequest.CLEAR_SCENES:r.SceneChangeRequest.REPLACE_SCENE,t)},s.pushScene=function(e,t){!e.getGame().getSceneData(t)||e.getScene().requestChange(r.SceneChangeRequest.PUSH_SCENE,t)},s.popScene=function(e){e.getScene().requestChange(r.SceneChangeRequest.POP_SCENE)},s.stopGame=function(e){e.getScene().requestChange(r.SceneChangeRequest.STOP_GAME)},s.createObjectsFromExternalLayout=function(e,t,n,a){const g=e.getGame().getExternalLayoutData(t);g!==null&&e.getScene().createObjectsFrom(g.instances,n,a,!1)},s.hasGameJustResumed=e=>e.getGame().hasJustResumed()})(c=i.runtimeScene||(i.runtimeScene={}))})(o=r.evtTools||(r.evtTools={}))})(gdjs||(gdjs={})); +//# sourceMappingURL=runtimescenetools.js.map diff --git a/desktop/apps/dezunkrr/events-tools/soundtools.js b/desktop/apps/dezunkrr/events-tools/soundtools.js new file mode 100644 index 0000000..ea06a52 --- /dev/null +++ b/desktop/apps/dezunkrr/events-tools/soundtools.js @@ -0,0 +1,2 @@ +var gdjs;(function(s){let r;(function(c){let l;(function(o){const a=new s.Logger("Audio events");o.getGlobalVolume=function(t){return t.getScene().getSoundManager().getGlobalVolume()},o.setGlobalVolume=function(t,e){t.getScene().getSoundManager().setGlobalVolume(e)},o.unloadAllAudio=function(t){t.getScene().getSoundManager().unloadAll()},o.playSound=function(t,e,n,i,g){t.getScene().getSoundManager().playSound(e,n,i,g)},o.playSoundOnChannel=function(t,e,n,i,g,u){t.getScene().getSoundManager().playSoundOnChannel(e,n,i,g,u)},o.stopSoundOnChannel=function(t,e){const n=t.getScene().getSoundManager().getSoundOnChannel(e);n?n.stop():a.error(`Cannot stop non-existing sound on channel ${e}.`)},o.pauseSoundOnChannel=function(t,e){const n=t.getScene().getSoundManager().getSoundOnChannel(e);n?n.pause():a.error(`Cannot pause non-existing sound on channel ${e}.`)},o.continueSoundOnChannel=function(t,e){const n=t.getScene().getSoundManager().getSoundOnChannel(e);n?n.playing()||n.play():a.error(`Cannot continue playing non-existing sound on channel ${e}.`)},o.isSoundOnChannelPlaying=function(t,e){const n=t.getScene().getSoundManager().getSoundOnChannel(e);return n?n.playing():!1},o.isSoundOnChannelPaused=function(t,e){const n=t.getScene().getSoundManager().getSoundOnChannel(e);return n?n.paused():(a.error(`Cannot check if non-existing sound on channel ${e} is paused.`),!1)},o.isSoundOnChannelStopped=function(t,e){const n=t.getScene().getSoundManager().getSoundOnChannel(e);return n?n.stopped():(a.error(`Cannot check if non-existing sound on channel ${e} is stopped.`),!0)},o.getSoundOnChannelVolume=function(t,e){const n=t.getScene().getSoundManager().getSoundOnChannel(e);return n?n.getVolume()*100:(a.error(`Cannot get the volume of a non-existing sound on channel ${e}.`),100)},o.setSoundOnChannelVolume=function(t,e,n){const i=t.getScene().getSoundManager().getSoundOnChannel(e);i?i.setVolume(n/100):a.error(`Cannot set the volume of a non-existing sound on channel ${e}.`)},o.getSoundOnChannelPlayingOffset=function(t,e){const n=t.getScene().getSoundManager().getSoundOnChannel(e);return n?n.getSeek():(a.error(`Cannot get the playing offset of a non-existing sound on channel ${e}.`),0)},o.setSoundOnChannelPlayingOffset=function(t,e,n){const i=t.getScene().getSoundManager().getSoundOnChannel(e);i?i.setSeek(n):a.error(`Cannot set the playing offset of a non-existing sound on channel ${e}.`)},o.getSoundOnChannelPitch=function(t,e){const n=t.getScene().getSoundManager().getSoundOnChannel(e);return n?n.getRate():(a.error(`Cannot get the pitch of a non-existing sound on channel ${e}.`),1)},o.setSoundOnChannelPitch=function(t,e,n){const i=t.getScene().getSoundManager().getSoundOnChannel(e);i?i.setRate(n):a.error(`Cannot get the pitch of a non-existing sound on channel ${e}.`)},o.preloadSound=(t,e)=>t.getScene().getSoundManager().loadAudio(e,!1),o.unloadSound=(t,e)=>t.getScene().getSoundManager().unloadAudio(e,!1),o.playMusic=function(t,e,n,i,g){t.getScene().getSoundManager().playMusic(e,n,i,g)},o.playMusicOnChannel=function(t,e,n,i,g,u){t.getScene().getSoundManager().playMusicOnChannel(e,n,i,g,u)},o.stopMusicOnChannel=function(t,e){const n=t.getScene().getSoundManager().getMusicOnChannel(e);n?n.stop():a.error(`Cannot stop a non-existing music on channel ${e}.`)},o.pauseMusicOnChannel=function(t,e){const n=t.getScene().getSoundManager().getMusicOnChannel(e);n?n.pause():a.error(`Cannot pause a non-existing music on channel ${e}.`)},o.continueMusicOnChannel=function(t,e){const n=t.getScene().getSoundManager().getMusicOnChannel(e);n?n.playing()||n.play():a.error(`Cannot stop a non-existing music on channel ${e}.`)},o.isMusicOnChannelPlaying=function(t,e){const n=t.getScene().getSoundManager().getMusicOnChannel(e);return n?n.playing():!1},o.isMusicOnChannelPaused=function(t,e){const n=t.getScene().getSoundManager().getMusicOnChannel(e);return n?n.paused():(a.error(`Cannot check if non-existing music on channel ${e} is paused.`),!1)},o.isMusicOnChannelStopped=function(t,e){const n=t.getScene().getSoundManager().getMusicOnChannel(e);return n?n.stopped():(a.error(`Cannot check if non-existing music on channel ${e} is stopped.`),!0)},o.getMusicOnChannelVolume=function(t,e){const n=t.getScene().getSoundManager().getMusicOnChannel(e);return n?n.getVolume()*100:(a.error(`Cannot get the volume of a non-existing music on channel ${e}.`),100)},o.setMusicOnChannelVolume=function(t,e,n){const i=t.getScene().getSoundManager().getMusicOnChannel(e);i?i.setVolume(n/100):a.error(`Cannot set the volume of a non-existing music on channel ${e}.`)},o.getMusicOnChannelPlayingOffset=function(t,e){const n=t.getScene().getSoundManager().getMusicOnChannel(e);return n?n.getSeek():(a.error(`Cannot get the playing offset of a non-existing music on channel ${e}.`),0)},o.setMusicOnChannelPlayingOffset=function(t,e,n){const i=t.getScene().getSoundManager().getMusicOnChannel(e);i?i.setSeek(n):a.error(`Cannot set the playing offset of a non-existing music on channel ${e}.`)},o.getMusicOnChannelPitch=function(t,e){const n=t.getScene().getSoundManager().getMusicOnChannel(e);return n?n.getRate():(a.error(`Cannot get the pitch of a non-existing music on channel ${e}.`),1)},o.setMusicOnChannelPitch=function(t,e,n){const i=t.getScene().getSoundManager().getMusicOnChannel(e);i?i.setRate(n):a.error(`Cannot get the pitch of a non-existing music on channel ${e}.`)},o.preloadMusic=(t,e)=>t.getScene().getSoundManager().loadAudio(e,!0),o.unloadMusic=(t,e)=>t.getScene().getSoundManager().unloadAudio(e,!0),o.fadeSoundVolume=(t,e,n,i)=>{const g=t.getScene().getSoundManager().getSoundOnChannel(e);g?g.fade(g.getVolume(),n/100,i*1e3):a.error(`Cannot fade the volume of a non-existing sound on channel ${e}.`)},o.fadeMusicVolume=(t,e,n,i)=>{const g=t.getScene().getSoundManager().getMusicOnChannel(e);g?g.fade(g.getVolume(),n/100,i*1e3):a.error(`Cannot fade the volume of a non-existing music on channel ${e}.`)}})(l=c.sound||(c.sound={}))})(r=s.evtTools||(s.evtTools={}))})(gdjs||(gdjs={})); +//# sourceMappingURL=soundtools.js.map diff --git a/desktop/apps/dezunkrr/events-tools/storagetools.js b/desktop/apps/dezunkrr/events-tools/storagetools.js new file mode 100644 index 0000000..2a41f6d --- /dev/null +++ b/desktop/apps/dezunkrr/events-tools/storagetools.js @@ -0,0 +1,2 @@ +var gdjs;(function(S){const f=new S.Logger("Storage");let d;(function(p){let h;(function(a){let c=null;try{typeof cc!="undefined"?c=cc.sys.localStorage:typeof window!="undefined"&&(c=window.localStorage)}catch(t){f.error("Unable to get access to the localStorage: "+t)}c||f.error("Storage actions won't work as no localStorage was found.");const u=new Hashtable;a.loadJSONFileFromStorage=t=>{if(u.containsKey(t))return;let i=null;try{c&&(i=c.getItem("GDJS_"+t))}catch(l){f.error('Unable to load data from localStorage for "'+t+'": '+l)}let o={};try{i&&(o=JSON.parse(i))}catch(l){f.error('Unable to load data from "'+t+'" - data is not valid JSON: '+l)}u.put(t,o)},a.unloadJSONFile=t=>{if(!u.containsKey(t))return;const i=u.get(t),o=JSON.stringify(i);try{c&&c.setItem("GDJS_"+t,o)}catch(l){f.error('Unable to save data to localStorage for "'+t+'": '+l)}u.remove(t)};const g=(t,i)=>{let o=!1;u.containsKey(t)||(o=!0,a.loadJSONFileFromStorage(t));const l=i(u.get(t));return o&&a.unloadJSONFile(t),l};a.clearJSONFile=t=>g(t,i=>{for(const o in i)i.hasOwnProperty(o)&&delete i[o];return!0}),a.elementExistsInJSONFile=(t,i)=>g(t,o=>{const l=i.split("/");let n=o;for(let e=0;eg(t,o=>{const l=i.split("/");let n=o;for(let e=0;eg(t,l=>{const n=i.split("/");let e=l;for(let r=0;rg(t,l=>{const n=i.split("/");let e=l;for(let r=0;rg(t,n=>{const e=i.split("/");let r=n;for(let s=0;sg(t,n=>{const e=i.split("/");let r=n;for(let s=0;s=0?t.substr(n,r):""},e.strAt=function(t,n){return n=0?t.substr(n,1):""},e.strRepeat=function(t,n){let r="";for(let o=0;oo.length));)i=o.indexOf(n,u);return o},e.strRFindFrom=s.evtTools.string.strFindLastFrom})(f=c.string||(c.string={}))})(p=s.evtTools||(s.evtTools={}))})(gdjs||(gdjs={})); +//# sourceMappingURL=stringtools.js.map diff --git a/desktop/apps/dezunkrr/events-tools/variabletools.js b/desktop/apps/dezunkrr/events-tools/variabletools.js new file mode 100644 index 0000000..4d87d6f --- /dev/null +++ b/desktop/apps/dezunkrr/events-tools/variabletools.js @@ -0,0 +1,2 @@ +var gdjs;(function(a){let l;(function(o){let i;(function(r){r.getVariableNumber=function(e){return e.getAsNumber()},r.getVariableString=function(e){return e.getAsString()},r.getVariableBoolean=function(e,t){return e.getAsBoolean()===t},r.setVariableBoolean=function(e,t){e.setBoolean(t)},r.toggleVariableBoolean=function(e){e.setBoolean(!e.getAsBoolean())},r.sceneVariableExists=function(e,t){return e.getScene().getVariables().has(t)},r.globalVariableExists=function(e,t){return e.getGame().getVariables().has(t)},r.variableChildExists=function(e,t){return e.hasChild(t)},r.variableRemoveChild=function(e,t){e.removeChild(t)},r.variableClearChildren=function(e){e.clearChildren()},r.variablePushCopy=function(e,t){e.pushVariableCopy(t)},r.valuePush=function(e,t){e.pushValue(t)},r.variableRemoveAt=function(e,t){e.removeAtIndex(t)},r.getVariableChildCount=function(e){return e.getChildrenCount()},r.getFirstVariableNumber=function(e){return e.getChildrenCount()===0?0:e.getAllChildrenArray()[0].getAsNumber()},r.getFirstVariableString=function(e){return e.getChildrenCount()===0?"":e.getAllChildrenArray()[0].getAsString()},r.getLastVariableNumber=function(e){const t=e.getAllChildrenArray();return t.length===0?0:t[t.length-1].getAsNumber()},r.getLastVariableString=function(e){const t=e.getAllChildrenArray();return t.length===0?"":t[t.length-1].getAsString()}})(i=o.variable||(o.variable={}));let s;(function(n){n.getVariableNumber=a.evtTools.variable.getVariableNumber,n.getVariableString=a.evtTools.variable.getVariableString,n.getVariableBoolean=a.evtTools.variable.getVariableBoolean,n.setVariableBoolean=a.evtTools.variable.setVariableBoolean,n.toggleVariableBoolean=a.evtTools.variable.toggleVariableBoolean,n.sceneVariableExists=a.evtTools.variable.sceneVariableExists,n.globalVariableExists=a.evtTools.variable.globalVariableExists,n.variableChildExists=a.evtTools.variable.variableChildExists,n.variableRemoveChild=a.evtTools.variable.variableRemoveChild,n.variableClearChildren=a.evtTools.variable.variableClearChildren,n.variablePushCopy=a.evtTools.variable.variablePushCopy,n.valuePush=a.evtTools.variable.valuePush,n.variableRemoveAt=a.evtTools.variable.variableRemoveAt,n.getVariableChildCount=a.evtTools.variable.getVariableChildCount})(s=o.common||(o.common={}))})(l=a.evtTools||(a.evtTools={}))})(gdjs||(gdjs={})); +//# sourceMappingURL=variabletools.js.map diff --git a/desktop/apps/dezunkrr/events-tools/windowtools.js b/desktop/apps/dezunkrr/events-tools/windowtools.js new file mode 100644 index 0000000..080febd --- /dev/null +++ b/desktop/apps/dezunkrr/events-tools/windowtools.js @@ -0,0 +1,2 @@ +var gdjs;(function(r){let s;(function(u){let m;(function(t){t.setMargins=function(e,n,o,i,g){e.getGame().getRenderer().setMargins(n,o,i,g)},t.setFullScreen=function(e,n,o){e.getGame().getRenderer().keepAspectRatio(o),e.getGame().getRenderer().setFullScreen(n)},t.isFullScreen=function(e){return e.getGame().getRenderer().isFullScreen()},t.setWindowSize=function(e,n,o,i){e.getGame().getRenderer().setWindowSize(n,o),i&&e.getGame().setGameResolutionSize(n,o)},t.centerWindow=function(e){e.getGame().getRenderer().centerWindow()},t.setGameResolutionSize=function(e,n,o){e.getGame().setGameResolutionSize(n,o)},t.setGameResolutionResizeMode=function(e,n){e.getGame().setGameResolutionResizeMode(n)},t.setAdaptGameResolutionAtRuntime=function(e,n){e.getGame().setAdaptGameResolutionAtRuntime(n)},t.setWindowTitle=function(e,n){e.getGame().getRenderer().setWindowTitle(n)},t.getWindowTitle=function(e){return e.getGame().getRenderer().getWindowTitle()},t.getWindowInnerWidth=function(){return r.RuntimeGameRenderer&&r.RuntimeGameRenderer.getWindowInnerWidth?r.RuntimeGameRenderer.getWindowInnerWidth():typeof t!="undefined"?t.innerWidth:800},t.getWindowInnerHeight=function(){return r.RuntimeGameRenderer&&r.RuntimeGameRenderer.getWindowInnerHeight?r.RuntimeGameRenderer.getWindowInnerHeight():typeof t!="undefined"?t.innerHeight:800},t.getGameResolutionWidth=function(e){return e.getGame().getGameResolutionWidth()},t.getGameResolutionHeight=function(e){return e.getGame().getGameResolutionHeight()},t.openURL=function(e,n){return n.getGame().getRenderer().openURL(e)}})(m=u.window||(u.window={}))})(s=r.evtTools||(r.evtTools={}))})(gdjs||(gdjs={})); +//# sourceMappingURL=windowtools.js.map diff --git a/desktop/apps/dezunkrr/fontfaceobserver-font-manager/fontfaceobserver-font-manager.js b/desktop/apps/dezunkrr/fontfaceobserver-font-manager/fontfaceobserver-font-manager.js new file mode 100644 index 0000000..862e60b --- /dev/null +++ b/desktop/apps/dezunkrr/fontfaceobserver-font-manager/fontfaceobserver-font-manager.js @@ -0,0 +1,2 @@ +var gdjs;(function(d){const c=new d.Logger("Font manager");class u{constructor(e,o){this._loadedFontFamily={};this._loadedFonts={};this._filenameToFontFamily={};this._resources=e,this._resourcesLoader=o}setResources(e){this._resources=e}getFontFamily(e){return this._loadedFontFamily[e]?this._loadedFontFamily[e]:"Arial"}getFontFile(e){return this._loadedFonts[e]?this._loadedFonts[e].file||"":e}_getFontFamilyFromFilename(e){if(this._filenameToFontFamily[e])return this._filenameToFontFamily[e];let o="gdjs_font_"+e.toLowerCase().replace(/[^\w]/gi,"-");const i=o;let r=2;for(;this._filenameToFontFamily[o];)o=o+"-"+r,r++;return this._filenameToFontFamily[e]=i}_loadFont(e,o){const i={},r="url("+encodeURI(o)+")";if(typeof FontFace!="undefined")return fetch(this._resourcesLoader.getFullUrl(o),{credentials:this._resourcesLoader.checkIfCredentialsRequired(o)?"include":"same-origin"}).then(n=>{if(!n.ok){const a="Unable to fetch "+o+" to be loaded as a font. HTTP status is: "+n.status+".";throw c.error(a),new Error(a)}return n.arrayBuffer()}).then(n=>{const a=new FontFace(e,n,i);document.fonts.add(a)});{const n=document.createElement("style");return n.appendChild(document.createTextNode("@font-face { font-family: '"+e+"'; src: "+r+"; }")),document.head.appendChild(n),new FontFaceObserver(e,i).load()}}loadFonts(e,o){const i=this._resources,r={};for(let s=0,l=i.length;s{l.forEach(t=>{this._loadedFontFamily[t.name]=s,this._loadedFonts[t.name]=t}),a++,e(a,n),a===n&&o(n)};Object.keys(r).forEach(s=>{const l=this._getFontFamilyFromFilename(s),t=r[s];this._loadFont(l,s).then(()=>{F(l,t)},f=>{c.error('Error loading font resource "'+t[0].name+'" (file: '+s+"): "+(f.message||"Unknown error")),F(l,t)})})}}d.FontFaceObserverFontManager=u,d.FontManager=u})(gdjs||(gdjs={})); +//# sourceMappingURL=fontfaceobserver-font-manager.js.map diff --git a/desktop/apps/dezunkrr/fontfaceobserver-font-manager/fontfaceobserver.js b/desktop/apps/dezunkrr/fontfaceobserver-font-manager/fontfaceobserver.js new file mode 100644 index 0000000..3ff4b31 --- /dev/null +++ b/desktop/apps/dezunkrr/fontfaceobserver-font-manager/fontfaceobserver.js @@ -0,0 +1,16 @@ +(function() { +var module; //Define an undefined module variable to avoid fontfaceobserver thinking it's used in an environment using require. + +/* Font Face Observer v2.0.13 - © Bram Stein. License: BSD-3-Clause */(function(){'use strict';var f,g=[];function l(a){g.push(a);1==g.length&&f()}function m(){for(;g.length;)g[0](),g.shift()}f=function(){setTimeout(m)};function n(a){this.a=p;this.b=void 0;this.f=[];var b=this;try{a(function(a){q(b,a)},function(a){r(b,a)})}catch(c){r(b,c)}}var p=2;function t(a){return new n(function(b,c){c(a)})}function u(a){return new n(function(b){b(a)})}function q(a,b){if(a.a==p){if(b==a)throw new TypeError;var c=!1;try{var d=b&&b.then;if(null!=b&&"object"==typeof b&&"function"==typeof d){d.call(b,function(b){c||q(a,b);c=!0},function(b){c||r(a,b);c=!0});return}}catch(e){c||r(a,e);return}a.a=0;a.b=b;v(a)}} +function r(a,b){if(a.a==p){if(b==a)throw new TypeError;a.a=1;a.b=b;v(a)}}function v(a){l(function(){if(a.a!=p)for(;a.f.length;){var b=a.f.shift(),c=b[0],d=b[1],e=b[2],b=b[3];try{0==a.a?"function"==typeof c?e(c.call(void 0,a.b)):e(a.b):1==a.a&&("function"==typeof d?e(d.call(void 0,a.b)):b(a.b))}catch(h){b(h)}}})}n.prototype.g=function(a){return this.c(void 0,a)};n.prototype.c=function(a,b){var c=this;return new n(function(d,e){c.f.push([a,b,d,e]);v(c)})}; +function w(a){return new n(function(b,c){function d(c){return function(d){h[c]=d;e+=1;e==a.length&&b(h)}}var e=0,h=[];0==a.length&&b(h);for(var k=0;kparseInt(a[1],10)}else C=!1;return C}function J(){null===F&&(F=!!document.fonts);return F} +function K(){if(null===E){var a=document.createElement("div");try{a.style.font="condensed 100px sans-serif"}catch(b){}E=""!==a.style.font}return E}function L(a,b){return[a.style,a.weight,K()?a.stretch:"","100px",b].join(" ")} +A.prototype.load=function(a,b){var c=this,k=a||"BESbswy",q=0,D=b||3E3,H=(new Date).getTime();return new Promise(function(a,b){if(J()&&!G()){var M=new Promise(function(a,b){function e(){(new Date).getTime()-H>=D?b():document.fonts.load(L(c,'"'+c.family+'"'),k).then(function(c){1<=c.length?a():setTimeout(e,25)},function(){b()})}e()}),N=new Promise(function(a,c){q=setTimeout(c,D)});Promise.race([N,M]).then(function(){clearTimeout(q);a(c)},function(){b(c)})}else m(function(){function u(){var b;if(b=-1!= +f&&-1!=g||-1!=f&&-1!=h||-1!=g&&-1!=h)(b=f!=g&&f!=h&&g!=h)||(null===B&&(b=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent),B=!!b&&(536>parseInt(b[1],10)||536===parseInt(b[1],10)&&11>=parseInt(b[2],10))),b=B&&(f==v&&g==v&&h==v||f==w&&g==w&&h==w||f==x&&g==x&&h==x)),b=!b;b&&(d.parentNode&&d.parentNode.removeChild(d),clearTimeout(q),a(c))}function I(){if((new Date).getTime()-H>=D)d.parentNode&&d.parentNode.removeChild(d),b(c);else{var a=document.hidden;if(!0===a||void 0===a)f=e.a.offsetWidth, +g=n.a.offsetWidth,h=p.a.offsetWidth,u();q=setTimeout(I,50)}}var e=new r(k),n=new r(k),p=new r(k),f=-1,g=-1,h=-1,v=-1,w=-1,x=-1,d=document.createElement("div");d.dir="ltr";t(e,L(c,"sans-serif"));t(n,L(c,"serif"));t(p,L(c,"monospace"));d.appendChild(e.a);d.appendChild(n.a);d.appendChild(p.a);document.body.appendChild(d);v=e.a.offsetWidth;w=n.a.offsetWidth;x=p.a.offsetWidth;I();z(e,function(a){f=a;u()});t(e,L(c,'"'+c.family+'",sans-serif'));z(n,function(a){g=a;u()});t(n,L(c,'"'+c.family+'",serif')); +z(p,function(a){h=a;u()});t(p,L(c,'"'+c.family+'",monospace'))})})};"object"===typeof module?module.exports=A:(window.FontFaceObserver=A,window.FontFaceObserver.prototype.load=A.prototype.load);}()); +})() \ No newline at end of file diff --git a/desktop/apps/dezunkrr/force.js b/desktop/apps/dezunkrr/force.js new file mode 100644 index 0000000..7f984af --- /dev/null +++ b/desktop/apps/dezunkrr/force.js @@ -0,0 +1,2 @@ +var gdjs;(function(e){class s{constructor(t,i,h){this._dirty=!1;this._x=t||0,this._y=i||0,this._angle=Math.atan2(i,t)*180/Math.PI,this._length=Math.sqrt(t*t+i*i),this._multiplier=h}getX(){return this._x}getY(){return this._y}setX(t){this._x=t,this._dirty=!0}setY(t){this._y=t,this._dirty=!0}setAngle(t){this._dirty&&(this._length=Math.sqrt(this._x*this._x+this._y*this._y),this._dirty=!1),this._angle=t;const i=t/180*Math.PI;this._x=Math.cos(i)*this._length,this._y=Math.sin(i)*this._length}setLength(t){this._dirty&&(this._angle=Math.atan2(this._y,this._x)*180/Math.PI,this._dirty=!1),this._length=t;const i=this._angle/180*Math.PI;this._x=Math.cos(i)*this._length,this._y=Math.sin(i)*this._length}getAngle(){return this._dirty&&(this._angle=Math.atan2(this._y,this._x)*180/Math.PI,this._length=Math.sqrt(this._x*this._x+this._y*this._y),this._dirty=!1),this._angle}getLength(){return this._dirty&&(this._angle=Math.atan2(this._y,this._x)*180/Math.PI,this._length=Math.sqrt(this._x*this._x+this._y*this._y),this._dirty=!1),this._length}getMultiplier(){return this._multiplier}setMultiplier(t){this._multiplier=t}}e.Force=s})(gdjs||(gdjs={})); +//# sourceMappingURL=force.js.map diff --git a/desktop/apps/dezunkrr/gd.js b/desktop/apps/dezunkrr/gd.js new file mode 100644 index 0000000..db5fda7 --- /dev/null +++ b/desktop/apps/dezunkrr/gd.js @@ -0,0 +1,2 @@ +var gdjs;(function(t){const i=new t.Logger("Engine runtime");let u;(function(n){const e=!0})(u=t.evtTools||(t.evtTools={})),t.objectsTypes=new Hashtable,t.behaviorsTypes=new Hashtable,t.callbacksFirstRuntimeSceneLoaded=[],t.callbacksRuntimeSceneLoaded=[],t.callbacksRuntimeScenePreEvents=[],t.callbacksRuntimeScenePostEvents=[],t.callbacksRuntimeScenePaused=[],t.callbacksRuntimeSceneResumed=[],t.callbacksRuntimeSceneUnloading=[],t.callbacksRuntimeSceneUnloaded=[],t.callbacksObjectDeletedFromScene=[],t.gdevelopLogo="",t.rgbToHex=function(e,n,r){return""+((1<<24)+(e<<16)+(n<<8)+r).toString(16).slice(1)},t.hexToRGBColor=function(e){var n=parseInt(e.replace("#",""),16);return[n>>16&255,n>>8&255,n&255]},t.rgbOrHexToRGBColor=function(e){const n=e.split(";");return n.length===3?[parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10)]:t.hexToRGBColor(e)},t.rgbOrHexStringToNumber=e=>{const n=t.rgbOrHexToRGBColor(e);return t.rgbToHexNumber(n[0],n[1],n[2])},t.rgbToHexNumber=function(e,n,r){return(e<<16)+(n<<8)+r},t.hexNumberToRGB=e=>({r:e>>16&255,g:e>>8&255,b:e&255,a:255}),t.random=function(e){return e<=0?0:Math.floor(Math.random()*(e+1))},t.randomInRange=function(e,n){return e+t.random(n-e)},t.randomFloat=function(e){return e<=0?0:Math.random()*e},t.randomFloatInRange=function(e,n){return e+t.randomFloat(n-e)},t.randomWithStep=function(e,n,r){return r<=0?e+t.random(n-e):e+t.random(Math.floor((n-e)/r))*r},t.toRad=function(e){return e/180*Math.PI},t.toDegrees=function(e){return e*180/Math.PI},t.registerObject=function(e,n){t.objectsTypes.put(e,n)},t.registerBehavior=function(e,n){t.behaviorsTypes.put(e,n)},t.registerFirstRuntimeSceneLoadedCallback=function(e){t.callbacksFirstRuntimeSceneLoaded.push(e)},t.registerRuntimeSceneLoadedCallback=function(e){t.callbacksRuntimeSceneLoaded.push(e)},t.registerRuntimeScenePreEventsCallback=function(e){t.callbacksRuntimeScenePreEvents.push(e)},t.registerRuntimeScenePostEventsCallback=function(e){t.callbacksRuntimeScenePostEvents.push(e)},t.registerRuntimeScenePausedCallback=function(e){t.callbacksRuntimeScenePaused.push(e)},t.registerRuntimeSceneResumedCallback=function(e){t.callbacksRuntimeSceneResumed.push(e)},t.registerRuntimeSceneUnloadingCallback=function(e){t.callbacksRuntimeSceneUnloading.push(e)},t.registerRuntimeSceneUnloadedCallback=function(e){t.callbacksRuntimeSceneUnloaded.push(e)},t.registerObjectDeletedFromSceneCallback=function(e){t.callbacksObjectDeletedFromScene.push(e)},t._unregisterCallback=function(e){const n=r=>{for(let o=0;oa?(a^Math.random()*16>>a/4).toString(16):(""+1e7+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,o);return o()}if(!t.makeUuid.hex){t.makeUuid.hex=[];for(var e=0;e<256;e++)t.makeUuid.hex[e]=(e<16?"0":"")+e.toString(16)}const n=t.makeUuid.hex;var r=crypto.getRandomValues(new Uint8Array(16));return r[6]=r[6]&15|64,r[8]=r[8]&63|128,n[r[0]]+n[r[1]]+n[r[2]]+n[r[3]]+"-"+n[r[4]]+n[r[5]]+"-"+n[r[6]]+n[r[7]]+"-"+n[r[8]]+n[r[9]]+"-"+n[r[10]]+n[r[11]]+n[r[12]]+n[r[13]]+n[r[14]]+n[r[15]]},t.nearlyEqual=(e,n,r)=>{const o=Math.abs(e),a=Math.abs(n),c=Math.abs(e-n);return e===n?!0:e==0||n==0||o+a{l.push(e)},t.getAllAsynchronouslyLoadingLibraryPromise=()=>Promise.all(l)})(gdjs||(gdjs={})),console.warn=console.warn||console.log,console.error=console.error||console.log; +//# sourceMappingURL=gd.js.map diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscenebottom-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscenebottom-func.js new file mode 100644 index 0000000..793ecb0 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscenebottom-func.js @@ -0,0 +1,91 @@ + +if (typeof gdjs.evtsExt__AlignObject__ToSceneBottom !== "undefined") { + gdjs.evtsExt__AlignObject__ToSceneBottom.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__AlignObject__ToSceneBottom = {}; +gdjs.evtsExt__AlignObject__ToSceneBottom.GDObjectToAlignObjects1= []; +gdjs.evtsExt__AlignObject__ToSceneBottom.GDObjectToAlignObjects2= []; + + +gdjs.evtsExt__AlignObject__ToSceneBottom.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("ObjectToAlign"), gdjs.evtsExt__AlignObject__ToSceneBottom.GDObjectToAlignObjects1); +{for(var i = 0, len = gdjs.evtsExt__AlignObject__ToSceneBottom.GDObjectToAlignObjects1.length ;i < len;++i) { + gdjs.evtsExt__AlignObject__ToSceneBottom.GDObjectToAlignObjects1[i].setY(gdjs.evtTools.window.getGameResolutionHeight(runtimeScene) - (gdjs.evtsExt__AlignObject__ToSceneBottom.GDObjectToAlignObjects1[i].getHeight())); +} +}} + +} + + +}; + +gdjs.evtsExt__AlignObject__ToSceneBottom.func = function(runtimeScene, ObjectToAlign, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +"ObjectToAlign": ObjectToAlign +}, + _objectArraysMap: { +"ObjectToAlign": gdjs.objectsListsToArray(ObjectToAlign) +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + +gdjs.evtsExt__AlignObject__ToSceneBottom.GDObjectToAlignObjects1.length = 0; +gdjs.evtsExt__AlignObject__ToSceneBottom.GDObjectToAlignObjects2.length = 0; + +gdjs.evtsExt__AlignObject__ToSceneBottom.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__AlignObject__ToSceneBottom.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscenecenter-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscenecenter-func.js new file mode 100644 index 0000000..e7b2d22 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscenecenter-func.js @@ -0,0 +1,91 @@ + +if (typeof gdjs.evtsExt__AlignObject__ToSceneCenter !== "undefined") { + gdjs.evtsExt__AlignObject__ToSceneCenter.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__AlignObject__ToSceneCenter = {}; +gdjs.evtsExt__AlignObject__ToSceneCenter.GDObjectToAlignObjects1= []; +gdjs.evtsExt__AlignObject__ToSceneCenter.GDObjectToAlignObjects2= []; + + +gdjs.evtsExt__AlignObject__ToSceneCenter.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("ObjectToAlign"), gdjs.evtsExt__AlignObject__ToSceneCenter.GDObjectToAlignObjects1); +{for(var i = 0, len = gdjs.evtsExt__AlignObject__ToSceneCenter.GDObjectToAlignObjects1.length ;i < len;++i) { + gdjs.evtsExt__AlignObject__ToSceneCenter.GDObjectToAlignObjects1[i].setX(gdjs.evtTools.window.getGameResolutionWidth(runtimeScene) / 2 - (gdjs.evtsExt__AlignObject__ToSceneCenter.GDObjectToAlignObjects1[i].getWidth()) / 2); +} +}} + +} + + +}; + +gdjs.evtsExt__AlignObject__ToSceneCenter.func = function(runtimeScene, ObjectToAlign, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +"ObjectToAlign": ObjectToAlign +}, + _objectArraysMap: { +"ObjectToAlign": gdjs.objectsListsToArray(ObjectToAlign) +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + +gdjs.evtsExt__AlignObject__ToSceneCenter.GDObjectToAlignObjects1.length = 0; +gdjs.evtsExt__AlignObject__ToSceneCenter.GDObjectToAlignObjects2.length = 0; + +gdjs.evtsExt__AlignObject__ToSceneCenter.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__AlignObject__ToSceneCenter.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscenecentered-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscenecentered-func.js new file mode 100644 index 0000000..9fd9251 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscenecentered-func.js @@ -0,0 +1,91 @@ + +if (typeof gdjs.evtsExt__AlignObject__ToSceneCentered !== "undefined") { + gdjs.evtsExt__AlignObject__ToSceneCentered.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__AlignObject__ToSceneCentered = {}; +gdjs.evtsExt__AlignObject__ToSceneCentered.GDObjectToCenterObjects1= []; +gdjs.evtsExt__AlignObject__ToSceneCentered.GDObjectToCenterObjects2= []; + + +gdjs.evtsExt__AlignObject__ToSceneCentered.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("ObjectToCenter"), gdjs.evtsExt__AlignObject__ToSceneCentered.GDObjectToCenterObjects1); +{for(var i = 0, len = gdjs.evtsExt__AlignObject__ToSceneCentered.GDObjectToCenterObjects1.length ;i < len;++i) { + gdjs.evtsExt__AlignObject__ToSceneCentered.GDObjectToCenterObjects1[i].setPosition(gdjs.evtTools.window.getGameResolutionWidth(runtimeScene) / 2 - (gdjs.evtsExt__AlignObject__ToSceneCentered.GDObjectToCenterObjects1[i].getWidth()) / 2,gdjs.evtTools.window.getGameResolutionHeight(runtimeScene) / 2 - (gdjs.evtsExt__AlignObject__ToSceneCentered.GDObjectToCenterObjects1[i].getHeight()) / 2); +} +}} + +} + + +}; + +gdjs.evtsExt__AlignObject__ToSceneCentered.func = function(runtimeScene, ObjectToCenter, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +"ObjectToCenter": ObjectToCenter +}, + _objectArraysMap: { +"ObjectToCenter": gdjs.objectsListsToArray(ObjectToCenter) +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + +gdjs.evtsExt__AlignObject__ToSceneCentered.GDObjectToCenterObjects1.length = 0; +gdjs.evtsExt__AlignObject__ToSceneCentered.GDObjectToCenterObjects2.length = 0; + +gdjs.evtsExt__AlignObject__ToSceneCentered.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__AlignObject__ToSceneCentered.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__tosceneleft-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__tosceneleft-func.js new file mode 100644 index 0000000..d453ee0 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__tosceneleft-func.js @@ -0,0 +1,91 @@ + +if (typeof gdjs.evtsExt__AlignObject__ToSceneLeft !== "undefined") { + gdjs.evtsExt__AlignObject__ToSceneLeft.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__AlignObject__ToSceneLeft = {}; +gdjs.evtsExt__AlignObject__ToSceneLeft.GDObjectToAlignObjects1= []; +gdjs.evtsExt__AlignObject__ToSceneLeft.GDObjectToAlignObjects2= []; + + +gdjs.evtsExt__AlignObject__ToSceneLeft.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("ObjectToAlign"), gdjs.evtsExt__AlignObject__ToSceneLeft.GDObjectToAlignObjects1); +{for(var i = 0, len = gdjs.evtsExt__AlignObject__ToSceneLeft.GDObjectToAlignObjects1.length ;i < len;++i) { + gdjs.evtsExt__AlignObject__ToSceneLeft.GDObjectToAlignObjects1[i].setX(0); +} +}} + +} + + +}; + +gdjs.evtsExt__AlignObject__ToSceneLeft.func = function(runtimeScene, ObjectToAlign, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +"ObjectToAlign": ObjectToAlign +}, + _objectArraysMap: { +"ObjectToAlign": gdjs.objectsListsToArray(ObjectToAlign) +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + +gdjs.evtsExt__AlignObject__ToSceneLeft.GDObjectToAlignObjects1.length = 0; +gdjs.evtsExt__AlignObject__ToSceneLeft.GDObjectToAlignObjects2.length = 0; + +gdjs.evtsExt__AlignObject__ToSceneLeft.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__AlignObject__ToSceneLeft.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscenemiddle-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscenemiddle-func.js new file mode 100644 index 0000000..6b5e1e3 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscenemiddle-func.js @@ -0,0 +1,91 @@ + +if (typeof gdjs.evtsExt__AlignObject__ToSceneMiddle !== "undefined") { + gdjs.evtsExt__AlignObject__ToSceneMiddle.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__AlignObject__ToSceneMiddle = {}; +gdjs.evtsExt__AlignObject__ToSceneMiddle.GDObjectToAlignObjects1= []; +gdjs.evtsExt__AlignObject__ToSceneMiddle.GDObjectToAlignObjects2= []; + + +gdjs.evtsExt__AlignObject__ToSceneMiddle.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("ObjectToAlign"), gdjs.evtsExt__AlignObject__ToSceneMiddle.GDObjectToAlignObjects1); +{for(var i = 0, len = gdjs.evtsExt__AlignObject__ToSceneMiddle.GDObjectToAlignObjects1.length ;i < len;++i) { + gdjs.evtsExt__AlignObject__ToSceneMiddle.GDObjectToAlignObjects1[i].setY(gdjs.evtTools.window.getGameResolutionHeight(runtimeScene) / 2 - (gdjs.evtsExt__AlignObject__ToSceneMiddle.GDObjectToAlignObjects1[i].getHeight()) / 2); +} +}} + +} + + +}; + +gdjs.evtsExt__AlignObject__ToSceneMiddle.func = function(runtimeScene, ObjectToAlign, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +"ObjectToAlign": ObjectToAlign +}, + _objectArraysMap: { +"ObjectToAlign": gdjs.objectsListsToArray(ObjectToAlign) +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + +gdjs.evtsExt__AlignObject__ToSceneMiddle.GDObjectToAlignObjects1.length = 0; +gdjs.evtsExt__AlignObject__ToSceneMiddle.GDObjectToAlignObjects2.length = 0; + +gdjs.evtsExt__AlignObject__ToSceneMiddle.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__AlignObject__ToSceneMiddle.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__tosceneright-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__tosceneright-func.js new file mode 100644 index 0000000..5f29d51 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__tosceneright-func.js @@ -0,0 +1,91 @@ + +if (typeof gdjs.evtsExt__AlignObject__ToSceneRight !== "undefined") { + gdjs.evtsExt__AlignObject__ToSceneRight.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__AlignObject__ToSceneRight = {}; +gdjs.evtsExt__AlignObject__ToSceneRight.GDObjectToAlignObjects1= []; +gdjs.evtsExt__AlignObject__ToSceneRight.GDObjectToAlignObjects2= []; + + +gdjs.evtsExt__AlignObject__ToSceneRight.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("ObjectToAlign"), gdjs.evtsExt__AlignObject__ToSceneRight.GDObjectToAlignObjects1); +{for(var i = 0, len = gdjs.evtsExt__AlignObject__ToSceneRight.GDObjectToAlignObjects1.length ;i < len;++i) { + gdjs.evtsExt__AlignObject__ToSceneRight.GDObjectToAlignObjects1[i].setX(gdjs.evtTools.window.getGameResolutionWidth(runtimeScene) - (gdjs.evtsExt__AlignObject__ToSceneRight.GDObjectToAlignObjects1[i].getWidth())); +} +}} + +} + + +}; + +gdjs.evtsExt__AlignObject__ToSceneRight.func = function(runtimeScene, ObjectToAlign, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +"ObjectToAlign": ObjectToAlign +}, + _objectArraysMap: { +"ObjectToAlign": gdjs.objectsListsToArray(ObjectToAlign) +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + +gdjs.evtsExt__AlignObject__ToSceneRight.GDObjectToAlignObjects1.length = 0; +gdjs.evtsExt__AlignObject__ToSceneRight.GDObjectToAlignObjects2.length = 0; + +gdjs.evtsExt__AlignObject__ToSceneRight.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__AlignObject__ToSceneRight.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscenetop-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscenetop-func.js new file mode 100644 index 0000000..36f7700 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscenetop-func.js @@ -0,0 +1,91 @@ + +if (typeof gdjs.evtsExt__AlignObject__ToSceneTop !== "undefined") { + gdjs.evtsExt__AlignObject__ToSceneTop.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__AlignObject__ToSceneTop = {}; +gdjs.evtsExt__AlignObject__ToSceneTop.GDObjectToAlignObjects1= []; +gdjs.evtsExt__AlignObject__ToSceneTop.GDObjectToAlignObjects2= []; + + +gdjs.evtsExt__AlignObject__ToSceneTop.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("ObjectToAlign"), gdjs.evtsExt__AlignObject__ToSceneTop.GDObjectToAlignObjects1); +{for(var i = 0, len = gdjs.evtsExt__AlignObject__ToSceneTop.GDObjectToAlignObjects1.length ;i < len;++i) { + gdjs.evtsExt__AlignObject__ToSceneTop.GDObjectToAlignObjects1[i].setY(0); +} +}} + +} + + +}; + +gdjs.evtsExt__AlignObject__ToSceneTop.func = function(runtimeScene, ObjectToAlign, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +"ObjectToAlign": ObjectToAlign +}, + _objectArraysMap: { +"ObjectToAlign": gdjs.objectsListsToArray(ObjectToAlign) +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + +gdjs.evtsExt__AlignObject__ToSceneTop.GDObjectToAlignObjects1.length = 0; +gdjs.evtsExt__AlignObject__ToSceneTop.GDObjectToAlignObjects2.length = 0; + +gdjs.evtsExt__AlignObject__ToSceneTop.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__AlignObject__ToSceneTop.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscreenbottom-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscreenbottom-func.js new file mode 100644 index 0000000..d2d9400 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscreenbottom-func.js @@ -0,0 +1,91 @@ + +if (typeof gdjs.evtsExt__AlignObject__ToScreenBottom !== "undefined") { + gdjs.evtsExt__AlignObject__ToScreenBottom.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__AlignObject__ToScreenBottom = {}; +gdjs.evtsExt__AlignObject__ToScreenBottom.GDObjectToAlignObjects1= []; +gdjs.evtsExt__AlignObject__ToScreenBottom.GDObjectToAlignObjects2= []; + + +gdjs.evtsExt__AlignObject__ToScreenBottom.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("ObjectToAlign"), gdjs.evtsExt__AlignObject__ToScreenBottom.GDObjectToAlignObjects1); +{for(var i = 0, len = gdjs.evtsExt__AlignObject__ToScreenBottom.GDObjectToAlignObjects1.length ;i < len;++i) { + gdjs.evtsExt__AlignObject__ToScreenBottom.GDObjectToAlignObjects1[i].setY(gdjs.evtTools.window.getWindowInnerHeight() - (gdjs.evtsExt__AlignObject__ToScreenBottom.GDObjectToAlignObjects1[i].getHeight())); +} +}} + +} + + +}; + +gdjs.evtsExt__AlignObject__ToScreenBottom.func = function(runtimeScene, ObjectToAlign, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +"ObjectToAlign": ObjectToAlign +}, + _objectArraysMap: { +"ObjectToAlign": gdjs.objectsListsToArray(ObjectToAlign) +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + +gdjs.evtsExt__AlignObject__ToScreenBottom.GDObjectToAlignObjects1.length = 0; +gdjs.evtsExt__AlignObject__ToScreenBottom.GDObjectToAlignObjects2.length = 0; + +gdjs.evtsExt__AlignObject__ToScreenBottom.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__AlignObject__ToScreenBottom.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscreencenter-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscreencenter-func.js new file mode 100644 index 0000000..746db93 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscreencenter-func.js @@ -0,0 +1,91 @@ + +if (typeof gdjs.evtsExt__AlignObject__ToScreenCenter !== "undefined") { + gdjs.evtsExt__AlignObject__ToScreenCenter.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__AlignObject__ToScreenCenter = {}; +gdjs.evtsExt__AlignObject__ToScreenCenter.GDObjectToAlignObjects1= []; +gdjs.evtsExt__AlignObject__ToScreenCenter.GDObjectToAlignObjects2= []; + + +gdjs.evtsExt__AlignObject__ToScreenCenter.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("ObjectToAlign"), gdjs.evtsExt__AlignObject__ToScreenCenter.GDObjectToAlignObjects1); +{for(var i = 0, len = gdjs.evtsExt__AlignObject__ToScreenCenter.GDObjectToAlignObjects1.length ;i < len;++i) { + gdjs.evtsExt__AlignObject__ToScreenCenter.GDObjectToAlignObjects1[i].setX(gdjs.evtTools.window.getWindowInnerWidth() / 2 - (gdjs.evtsExt__AlignObject__ToScreenCenter.GDObjectToAlignObjects1[i].getWidth()) / 2); +} +}} + +} + + +}; + +gdjs.evtsExt__AlignObject__ToScreenCenter.func = function(runtimeScene, ObjectToAlign, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +"ObjectToAlign": ObjectToAlign +}, + _objectArraysMap: { +"ObjectToAlign": gdjs.objectsListsToArray(ObjectToAlign) +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + +gdjs.evtsExt__AlignObject__ToScreenCenter.GDObjectToAlignObjects1.length = 0; +gdjs.evtsExt__AlignObject__ToScreenCenter.GDObjectToAlignObjects2.length = 0; + +gdjs.evtsExt__AlignObject__ToScreenCenter.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__AlignObject__ToScreenCenter.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscreencentered-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscreencentered-func.js new file mode 100644 index 0000000..3b9327d --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscreencentered-func.js @@ -0,0 +1,91 @@ + +if (typeof gdjs.evtsExt__AlignObject__ToScreenCentered !== "undefined") { + gdjs.evtsExt__AlignObject__ToScreenCentered.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__AlignObject__ToScreenCentered = {}; +gdjs.evtsExt__AlignObject__ToScreenCentered.GDObjectToCenterObjects1= []; +gdjs.evtsExt__AlignObject__ToScreenCentered.GDObjectToCenterObjects2= []; + + +gdjs.evtsExt__AlignObject__ToScreenCentered.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("ObjectToCenter"), gdjs.evtsExt__AlignObject__ToScreenCentered.GDObjectToCenterObjects1); +{for(var i = 0, len = gdjs.evtsExt__AlignObject__ToScreenCentered.GDObjectToCenterObjects1.length ;i < len;++i) { + gdjs.evtsExt__AlignObject__ToScreenCentered.GDObjectToCenterObjects1[i].setPosition(gdjs.evtTools.window.getWindowInnerWidth() / 2 - (gdjs.evtsExt__AlignObject__ToScreenCentered.GDObjectToCenterObjects1[i].getWidth()) / 2,gdjs.evtTools.window.getWindowInnerHeight() / 2 - (gdjs.evtsExt__AlignObject__ToScreenCentered.GDObjectToCenterObjects1[i].getHeight()) / 2); +} +}} + +} + + +}; + +gdjs.evtsExt__AlignObject__ToScreenCentered.func = function(runtimeScene, ObjectToCenter, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +"ObjectToCenter": ObjectToCenter +}, + _objectArraysMap: { +"ObjectToCenter": gdjs.objectsListsToArray(ObjectToCenter) +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + +gdjs.evtsExt__AlignObject__ToScreenCentered.GDObjectToCenterObjects1.length = 0; +gdjs.evtsExt__AlignObject__ToScreenCentered.GDObjectToCenterObjects2.length = 0; + +gdjs.evtsExt__AlignObject__ToScreenCentered.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__AlignObject__ToScreenCentered.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscreenleft-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscreenleft-func.js new file mode 100644 index 0000000..b2614fc --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscreenleft-func.js @@ -0,0 +1,91 @@ + +if (typeof gdjs.evtsExt__AlignObject__ToScreenLeft !== "undefined") { + gdjs.evtsExt__AlignObject__ToScreenLeft.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__AlignObject__ToScreenLeft = {}; +gdjs.evtsExt__AlignObject__ToScreenLeft.GDObjectToAlignObjects1= []; +gdjs.evtsExt__AlignObject__ToScreenLeft.GDObjectToAlignObjects2= []; + + +gdjs.evtsExt__AlignObject__ToScreenLeft.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("ObjectToAlign"), gdjs.evtsExt__AlignObject__ToScreenLeft.GDObjectToAlignObjects1); +{for(var i = 0, len = gdjs.evtsExt__AlignObject__ToScreenLeft.GDObjectToAlignObjects1.length ;i < len;++i) { + gdjs.evtsExt__AlignObject__ToScreenLeft.GDObjectToAlignObjects1[i].setX(0); +} +}} + +} + + +}; + +gdjs.evtsExt__AlignObject__ToScreenLeft.func = function(runtimeScene, ObjectToAlign, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +"ObjectToAlign": ObjectToAlign +}, + _objectArraysMap: { +"ObjectToAlign": gdjs.objectsListsToArray(ObjectToAlign) +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + +gdjs.evtsExt__AlignObject__ToScreenLeft.GDObjectToAlignObjects1.length = 0; +gdjs.evtsExt__AlignObject__ToScreenLeft.GDObjectToAlignObjects2.length = 0; + +gdjs.evtsExt__AlignObject__ToScreenLeft.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__AlignObject__ToScreenLeft.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscreenmiddle-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscreenmiddle-func.js new file mode 100644 index 0000000..4bd4342 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscreenmiddle-func.js @@ -0,0 +1,91 @@ + +if (typeof gdjs.evtsExt__AlignObject__ToScreenMiddle !== "undefined") { + gdjs.evtsExt__AlignObject__ToScreenMiddle.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__AlignObject__ToScreenMiddle = {}; +gdjs.evtsExt__AlignObject__ToScreenMiddle.GDObjectToAlignObjects1= []; +gdjs.evtsExt__AlignObject__ToScreenMiddle.GDObjectToAlignObjects2= []; + + +gdjs.evtsExt__AlignObject__ToScreenMiddle.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("ObjectToAlign"), gdjs.evtsExt__AlignObject__ToScreenMiddle.GDObjectToAlignObjects1); +{for(var i = 0, len = gdjs.evtsExt__AlignObject__ToScreenMiddle.GDObjectToAlignObjects1.length ;i < len;++i) { + gdjs.evtsExt__AlignObject__ToScreenMiddle.GDObjectToAlignObjects1[i].setY(gdjs.evtTools.window.getWindowInnerHeight() / 2 - (gdjs.evtsExt__AlignObject__ToScreenMiddle.GDObjectToAlignObjects1[i].getHeight()) / 2); +} +}} + +} + + +}; + +gdjs.evtsExt__AlignObject__ToScreenMiddle.func = function(runtimeScene, ObjectToAlign, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +"ObjectToAlign": ObjectToAlign +}, + _objectArraysMap: { +"ObjectToAlign": gdjs.objectsListsToArray(ObjectToAlign) +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + +gdjs.evtsExt__AlignObject__ToScreenMiddle.GDObjectToAlignObjects1.length = 0; +gdjs.evtsExt__AlignObject__ToScreenMiddle.GDObjectToAlignObjects2.length = 0; + +gdjs.evtsExt__AlignObject__ToScreenMiddle.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__AlignObject__ToScreenMiddle.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscreenright-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscreenright-func.js new file mode 100644 index 0000000..71a6858 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscreenright-func.js @@ -0,0 +1,91 @@ + +if (typeof gdjs.evtsExt__AlignObject__ToScreenRight !== "undefined") { + gdjs.evtsExt__AlignObject__ToScreenRight.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__AlignObject__ToScreenRight = {}; +gdjs.evtsExt__AlignObject__ToScreenRight.GDObjectToAlignObjects1= []; +gdjs.evtsExt__AlignObject__ToScreenRight.GDObjectToAlignObjects2= []; + + +gdjs.evtsExt__AlignObject__ToScreenRight.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("ObjectToAlign"), gdjs.evtsExt__AlignObject__ToScreenRight.GDObjectToAlignObjects1); +{for(var i = 0, len = gdjs.evtsExt__AlignObject__ToScreenRight.GDObjectToAlignObjects1.length ;i < len;++i) { + gdjs.evtsExt__AlignObject__ToScreenRight.GDObjectToAlignObjects1[i].setX(gdjs.evtTools.window.getWindowInnerWidth() - (gdjs.evtsExt__AlignObject__ToScreenRight.GDObjectToAlignObjects1[i].getWidth())); +} +}} + +} + + +}; + +gdjs.evtsExt__AlignObject__ToScreenRight.func = function(runtimeScene, ObjectToAlign, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +"ObjectToAlign": ObjectToAlign +}, + _objectArraysMap: { +"ObjectToAlign": gdjs.objectsListsToArray(ObjectToAlign) +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + +gdjs.evtsExt__AlignObject__ToScreenRight.GDObjectToAlignObjects1.length = 0; +gdjs.evtsExt__AlignObject__ToScreenRight.GDObjectToAlignObjects2.length = 0; + +gdjs.evtsExt__AlignObject__ToScreenRight.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__AlignObject__ToScreenRight.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscreentop-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscreentop-func.js new file mode 100644 index 0000000..52d5069 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__alignobject__toscreentop-func.js @@ -0,0 +1,91 @@ + +if (typeof gdjs.evtsExt__AlignObject__ToScreenTop !== "undefined") { + gdjs.evtsExt__AlignObject__ToScreenTop.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__AlignObject__ToScreenTop = {}; +gdjs.evtsExt__AlignObject__ToScreenTop.GDObjectToAlignObjects1= []; +gdjs.evtsExt__AlignObject__ToScreenTop.GDObjectToAlignObjects2= []; + + +gdjs.evtsExt__AlignObject__ToScreenTop.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("ObjectToAlign"), gdjs.evtsExt__AlignObject__ToScreenTop.GDObjectToAlignObjects1); +{for(var i = 0, len = gdjs.evtsExt__AlignObject__ToScreenTop.GDObjectToAlignObjects1.length ;i < len;++i) { + gdjs.evtsExt__AlignObject__ToScreenTop.GDObjectToAlignObjects1[i].setY(0); +} +}} + +} + + +}; + +gdjs.evtsExt__AlignObject__ToScreenTop.func = function(runtimeScene, ObjectToAlign, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +"ObjectToAlign": ObjectToAlign +}, + _objectArraysMap: { +"ObjectToAlign": gdjs.objectsListsToArray(ObjectToAlign) +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + +gdjs.evtsExt__AlignObject__ToScreenTop.GDObjectToAlignObjects1.length = 0; +gdjs.evtsExt__AlignObject__ToScreenTop.GDObjectToAlignObjects2.length = 0; + +gdjs.evtsExt__AlignObject__ToScreenTop.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__AlignObject__ToScreenTop.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__authorizedplatformsvalidation__addexecution-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__authorizedplatformsvalidation__addexecution-func.js new file mode 100644 index 0000000..2ababf1 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__authorizedplatformsvalidation__addexecution-func.js @@ -0,0 +1,83 @@ + +if (typeof gdjs.evtsExt__AuthorizedPlatformsValidation__AddExecution !== "undefined") { + gdjs.evtsExt__AuthorizedPlatformsValidation__AddExecution.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__AuthorizedPlatformsValidation__AddExecution = {}; + + +gdjs.evtsExt__AuthorizedPlatformsValidation__AddExecution.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtTools.variable.valuePush(runtimeScene.getGame().getVariables().get("__AuthorizedPlatformsValidation").getChild("AuthorizedPlatforms"), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Domain") : "")); +}} + +} + + +}; + +gdjs.evtsExt__AuthorizedPlatformsValidation__AddExecution.func = function(runtimeScene, Domain, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Domain") return Domain; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__AuthorizedPlatformsValidation__AddExecution.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__AuthorizedPlatformsValidation__AddExecution.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__authorizedplatformsvalidation__checkexecution-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__authorizedplatformsvalidation__checkexecution-func.js new file mode 100644 index 0000000..ea1ddc8 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__authorizedplatformsvalidation__checkexecution-func.js @@ -0,0 +1,118 @@ + +if (typeof gdjs.evtsExt__AuthorizedPlatformsValidation__CheckExecution !== "undefined") { + gdjs.evtsExt__AuthorizedPlatformsValidation__CheckExecution.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__AuthorizedPlatformsValidation__CheckExecution = {}; + + +gdjs.evtsExt__AuthorizedPlatformsValidation__CheckExecution.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{let isConditionTrue_1 = false; +isConditionTrue_0 = false; +{ +isConditionTrue_1 = gdjs.evtsExt__AuthorizedPlatformsValidation__Includes.func(runtimeScene, gdjs.evtsExt__AuthorizedPlatformsValidation__CurrentRefferer.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if(isConditionTrue_1) { + isConditionTrue_0 = true; +} +} +{ +isConditionTrue_1 = gdjs.evtTools.systemInfo.isPreview(runtimeScene); +if(isConditionTrue_1) { + isConditionTrue_0 = true; +} +} +{ +isConditionTrue_1 = gdjs.evtTools.systemInfo.isNativeMobileApp(); +if(isConditionTrue_1) { + isConditionTrue_0 = true; +} +} +{ +isConditionTrue_1 = gdjs.evtTools.systemInfo.isNativeDesktopApp(runtimeScene); +if(isConditionTrue_1) { + isConditionTrue_0 = true; +} +} +{ +} +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +}; + +gdjs.evtsExt__AuthorizedPlatformsValidation__CheckExecution.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__AuthorizedPlatformsValidation__CheckExecution.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__AuthorizedPlatformsValidation__CheckExecution.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__authorizedplatformsvalidation__currentrefferer-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__authorizedplatformsvalidation__currentrefferer-func.js new file mode 100644 index 0000000..fcc50a3 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__authorizedplatformsvalidation__currentrefferer-func.js @@ -0,0 +1,85 @@ + +if (typeof gdjs.evtsExt__AuthorizedPlatformsValidation__CurrentRefferer !== "undefined") { + gdjs.evtsExt__AuthorizedPlatformsValidation__CurrentRefferer.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__AuthorizedPlatformsValidation__CurrentRefferer = {}; + + +gdjs.evtsExt__AuthorizedPlatformsValidation__CurrentRefferer.userFunc0x9c04a8 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +// If the document referrer is not empty, return the hostname (the domain name) else, return an empty string. +eventsFunctionContext.returnValue = document.referrer ? new URL(document.referrer).hostname : "" ; + +}; +gdjs.evtsExt__AuthorizedPlatformsValidation__CurrentRefferer.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__AuthorizedPlatformsValidation__CurrentRefferer.userFunc0x9c04a8(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__AuthorizedPlatformsValidation__CurrentRefferer.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__AuthorizedPlatformsValidation__CurrentRefferer.eventsList0(runtimeScene, eventsFunctionContext); + +return "" + eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__AuthorizedPlatformsValidation__CurrentRefferer.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__authorizedplatformsvalidation__includes-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__authorizedplatformsvalidation__includes-func.js new file mode 100644 index 0000000..2857c85 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__authorizedplatformsvalidation__includes-func.js @@ -0,0 +1,96 @@ + +if (typeof gdjs.evtsExt__AuthorizedPlatformsValidation__Includes !== "undefined") { + gdjs.evtsExt__AuthorizedPlatformsValidation__Includes.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__AuthorizedPlatformsValidation__Includes = {}; + + +gdjs.evtsExt__AuthorizedPlatformsValidation__Includes.userFunc0x9c04a8 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +const authorizedPlatformsVariableReference = runtimeScene.getGame() + .getVariables() + .get("__AuthorizedPlatformsValidation") + .getChild("AuthorizedPlatforms"); + +authorizedPlatformsVariableReference.castTo("array"); + +eventsFunctionContext.returnValue = + authorizedPlatformsVariableReference.toJSObject() + .includes( + eventsFunctionContext.getArgument("DomainToCheck") + ); + +}; +gdjs.evtsExt__AuthorizedPlatformsValidation__Includes.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__AuthorizedPlatformsValidation__Includes.userFunc0x9c04a8(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__AuthorizedPlatformsValidation__Includes.func = function(runtimeScene, DomainToCheck, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "DomainToCheck") return DomainToCheck; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__AuthorizedPlatformsValidation__Includes.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__AuthorizedPlatformsValidation__Includes.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__currentgameversion__returncurrentgameversion-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__currentgameversion__returncurrentgameversion-func.js new file mode 100644 index 0000000..2ffa33c --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__currentgameversion__returncurrentgameversion-func.js @@ -0,0 +1,83 @@ + +if (typeof gdjs.evtsExt__CurrentGameVersion__ReturnCurrentGameVersion !== "undefined") { + gdjs.evtsExt__CurrentGameVersion__ReturnCurrentGameVersion.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__CurrentGameVersion__ReturnCurrentGameVersion = {}; + + +gdjs.evtsExt__CurrentGameVersion__ReturnCurrentGameVersion.userFunc0x1992370 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +eventsFunctionContext.returnValue = runtimeScene.getGame().getGameData().properties.version; +}; +gdjs.evtsExt__CurrentGameVersion__ReturnCurrentGameVersion.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__CurrentGameVersion__ReturnCurrentGameVersion.userFunc0x1992370(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__CurrentGameVersion__ReturnCurrentGameVersion.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__CurrentGameVersion__ReturnCurrentGameVersion.eventsList0(runtimeScene, eventsFunctionContext); + +return "" + eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__CurrentGameVersion__ReturnCurrentGameVersion.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__firebullet__firebullet.js b/desktop/apps/dezunkrr/gdjs-evtsext__firebullet__firebullet.js new file mode 100644 index 0000000..7663e0b --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__firebullet__firebullet.js @@ -0,0 +1,7940 @@ + +gdjs.evtsExt__FireBullet__FireBullet = gdjs.evtsExt__FireBullet__FireBullet || {}; + +/** + * Behavior generated from Fire bullets + */ +gdjs.evtsExt__FireBullet__FireBullet.FireBullet = class FireBullet extends gdjs.RuntimeBehavior { + constructor(instanceContainer, behaviorData, owner) { + super(instanceContainer, behaviorData, owner); + this._runtimeScene = instanceContainer; + + this._onceTriggers = new gdjs.OnceTriggers(); + this._behaviorData = {}; + this._sharedData = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.getSharedData( + instanceContainer, + behaviorData.name + ); + + this._behaviorData.FireCooldown = behaviorData.FireCooldown !== undefined ? behaviorData.FireCooldown : Number("0.1") || 0; + this._behaviorData.HasJustFired = false; + this._behaviorData.FiringArc = behaviorData.FiringArc !== undefined ? behaviorData.FiringArc : Number("45") || 0; + this._behaviorData.BulletQuantity = behaviorData.BulletQuantity !== undefined ? behaviorData.BulletQuantity : Number("1") || 0; + this._behaviorData.AngleVariance = behaviorData.AngleVariance !== undefined ? behaviorData.AngleVariance : Number("0") || 0; + this._behaviorData.RotateBullet = behaviorData.RotateBullet !== undefined ? behaviorData.RotateBullet : true; + this._behaviorData.AmmoQuantity = Number("0") || 0; + this._behaviorData.ShotsPerReload = behaviorData.ShotsPerReload !== undefined ? behaviorData.ShotsPerReload : Number("0") || 0; + this._behaviorData.ReloadDuration = behaviorData.ReloadDuration !== undefined ? behaviorData.ReloadDuration : Number("1") || 0; + this._behaviorData.MaxAmmo = behaviorData.MaxAmmo !== undefined ? behaviorData.MaxAmmo : Number("0") || 0; + this._behaviorData.ShotsBeforeNextReload = Number("0") || 0; + this._behaviorData.TotalShotsFired = Number("0") || 0; + this._behaviorData.TotalBulletsCreated = Number("0") || 0; + this._behaviorData.StartingAmmo = behaviorData.StartingAmmo !== undefined ? behaviorData.StartingAmmo : Number("0") || 0; + this._behaviorData.TotalReloadsCompleted = Number("0") || 0; + this._behaviorData.UnlimitedAmmo = behaviorData.UnlimitedAmmo !== undefined ? behaviorData.UnlimitedAmmo : true; + this._behaviorData.ReloadInProgress = false; + this._behaviorData.HeatIncreasePerShot = behaviorData.HeatIncreasePerShot !== undefined ? behaviorData.HeatIncreasePerShot : Number("0") || 0; + this._behaviorData.HeatLevel = Number("0") || 0; + this._behaviorData.AutomaticReloading = behaviorData.AutomaticReloading !== undefined ? behaviorData.AutomaticReloading : true; + this._behaviorData.OverheatDuration = behaviorData.OverheatDuration !== undefined ? behaviorData.OverheatDuration : Number("0") || 0; + this._behaviorData.LinearCoolingRate = behaviorData.LinearCoolingRate !== undefined ? behaviorData.LinearCoolingRate : Number("0.1") || 0; + this._behaviorData.ExponentialCoolingRate = behaviorData.ExponentialCoolingRate !== undefined ? behaviorData.ExponentialCoolingRate : Number("0.3") || 0; + this._behaviorData.BulletLayer = ""; + this._behaviorData.RandomizedAngle = Number("0") || 0; + this._behaviorData.BulletSpeedVariance = behaviorData.BulletSpeedVariance !== undefined ? behaviorData.BulletSpeedVariance : Number("0") || 0; + } + + // Hot-reload: + updateFromBehaviorData(oldBehaviorData, newBehaviorData) { + + if (oldBehaviorData.FireCooldown !== newBehaviorData.FireCooldown) + this._behaviorData.FireCooldown = newBehaviorData.FireCooldown; + if (oldBehaviorData.HasJustFired !== newBehaviorData.HasJustFired) + this._behaviorData.HasJustFired = newBehaviorData.HasJustFired; + if (oldBehaviorData.FiringArc !== newBehaviorData.FiringArc) + this._behaviorData.FiringArc = newBehaviorData.FiringArc; + if (oldBehaviorData.BulletQuantity !== newBehaviorData.BulletQuantity) + this._behaviorData.BulletQuantity = newBehaviorData.BulletQuantity; + if (oldBehaviorData.AngleVariance !== newBehaviorData.AngleVariance) + this._behaviorData.AngleVariance = newBehaviorData.AngleVariance; + if (oldBehaviorData.RotateBullet !== newBehaviorData.RotateBullet) + this._behaviorData.RotateBullet = newBehaviorData.RotateBullet; + if (oldBehaviorData.AmmoQuantity !== newBehaviorData.AmmoQuantity) + this._behaviorData.AmmoQuantity = newBehaviorData.AmmoQuantity; + if (oldBehaviorData.ShotsPerReload !== newBehaviorData.ShotsPerReload) + this._behaviorData.ShotsPerReload = newBehaviorData.ShotsPerReload; + if (oldBehaviorData.ReloadDuration !== newBehaviorData.ReloadDuration) + this._behaviorData.ReloadDuration = newBehaviorData.ReloadDuration; + if (oldBehaviorData.MaxAmmo !== newBehaviorData.MaxAmmo) + this._behaviorData.MaxAmmo = newBehaviorData.MaxAmmo; + if (oldBehaviorData.ShotsBeforeNextReload !== newBehaviorData.ShotsBeforeNextReload) + this._behaviorData.ShotsBeforeNextReload = newBehaviorData.ShotsBeforeNextReload; + if (oldBehaviorData.TotalShotsFired !== newBehaviorData.TotalShotsFired) + this._behaviorData.TotalShotsFired = newBehaviorData.TotalShotsFired; + if (oldBehaviorData.TotalBulletsCreated !== newBehaviorData.TotalBulletsCreated) + this._behaviorData.TotalBulletsCreated = newBehaviorData.TotalBulletsCreated; + if (oldBehaviorData.StartingAmmo !== newBehaviorData.StartingAmmo) + this._behaviorData.StartingAmmo = newBehaviorData.StartingAmmo; + if (oldBehaviorData.TotalReloadsCompleted !== newBehaviorData.TotalReloadsCompleted) + this._behaviorData.TotalReloadsCompleted = newBehaviorData.TotalReloadsCompleted; + if (oldBehaviorData.UnlimitedAmmo !== newBehaviorData.UnlimitedAmmo) + this._behaviorData.UnlimitedAmmo = newBehaviorData.UnlimitedAmmo; + if (oldBehaviorData.ReloadInProgress !== newBehaviorData.ReloadInProgress) + this._behaviorData.ReloadInProgress = newBehaviorData.ReloadInProgress; + if (oldBehaviorData.HeatIncreasePerShot !== newBehaviorData.HeatIncreasePerShot) + this._behaviorData.HeatIncreasePerShot = newBehaviorData.HeatIncreasePerShot; + if (oldBehaviorData.HeatLevel !== newBehaviorData.HeatLevel) + this._behaviorData.HeatLevel = newBehaviorData.HeatLevel; + if (oldBehaviorData.AutomaticReloading !== newBehaviorData.AutomaticReloading) + this._behaviorData.AutomaticReloading = newBehaviorData.AutomaticReloading; + if (oldBehaviorData.OverheatDuration !== newBehaviorData.OverheatDuration) + this._behaviorData.OverheatDuration = newBehaviorData.OverheatDuration; + if (oldBehaviorData.LinearCoolingRate !== newBehaviorData.LinearCoolingRate) + this._behaviorData.LinearCoolingRate = newBehaviorData.LinearCoolingRate; + if (oldBehaviorData.ExponentialCoolingRate !== newBehaviorData.ExponentialCoolingRate) + this._behaviorData.ExponentialCoolingRate = newBehaviorData.ExponentialCoolingRate; + if (oldBehaviorData.BulletLayer !== newBehaviorData.BulletLayer) + this._behaviorData.BulletLayer = newBehaviorData.BulletLayer; + if (oldBehaviorData.RandomizedAngle !== newBehaviorData.RandomizedAngle) + this._behaviorData.RandomizedAngle = newBehaviorData.RandomizedAngle; + if (oldBehaviorData.BulletSpeedVariance !== newBehaviorData.BulletSpeedVariance) + this._behaviorData.BulletSpeedVariance = newBehaviorData.BulletSpeedVariance; + + return true; + } + + // Properties: + + _getFireCooldown() { + return this._behaviorData.FireCooldown !== undefined ? this._behaviorData.FireCooldown : Number("0.1") || 0; + } + _setFireCooldown(newValue) { + this._behaviorData.FireCooldown = newValue; + } + _getHasJustFired() { + return this._behaviorData.HasJustFired !== undefined ? this._behaviorData.HasJustFired : false; + } + _setHasJustFired(newValue) { + this._behaviorData.HasJustFired = newValue; + } + _toggleHasJustFired() { + this._setHasJustFired(!this._getHasJustFired()); + } + _getFiringArc() { + return this._behaviorData.FiringArc !== undefined ? this._behaviorData.FiringArc : Number("45") || 0; + } + _setFiringArc(newValue) { + this._behaviorData.FiringArc = newValue; + } + _getBulletQuantity() { + return this._behaviorData.BulletQuantity !== undefined ? this._behaviorData.BulletQuantity : Number("1") || 0; + } + _setBulletQuantity(newValue) { + this._behaviorData.BulletQuantity = newValue; + } + _getAngleVariance() { + return this._behaviorData.AngleVariance !== undefined ? this._behaviorData.AngleVariance : Number("0") || 0; + } + _setAngleVariance(newValue) { + this._behaviorData.AngleVariance = newValue; + } + _getRotateBullet() { + return this._behaviorData.RotateBullet !== undefined ? this._behaviorData.RotateBullet : true; + } + _setRotateBullet(newValue) { + this._behaviorData.RotateBullet = newValue; + } + _toggleRotateBullet() { + this._setRotateBullet(!this._getRotateBullet()); + } + _getAmmoQuantity() { + return this._behaviorData.AmmoQuantity !== undefined ? this._behaviorData.AmmoQuantity : Number("0") || 0; + } + _setAmmoQuantity(newValue) { + this._behaviorData.AmmoQuantity = newValue; + } + _getShotsPerReload() { + return this._behaviorData.ShotsPerReload !== undefined ? this._behaviorData.ShotsPerReload : Number("0") || 0; + } + _setShotsPerReload(newValue) { + this._behaviorData.ShotsPerReload = newValue; + } + _getReloadDuration() { + return this._behaviorData.ReloadDuration !== undefined ? this._behaviorData.ReloadDuration : Number("1") || 0; + } + _setReloadDuration(newValue) { + this._behaviorData.ReloadDuration = newValue; + } + _getMaxAmmo() { + return this._behaviorData.MaxAmmo !== undefined ? this._behaviorData.MaxAmmo : Number("0") || 0; + } + _setMaxAmmo(newValue) { + this._behaviorData.MaxAmmo = newValue; + } + _getShotsBeforeNextReload() { + return this._behaviorData.ShotsBeforeNextReload !== undefined ? this._behaviorData.ShotsBeforeNextReload : Number("0") || 0; + } + _setShotsBeforeNextReload(newValue) { + this._behaviorData.ShotsBeforeNextReload = newValue; + } + _getTotalShotsFired() { + return this._behaviorData.TotalShotsFired !== undefined ? this._behaviorData.TotalShotsFired : Number("0") || 0; + } + _setTotalShotsFired(newValue) { + this._behaviorData.TotalShotsFired = newValue; + } + _getTotalBulletsCreated() { + return this._behaviorData.TotalBulletsCreated !== undefined ? this._behaviorData.TotalBulletsCreated : Number("0") || 0; + } + _setTotalBulletsCreated(newValue) { + this._behaviorData.TotalBulletsCreated = newValue; + } + _getStartingAmmo() { + return this._behaviorData.StartingAmmo !== undefined ? this._behaviorData.StartingAmmo : Number("0") || 0; + } + _setStartingAmmo(newValue) { + this._behaviorData.StartingAmmo = newValue; + } + _getTotalReloadsCompleted() { + return this._behaviorData.TotalReloadsCompleted !== undefined ? this._behaviorData.TotalReloadsCompleted : Number("0") || 0; + } + _setTotalReloadsCompleted(newValue) { + this._behaviorData.TotalReloadsCompleted = newValue; + } + _getUnlimitedAmmo() { + return this._behaviorData.UnlimitedAmmo !== undefined ? this._behaviorData.UnlimitedAmmo : true; + } + _setUnlimitedAmmo(newValue) { + this._behaviorData.UnlimitedAmmo = newValue; + } + _toggleUnlimitedAmmo() { + this._setUnlimitedAmmo(!this._getUnlimitedAmmo()); + } + _getReloadInProgress() { + return this._behaviorData.ReloadInProgress !== undefined ? this._behaviorData.ReloadInProgress : false; + } + _setReloadInProgress(newValue) { + this._behaviorData.ReloadInProgress = newValue; + } + _toggleReloadInProgress() { + this._setReloadInProgress(!this._getReloadInProgress()); + } + _getHeatIncreasePerShot() { + return this._behaviorData.HeatIncreasePerShot !== undefined ? this._behaviorData.HeatIncreasePerShot : Number("0") || 0; + } + _setHeatIncreasePerShot(newValue) { + this._behaviorData.HeatIncreasePerShot = newValue; + } + _getHeatLevel() { + return this._behaviorData.HeatLevel !== undefined ? this._behaviorData.HeatLevel : Number("0") || 0; + } + _setHeatLevel(newValue) { + this._behaviorData.HeatLevel = newValue; + } + _getAutomaticReloading() { + return this._behaviorData.AutomaticReloading !== undefined ? this._behaviorData.AutomaticReloading : true; + } + _setAutomaticReloading(newValue) { + this._behaviorData.AutomaticReloading = newValue; + } + _toggleAutomaticReloading() { + this._setAutomaticReloading(!this._getAutomaticReloading()); + } + _getOverheatDuration() { + return this._behaviorData.OverheatDuration !== undefined ? this._behaviorData.OverheatDuration : Number("0") || 0; + } + _setOverheatDuration(newValue) { + this._behaviorData.OverheatDuration = newValue; + } + _getLinearCoolingRate() { + return this._behaviorData.LinearCoolingRate !== undefined ? this._behaviorData.LinearCoolingRate : Number("0.1") || 0; + } + _setLinearCoolingRate(newValue) { + this._behaviorData.LinearCoolingRate = newValue; + } + _getExponentialCoolingRate() { + return this._behaviorData.ExponentialCoolingRate !== undefined ? this._behaviorData.ExponentialCoolingRate : Number("0.3") || 0; + } + _setExponentialCoolingRate(newValue) { + this._behaviorData.ExponentialCoolingRate = newValue; + } + _getBulletLayer() { + return this._behaviorData.BulletLayer !== undefined ? this._behaviorData.BulletLayer : ""; + } + _setBulletLayer(newValue) { + this._behaviorData.BulletLayer = newValue; + } + _getRandomizedAngle() { + return this._behaviorData.RandomizedAngle !== undefined ? this._behaviorData.RandomizedAngle : Number("0") || 0; + } + _setRandomizedAngle(newValue) { + this._behaviorData.RandomizedAngle = newValue; + } + _getBulletSpeedVariance() { + return this._behaviorData.BulletSpeedVariance !== undefined ? this._behaviorData.BulletSpeedVariance : Number("0") || 0; + } + _setBulletSpeedVariance(newValue) { + this._behaviorData.BulletSpeedVariance = newValue; + } +} + +/** + * Shared data generated from Fire bullets + */ +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.SharedData = class FireBulletSharedData { + constructor(sharedData) { + + } + + // Shared properties: + +} + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.getSharedData = function(instanceContainer, behaviorName) { + if (!instanceContainer._FireBullet_FireBulletSharedData) { + const initialData = instanceContainer.getInitialSharedDataForBehavior( + behaviorName + ); + instanceContainer._FireBullet_FireBulletSharedData = new gdjs.evtsExt__FireBullet__FireBullet.FireBullet.SharedData( + initialData + ); + } + return instanceContainer._FireBullet_FireBulletSharedData; +} + +// Methods: +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.onCreatedContext = {}; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.onCreatedContext.GDObjectObjects1= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.onCreatedContext.GDObjectObjects2= []; + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.onCreatedContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.onCreatedContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.onCreatedContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.onCreatedContext.GDObjectObjects1[i].resetTimer("__FireBullet.FiringCooldown"); +} +}{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.onCreatedContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.onCreatedContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setAmmoQuantity((gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.onCreatedContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getStartingAmmo())); +} +}{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.onCreatedContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.onCreatedContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setShotsBeforeNextReload((gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.onCreatedContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getShotsPerReload())); +} +}} + +} + + +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.onCreated = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.onCreatedContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.onCreatedContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.onCreatedContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext = {}; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects3= []; + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1, gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2); + +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2[i].resetTimer("__FireBullet.FiringCooldown"); +} +}} + +} + + +};gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + + +} + + +{ + +gdjs.copyArray(gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1, gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2); + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2.length;i 0 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2[k] = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2[i]; + ++k; + } +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2.length = k; +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2 */ +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setShotsBeforeNextReload(gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getShotsBeforeNextReload() - (1)); +} +}} + +} + + +};gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.eventsList3 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1, gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2); + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2.length;i 0 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2[k] = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2[i]; + ++k; + } +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2.length = k; +if (isConditionTrue_0) { +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2.length;i 0 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2[k] = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2[i]; + ++k; + } +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2.length = k; +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2 */ +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setHeatLevel(gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getHeatLevel() + ((gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getHeatIncreasePerShot()))); +} +} +{ //Subevents +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.eventsList4(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.eventsList6 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1, gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2); + +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setTotalShotsFired(gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getTotalShotsFired() + (1)); +} +}} + +} + + +};gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.eventsList7 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +/* Reuse gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1 */ +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setHasJustFired(false); +} +}} + +} + + +};gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.eventsList8 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.eventsList0(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.eventsList1(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.eventsList2(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.eventsList3(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.eventsList5(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.eventsList6(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.eventsList7(runtimeScene, eventsFunctionContext); +} + + +};gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.eventsList9 = function(runtimeScene, eventsFunctionContext) { + +{ + + + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1.length;i= (gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getReloadDuration()) ) { + isConditionTrue_0 = true; + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1[k] = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1[i]; + ++k; + } +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1.length = k; +} +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1 */ +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setTotalReloadsCompleted(gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getTotalReloadsCompleted() + (1)); +} +}{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setReloadInProgress(false); +} +} +{ //Subevents +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.eventsList10(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.eventsList12 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1, gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2); + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2.length;i 0 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2[k] = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2[i]; + ++k; + } +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2.length = k; +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2 */ +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setHeatLevel(Math.max(0, (gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getHeatLevel()) - gdjs.evtTools.runtimeScene.getElapsedTimeInSeconds(runtimeScene) * (gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getExponentialCoolingRate()) * (gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getHeatLevel()))); +} +}} + +} + + +{ + +/* Reuse gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1 */ + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1.length;i 0 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1[k] = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1[i]; + ++k; + } +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1.length = k; +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1 */ +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setHeatLevel(Math.max(0, (gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getHeatLevel()) - gdjs.evtTools.runtimeScene.getElapsedTimeInSeconds(runtimeScene) * (gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getLinearCoolingRate()))); +} +}} + +} + + +};gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.eventsList13 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((( gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).HeatLevel((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))) > 0); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.eventsList12(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.eventsList14 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.eventsList9(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.eventsList11(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.eventsList13(runtimeScene, eventsFunctionContext); +} + + +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEvents = function(parentEventsFunctionContext) { +this._onceTriggers.startNewFrame(); +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects2.length = 0; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.GDObjectObjects3.length = 0; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.doStepPreEventsContext.eventsList14(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireTowardPositionContext = {}; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireTowardPositionContext.GDObjectObjects1= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireTowardPositionContext.GDObjectObjects2= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireTowardPositionContext.GDBulletObjects1= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireTowardPositionContext.GDBulletObjects2= []; + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireTowardPositionContext.mapOfGDgdjs_46evtsExt_95_95FireBullet_95_95FireBullet_46FireBullet_46prototype_46FireTowardPositionContext_46GDBulletObjects1Objects = Hashtable.newFrom({"Bullet": gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireTowardPositionContext.GDBulletObjects1}); +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireTowardPositionContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Bullet"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireTowardPositionContext.GDBulletObjects1); +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireTowardPositionContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireTowardPositionContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireTowardPositionContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).Fire((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("XPosition")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("YPosition")) || 0 : 0), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireTowardPositionContext.mapOfGDgdjs_46evtsExt_95_95FireBullet_95_95FireBullet_46FireBullet_46prototype_46FireTowardPositionContext_46GDBulletObjects1Objects, (gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireTowardPositionContext.GDObjectObjects1[i].getAngleToPosition((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("TargetXPosition")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("TargetYPosition")) || 0 : 0))), (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Speed")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +};gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireTowardPositionContext.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireTowardPositionContext.eventsList0(runtimeScene, eventsFunctionContext); +} + + +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireTowardPosition = function(XPosition, YPosition, Bullet, TargetXPosition, TargetYPosition, Speed, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +, "Bullet": Bullet +}, + _objectArraysMap: { +"Object": thisObjectList +, "Bullet": gdjs.objectsListsToArray(Bullet) +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "XPosition") return XPosition; +if (argName === "YPosition") return YPosition; +if (argName === "TargetXPosition") return TargetXPosition; +if (argName === "TargetYPosition") return TargetYPosition; +if (argName === "Speed") return Speed; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireTowardPositionContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireTowardPositionContext.GDObjectObjects2.length = 0; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireTowardPositionContext.GDBulletObjects1.length = 0; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireTowardPositionContext.GDBulletObjects2.length = 0; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireTowardPositionContext.eventsList1(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext = {}; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects1= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects2= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects3= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects4= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDBulletObjects1= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDBulletObjects2= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDBulletObjects3= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDBulletObjects4= []; + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.mapOfGDgdjs_46evtsExt_95_95FireBullet_95_95FireBullet_46FireBullet_46prototype_46FireContext_46GDBulletObjects2Objects = Hashtable.newFrom({"Bullet": gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDBulletObjects2}); +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects1, gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects2); + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((( gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects2.length === 0 ) ? 0 :gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects2[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getBulletQuantity()) == 1); +} +if (isConditionTrue_0) { +gdjs.copyArray(eventsFunctionContext.getObjects("Bullet"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDBulletObjects2); +/* Reuse gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects2 */ +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).FireSingleBullet((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("XPosition")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("YPosition")) || 0 : 0), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.mapOfGDgdjs_46evtsExt_95_95FireBullet_95_95FireBullet_46FireBullet_46prototype_46FireContext_46GDBulletObjects2Objects, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Angle")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Speed")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +};gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.mapOfGDgdjs_46evtsExt_95_95FireBullet_95_95FireBullet_46FireBullet_46prototype_46FireContext_46GDBulletObjects2Objects = Hashtable.newFrom({"Bullet": gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDBulletObjects2}); +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + + +} + + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects2, gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects3); + +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects3.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects3[i].returnVariable(gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects3[i].getVariables().get("__FireBullet").getChild("CurrentBulletAngle")).add((gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects3[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getFiringArc()) / ((gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects3[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getBulletQuantity()) - 1)); +} +}{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects3.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects3[i].returnVariable(gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects3[i].getVariables().get("__FireBullet").getChild("BatchOrderID")).add(1); +} +}} + +} + + +};gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.eventsList2 = function(runtimeScene, eventsFunctionContext) { + +{ + +/* Reuse gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects1 */ + +const repeatCount2 = (( gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getBulletQuantity()); +for (let repeatIndex2 = 0;repeatIndex2 < repeatCount2;++repeatIndex2) { +gdjs.copyArray(eventsFunctionContext.getObjects("Bullet"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDBulletObjects2); +gdjs.copyArray(gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects1, gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects2); + + +let isConditionTrue_0 = false; +if (true) +{ +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).FireSingleBullet((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("XPosition")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("YPosition")) || 0 : 0), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.mapOfGDgdjs_46evtsExt_95_95FireBullet_95_95FireBullet_46FireBullet_46prototype_46FireContext_46GDBulletObjects2Objects, (gdjs.RuntimeObject.getVariableNumber(gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects2[i].getVariables().get("__FireBullet").getChild("CurrentBulletAngle"))) + gdjs.randomInRange(-((gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getAngleVariance())), (gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getAngleVariance())), (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Speed")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +} +{ //Subevents: +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.eventsList1(runtimeScene, eventsFunctionContext);} //Subevents end. +} +} + +} + + +};gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.eventsList3 = function(runtimeScene, eventsFunctionContext) { + +{ + +/* Reuse gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects1 */ + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((( gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getBulletQuantity()) > 1); +} +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects1 */ +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects1[i].returnVariable(gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects1[i].getVariables().get("__FireBullet").getChild("CurrentBulletAngle")).setNumber((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Angle")) || 0 : 0) - (gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getFiringArc()) / 2); +} +}{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects1[i].returnVariable(gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects1[i].getVariables().get("__FireBullet").getChild("BatchOrderID")).setNumber(0); +} +} +{ //Subevents +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.eventsList2(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.eventsList4 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.eventsList0(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.eventsList3(runtimeScene, eventsFunctionContext); +} + + +};gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.eventsList5 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.FireContext.GDObjectObjects1.length;i 0 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetMaxAmmoOpContext.GDObjectObjects1[k] = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetMaxAmmoOpContext.GDObjectObjects1[i]; + ++k; + } +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetMaxAmmoOpContext.GDObjectObjects1.length = k; +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetMaxAmmoOpContext.GDObjectObjects1 */ +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetMaxAmmoOpContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetMaxAmmoOpContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setAmmoQuantity(Math.min((gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetMaxAmmoOpContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).MaxAmmo((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))), (gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetMaxAmmoOpContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).AmmoQuantity((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))))); +} +}} + +} + + +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetMaxAmmoOp = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetMaxAmmoOpContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetMaxAmmoOpContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetMaxAmmoOpContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetMaxAmmoContext = {}; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetMaxAmmoContext.GDObjectObjects1= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetMaxAmmoContext.GDObjectObjects2= []; + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetMaxAmmoContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetMaxAmmoContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetMaxAmmoContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetMaxAmmoContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetMaxAmmoOp((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetMaxAmmo = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetMaxAmmoContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetMaxAmmoContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetMaxAmmoContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalShotsFiredContext = {}; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalShotsFiredContext.GDObjectObjects1= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalShotsFiredContext.GDObjectObjects2= []; + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalShotsFiredContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalShotsFiredContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalShotsFiredContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalShotsFiredContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setTotalShotsFired(0); +} +}} + +} + + +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalShotsFired = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalShotsFiredContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalShotsFiredContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalShotsFiredContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalBulletsCreatedContext = {}; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalBulletsCreatedContext.GDObjectObjects1= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalBulletsCreatedContext.GDObjectObjects2= []; + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalBulletsCreatedContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalBulletsCreatedContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalBulletsCreatedContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalBulletsCreatedContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setTotalBulletsCreated(0); +} +}} + +} + + +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalBulletsCreated = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalBulletsCreatedContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalBulletsCreatedContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalBulletsCreatedContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalReloadsCompletedContext = {}; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalReloadsCompletedContext.GDObjectObjects1= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalReloadsCompletedContext.GDObjectObjects2= []; + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalReloadsCompletedContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalReloadsCompletedContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalReloadsCompletedContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalReloadsCompletedContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setTotalReloadsCompleted(0); +} +}} + +} + + +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalReloadsCompleted = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalReloadsCompletedContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalReloadsCompletedContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ResetTotalReloadsCompletedContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ShotsPerReloadContext = {}; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ShotsPerReloadContext.GDObjectObjects1= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ShotsPerReloadContext.GDObjectObjects2= []; + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ShotsPerReloadContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ShotsPerReloadContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ShotsPerReloadContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ShotsPerReloadContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getShotsPerReload()); }}} + +} + + +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ShotsPerReload = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ShotsPerReloadContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ShotsPerReloadContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ShotsPerReloadContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadOpContext = {}; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadOpContext.GDObjectObjects1= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadOpContext.GDObjectObjects2= []; + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadOpContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadOpContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadOpContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadOpContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setShotsPerReload((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0)); +} +}} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadOpContext.GDObjectObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadOpContext.GDObjectObjects1.length;i (gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadOpContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getShotsPerReload()) ) { + isConditionTrue_0 = true; + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadOpContext.GDObjectObjects1[k] = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadOpContext.GDObjectObjects1[i]; + ++k; + } +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadOpContext.GDObjectObjects1.length = k; +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadOpContext.GDObjectObjects1 */ +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadOpContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadOpContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setShotsBeforeNextReload((gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadOpContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getShotsPerReload())); +} +}} + +} + + +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadOp = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadOpContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadOpContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadOpContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadContext = {}; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadContext.GDObjectObjects1= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadContext.GDObjectObjects2= []; + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetShotsPerReloadOp((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReload = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetShotsPerReloadContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetAutomaticReloadContext = {}; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetAutomaticReloadContext.GDObjectObjects1= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetAutomaticReloadContext.GDObjectObjects2= []; + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetAutomaticReloadContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetAutomaticReloadContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetAutomaticReloadContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetAutomaticReloadContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setAutomaticReloading(false); +} +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("Value") : false); +} +if (isConditionTrue_0) { +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetAutomaticReloadContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetAutomaticReloadContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetAutomaticReloadContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setAutomaticReloading(true); +} +}} + +} + + +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetAutomaticReload = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetAutomaticReloadContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetAutomaticReloadContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetAutomaticReloadContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.LinearCoolingRateContext = {}; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.LinearCoolingRateContext.GDObjectObjects1= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.LinearCoolingRateContext.GDObjectObjects2= []; + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.LinearCoolingRateContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.LinearCoolingRateContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.LinearCoolingRateContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.LinearCoolingRateContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getLinearCoolingRate()); }}} + +} + + +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.LinearCoolingRate = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.LinearCoolingRateContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.LinearCoolingRateContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.LinearCoolingRateContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetLinearCoolingRateOpContext = {}; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetLinearCoolingRateOpContext.GDObjectObjects1= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetLinearCoolingRateOpContext.GDObjectObjects2= []; + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetLinearCoolingRateOpContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetLinearCoolingRateOpContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetLinearCoolingRateOpContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetLinearCoolingRateOpContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setLinearCoolingRate((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0)); +} +}} + +} + + +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetLinearCoolingRateOp = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetLinearCoolingRateOpContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetLinearCoolingRateOpContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetLinearCoolingRateOpContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetLinearCoolingRateContext = {}; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetLinearCoolingRateContext.GDObjectObjects1= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetLinearCoolingRateContext.GDObjectObjects2= []; + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetLinearCoolingRateContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetLinearCoolingRateContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetLinearCoolingRateContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetLinearCoolingRateContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetLinearCoolingRateOp((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetLinearCoolingRate = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetLinearCoolingRateContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetLinearCoolingRateContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetLinearCoolingRateContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ExponentialCoolingRateContext = {}; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ExponentialCoolingRateContext.GDObjectObjects1= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ExponentialCoolingRateContext.GDObjectObjects2= []; + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ExponentialCoolingRateContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ExponentialCoolingRateContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ExponentialCoolingRateContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ExponentialCoolingRateContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getExponentialCoolingRate()); }}} + +} + + +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ExponentialCoolingRate = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ExponentialCoolingRateContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ExponentialCoolingRateContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.ExponentialCoolingRateContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetExponentialCoolingRateOpContext = {}; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetExponentialCoolingRateOpContext.GDObjectObjects1= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetExponentialCoolingRateOpContext.GDObjectObjects2= []; + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetExponentialCoolingRateOpContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetExponentialCoolingRateOpContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetExponentialCoolingRateOpContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetExponentialCoolingRateOpContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setExponentialCoolingRate((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0)); +} +}} + +} + + +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetExponentialCoolingRateOp = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetExponentialCoolingRateOpContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetExponentialCoolingRateOpContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetExponentialCoolingRateOpContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetExponentialCoolingRateContext = {}; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetExponentialCoolingRateContext.GDObjectObjects1= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetExponentialCoolingRateContext.GDObjectObjects2= []; + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetExponentialCoolingRateContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetExponentialCoolingRateContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetExponentialCoolingRateContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetExponentialCoolingRateContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetExponentialCoolingRateOp((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetExponentialCoolingRate = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetExponentialCoolingRateContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetExponentialCoolingRateContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.SetExponentialCoolingRateContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IncreaseAmmoContext = {}; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IncreaseAmmoContext.GDObjectObjects1= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IncreaseAmmoContext.GDObjectObjects2= []; + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IncreaseAmmoContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IncreaseAmmoContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IncreaseAmmoContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IncreaseAmmoContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setAmmoQuantity(gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IncreaseAmmoContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getAmmoQuantity() + ((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("AmmoGained")) || 0 : 0))); +} +}} + +} + + +{ + + + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IncreaseAmmoContext.GDObjectObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IncreaseAmmoContext.GDObjectObjects1.length;i 0 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IncreaseAmmoContext.GDObjectObjects1[k] = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IncreaseAmmoContext.GDObjectObjects1[i]; + ++k; + } +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IncreaseAmmoContext.GDObjectObjects1.length = k; +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IncreaseAmmoContext.GDObjectObjects1 */ +{for(var i = 0, len = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IncreaseAmmoContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IncreaseAmmoContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setAmmoQuantity(Math.min((gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IncreaseAmmoContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).MaxAmmo((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))), (gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IncreaseAmmoContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).AmmoQuantity((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))))); +} +}} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IncreaseAmmoContext.GDObjectObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IncreaseAmmoContext.GDObjectObjects1.length;i 0 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.OverheatTimeLeftContext.GDObjectObjects1[k] = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.OverheatTimeLeftContext.GDObjectObjects1[i]; + ++k; + } +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.OverheatTimeLeftContext.GDObjectObjects1.length = k; +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.OverheatTimeLeftContext.GDObjectObjects1 */ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = Math.max(0, (( gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.OverheatTimeLeftContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.OverheatTimeLeftContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getOverheatDuration()) - (( gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.OverheatTimeLeftContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.OverheatTimeLeftContext.GDObjectObjects1[0].getTimerElapsedTimeInSeconds("__FireBullet.OverheatDuration"))); }}} + +} + + +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.OverheatTimeLeft = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.OverheatTimeLeftContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.OverheatTimeLeftContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.OverheatTimeLeftContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsReloadInProgressContext = {}; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsReloadInProgressContext.GDObjectObjects1= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsReloadInProgressContext.GDObjectObjects2= []; + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsReloadInProgressContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = false; }}} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsReloadInProgressContext.GDObjectObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsReloadInProgressContext.GDObjectObjects1.length;i 0 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsReloadNeededContext.GDObjectObjects1[k] = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsReloadNeededContext.GDObjectObjects1[i]; + ++k; + } +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsReloadNeededContext.GDObjectObjects1.length = k; +if (isConditionTrue_0) { +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsReloadNeededContext.GDObjectObjects1.length;i= 1 ) { + isConditionTrue_1 = true; + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsOverheatedContext.GDObjectObjects2[k] = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsOverheatedContext.GDObjectObjects2[i]; + ++k; + } +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsOverheatedContext.GDObjectObjects2.length = k; +if(isConditionTrue_1) { + isConditionTrue_0 = true; + for (let j = 0, jLen = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsOverheatedContext.GDObjectObjects2.length; j < jLen ; ++j) { + if ( gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsOverheatedContext.GDObjectObjects1_1final.indexOf(gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsOverheatedContext.GDObjectObjects2[j]) === -1 ) + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsOverheatedContext.GDObjectObjects1_1final.push(gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsOverheatedContext.GDObjectObjects2[j]); + } +} +} +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsOverheatedContext.GDObjectObjects2); +{isConditionTrue_1 = ((( gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsOverheatedContext.GDObjectObjects2.length === 0 ) ? 0 :gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsOverheatedContext.GDObjectObjects2[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).OverheatTimeLeft((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))) > 0); +} +if(isConditionTrue_1) { + isConditionTrue_0 = true; + for (let j = 0, jLen = gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsOverheatedContext.GDObjectObjects2.length; j < jLen ; ++j) { + if ( gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsOverheatedContext.GDObjectObjects1_1final.indexOf(gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsOverheatedContext.GDObjectObjects2[j]) === -1 ) + gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsOverheatedContext.GDObjectObjects1_1final.push(gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsOverheatedContext.GDObjectObjects2[j]); + } +} +} +{ +gdjs.copyArray(gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsOverheatedContext.GDObjectObjects1_1final, gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsOverheatedContext.GDObjectObjects1); +} +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsOverheated = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsOverheatedContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsOverheatedContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsOverheatedContext.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsFiringCooldownActiveContext = {}; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsFiringCooldownActiveContext.GDObjectObjects1= []; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsFiringCooldownActiveContext.GDObjectObjects2= []; + + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsFiringCooldownActiveContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = false; }}} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsFiringCooldownActiveContext.GDObjectObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((( gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsFiringCooldownActiveContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsFiringCooldownActiveContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).CooldownTimeLeft((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))) > 0); +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsFiringCooldownActive = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsFiringCooldownActiveContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsFiringCooldownActiveContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__FireBullet__FireBullet.FireBullet.prototype.IsFiringCooldownActiveContext.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + + +gdjs.registerBehavior("FireBullet::FireBullet", gdjs.evtsExt__FireBullet__FireBullet.FireBullet); diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__addconnecteduser-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__addconnecteduser-func.js new file mode 100644 index 0000000..0326a71 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__addconnecteduser-func.js @@ -0,0 +1,85 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__AddConnectedUser !== "undefined") { + gdjs.evtsExt__GamejoltAPI__AddConnectedUser.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__AddConnectedUser = {}; + + +gdjs.evtsExt__GamejoltAPI__AddConnectedUser.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "username", gdjs.evtsExt__GamejoltAPI__Username.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "user_token", gdjs.evtsExt__GamejoltAPI__UserToken.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__AddConnectedUser.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__AddConnectedUser.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__GamejoltAPI__AddConnectedUser.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__addscore-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__addscore-func.js new file mode 100644 index 0000000..7070b86 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__addscore-func.js @@ -0,0 +1,271 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__AddScore !== "undefined") { + gdjs.evtsExt__GamejoltAPI__AddScore.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__AddScore = {}; + + +gdjs.evtsExt__GamejoltAPI__AddScore.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("GuestName") : "") != ""); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "guest", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("GuestName") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("GuestName") : "") == ""); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "guest", "Unknown", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +};gdjs.evtsExt__GamejoltAPI__AddScore.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("GuestName") : "") != ""); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "guest", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("GuestName") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("GuestName") : "") == ""); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "guest", "Unknown", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +};gdjs.evtsExt__GamejoltAPI__AddScore.eventsList2 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddConnectedUser.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))); +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__AddScore.eventsList1(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__GamejoltAPI__AddScore.asyncCallback24898692 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__AddScore.eventsList3 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "scores/add", "", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__AddScore.asyncCallback24898692(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__AddScore.eventsList4 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "score", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Score") : "") + (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Unit") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "sort", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Score") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Extra") : "") != ""); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "extra_data", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Extra") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Board") : "") != ""); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "table_id", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Board") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("ForceGuest") : false); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__AddScore.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = !(typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("ForceGuest") : false); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__AddScore.eventsList2(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +{ + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__AddScore.eventsList3(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__AddScore.func = function(runtimeScene, ForceGuest, GuestName, Score, Unit, Extra, Board, parentEventsFunctionContext) { +var eventsFunctionContext = { + task: new gdjs.ManuallyResolvableTask(), + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ForceGuest") return ForceGuest; +if (argName === "GuestName") return GuestName; +if (argName === "Score") return Score; +if (argName === "Unit") return Unit; +if (argName === "Extra") return Extra; +if (argName === "Board") return Board; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__AddScore.eventsList4(runtimeScene, eventsFunctionContext); + +return eventsFunctionContext.task +} + +gdjs.evtsExt__GamejoltAPI__AddScore.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__addscorewithlabel-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__addscorewithlabel-func.js new file mode 100644 index 0000000..a67cc3b --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__addscorewithlabel-func.js @@ -0,0 +1,271 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__AddScoreWithLabel !== "undefined") { + gdjs.evtsExt__GamejoltAPI__AddScoreWithLabel.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__AddScoreWithLabel = {}; + + +gdjs.evtsExt__GamejoltAPI__AddScoreWithLabel.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("GuestName") : "") != ""); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "guest", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("GuestName") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("GuestName") : "") == ""); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "guest", "Unknown", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +};gdjs.evtsExt__GamejoltAPI__AddScoreWithLabel.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("GuestName") : "") != ""); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "guest", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("GuestName") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("GuestName") : "") == ""); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "guest", "Unknown", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +};gdjs.evtsExt__GamejoltAPI__AddScoreWithLabel.eventsList2 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddConnectedUser.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))); +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__AddScoreWithLabel.eventsList1(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__GamejoltAPI__AddScoreWithLabel.asyncCallback24908140 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__AddScoreWithLabel.eventsList3 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "scores/add", "", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__AddScoreWithLabel.asyncCallback24908140(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__AddScoreWithLabel.eventsList4 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "score", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Label") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "sort", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Score") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Extra") : "") != ""); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "extra_data", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Extra") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Board") : "") != ""); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "table_id", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Board") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("ForceGuest") : false); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__AddScoreWithLabel.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = !(typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("ForceGuest") : false); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__AddScoreWithLabel.eventsList2(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +{ + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__AddScoreWithLabel.eventsList3(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__AddScoreWithLabel.func = function(runtimeScene, ForceGuest, GuestName, Score, Label, Extra, Board, parentEventsFunctionContext) { +var eventsFunctionContext = { + task: new gdjs.ManuallyResolvableTask(), + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ForceGuest") return ForceGuest; +if (argName === "GuestName") return GuestName; +if (argName === "Score") return Score; +if (argName === "Label") return Label; +if (argName === "Extra") return Extra; +if (argName === "Board") return Board; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__AddScoreWithLabel.eventsList4(runtimeScene, eventsFunctionContext); + +return eventsFunctionContext.task +} + +gdjs.evtsExt__GamejoltAPI__AddScoreWithLabel.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__addtrophies-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__addtrophies-func.js new file mode 100644 index 0000000..88a0775 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__addtrophies-func.js @@ -0,0 +1,123 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__AddTrophies !== "undefined") { + gdjs.evtsExt__GamejoltAPI__AddTrophies.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__AddTrophies = {}; + + +gdjs.evtsExt__GamejoltAPI__AddTrophies.asyncCallback24947756 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__AddTrophies.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "trophies/add-achieved", "", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__AddTrophies.asyncCallback24947756(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__AddTrophies.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__SetErrorMessage.func(runtimeScene, "User is not connected", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__SetSuccess.func(runtimeScene, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddConnectedUser.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "trophy_id", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Trophy") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +{ //Subevents +gdjs.evtsExt__GamejoltAPI__AddTrophies.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__AddTrophies.func = function(runtimeScene, Trophy, parentEventsFunctionContext) { +var eventsFunctionContext = { + task: new gdjs.ManuallyResolvableTask(), + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Trophy") return Trophy; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__AddTrophies.eventsList1(runtimeScene, eventsFunctionContext); + +return eventsFunctionContext.task +} + +gdjs.evtsExt__GamejoltAPI__AddTrophies.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__addurlparameter-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__addurlparameter-func.js new file mode 100644 index 0000000..d145edb --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__addurlparameter-func.js @@ -0,0 +1,84 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__AddURLParameter !== "undefined") { + gdjs.evtsExt__GamejoltAPI__AddURLParameter.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__AddURLParameter = {}; + + +gdjs.evtsExt__GamejoltAPI__AddURLParameter.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtTools.variable.valuePush(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("Parameters"), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Identifier") : "") + "=" + (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Value") : "")); +}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__AddURLParameter.func = function(runtimeScene, Identifier, Value, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Identifier") return Identifier; +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__AddURLParameter.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__GamejoltAPI__AddURLParameter.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__authenticated-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__authenticated-func.js new file mode 100644 index 0000000..5d3a4e8 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__authenticated-func.js @@ -0,0 +1,95 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__Authenticated !== "undefined") { + gdjs.evtsExt__GamejoltAPI__Authenticated.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__Authenticated = {}; + + +gdjs.evtsExt__GamejoltAPI__Authenticated.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.getVariableBoolean(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("IsAuthenticated"), true); +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.getVariableBoolean(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("IsAuthenticated"), false); +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = false; }}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__Authenticated.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__Authenticated.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__GamejoltAPI__Authenticated.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__authenticateuser-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__authenticateuser-func.js new file mode 100644 index 0000000..90b98f3 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__authenticateuser-func.js @@ -0,0 +1,181 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__AuthenticateUser !== "undefined") { + gdjs.evtsExt__GamejoltAPI__AuthenticateUser.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__AuthenticateUser = {}; + + +gdjs.evtsExt__GamejoltAPI__AuthenticateUser.eventsList0 = function(runtimeScene, eventsFunctionContext, asyncObjectsList) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtsExt__GamejoltAPI__TestMode.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__SetUsername.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Username") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__SetUserToken.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("UserToken") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +};gdjs.evtsExt__GamejoltAPI__AuthenticateUser.eventsList1 = function(runtimeScene, eventsFunctionContext, asyncObjectsList) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__LastSuccess.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__SetAuthenticated.func(runtimeScene, true, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +{ //Subevents +gdjs.evtsExt__GamejoltAPI__AuthenticateUser.eventsList0(runtimeScene, eventsFunctionContext, asyncObjectsList);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +};gdjs.evtsExt__GamejoltAPI__AuthenticateUser.asyncCallback24864388 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__AuthenticateUser.eventsList1(runtimeScene, eventsFunctionContext, asyncObjectsList);} //End of subevents +} +gdjs.evtsExt__GamejoltAPI__AuthenticateUser.eventsList2 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "users/auth", "", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__AuthenticateUser.asyncCallback24864388(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__AuthenticateUser.eventsList3 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__TestMode.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "username", gdjs.evtsExt__GamejoltAPI__Username.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "user_token", gdjs.evtsExt__GamejoltAPI__UserToken.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtsExt__GamejoltAPI__TestMode.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "username", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Username") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "user_token", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("UserToken") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtsExt__GamejoltAPI__SetAuthenticated.func(runtimeScene, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +{ //Subevents +gdjs.evtsExt__GamejoltAPI__AuthenticateUser.eventsList2(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__AuthenticateUser.func = function(runtimeScene, Username, UserToken, parentEventsFunctionContext) { +var eventsFunctionContext = { + task: new gdjs.ManuallyResolvableTask(), + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Username") return Username; +if (argName === "UserToken") return UserToken; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__AuthenticateUser.eventsList3(runtimeScene, eventsFunctionContext); + +return eventsFunctionContext.task +} + +gdjs.evtsExt__GamejoltAPI__AuthenticateUser.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__callgamejolt-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__callgamejolt-func.js new file mode 100644 index 0000000..5872f20 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__callgamejolt-func.js @@ -0,0 +1,186 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__CallGamejolt !== "undefined") { + gdjs.evtsExt__GamejoltAPI__CallGamejolt.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__CallGamejolt = {}; + + +gdjs.evtsExt__GamejoltAPI__CallGamejolt.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.systemInfo.isPreview(runtimeScene); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__TestMode.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +if (isConditionTrue_0) { +{gdjs.evtTools.debuggerTools.log(gdjs.evtsExt__GamejoltAPI__URL.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), "", ""); +}} + +} + + +};gdjs.evtsExt__GamejoltAPI__CallGamejolt.userFunc0x1965688 = function(runtimeScene, eventsFunctionContext) { +"use strict"; + let global = runtimeScene.getGame().getVariables().get("__GamejoltAPI"); + + let url = global.getChild("Url").getAsString(); + let callback = eventsFunctionContext.getArgument("Callback"); + let http = new XMLHttpRequest(); + + http.addEventListener("load", onComplete); + http.addEventListener("error", onFail); + + http.open("GET", url, true); + + global.getChild("Success").setBoolean(false); + global.getChild("ErrorMessage").setString(""); + global.getChild("Response").setString(""); + global.getChild("Parameters").clearChildren(); + + http.send(null); + + function onComplete(evt) + { + let json = JSON.parse(http.responseText); + let success = json.response.success == "true"; + + changeStatus(global, callback, success, + json.response.hasOwnProperty('message') ? json.response.message : "", + JSON.stringify(json.response)); + + eventsFunctionContext.task.resolve(); + } + + function onFail(evt) + { + changeStatus(global, callback, false, "Unknown error", ""); + + eventsFunctionContext.task.resolve(); + } + + function changeStatus(global, callback, success, message, response) + { + // save last content for Async behavior + global.getChild("Success").setBoolean(success); + if (success) + { + global.getChild("Response").setString(response); + } + else + { + global.getChild("ErrorMessage").setString(message); + } + + // if callback set, for later use + if (callback.length > 0) + { + let stack = global.getChild("CompleteStack").getChild(callback); + stack.getChild("Success").setBoolean(success); + + if (success) + { + stack.getChild("Response").setString(response); + } + else + { + stack.getChild("ErrorMessage").setString(message); + } + } + } + +}; +gdjs.evtsExt__GamejoltAPI__CallGamejolt.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtsExt__GamejoltAPI__PrepareURL.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Endpoint") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__SetURL.func(runtimeScene, gdjs.evtsExt__GamejoltAPI__URL.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) + ("&signature=" + gdjs.evtsExt__GamejoltAPI__SHA1.func(runtimeScene, gdjs.evtsExt__GamejoltAPI__URL.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) + gdjs.evtsExt__GamejoltAPI__GameKey.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) + "#" + gdjs.evtTools.common.toString(gdjs.randomFloat(9999))), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +{ //Subevents +gdjs.evtsExt__GamejoltAPI__CallGamejolt.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + + +gdjs.evtsExt__GamejoltAPI__CallGamejolt.userFunc0x1965688(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__CallGamejolt.func = function(runtimeScene, Endpoint, Callback, parentEventsFunctionContext) { +var eventsFunctionContext = { + task: new gdjs.ManuallyResolvableTask(), + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Endpoint") return Endpoint; +if (argName === "Callback") return Callback; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__CallGamejolt.eventsList1(runtimeScene, eventsFunctionContext); + +return eventsFunctionContext.task +} + +gdjs.evtsExt__GamejoltAPI__CallGamejolt.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__checksession-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__checksession-func.js new file mode 100644 index 0000000..30ce6f5 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__checksession-func.js @@ -0,0 +1,164 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__CheckSession !== "undefined") { + gdjs.evtsExt__GamejoltAPI__CheckSession.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__CheckSession = {}; + + +gdjs.evtsExt__GamejoltAPI__CheckSession.eventsList0 = function(runtimeScene, eventsFunctionContext, asyncObjectsList) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtsExt__GamejoltAPI__LastSuccess.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))); +if (isConditionTrue_0) { +{gdjs.evtTools.runtimeScene.removeTimer(runtimeScene, "__GamejoltAPI_Session"); +}{gdjs.evtsExt__GamejoltAPI__SetSession.func(runtimeScene, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__LastSuccess.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__SetSession.func(runtimeScene, true, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtTools.runtimeScene.resetTimer(runtimeScene, "__GamejoltAPI_Session"); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +};gdjs.evtsExt__GamejoltAPI__CheckSession.asyncCallback24881508 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__CheckSession.eventsList0(runtimeScene, eventsFunctionContext, asyncObjectsList);} //End of subevents +} +gdjs.evtsExt__GamejoltAPI__CheckSession.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "sessions/check", "", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__CheckSession.asyncCallback24881508(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__CheckSession.eventsList2 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__SetErrorMessage.func(runtimeScene, "User is not connected", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__SetSuccess.func(runtimeScene, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddConnectedUser.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +{ //Subevents +gdjs.evtsExt__GamejoltAPI__CheckSession.eventsList1(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__CheckSession.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + task: new gdjs.ManuallyResolvableTask(), + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__CheckSession.eventsList2(runtimeScene, eventsFunctionContext); + +return eventsFunctionContext.task +} + +gdjs.evtsExt__GamejoltAPI__CheckSession.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__closesession-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__closesession-func.js new file mode 100644 index 0000000..d2fc420 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__closesession-func.js @@ -0,0 +1,150 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__CloseSession !== "undefined") { + gdjs.evtsExt__GamejoltAPI__CloseSession.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__CloseSession = {}; + + +gdjs.evtsExt__GamejoltAPI__CloseSession.eventsList0 = function(runtimeScene, eventsFunctionContext, asyncObjectsList) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__LastSuccess.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +{gdjs.evtTools.runtimeScene.removeTimer(runtimeScene, "__GamejoltAPI_Session"); +}{gdjs.evtsExt__GamejoltAPI__SetSession.func(runtimeScene, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +};gdjs.evtsExt__GamejoltAPI__CloseSession.asyncCallback24877852 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__CloseSession.eventsList0(runtimeScene, eventsFunctionContext, asyncObjectsList);} //End of subevents +} +gdjs.evtsExt__GamejoltAPI__CloseSession.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "sessions/close", "", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__CloseSession.asyncCallback24877852(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__CloseSession.eventsList2 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__SetErrorMessage.func(runtimeScene, "User is not connected", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__SetSuccess.func(runtimeScene, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddConnectedUser.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +{ //Subevents +gdjs.evtsExt__GamejoltAPI__CloseSession.eventsList1(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__CloseSession.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + task: new gdjs.ManuallyResolvableTask(), + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__CloseSession.eventsList2(runtimeScene, eventsFunctionContext); + +return eventsFunctionContext.task +} + +gdjs.evtsExt__GamejoltAPI__CloseSession.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__dodataoperation-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__dodataoperation-func.js new file mode 100644 index 0000000..2afbd08 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__dodataoperation-func.js @@ -0,0 +1,252 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__DoDataOperation !== "undefined") { + gdjs.evtsExt__GamejoltAPI__DoDataOperation.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__DoDataOperation = {}; + + +gdjs.evtsExt__GamejoltAPI__DoDataOperation.asyncCallback24966300 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__DoDataOperation.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "data-store/update", "", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__DoDataOperation.asyncCallback24966300(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__DoDataOperation.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__SetErrorMessage.func(runtimeScene, "User is not connected", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__SetSuccess.func(runtimeScene, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddConnectedUser.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +{ //Subevents +gdjs.evtsExt__GamejoltAPI__DoDataOperation.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__GamejoltAPI__DoDataOperation.asyncCallback24967116 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__DoDataOperation.eventsList2 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "data-store/update", "", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__DoDataOperation.asyncCallback24967116(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__DoDataOperation.eventsList3 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = !(typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("IsGlobal") : false); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__DoDataOperation.eventsList1(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("IsGlobal") : false); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__DoDataOperation.eventsList2(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__GamejoltAPI__DoDataOperation.eventsList4 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{let isConditionTrue_1 = false; +isConditionTrue_0 = false; +{ +{isConditionTrue_1 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Operator") : "") != "divide"); +} +if(isConditionTrue_1) { + isConditionTrue_0 = true; +} +} +{ +{isConditionTrue_1 = ((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0) != 0); +} +if(isConditionTrue_1) { + isConditionTrue_0 = true; +} +} +{ +} +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "key", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Key") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "operation", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Operator") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "value", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Value") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +{ //Subevents +gdjs.evtsExt__GamejoltAPI__DoDataOperation.eventsList3(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{let isConditionTrue_1 = false; +isConditionTrue_1 = false; +{let isConditionTrue_2 = false; +isConditionTrue_1 = false; +{ +{isConditionTrue_2 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Operator") : "") != "divide"); +} +if(isConditionTrue_2) { + isConditionTrue_1 = true; +} +} +{ +{isConditionTrue_2 = ((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0) != 0); +} +if(isConditionTrue_2) { + isConditionTrue_1 = true; +} +} +{ +} +} +isConditionTrue_0 = !isConditionTrue_1; +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__SetErrorMessage.func(runtimeScene, "Divide by 0", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__SetSuccess.func(runtimeScene, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__DoDataOperation.func = function(runtimeScene, IsGlobal, Key, Operator, Value, parentEventsFunctionContext) { +var eventsFunctionContext = { + task: new gdjs.ManuallyResolvableTask(), + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "IsGlobal") return IsGlobal; +if (argName === "Key") return Key; +if (argName === "Operator") return Operator; +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__DoDataOperation.eventsList4(runtimeScene, eventsFunctionContext); + +return eventsFunctionContext.task +} + +gdjs.evtsExt__GamejoltAPI__DoDataOperation.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__dodataoperationtext-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__dodataoperationtext-func.js new file mode 100644 index 0000000..8468eb1 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__dodataoperationtext-func.js @@ -0,0 +1,195 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__DoDataOperationText !== "undefined") { + gdjs.evtsExt__GamejoltAPI__DoDataOperationText.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__DoDataOperationText = {}; + + +gdjs.evtsExt__GamejoltAPI__DoDataOperationText.asyncCallback24973732 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__DoDataOperationText.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "data-store/update", "", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__DoDataOperationText.asyncCallback24973732(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__DoDataOperationText.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__SetErrorMessage.func(runtimeScene, "User is not connected", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__SetSuccess.func(runtimeScene, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddConnectedUser.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +{ //Subevents +gdjs.evtsExt__GamejoltAPI__DoDataOperationText.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__GamejoltAPI__DoDataOperationText.asyncCallback24974548 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__DoDataOperationText.eventsList2 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "data-store/update", "", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__DoDataOperationText.asyncCallback24974548(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__DoDataOperationText.eventsList3 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = !(typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("IsGlobal") : false); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__DoDataOperationText.eventsList1(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("IsGlobal") : false); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__DoDataOperationText.eventsList2(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__GamejoltAPI__DoDataOperationText.eventsList4 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "key", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Key") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "operation", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Operator") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "value", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Value") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +{ //Subevents +gdjs.evtsExt__GamejoltAPI__DoDataOperationText.eventsList3(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__DoDataOperationText.func = function(runtimeScene, IsGlobal, Key, Operator, Value, parentEventsFunctionContext) { +var eventsFunctionContext = { + task: new gdjs.ManuallyResolvableTask(), + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "IsGlobal") return IsGlobal; +if (argName === "Key") return Key; +if (argName === "Operator") return Operator; +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__DoDataOperationText.eventsList4(runtimeScene, eventsFunctionContext); + +return eventsFunctionContext.task +} + +gdjs.evtsExt__GamejoltAPI__DoDataOperationText.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchdata-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchdata-func.js new file mode 100644 index 0000000..4657f00 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchdata-func.js @@ -0,0 +1,187 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__FetchData !== "undefined") { + gdjs.evtsExt__GamejoltAPI__FetchData.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__FetchData = {}; + + +gdjs.evtsExt__GamejoltAPI__FetchData.asyncCallback24955172 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__FetchData.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "data-store", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("RequestName") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__FetchData.asyncCallback24955172(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__FetchData.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__SetErrorMessage.func(runtimeScene, "User is not connected", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__SetSuccess.func(runtimeScene, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddConnectedUser.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +{ //Subevents +gdjs.evtsExt__GamejoltAPI__FetchData.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__GamejoltAPI__FetchData.asyncCallback24955668 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__FetchData.eventsList2 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "data-store", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("RequestName") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__FetchData.asyncCallback24955668(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__FetchData.eventsList3 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "key", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Key") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = !(typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("IsGlobal") : false); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__FetchData.eventsList1(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("IsGlobal") : false); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__FetchData.eventsList2(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__FetchData.func = function(runtimeScene, RequestName, IsGlobal, Key, parentEventsFunctionContext) { +var eventsFunctionContext = { + task: new gdjs.ManuallyResolvableTask(), + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "RequestName") return RequestName; +if (argName === "IsGlobal") return IsGlobal; +if (argName === "Key") return Key; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__FetchData.eventsList3(runtimeScene, eventsFunctionContext); + +return eventsFunctionContext.task +} + +gdjs.evtsExt__GamejoltAPI__FetchData.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchdatakeys-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchdatakeys-func.js new file mode 100644 index 0000000..24ba4a4 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchdatakeys-func.js @@ -0,0 +1,190 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__FetchDataKeys !== "undefined") { + gdjs.evtsExt__GamejoltAPI__FetchDataKeys.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__FetchDataKeys = {}; + + +gdjs.evtsExt__GamejoltAPI__FetchDataKeys.asyncCallback24983852 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__FetchDataKeys.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "data-store/get-keys", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("RequestName") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__FetchDataKeys.asyncCallback24983852(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__FetchDataKeys.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__SetErrorMessage.func(runtimeScene, "User is not connected", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__SetSuccess.func(runtimeScene, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddConnectedUser.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +{ //Subevents +gdjs.evtsExt__GamejoltAPI__FetchDataKeys.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__GamejoltAPI__FetchDataKeys.asyncCallback24984804 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__FetchDataKeys.eventsList2 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "data-store/get-keys", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("RequestName") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__FetchDataKeys.asyncCallback24984804(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__FetchDataKeys.eventsList3 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Pattern") : "") != ""); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "pattern", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Pattern") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = !(typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("IsGlobal") : false); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__FetchDataKeys.eventsList1(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("IsGlobal") : false); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__FetchDataKeys.eventsList2(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__FetchDataKeys.func = function(runtimeScene, RequestName, IsGlobal, Pattern, parentEventsFunctionContext) { +var eventsFunctionContext = { + task: new gdjs.ManuallyResolvableTask(), + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "RequestName") return RequestName; +if (argName === "IsGlobal") return IsGlobal; +if (argName === "Pattern") return Pattern; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__FetchDataKeys.eventsList3(runtimeScene, eventsFunctionContext); + +return eventsFunctionContext.task +} + +gdjs.evtsExt__GamejoltAPI__FetchDataKeys.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchscore-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchscore-func.js new file mode 100644 index 0000000..abdaa44 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchscore-func.js @@ -0,0 +1,196 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__FetchScore !== "undefined") { + gdjs.evtsExt__GamejoltAPI__FetchScore.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__FetchScore = {}; + + +gdjs.evtsExt__GamejoltAPI__FetchScore.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Filter") : "") == "better_than"); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "better_than", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("FilterScore") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Filter") : "") != "better_than"); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "worse_than", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("FilterScore") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +};gdjs.evtsExt__GamejoltAPI__FetchScore.asyncCallback24928684 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__FetchScore.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "scores", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("RequestName") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__FetchScore.asyncCallback24928684(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__FetchScore.eventsList2 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Limit")) || 0 : 0) != 0); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "limit", gdjs.evtTools.common.toString(gdjs.evtTools.common.clamp((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Limit")) || 0 : 0), 1, 100)), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Limit")) || 0 : 0) == 0); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "limit", "10", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Board") : "") != ""); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "table_id", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Board") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Filter") : "") != "none"); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__FetchScore.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +{ + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__FetchScore.eventsList1(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__FetchScore.func = function(runtimeScene, RequestName, Limit, Board, Filter, FilterScore, parentEventsFunctionContext) { +var eventsFunctionContext = { + task: new gdjs.ManuallyResolvableTask(), + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "RequestName") return RequestName; +if (argName === "Limit") return Limit; +if (argName === "Board") return Board; +if (argName === "Filter") return Filter; +if (argName === "FilterScore") return FilterScore; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__FetchScore.eventsList2(runtimeScene, eventsFunctionContext); + +return eventsFunctionContext.task +} + +gdjs.evtsExt__GamejoltAPI__FetchScore.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchscorefromuser-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchscorefromuser-func.js new file mode 100644 index 0000000..9698bfb --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchscorefromuser-func.js @@ -0,0 +1,356 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser !== "undefined") { + gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser = {}; + + +gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Filter") : "") == "better_than"); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "better_than", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("FilterScore") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Filter") : "") != "better_than"); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "worse_than", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("FilterScore") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +};gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser.asyncCallback24915828 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "scores", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("RequestName") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser.asyncCallback24915828(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser.eventsList2 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("GuestName") : "") != ""); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "guest", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("GuestName") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +{ //Subevents +gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser.eventsList1(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("GuestName") : "") == ""); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__SetErrorMessage.func(runtimeScene, "No guest name specified", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__SetSuccess.func(runtimeScene, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +};gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser.asyncCallback24918548 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser.eventsList3 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "scores", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("RequestName") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser.asyncCallback24918548(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser.asyncCallback24920004 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser.eventsList4 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "scores", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("RequestName") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser.asyncCallback24920004(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser.eventsList5 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("GuestName") : "") != ""); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "guest", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("GuestName") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +{ //Subevents +gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser.eventsList4(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("GuestName") : "") == ""); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__SetErrorMessage.func(runtimeScene, "No guest name specified", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__SetSuccess.func(runtimeScene, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +};gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser.eventsList6 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddConnectedUser.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +{ //Subevents +gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser.eventsList3(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))); +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser.eventsList5(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser.eventsList7 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Limit")) || 0 : 0) != 0); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "limit", gdjs.evtTools.common.toString(gdjs.evtTools.common.clamp((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Limit")) || 0 : 0), 1, 100)), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Limit")) || 0 : 0) == 0); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "limit", "10", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Board") : "") != ""); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "table_id", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Board") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Filter") : "") != "none"); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("GuestRecord") : false); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser.eventsList2(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = !(typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("GuestRecord") : false); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser.eventsList6(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser.func = function(runtimeScene, RequestName, GuestRecord, GuestName, Limit, Board, Filter, FilterScore, parentEventsFunctionContext) { +var eventsFunctionContext = { + task: new gdjs.ManuallyResolvableTask(), + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "RequestName") return RequestName; +if (argName === "GuestRecord") return GuestRecord; +if (argName === "GuestName") return GuestName; +if (argName === "Limit") return Limit; +if (argName === "Board") return Board; +if (argName === "Filter") return Filter; +if (argName === "FilterScore") return FilterScore; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser.eventsList7(runtimeScene, eventsFunctionContext); + +return eventsFunctionContext.task +} + +gdjs.evtsExt__GamejoltAPI__FetchScoreFromUser.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchscorerank-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchscorerank-func.js new file mode 100644 index 0000000..873fe1e --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchscorerank-func.js @@ -0,0 +1,131 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__FetchScoreRank !== "undefined") { + gdjs.evtsExt__GamejoltAPI__FetchScoreRank.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__FetchScoreRank = {}; + + +gdjs.evtsExt__GamejoltAPI__FetchScoreRank.asyncCallback24933324 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__FetchScoreRank.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "scores/get-rank", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("RequestName") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__FetchScoreRank.asyncCallback24933324(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__FetchScoreRank.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "sort", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Score") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Board") : "") != ""); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "table_id", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Board") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +{ + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__FetchScoreRank.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__FetchScoreRank.func = function(runtimeScene, RequestName, Score, Board, parentEventsFunctionContext) { +var eventsFunctionContext = { + task: new gdjs.ManuallyResolvableTask(), + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "RequestName") return RequestName; +if (argName === "Score") return Score; +if (argName === "Board") return Board; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__FetchScoreRank.eventsList1(runtimeScene, eventsFunctionContext); + +return eventsFunctionContext.task +} + +gdjs.evtsExt__GamejoltAPI__FetchScoreRank.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchscoretables-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchscoretables-func.js new file mode 100644 index 0000000..f6425a3 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchscoretables-func.js @@ -0,0 +1,104 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__FetchScoreTables !== "undefined") { + gdjs.evtsExt__GamejoltAPI__FetchScoreTables.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__FetchScoreTables = {}; + + +gdjs.evtsExt__GamejoltAPI__FetchScoreTables.asyncCallback24935244 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__FetchScoreTables.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "scores/tables", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("RequestName") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__FetchScoreTables.asyncCallback24935244(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__FetchScoreTables.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__FetchScoreTables.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__FetchScoreTables.func = function(runtimeScene, RequestName, parentEventsFunctionContext) { +var eventsFunctionContext = { + task: new gdjs.ManuallyResolvableTask(), + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "RequestName") return RequestName; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__FetchScoreTables.eventsList1(runtimeScene, eventsFunctionContext); + +return eventsFunctionContext.task +} + +gdjs.evtsExt__GamejoltAPI__FetchScoreTables.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchservertime-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchservertime-func.js new file mode 100644 index 0000000..0641d6e --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchservertime-func.js @@ -0,0 +1,104 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__FetchServerTime !== "undefined") { + gdjs.evtsExt__GamejoltAPI__FetchServerTime.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__FetchServerTime = {}; + + +gdjs.evtsExt__GamejoltAPI__FetchServerTime.asyncCallback24870892 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__FetchServerTime.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "time", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("RequestName") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__FetchServerTime.asyncCallback24870892(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__FetchServerTime.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__FetchServerTime.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__FetchServerTime.func = function(runtimeScene, RequestName, parentEventsFunctionContext) { +var eventsFunctionContext = { + task: new gdjs.ManuallyResolvableTask(), + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "RequestName") return RequestName; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__FetchServerTime.eventsList1(runtimeScene, eventsFunctionContext); + +return eventsFunctionContext.task +} + +gdjs.evtsExt__GamejoltAPI__FetchServerTime.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchtrophies-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchtrophies-func.js new file mode 100644 index 0000000..9bdc8b4 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchtrophies-func.js @@ -0,0 +1,184 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__FetchTrophies !== "undefined") { + gdjs.evtsExt__GamejoltAPI__FetchTrophies.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__FetchTrophies = {}; + + +gdjs.evtsExt__GamejoltAPI__FetchTrophies.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Filter") : "") == "achieved"); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "achieved", "true", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Filter") : "") != "achieved"); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "achieved", "false", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +};gdjs.evtsExt__GamejoltAPI__FetchTrophies.asyncCallback24940300 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__FetchTrophies.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "trophies", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("RequestName") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__FetchTrophies.asyncCallback24940300(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__FetchTrophies.eventsList2 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Filter") : "") != "none"); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__FetchTrophies.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +{ + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__FetchTrophies.eventsList1(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__GamejoltAPI__FetchTrophies.eventsList3 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__SetErrorMessage.func(runtimeScene, "User is not connected", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__SetSuccess.func(runtimeScene, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddConnectedUser.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +{ //Subevents +gdjs.evtsExt__GamejoltAPI__FetchTrophies.eventsList2(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__FetchTrophies.func = function(runtimeScene, RequestName, Filter, parentEventsFunctionContext) { +var eventsFunctionContext = { + task: new gdjs.ManuallyResolvableTask(), + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "RequestName") return RequestName; +if (argName === "Filter") return Filter; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__FetchTrophies.eventsList3(runtimeScene, eventsFunctionContext); + +return eventsFunctionContext.task +} + +gdjs.evtsExt__GamejoltAPI__FetchTrophies.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchtrophiesbyidentifier-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchtrophiesbyidentifier-func.js new file mode 100644 index 0000000..44d2ee9 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchtrophiesbyidentifier-func.js @@ -0,0 +1,124 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__FetchTrophiesByIdentifier !== "undefined") { + gdjs.evtsExt__GamejoltAPI__FetchTrophiesByIdentifier.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__FetchTrophiesByIdentifier = {}; + + +gdjs.evtsExt__GamejoltAPI__FetchTrophiesByIdentifier.asyncCallback24944412 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__FetchTrophiesByIdentifier.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "trophies", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("RequestName") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__FetchTrophiesByIdentifier.asyncCallback24944412(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__FetchTrophiesByIdentifier.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__SetErrorMessage.func(runtimeScene, "User is not connected", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__SetSuccess.func(runtimeScene, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddConnectedUser.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "trophy_id", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Trophy") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +{ //Subevents +gdjs.evtsExt__GamejoltAPI__FetchTrophiesByIdentifier.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__FetchTrophiesByIdentifier.func = function(runtimeScene, RequestName, Trophy, parentEventsFunctionContext) { +var eventsFunctionContext = { + task: new gdjs.ManuallyResolvableTask(), + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "RequestName") return RequestName; +if (argName === "Trophy") return Trophy; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__FetchTrophiesByIdentifier.eventsList1(runtimeScene, eventsFunctionContext); + +return eventsFunctionContext.task +} + +gdjs.evtsExt__GamejoltAPI__FetchTrophiesByIdentifier.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchuser-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchuser-func.js new file mode 100644 index 0000000..a207c75 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchuser-func.js @@ -0,0 +1,164 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__FetchUser !== "undefined") { + gdjs.evtsExt__GamejoltAPI__FetchUser.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__FetchUser = {}; + + +gdjs.evtsExt__GamejoltAPI__FetchUser.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("WithIdentifier") : false); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "user_id", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Username") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = !(typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("WithIdentifier") : false); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "username", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Username") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +};gdjs.evtsExt__GamejoltAPI__FetchUser.asyncCallback24859404 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__FetchUser.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "users", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("RequestName") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__FetchUser.asyncCallback24859404(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__FetchUser.eventsList2 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__TestMode.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "username", gdjs.evtsExt__GamejoltAPI__Username.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtsExt__GamejoltAPI__TestMode.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))); +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__FetchUser.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +{ + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__FetchUser.eventsList1(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__FetchUser.func = function(runtimeScene, RequestName, Username, WithIdentifier, parentEventsFunctionContext) { +var eventsFunctionContext = { + task: new gdjs.ManuallyResolvableTask(), + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "RequestName") return RequestName; +if (argName === "Username") return Username; +if (argName === "WithIdentifier") return WithIdentifier; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__FetchUser.eventsList2(runtimeScene, eventsFunctionContext); + +return eventsFunctionContext.task +} + +gdjs.evtsExt__GamejoltAPI__FetchUser.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchuserfriends-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchuserfriends-func.js new file mode 100644 index 0000000..e6ba107 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__fetchuserfriends-func.js @@ -0,0 +1,122 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__FetchUserFriends !== "undefined") { + gdjs.evtsExt__GamejoltAPI__FetchUserFriends.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__FetchUserFriends = {}; + + +gdjs.evtsExt__GamejoltAPI__FetchUserFriends.asyncCallback24868324 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__FetchUserFriends.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "friends", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("RequestName") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__FetchUserFriends.asyncCallback24868324(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__FetchUserFriends.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddConnectedUser.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +{ //Subevents +gdjs.evtsExt__GamejoltAPI__FetchUserFriends.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__SetErrorMessage.func(runtimeScene, "User is not connected", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__SetSuccess.func(runtimeScene, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__FetchUserFriends.func = function(runtimeScene, RequestName, parentEventsFunctionContext) { +var eventsFunctionContext = { + task: new gdjs.ManuallyResolvableTask(), + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "RequestName") return RequestName; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__FetchUserFriends.eventsList1(runtimeScene, eventsFunctionContext); + +return eventsFunctionContext.task +} + +gdjs.evtsExt__GamejoltAPI__FetchUserFriends.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__finished-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__finished-func.js new file mode 100644 index 0000000..ec77e77 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__finished-func.js @@ -0,0 +1,94 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__Finished !== "undefined") { + gdjs.evtsExt__GamejoltAPI__Finished.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__Finished = {}; + + +gdjs.evtsExt__GamejoltAPI__Finished.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = false; }}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.variableChildExists(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("CompleteStack"), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("RequestName") : "")); +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__Finished.func = function(runtimeScene, RequestName, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "RequestName") return RequestName; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__Finished.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__GamejoltAPI__Finished.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__gameidentifier-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__gameidentifier-func.js new file mode 100644 index 0000000..7991e48 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__gameidentifier-func.js @@ -0,0 +1,81 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__GameIdentifier !== "undefined") { + gdjs.evtsExt__GamejoltAPI__GameIdentifier.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__GameIdentifier = {}; + + +gdjs.evtsExt__GamejoltAPI__GameIdentifier.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtTools.variable.getVariableString(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("GameID")); }}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__GameIdentifier.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__GameIdentifier.eventsList0(runtimeScene, eventsFunctionContext); + +return "" + eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__GamejoltAPI__GameIdentifier.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__gamekey-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__gamekey-func.js new file mode 100644 index 0000000..ac7e2dd --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__gamekey-func.js @@ -0,0 +1,81 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__GameKey !== "undefined") { + gdjs.evtsExt__GamejoltAPI__GameKey.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__GameKey = {}; + + +gdjs.evtsExt__GamejoltAPI__GameKey.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtTools.variable.getVariableString(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("GameKey")); }}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__GameKey.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__GameKey.eventsList0(runtimeScene, eventsFunctionContext); + +return "" + eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__GamejoltAPI__GameKey.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__lasterrormessage-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__lasterrormessage-func.js new file mode 100644 index 0000000..c9719dc --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__lasterrormessage-func.js @@ -0,0 +1,81 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__LastErrorMessage !== "undefined") { + gdjs.evtsExt__GamejoltAPI__LastErrorMessage.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__LastErrorMessage = {}; + + +gdjs.evtsExt__GamejoltAPI__LastErrorMessage.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtTools.variable.getVariableString(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("ErrorMessage")); }}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__LastErrorMessage.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__LastErrorMessage.eventsList0(runtimeScene, eventsFunctionContext); + +return "" + eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__GamejoltAPI__LastErrorMessage.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__lastresponse-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__lastresponse-func.js new file mode 100644 index 0000000..16ea2a9 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__lastresponse-func.js @@ -0,0 +1,81 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__LastResponse !== "undefined") { + gdjs.evtsExt__GamejoltAPI__LastResponse.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__LastResponse = {}; + + +gdjs.evtsExt__GamejoltAPI__LastResponse.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtTools.variable.getVariableString(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("Response")); }}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__LastResponse.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__LastResponse.eventsList0(runtimeScene, eventsFunctionContext); + +return "" + eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__GamejoltAPI__LastResponse.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__lastsuccess-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__lastsuccess-func.js new file mode 100644 index 0000000..ab69def --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__lastsuccess-func.js @@ -0,0 +1,95 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__LastSuccess !== "undefined") { + gdjs.evtsExt__GamejoltAPI__LastSuccess.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__LastSuccess = {}; + + +gdjs.evtsExt__GamejoltAPI__LastSuccess.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.getVariableBoolean(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("Success"), true); +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.getVariableBoolean(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("Success"), false); +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = false; }}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__LastSuccess.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__LastSuccess.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__GamejoltAPI__LastSuccess.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__onsceneloaded-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__onsceneloaded-func.js new file mode 100644 index 0000000..b08f7e3 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__onsceneloaded-func.js @@ -0,0 +1,88 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__onSceneLoaded !== "undefined") { + gdjs.evtsExt__GamejoltAPI__onSceneLoaded.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__onSceneLoaded = {}; + + +gdjs.evtsExt__GamejoltAPI__onSceneLoaded.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__Session.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +{gdjs.evtTools.runtimeScene.resetTimer(runtimeScene, "__GamejoltAPI_Session"); +}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__onSceneLoaded.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__onSceneLoaded.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__GamejoltAPI__onSceneLoaded.registeredGdjsCallbacks = []; +gdjs.evtsExt__GamejoltAPI__onSceneLoaded.registeredGdjsCallbacks.push((runtimeScene) => { + gdjs.evtsExt__GamejoltAPI__onSceneLoaded.func(runtimeScene, runtimeScene); +}) +gdjs.registerRuntimeSceneLoadedCallback(gdjs.evtsExt__GamejoltAPI__onSceneLoaded.registeredGdjsCallbacks[gdjs.evtsExt__GamejoltAPI__onSceneLoaded.registeredGdjsCallbacks.length - 1]); diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__onscenepostevents-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__onscenepostevents-func.js new file mode 100644 index 0000000..8cc919d --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__onscenepostevents-func.js @@ -0,0 +1,86 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__onScenePostEvents !== "undefined") { + gdjs.evtsExt__GamejoltAPI__onScenePostEvents.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__onScenePostEvents = {}; + + +gdjs.evtsExt__GamejoltAPI__onScenePostEvents.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtTools.variable.variableClearChildren(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("CompleteStack")); +}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__onScenePostEvents.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__onScenePostEvents.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__GamejoltAPI__onScenePostEvents.registeredGdjsCallbacks = []; +gdjs.evtsExt__GamejoltAPI__onScenePostEvents.registeredGdjsCallbacks.push((runtimeScene) => { + gdjs.evtsExt__GamejoltAPI__onScenePostEvents.func(runtimeScene, runtimeScene); +}) +gdjs.registerRuntimeScenePostEventsCallback(gdjs.evtsExt__GamejoltAPI__onScenePostEvents.registeredGdjsCallbacks[gdjs.evtsExt__GamejoltAPI__onScenePostEvents.registeredGdjsCallbacks.length - 1]); diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__opensession-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__opensession-func.js new file mode 100644 index 0000000..6c7878b --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__opensession-func.js @@ -0,0 +1,152 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__OpenSession !== "undefined") { + gdjs.evtsExt__GamejoltAPI__OpenSession.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__OpenSession = {}; + + +gdjs.evtsExt__GamejoltAPI__OpenSession.eventsList0 = function(runtimeScene, eventsFunctionContext, asyncObjectsList) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__LastSuccess.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__SetSession.func(runtimeScene, true, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtTools.runtimeScene.resetTimer(runtimeScene, "__GamejoltAPI_Session"); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +};gdjs.evtsExt__GamejoltAPI__OpenSession.asyncCallback24874284 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__OpenSession.eventsList0(runtimeScene, eventsFunctionContext, asyncObjectsList);} //End of subevents +} +gdjs.evtsExt__GamejoltAPI__OpenSession.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "sessions/open", "", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__OpenSession.asyncCallback24874284(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__OpenSession.eventsList2 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__SetErrorMessage.func(runtimeScene, "User is not connected", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__SetSuccess.func(runtimeScene, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +{gdjs.evtTools.runtimeScene.removeTimer(runtimeScene, "__GamejoltAPI_Session"); +}{gdjs.evtsExt__GamejoltAPI__SetSession.func(runtimeScene, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__AddConnectedUser.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +{ //Subevents +gdjs.evtsExt__GamejoltAPI__OpenSession.eventsList1(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__OpenSession.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + task: new gdjs.ManuallyResolvableTask(), + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__OpenSession.eventsList2(runtimeScene, eventsFunctionContext); + +return eventsFunctionContext.task +} + +gdjs.evtsExt__GamejoltAPI__OpenSession.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__prepareurl-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__prepareurl-func.js new file mode 100644 index 0000000..5231b39 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__prepareurl-func.js @@ -0,0 +1,103 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__PrepareURL !== "undefined") { + gdjs.evtsExt__GamejoltAPI__PrepareURL.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__PrepareURL = {}; + + +gdjs.evtsExt__GamejoltAPI__PrepareURL.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +};gdjs.evtsExt__GamejoltAPI__PrepareURL.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtsExt__GamejoltAPI__SetURL.func(runtimeScene, "https://api.gamejolt.com/api/game/v1_2/" + (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Endpoint") : "") + "/", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__SetURL.func(runtimeScene, gdjs.evtsExt__GamejoltAPI__URL.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) + ("?game_id=" + gdjs.evtsExt__GamejoltAPI__GameIdentifier.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +const repeatCount2 = gdjs.evtTools.variable.getVariableChildCount(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("Parameters")); +for (let repeatIndex2 = 0;repeatIndex2 < repeatCount2;++repeatIndex2) { + +let isConditionTrue_0 = false; +if (true) +{ +{gdjs.evtsExt__GamejoltAPI__SetURL.func(runtimeScene, gdjs.evtsExt__GamejoltAPI__URL.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) + ("&" + gdjs.evtTools.variable.getFirstVariableString(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("Parameters"))), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtTools.variable.variableRemoveAt(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("Parameters"), 0); +}} +} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__PrepareURL.func = function(runtimeScene, Endpoint, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Endpoint") return Endpoint; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__PrepareURL.eventsList1(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__GamejoltAPI__PrepareURL.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__registergame-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__registergame-func.js new file mode 100644 index 0000000..2c064cc --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__registergame-func.js @@ -0,0 +1,94 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__RegisterGame !== "undefined") { + gdjs.evtsExt__GamejoltAPI__RegisterGame.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__RegisterGame = {}; + + +gdjs.evtsExt__GamejoltAPI__RegisterGame.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("GameID").setString((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("GameIdentifier") : "")); +}{runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("GameKey").setString((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("GameSecretKey") : "")); +}{runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("Url").setString(""); +}{runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("Response").setString(""); +}{runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("Username").setString(""); +}{runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("UserToken").setString(""); +}{runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("ErrorMessage").setString(""); +}{gdjs.evtTools.variable.setVariableBoolean(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("Success"), false); +}{gdjs.evtTools.variable.setVariableBoolean(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("TestMode"), false); +}{gdjs.evtTools.variable.setVariableBoolean(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("Session"), false); +}{gdjs.evtTools.variable.setVariableBoolean(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("IsAuthenticated"), false); +}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__RegisterGame.func = function(runtimeScene, GameIdentifier, GameSecretKey, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "GameIdentifier") return GameIdentifier; +if (argName === "GameSecretKey") return GameSecretKey; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__RegisterGame.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__GamejoltAPI__RegisterGame.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__removedata-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__removedata-func.js new file mode 100644 index 0000000..9f9c91b --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__removedata-func.js @@ -0,0 +1,186 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__RemoveData !== "undefined") { + gdjs.evtsExt__GamejoltAPI__RemoveData.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__RemoveData = {}; + + +gdjs.evtsExt__GamejoltAPI__RemoveData.asyncCallback24978636 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__RemoveData.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "data-store/remove", "", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__RemoveData.asyncCallback24978636(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__RemoveData.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__SetErrorMessage.func(runtimeScene, "User is not connected", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__SetSuccess.func(runtimeScene, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddConnectedUser.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +{ //Subevents +gdjs.evtsExt__GamejoltAPI__RemoveData.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__GamejoltAPI__RemoveData.asyncCallback24979484 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__RemoveData.eventsList2 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "data-store/remove", "", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__RemoveData.asyncCallback24979484(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__RemoveData.eventsList3 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "key", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Key") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = !(typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("IsGlobal") : false); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__RemoveData.eventsList1(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("IsGlobal") : false); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__RemoveData.eventsList2(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__RemoveData.func = function(runtimeScene, IsGlobal, Key, parentEventsFunctionContext) { +var eventsFunctionContext = { + task: new gdjs.ManuallyResolvableTask(), + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "IsGlobal") return IsGlobal; +if (argName === "Key") return Key; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__RemoveData.eventsList3(runtimeScene, eventsFunctionContext); + +return eventsFunctionContext.task +} + +gdjs.evtsExt__GamejoltAPI__RemoveData.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__removetrophies-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__removetrophies-func.js new file mode 100644 index 0000000..1b08d8d --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__removetrophies-func.js @@ -0,0 +1,123 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__RemoveTrophies !== "undefined") { + gdjs.evtsExt__GamejoltAPI__RemoveTrophies.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__RemoveTrophies = {}; + + +gdjs.evtsExt__GamejoltAPI__RemoveTrophies.asyncCallback24950740 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__RemoveTrophies.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "trophies/remove-achieved", "", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__RemoveTrophies.asyncCallback24950740(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__RemoveTrophies.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__SetErrorMessage.func(runtimeScene, "User is not connected", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__SetSuccess.func(runtimeScene, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddConnectedUser.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "trophy_id", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Trophy") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +{ //Subevents +gdjs.evtsExt__GamejoltAPI__RemoveTrophies.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__RemoveTrophies.func = function(runtimeScene, Trophy, parentEventsFunctionContext) { +var eventsFunctionContext = { + task: new gdjs.ManuallyResolvableTask(), + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Trophy") return Trophy; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__RemoveTrophies.eventsList1(runtimeScene, eventsFunctionContext); + +return eventsFunctionContext.task +} + +gdjs.evtsExt__GamejoltAPI__RemoveTrophies.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__requesterrormessage-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__requesterrormessage-func.js new file mode 100644 index 0000000..5fd2dd8 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__requesterrormessage-func.js @@ -0,0 +1,99 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__RequestErrorMessage !== "undefined") { + gdjs.evtsExt__GamejoltAPI__RequestErrorMessage.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__RequestErrorMessage = {}; + + +gdjs.evtsExt__GamejoltAPI__RequestErrorMessage.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = ""; }}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("RequestName") : "") != ""); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.variableChildExists(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("CompleteStack"), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("RequestName") : "")); +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtTools.variable.getVariableString(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("CompleteStack").getChild((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("RequestName") : "")).getChild("ErrorMessage")); }}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__RequestErrorMessage.func = function(runtimeScene, RequestName, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "RequestName") return RequestName; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__RequestErrorMessage.eventsList0(runtimeScene, eventsFunctionContext); + +return "" + eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__GamejoltAPI__RequestErrorMessage.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__requestresponse-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__requestresponse-func.js new file mode 100644 index 0000000..2dc8e49 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__requestresponse-func.js @@ -0,0 +1,99 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__RequestResponse !== "undefined") { + gdjs.evtsExt__GamejoltAPI__RequestResponse.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__RequestResponse = {}; + + +gdjs.evtsExt__GamejoltAPI__RequestResponse.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = ""; }}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("RequestName") : "") != ""); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.variableChildExists(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("CompleteStack"), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("RequestName") : "")); +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtTools.variable.getVariableString(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("CompleteStack").getChild((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("RequestName") : "")).getChild("Response")); }}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__RequestResponse.func = function(runtimeScene, RequestName, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "RequestName") return RequestName; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__RequestResponse.eventsList0(runtimeScene, eventsFunctionContext); + +return "" + eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__GamejoltAPI__RequestResponse.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__requestsuccess-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__requestsuccess-func.js new file mode 100644 index 0000000..d0bbab7 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__requestsuccess-func.js @@ -0,0 +1,103 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__RequestSuccess !== "undefined") { + gdjs.evtsExt__GamejoltAPI__RequestSuccess.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__RequestSuccess = {}; + + +gdjs.evtsExt__GamejoltAPI__RequestSuccess.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = false; }}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("RequestName") : "") != ""); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.variableChildExists(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("CompleteStack"), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("RequestName") : "")); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.getVariableBoolean(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("CompleteStack").getChild((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("RequestName") : "")).getChild("Success"), true); +} +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__RequestSuccess.func = function(runtimeScene, RequestName, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "RequestName") return RequestName; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__RequestSuccess.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__GamejoltAPI__RequestSuccess.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__session-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__session-func.js new file mode 100644 index 0000000..122a737 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__session-func.js @@ -0,0 +1,95 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__Session !== "undefined") { + gdjs.evtsExt__GamejoltAPI__Session.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__Session = {}; + + +gdjs.evtsExt__GamejoltAPI__Session.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.getVariableBoolean(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("Session"), true); +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.getVariableBoolean(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("Session"), false); +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = false; }}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__Session.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__Session.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__GamejoltAPI__Session.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__setauthenticated-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__setauthenticated-func.js new file mode 100644 index 0000000..978b7ff --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__setauthenticated-func.js @@ -0,0 +1,100 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__SetAuthenticated !== "undefined") { + gdjs.evtsExt__GamejoltAPI__SetAuthenticated.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__SetAuthenticated = {}; + + +gdjs.evtsExt__GamejoltAPI__SetAuthenticated.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("Value") : false); +} +if (isConditionTrue_0) { +{gdjs.evtTools.variable.setVariableBoolean(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("IsAuthenticated"), true); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = !(typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("Value") : false); +} +if (isConditionTrue_0) { +{gdjs.evtTools.variable.setVariableBoolean(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("IsAuthenticated"), false); +}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__SetAuthenticated.func = function(runtimeScene, Value, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__SetAuthenticated.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__GamejoltAPI__SetAuthenticated.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__seterrormessage-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__seterrormessage-func.js new file mode 100644 index 0000000..fb64281 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__seterrormessage-func.js @@ -0,0 +1,83 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__SetErrorMessage !== "undefined") { + gdjs.evtsExt__GamejoltAPI__SetErrorMessage.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__SetErrorMessage = {}; + + +gdjs.evtsExt__GamejoltAPI__SetErrorMessage.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("ErrorMessage").setString((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Value") : "")); +}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__SetErrorMessage.func = function(runtimeScene, Value, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__SetErrorMessage.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__GamejoltAPI__SetErrorMessage.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__setsession-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__setsession-func.js new file mode 100644 index 0000000..0d2f560 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__setsession-func.js @@ -0,0 +1,100 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__SetSession !== "undefined") { + gdjs.evtsExt__GamejoltAPI__SetSession.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__SetSession = {}; + + +gdjs.evtsExt__GamejoltAPI__SetSession.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("Value") : false); +} +if (isConditionTrue_0) { +{gdjs.evtTools.variable.setVariableBoolean(runtimeScene.getGame().getVariables().get("__Gamejolt").getChild("Session"), true); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = !(typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("Value") : false); +} +if (isConditionTrue_0) { +{gdjs.evtTools.variable.setVariableBoolean(runtimeScene.getGame().getVariables().get("__Gamejolt").getChild("Session"), false); +}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__SetSession.func = function(runtimeScene, Value, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__SetSession.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__GamejoltAPI__SetSession.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__setsuccess-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__setsuccess-func.js new file mode 100644 index 0000000..4187b53 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__setsuccess-func.js @@ -0,0 +1,100 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__SetSuccess !== "undefined") { + gdjs.evtsExt__GamejoltAPI__SetSuccess.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__SetSuccess = {}; + + +gdjs.evtsExt__GamejoltAPI__SetSuccess.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("Value") : false); +} +if (isConditionTrue_0) { +{gdjs.evtTools.variable.setVariableBoolean(runtimeScene.getGame().getVariables().get("__Gamejolt").getChild("Success"), true); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = !(typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("Value") : false); +} +if (isConditionTrue_0) { +{gdjs.evtTools.variable.setVariableBoolean(runtimeScene.getGame().getVariables().get("__Gamejolt").getChild("Success"), false); +}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__SetSuccess.func = function(runtimeScene, Value, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__SetSuccess.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__GamejoltAPI__SetSuccess.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__settestmode-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__settestmode-func.js new file mode 100644 index 0000000..a00d6c8 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__settestmode-func.js @@ -0,0 +1,100 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__SetTestMode !== "undefined") { + gdjs.evtsExt__GamejoltAPI__SetTestMode.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__SetTestMode = {}; + + +gdjs.evtsExt__GamejoltAPI__SetTestMode.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("Value") : false); +} +if (isConditionTrue_0) { +{gdjs.evtTools.variable.setVariableBoolean(runtimeScene.getGame().getVariables().get("__Gamejolt").getChild("TestMode"), true); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = !(typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("Value") : false); +} +if (isConditionTrue_0) { +{gdjs.evtTools.variable.setVariableBoolean(runtimeScene.getGame().getVariables().get("__Gamejolt").getChild("TestMode"), false); +}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__SetTestMode.func = function(runtimeScene, Value, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__SetTestMode.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__GamejoltAPI__SetTestMode.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__settestuser-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__settestuser-func.js new file mode 100644 index 0000000..ecc95cc --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__settestuser-func.js @@ -0,0 +1,86 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__SetTestUser !== "undefined") { + gdjs.evtsExt__GamejoltAPI__SetTestUser.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__SetTestUser = {}; + + +gdjs.evtsExt__GamejoltAPI__SetTestUser.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtsExt__GamejoltAPI__SetUsername.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Username") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__SetUserToken.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("UserToken") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__SetTestMode.func(runtimeScene, true, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__SetTestUser.func = function(runtimeScene, Username, UserToken, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Username") return Username; +if (argName === "UserToken") return UserToken; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__SetTestUser.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__GamejoltAPI__SetTestUser.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__seturl-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__seturl-func.js new file mode 100644 index 0000000..aaf1f4b --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__seturl-func.js @@ -0,0 +1,83 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__SetURL !== "undefined") { + gdjs.evtsExt__GamejoltAPI__SetURL.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__SetURL = {}; + + +gdjs.evtsExt__GamejoltAPI__SetURL.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("Url").setString((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Value") : "")); +}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__SetURL.func = function(runtimeScene, Value, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__SetURL.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__GamejoltAPI__SetURL.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__setusername-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__setusername-func.js new file mode 100644 index 0000000..352eb6f --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__setusername-func.js @@ -0,0 +1,83 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__SetUsername !== "undefined") { + gdjs.evtsExt__GamejoltAPI__SetUsername.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__SetUsername = {}; + + +gdjs.evtsExt__GamejoltAPI__SetUsername.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("Username").setString((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Value") : "")); +}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__SetUsername.func = function(runtimeScene, Value, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__SetUsername.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__GamejoltAPI__SetUsername.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__setusertoken-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__setusertoken-func.js new file mode 100644 index 0000000..81f4cfb --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__setusertoken-func.js @@ -0,0 +1,83 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__SetUserToken !== "undefined") { + gdjs.evtsExt__GamejoltAPI__SetUserToken.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__SetUserToken = {}; + + +gdjs.evtsExt__GamejoltAPI__SetUserToken.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("UserToken").setString((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Value") : "")); +}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__SetUserToken.func = function(runtimeScene, Value, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__SetUserToken.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__GamejoltAPI__SetUserToken.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__sha1-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__sha1-func.js new file mode 100644 index 0000000..9dfecce --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__sha1-func.js @@ -0,0 +1,221 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__SHA1 !== "undefined") { + gdjs.evtsExt__GamejoltAPI__SHA1.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__SHA1 = {}; + + +gdjs.evtsExt__GamejoltAPI__SHA1.userFunc0x1966a80 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +eventsFunctionContext.returnValue = sha1(eventsFunctionContext.getArgument("Text").toString()); + + + +function sha1(msg) { + function rotate_left(n,s) { + var t4 = ( n<>>(32-s)); + return t4; + }; + function lsb_hex(val) { + var str=''; + var i; + var vh; + var vl; + for( i=0; i<=6; i+=2 ) { + vh = (val>>>(i*4+4))&0x0f; + vl = (val>>>(i*4))&0x0f; + str += vh.toString(16) + vl.toString(16); + } + return str; + }; + function cvt_hex(val) { + var str=''; + var i; + var v; + for( i=7; i>=0; i-- ) { + v = (val>>>(i*4))&0x0f; + str += v.toString(16); + } + return str; + }; + function Utf8Encode(string) { + string = string.replace(/\r\n/g,'\n'); + var utftext = ''; + for (var n = 0; n < string.length; n++) { + var c = string.charCodeAt(n); + if (c < 128) { + utftext += String.fromCharCode(c); + } + else if((c > 127) && (c < 2048)) { + utftext += String.fromCharCode((c >> 6) | 192); + utftext += String.fromCharCode((c & 63) | 128); + } + else { + utftext += String.fromCharCode((c >> 12) | 224); + utftext += String.fromCharCode(((c >> 6) & 63) | 128); + utftext += String.fromCharCode((c & 63) | 128); + } + } + return utftext; + }; + var blockstart; + var i, j; + var W = new Array(80); + var H0 = 0x67452301; + var H1 = 0xEFCDAB89; + var H2 = 0x98BADCFE; + var H3 = 0x10325476; + var H4 = 0xC3D2E1F0; + var A, B, C, D, E; + var temp; + msg = Utf8Encode(msg); + var msg_len = msg.length; + var word_array = new Array(); + for( i=0; i>>29 ); + word_array.push( (msg_len<<3)&0x0ffffffff ); + for ( blockstart=0; blockstart + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__StoreData = {}; + + +gdjs.evtsExt__GamejoltAPI__StoreData.asyncCallback24960020 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__StoreData.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "data-store/set", "", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__StoreData.asyncCallback24960020(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__StoreData.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__SetErrorMessage.func(runtimeScene, "User is not connected", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__SetSuccess.func(runtimeScene, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddConnectedUser.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +{ //Subevents +gdjs.evtsExt__GamejoltAPI__StoreData.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__GamejoltAPI__StoreData.asyncCallback24960868 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__StoreData.eventsList2 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "data-store/set", "", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__StoreData.asyncCallback24960868(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__StoreData.eventsList3 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "key", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Key") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = !(typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("IsGlobal") : false); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__StoreData.eventsList1(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("IsGlobal") : false); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__GamejoltAPI__StoreData.eventsList2(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__StoreData.func = function(runtimeScene, IsGlobal, Key, DataSet, parentEventsFunctionContext) { +var eventsFunctionContext = { + task: new gdjs.ManuallyResolvableTask(), + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "IsGlobal") return IsGlobal; +if (argName === "Key") return Key; +if (argName === "DataSet") return DataSet; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__StoreData.eventsList3(runtimeScene, eventsFunctionContext); + +return eventsFunctionContext.task +} + +gdjs.evtsExt__GamejoltAPI__StoreData.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__testmode-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__testmode-func.js new file mode 100644 index 0000000..40866f2 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__testmode-func.js @@ -0,0 +1,95 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__TestMode !== "undefined") { + gdjs.evtsExt__GamejoltAPI__TestMode.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__TestMode = {}; + + +gdjs.evtsExt__GamejoltAPI__TestMode.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.getVariableBoolean(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("TestMode"), true); +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.getVariableBoolean(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("TestMode"), false); +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = false; }}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__TestMode.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__TestMode.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__GamejoltAPI__TestMode.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__updatesession-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__updatesession-func.js new file mode 100644 index 0000000..7163071 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__updatesession-func.js @@ -0,0 +1,215 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__UpdateSession !== "undefined") { + gdjs.evtsExt__GamejoltAPI__UpdateSession.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__UpdateSession = {}; + + +gdjs.evtsExt__GamejoltAPI__UpdateSession.asyncCallback24888180 = function (runtimeScene, eventsFunctionContext, asyncObjectsList) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} +gdjs.evtsExt__GamejoltAPI__UpdateSession.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +{ +{ +const asyncObjectsList = new gdjs.LongLivedObjectsList(); +runtimeScene.getAsyncTasksManager().addTask(gdjs.evtsExt__GamejoltAPI__CallGamejolt.func(runtimeScene, "sessions/ping", "", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (runtimeScene) => (gdjs.evtsExt__GamejoltAPI__UpdateSession.asyncCallback24888180(runtimeScene, eventsFunctionContext, asyncObjectsList))); +} +} + +} + + +};gdjs.evtsExt__GamejoltAPI__UpdateSession.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Status") : "") != "keep"); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddURLParameter.func(runtimeScene, "status", (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Status") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtTools.runtimeScene.resetTimer(runtimeScene, "__GamejoltAPI_Session"); +} +{ //Subevents +gdjs.evtsExt__GamejoltAPI__UpdateSession.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__GamejoltAPI__UpdateSession.eventsList2 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = !(gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))); +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__SetErrorMessage.func(runtimeScene, "User is not connected", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__GamejoltAPI__SetSuccess.func(runtimeScene, false, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__Authenticated.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__GamejoltAPI__Session.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +{let isConditionTrue_1 = false; +isConditionTrue_0 = false; +{ +{isConditionTrue_1 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Status") : "") != "keep"); +} +if(isConditionTrue_1) { + isConditionTrue_0 = true; +} +} +{ +isConditionTrue_1 = gdjs.evtTools.runtimeScene.getTimerElapsedTimeInSecondsOrNaN(runtimeScene, "__GamejoltAPI_Session") >= 30; +if(isConditionTrue_1) { + isConditionTrue_0 = true; +} +} +{ +} +} +} +} +if (isConditionTrue_0) { +{gdjs.evtsExt__GamejoltAPI__AddConnectedUser.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +{ //Subevents +gdjs.evtsExt__GamejoltAPI__UpdateSession.eventsList1(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{let isConditionTrue_1 = false; +isConditionTrue_1 = false; +isConditionTrue_1 = gdjs.evtsExt__GamejoltAPI__Session.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_1) { +isConditionTrue_1 = false; +{let isConditionTrue_2 = false; +isConditionTrue_1 = false; +{ +{isConditionTrue_2 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Status") : "") != "keep"); +} +if(isConditionTrue_2) { + isConditionTrue_1 = true; +} +} +{ +isConditionTrue_2 = gdjs.evtTools.runtimeScene.getTimerElapsedTimeInSecondsOrNaN(runtimeScene, "__GamejoltAPI_Session") >= 30; +if(isConditionTrue_2) { + isConditionTrue_1 = true; +} +} +{ +} +} +} +isConditionTrue_0 = !isConditionTrue_1; +} +if (isConditionTrue_0) { +{gdjs.evtTools.common.resolveAsyncEventsFunction((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__UpdateSession.func = function(runtimeScene, Status, parentEventsFunctionContext) { +var eventsFunctionContext = { + task: new gdjs.ManuallyResolvableTask(), + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Status") return Status; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__UpdateSession.eventsList2(runtimeScene, eventsFunctionContext); + +return eventsFunctionContext.task +} + +gdjs.evtsExt__GamejoltAPI__UpdateSession.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__url-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__url-func.js new file mode 100644 index 0000000..713cb7b --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__url-func.js @@ -0,0 +1,81 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__URL !== "undefined") { + gdjs.evtsExt__GamejoltAPI__URL.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__URL = {}; + + +gdjs.evtsExt__GamejoltAPI__URL.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtTools.variable.getVariableString(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("Url")); }}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__URL.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__URL.eventsList0(runtimeScene, eventsFunctionContext); + +return "" + eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__GamejoltAPI__URL.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__username-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__username-func.js new file mode 100644 index 0000000..0194421 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__username-func.js @@ -0,0 +1,81 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__Username !== "undefined") { + gdjs.evtsExt__GamejoltAPI__Username.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__Username = {}; + + +gdjs.evtsExt__GamejoltAPI__Username.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtTools.variable.getVariableString(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("Username")); }}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__Username.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__Username.eventsList0(runtimeScene, eventsFunctionContext); + +return "" + eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__GamejoltAPI__Username.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__usertoken-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__usertoken-func.js new file mode 100644 index 0000000..06d2ef2 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamejoltapi__usertoken-func.js @@ -0,0 +1,81 @@ + +if (typeof gdjs.evtsExt__GamejoltAPI__UserToken !== "undefined") { + gdjs.evtsExt__GamejoltAPI__UserToken.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__GamejoltAPI__UserToken = {}; + + +gdjs.evtsExt__GamejoltAPI__UserToken.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtTools.variable.getVariableString(runtimeScene.getGame().getVariables().get("__GamejoltAPI").getChild("UserToken")); }}} + +} + + +}; + +gdjs.evtsExt__GamejoltAPI__UserToken.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__GamejoltAPI__UserToken.eventsList0(runtimeScene, eventsFunctionContext); + +return "" + eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__GamejoltAPI__UserToken.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__a_advanced_vibration_controller-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__a_advanced_vibration_controller-func.js new file mode 100644 index 0000000..6ec8dce --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__a_advanced_vibration_controller-func.js @@ -0,0 +1,127 @@ + +if (typeof gdjs.evtsExt__Gamepads__A_Advanced_Vibration_Controller !== "undefined") { + gdjs.evtsExt__Gamepads__A_Advanced_Vibration_Controller.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__A_Advanced_Vibration_Controller = {}; + + +gdjs.evtsExt__Gamepads__A_Advanced_Vibration_Controller.userFunc0x19d1f30 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +/** @type {Gamepad[]} */ +//Vibration work only on game in browser. +const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []); + +//Get function parameters +const playerId = eventsFunctionContext.getArgument("Player_ID") - 1; +const duration = eventsFunctionContext.getArgument("Duration") || 1; +const strongRumbleMagnitude = eventsFunctionContext.getArgument("StrongMagnitude"); +const weakRumbleMagnitude = eventsFunctionContext.getArgument("WeakMagnitude"); + +if (playerId < 0 || playerId > 4) { + console.error('Parameter gamepad identifier in action: "Advanced gamepad vibration", is not valid number, must be between 0 and 4.'); + return; +} +if (weakRumbleMagnitude < 0 || weakRumbleMagnitude > 1) { + console.error('Parameter weakRumble identifier in action: "Advanced gamepad vibration", is not valid number, must be between 0 and 1.'); + return; +} +if (strongRumbleMagnitude < 0 || strongRumbleMagnitude > 1) { + console.error('Parameter strongRumble identifier in action: "Advanced gamepad vibration", is not valid number, must be between 0 and 1.'); + return; +} + +const gamepad = gamepads[playerId]; + +//we need keep this condition because when use have not yet plug the controller we can't get the controller in the gamepad variable. +if (gamepad == null) return; + +if (gamepad && gamepad.vibrationActuator) { + gamepad.vibrationActuator.playEffect("dual-rumble", { + startDelay: 0, + duration: duration * 1000, + weakMagnitude: weakRumbleMagnitude, + strongMagnitude: strongRumbleMagnitude + }); +} + +gdjs._extensionController.players[playerId].rumble.duration = duration; +gdjs._extensionController.players[playerId].rumble.elapsedTime = 0; +gdjs._extensionController.players[playerId].rumble.weakMagnitude = weakRumbleMagnitude; +gdjs._extensionController.players[playerId].rumble.strongMagnitude = strongRumbleMagnitude; +}; +gdjs.evtsExt__Gamepads__A_Advanced_Vibration_Controller.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Gamepads__A_Advanced_Vibration_Controller.userFunc0x19d1f30(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__A_Advanced_Vibration_Controller.func = function(runtimeScene, Player_ID, Duration, StrongMagnitude, WeakMagnitude, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Player_ID") return Player_ID; +if (argName === "Duration") return Duration; +if (argName === "StrongMagnitude") return StrongMagnitude; +if (argName === "WeakMagnitude") return WeakMagnitude; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__A_Advanced_Vibration_Controller.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__Gamepads__A_Advanced_Vibration_Controller.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__a_change_vibration_magnitude-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__a_change_vibration_magnitude-func.js new file mode 100644 index 0000000..63db991 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__a_change_vibration_magnitude-func.js @@ -0,0 +1,128 @@ + +if (typeof gdjs.evtsExt__Gamepads__A_Change_Vibration_Magnitude !== "undefined") { + gdjs.evtsExt__Gamepads__A_Change_Vibration_Magnitude.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__A_Change_Vibration_Magnitude = {}; + + +gdjs.evtsExt__Gamepads__A_Change_Vibration_Magnitude.userFunc0x19d2758 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +/** @type {Gamepad[]} */ +//Vibration work only on game in browser. +const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []); + +//Get function parameters +const playerId = eventsFunctionContext.getArgument("Player_ID") - 1; +const elapsedTime = gdjs._extensionController.players[playerId].rumble.elapsedTime || 0; +const originalDuration = gdjs._extensionController.players[playerId].rumble.duration || 1; +const strongRumbleMagnitude = eventsFunctionContext.getArgument("StrongMagnitude"); +const weakRumbleMagnitude = eventsFunctionContext.getArgument("WeakMagnitude"); + + +if (playerId < 0 || playerId > 4) { + console.error('Parameter gamepad identifier in action: "Change gamepad active vibration", is not valid number, must be between 0 and 4.'); + return; +} +if (weakRumbleMagnitude < 0 || weakRumbleMagnitude > 1) { + console.error('Parameter weakRumble identifier in action: "Change gamepad active vibration", is not valid number, must be between 0 and 1.'); + return; +} +if (strongRumbleMagnitude < 0 || strongRumbleMagnitude > 1) { + console.error('Parameter strongRumble identifier in action: "Change gamepad active vibration", is not valid number, must be between 0 and 1.'); + return; +} + +const gamepad = gamepads[playerId]; + +//we need keep this condition because when use have not yet plug the controller we can't get the controller in the gamepad variable. +if (gamepad == null) return; + +if (originalDuration - elapsedTime <= 0) return; + +if (gamepad && gamepad.vibrationActuator) { + gamepad.vibrationActuator.playEffect("dual-rumble", { + startDelay: 0, + duration: 1000 * (originalDuration - elapsedTime), + weakMagnitude: weakRumbleMagnitude, + strongMagnitude: strongRumbleMagnitude + }); +} + +gdjs._extensionController.players[playerId].rumble.weakMagnitude = weakRumbleMagnitude; +gdjs._extensionController.players[playerId].rumble.strongMagnitude = strongRumbleMagnitude; +}; +gdjs.evtsExt__Gamepads__A_Change_Vibration_Magnitude.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Gamepads__A_Change_Vibration_Magnitude.userFunc0x19d2758(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__A_Change_Vibration_Magnitude.func = function(runtimeScene, Player_ID, StrongMagnitude, WeakMagnitude, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Player_ID") return Player_ID; +if (argName === "StrongMagnitude") return StrongMagnitude; +if (argName === "WeakMagnitude") return WeakMagnitude; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__A_Change_Vibration_Magnitude.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__Gamepads__A_Change_Vibration_Magnitude.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__a_set_deadzone-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__a_set_deadzone-func.js new file mode 100644 index 0000000..3a2cd05 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__a_set_deadzone-func.js @@ -0,0 +1,97 @@ + +if (typeof gdjs.evtsExt__Gamepads__A_Set_deadzone !== "undefined") { + gdjs.evtsExt__Gamepads__A_Set_deadzone.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__A_Set_deadzone = {}; + + +gdjs.evtsExt__Gamepads__A_Set_deadzone.userFunc0x19c2170 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +//Get function parameter +const playerId = eventsFunctionContext.getArgument("player_ID") - 1; +const newDeadzone = eventsFunctionContext.getArgument("deadzone"); + +if (playerId < 0 || playerId > 4) { + console.error('Parameter gamepad identifier in action: "Set gamepad deadzone for sticks", is not valid, must be between 0 and 4.'); + return; +} + +// clamp the newDeadzone in range [0, 1]. +// https://github.com/4ian/GDevelop-extensions/pull/33#issuecomment-618224857 +gdjs._extensionController.players[playerId].deadzone = gdjs.evtTools.common.clamp(newDeadzone, 0, 1); + +}; +gdjs.evtsExt__Gamepads__A_Set_deadzone.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Gamepads__A_Set_deadzone.userFunc0x19c2170(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__A_Set_deadzone.func = function(runtimeScene, player_ID, deadzone, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "player_ID") return player_ID; +if (argName === "deadzone") return deadzone; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__A_Set_deadzone.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__Gamepads__A_Set_deadzone.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__a_vibrate_controller-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__a_vibrate_controller-func.js new file mode 100644 index 0000000..d8df408 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__a_vibrate_controller-func.js @@ -0,0 +1,110 @@ + +if (typeof gdjs.evtsExt__Gamepads__A_Vibrate_controller !== "undefined") { + gdjs.evtsExt__Gamepads__A_Vibrate_controller.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__A_Vibrate_controller = {}; + + +gdjs.evtsExt__Gamepads__A_Vibrate_controller.userFunc0x19cd9f8 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +/** @type {Gamepad[]} */ +//Vibration work only on game in browser. +const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []); + +//Get function parameters +const playerId = eventsFunctionContext.getArgument("Player_ID") - 1; +const duration = eventsFunctionContext.getArgument("Duration") || 1; + +if (playerId < 0 || playerId > 4) { + console.error('Parameter gamepad identifier in action: "Gamepad connected", is not valid number, must be between 0 and 4.'); + return; +} + +const gamepad = gamepads[playerId]; + +//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable. +if (gamepad == null) return; + +if (gamepad && gamepad.vibrationActuator) { + gamepad.vibrationActuator.playEffect("dual-rumble", { + startDelay: 0, + duration: duration * 1000, + weakMagnitude: 1.0, + strongMagnitude: 1.0 + }); +} +}; +gdjs.evtsExt__Gamepads__A_Vibrate_controller.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Gamepads__A_Vibrate_controller.userFunc0x19cd9f8(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__A_Vibrate_controller.func = function(runtimeScene, Player_ID, Duration, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Player_ID") return Player_ID; +if (argName === "Duration") return Duration; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__A_Vibrate_controller.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__Gamepads__A_Vibrate_controller.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__axisvalue-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__axisvalue-func.js new file mode 100644 index 0000000..4d8d2ef --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__axisvalue-func.js @@ -0,0 +1,194 @@ + +if (typeof gdjs.evtsExt__Gamepads__AxisValue !== "undefined") { + gdjs.evtsExt__Gamepads__AxisValue.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__AxisValue = {}; + + +gdjs.evtsExt__Gamepads__AxisValue.userFunc0xc77d08 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +/** @type {Gamepad[]} */ +const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []); + +//Get function parameters +const playerId = eventsFunctionContext.getArgument("player_ID") - 1; +const stick = eventsFunctionContext.getArgument("stick").toUpperCase(); +const direction = eventsFunctionContext.getArgument("direction").toUpperCase(); + +if (playerId < 0 || playerId > 4) { + console.error('Parameter gamepad identifier is not valid in expression: "Value of a gamepad axis"'); + return; +} +if (stick != "LEFT" && stick != "RIGHT") { + console.error('Parameter stick is not valid in expression: "Value of a gamepad axis"'); + return; +} +if (direction != "UP" && direction != "DOWN" && direction != "LEFT" && direction != "RIGHT" && direction != "HORIZONTAL" && direction != "VERTICAL") { + console.error('Parameter direction is not valid in expression: "Value of a gamepad axis"'); + return; +} +const gamepad = gamepads[playerId]; + +//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable. +if (gamepad == null) return; + +let parameterError = false; +switch (stick) { + case 'LEFT': + switch (direction) { + case 'LEFT': + if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId) < 0) { + eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId); + } + break; + + case 'RIGHT': + if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId) > 0) { + eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId); + } + break; + + case 'UP': + if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId) < 0) { + eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId); + } + break; + + case 'DOWN': + if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId) > 0) { + eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId); + } + break; + + case "HORIZONTAL": + eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId); + break; + + case "VERTICAL": + eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId); + break; + + default: + break; + } + break; + + case 'RIGHT': + switch (direction) { + case 'LEFT': + if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId) < 0) { + eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId); + } + break; + + case 'RIGHT': + if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId) > 0) { + eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId); + } + break; + + case 'UP': + if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId) < 0) { + eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId); + } + break; + + case 'DOWN': + if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId) > 0) { + eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId); + } + break; + + case "HORIZONTAL": + eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId); + break; + + case "VERTICAL": + eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId); + break; + + default: + break; + } + break; + + default: + break; +} + +}; +gdjs.evtsExt__Gamepads__AxisValue.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Gamepads__AxisValue.userFunc0xc77d08(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__AxisValue.func = function(runtimeScene, player_ID, stick, direction, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "player_ID") return player_ID; +if (argName === "stick") return stick; +if (argName === "direction") return direction; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__AxisValue.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__Gamepads__AxisValue.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__c_any_button_pressed-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__c_any_button_pressed-func.js new file mode 100644 index 0000000..2e624cf --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__c_any_button_pressed-func.js @@ -0,0 +1,124 @@ + +if (typeof gdjs.evtsExt__Gamepads__C_Any_Button_pressed !== "undefined") { + gdjs.evtsExt__Gamepads__C_Any_Button_pressed.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__C_Any_Button_pressed = {}; + + +gdjs.evtsExt__Gamepads__C_Any_Button_pressed.userFunc0xbb7900 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +/** @type {Gamepad[]} */ +const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []); + +//Get function parameter +const playerId = eventsFunctionContext.getArgument("player_ID") - 1; + +if (playerId < 0 || playerId > 4) { + console.error('Parameter gamepad identifier in condition: "Any gamepad button pressed", is not valid number, must be between 0 and 4.'); + return; +} +const gamepad = gamepads[playerId]; + +//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable. +if (gamepad == null) return; + +let buttonId; +for (let i = 0; i < gamepad.buttons.length; i++) { //For each buttons + if (gamepad.buttons[i].pressed) { //One of them is pressed + buttonId = i; //Save the button pressed + break; + } +} + +if (buttonId === undefined) { + // No buttons are pressed. + eventsFunctionContext.returnValue = false; + return; +} + +if (gamepad.buttons == null || gamepad.buttons[buttonId] == null) { + console.error('Buttons on the gamepad are not accessible in condition: "Any gamepad button pressed"'); + eventsFunctionContext.returnValue = false; + return; +} + +//When a button is pressed, save the button in lastButtonUsed for each players +if (gamepad.buttons[buttonId].pressed) gdjs._extensionController.players[playerId].lastButtonUsed = buttonId; +eventsFunctionContext.returnValue = gamepad.buttons[buttonId].pressed; + + + +}; +gdjs.evtsExt__Gamepads__C_Any_Button_pressed.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Gamepads__C_Any_Button_pressed.userFunc0xbb7900(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__C_Any_Button_pressed.func = function(runtimeScene, player_ID, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "player_ID") return player_ID; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__C_Any_Button_pressed.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__Gamepads__C_Any_Button_pressed.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__c_any_button_released-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__c_any_button_released-func.js new file mode 100644 index 0000000..e9a52de --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__c_any_button_released-func.js @@ -0,0 +1,141 @@ + +if (typeof gdjs.evtsExt__Gamepads__C_any_button_released !== "undefined") { + gdjs.evtsExt__Gamepads__C_any_button_released.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__C_any_button_released = {}; + + +gdjs.evtsExt__Gamepads__C_any_button_released.userFunc0x19d47d8 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +/** @type {Gamepad[]} */ +const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []); + +//Get function parameters +const playerId = eventsFunctionContext.getArgument("player_ID") - 1; + +if (playerId < 0 || playerId > 4) { + console.error('Parameter gamepad identifier in condition: "Any gamepad button released", is not valid number, must be between 0 and 4.'); + return; +} + +const gamepad = gamepads[playerId]; + +//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable. +if (gamepad == null) return; + +for (let buttonId = 0; buttonId < gamepad.buttons.length; buttonId++) { //For each buttons on current frame. + + if (buttonId === undefined) { + eventsFunctionContext.returnValue = false; + return; + } + + //Get previous value or define value by default for the current button + gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] || { pressed: false }; + + //Get state of the button at previous frame + const previousStateButtonIsPressed = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed; + + //Get the state of the button on the current frame. + const currentFrameStateButtonIsPressed = gamepad.buttons[buttonId].pressed; + + //When previousStateButtonIsPressed is true and actual button state is not pressed + //Player have release the button + if (previousStateButtonIsPressed === true && currentFrameStateButtonIsPressed === false) { + gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = true; + eventsFunctionContext.returnValue = true; + //break; + return; + } else { + //The player didn't released the button yet, the previous frame state is still true + gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = false; + eventsFunctionContext.returnValue = false; + } + + if (currentFrameStateButtonIsPressed) gdjs._extensionController.players[playerId].lastButtonUsed = buttonId; +} + +}; +gdjs.evtsExt__Gamepads__C_any_button_released.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +} + +} + + +{ + + +gdjs.evtsExt__Gamepads__C_any_button_released.userFunc0x19d47d8(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__C_any_button_released.func = function(runtimeScene, player_ID, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "player_ID") return player_ID; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__C_any_button_released.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__Gamepads__C_any_button_released.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__c_axis_pushed-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__c_axis_pushed-func.js new file mode 100644 index 0000000..0a78869 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__c_axis_pushed-func.js @@ -0,0 +1,221 @@ + +if (typeof gdjs.evtsExt__Gamepads__C_Axis_pushed !== "undefined") { + gdjs.evtsExt__Gamepads__C_Axis_pushed.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__C_Axis_pushed = {}; + + +gdjs.evtsExt__Gamepads__C_Axis_pushed.userFunc0x19c32c8 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +/** @type {Gamepad[]} */ +const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []); + +//Get function parameters +const playerId = eventsFunctionContext.getArgument("player_ID") - 1; +const stick = eventsFunctionContext.getArgument("stick").toUpperCase(); +const direction = eventsFunctionContext.getArgument("direction").toUpperCase(); + +if (playerId < 0 || playerId > 4) { + console.error('Parameter gamepad identifier in condition: "Gamepad stick pushed (axis)", is not valid number, must be between 0 and 4.'); + return; +} +if (stick != "LEFT" && stick != "RIGHT") { + console.error('Parameter stick in condition: "Gamepad stick pushed (axis)", is not valid, must be LEFT or RIGHT'); + return; +} +if (direction != "UP" && direction != "DOWN" && direction != "LEFT" && direction != "RIGHT" && direction != "ANY") { + console.error('Parameter deadzone in condition: "Gamepad stick pushed (axis)", is not valid, must be UP, DOWN, LEFT or RIGHT'); + return; +} + +const gamepad = gamepads[playerId]; + +//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable. +if (gamepad == null) { + eventsFunctionContext.returnValue = false; + return; +} + + +//Define in onFirstSceneLoaded function +const getNormalizedAxisValue = gdjs._extensionController.getNormalizedAxisValue; + +switch (stick) { + case 'LEFT': + switch (direction) { + case 'LEFT': + if (getNormalizedAxisValue(gamepad.axes[0], playerId) < 0) { + eventsFunctionContext.returnValue = true; + return; + } + break; + + case 'RIGHT': + if (getNormalizedAxisValue(gamepad.axes[0], playerId) > 0) { + eventsFunctionContext.returnValue = true; + return; + } + break; + + case 'UP': + if (getNormalizedAxisValue(gamepad.axes[1], playerId) < 0) { + eventsFunctionContext.returnValue = true; + return; + } + break; + + case 'DOWN': + if (getNormalizedAxisValue(gamepad.axes[1], playerId) > 0) { + eventsFunctionContext.returnValue = true; + return; + } + break; + + case 'ANY': + if ( getNormalizedAxisValue(gamepad.axes[0], playerId) < 0 + || getNormalizedAxisValue(gamepad.axes[0], playerId) > 0 + || getNormalizedAxisValue(gamepad.axes[1], playerId) < 0 + || getNormalizedAxisValue(gamepad.axes[1], playerId) > 0) { + eventsFunctionContext.returnValue = true; + return; + } + break; + + default: + console.error('The value Direction on stick Left on the condition: "Gamepad stick pushed (axis)" is not valid.'); + eventsFunctionContext.returnValue = false; + break; + } + break; + + case 'RIGHT': + switch (direction) { + case 'LEFT': + if (getNormalizedAxisValue(gamepad.axes[2], playerId) < 0) { + eventsFunctionContext.returnValue = true; + return; + } + break; + + case 'RIGHT': + if (getNormalizedAxisValue(gamepad.axes[2], playerId) > 0) { + eventsFunctionContext.returnValue = true; + return; + } + break; + + case 'UP': + if (getNormalizedAxisValue(gamepad.axes[3], playerId) < 0) { + eventsFunctionContext.returnValue = true; + return; + } + break; + + case 'DOWN': + if (getNormalizedAxisValue(gamepad.axes[3], playerId) > 0) { + eventsFunctionContext.returnValue = true; + return; + } + break; + + case 'ANY': + if ( getNormalizedAxisValue(gamepad.axes[2], playerId) < 0 + || getNormalizedAxisValue(gamepad.axes[2], playerId) > 0 + || getNormalizedAxisValue(gamepad.axes[3], playerId) < 0 + || getNormalizedAxisValue(gamepad.axes[3], playerId) > 0) { + eventsFunctionContext.returnValue = true; + return; + } + break; + + default: + console.error('The value Direction on stick Right on the condition: "Gamepad stick pushed (axis)" is not valid.'); + eventsFunctionContext.returnValue = false; + break; + } + break; + + default: + console.error('The value Stick on the condition: "Gamepad stick pushed (axis)" is not valid.'); + eventsFunctionContext.returnValue = false; + break; +} + +eventsFunctionContext.returnValue = false; + +}; +gdjs.evtsExt__Gamepads__C_Axis_pushed.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Gamepads__C_Axis_pushed.userFunc0x19c32c8(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__C_Axis_pushed.func = function(runtimeScene, player_ID, stick, direction, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "player_ID") return player_ID; +if (argName === "stick") return stick; +if (argName === "direction") return direction; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__C_Axis_pushed.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__Gamepads__C_Axis_pushed.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__c_button_pressed-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__c_button_pressed-func.js new file mode 100644 index 0000000..0564b50 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__c_button_pressed-func.js @@ -0,0 +1,206 @@ + +if (typeof gdjs.evtsExt__Gamepads__C_Button_pressed !== "undefined") { + gdjs.evtsExt__Gamepads__C_Button_pressed.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__C_Button_pressed = {}; + + +gdjs.evtsExt__Gamepads__C_Button_pressed.userFunc0x19c0790 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +/** @type {Gamepad[]} */ +const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []); + +//Get function parameters +const playerId = eventsFunctionContext.getArgument("player_ID") - 1; +const button = eventsFunctionContext.getArgument("button").toUpperCase(); + +if (playerId < 0 || playerId > 4) { + console.error('Parameter gamepad identifier in condition: "Gamepad button pressed", is not valid number, must be between 0 and 4.'); + return; +} +if (button === "") { + console.error('Parameter button is not valid in condition: "Gamepad button pressed"'); + eventsFunctionContext.returnValue = false; + return; +} + +const gamepad = gamepads[playerId]; + +//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable. +if (gamepad == null) return; + +let buttonId; + +switch (button) { + case 'A': + case 'CROSS': + buttonId = 0; + break; + case 'B': + case 'CIRCLE': + buttonId = 1; + break; + case 'X': + case 'SQUARE': + buttonId = 2; + break; + case 'Y': + case 'TRIANGLE': + buttonId = 3; + break; + case 'LB': + case 'L1': + buttonId = 4; + break; + case 'RB': + case 'R1': + buttonId = 5; + break; + case 'LT': + case 'L2': + buttonId = 6; + break; + case 'RT': + case 'R2': + buttonId = 7; + break; + + case 'UP': + buttonId = 12; + break; + case 'DOWN': + buttonId = 13; + break; + case 'LEFT': + buttonId = 14; + break; + case 'RIGHT': + buttonId = 15; + break; + + case 'BACK': + case 'SHARE': + buttonId = 8; + break; + case 'START': + case 'OPTIONS': + buttonId = 9; + break; + + case 'CLICK_STICK_LEFT': + buttonId = 10; + break; + case 'CLICK_STICK_RIGHT': + buttonId = 11; + break; + + //PS4 + case 'PS_BUTTON': + buttonId = 16; + break; + case 'CLICK_TOUCHPAD': + buttonId = 17; + break; + + default: + console.error('The button: ' + button + ' in condition: "Gamepad button pressed" is not valid.'); + eventsFunctionContext.returnValue = false; + break; +} + + + +if (buttonId === undefined) { + console.error('There is no buttons valid in condition: "Gamepad button pressed"'); + eventsFunctionContext.returnValue = false; + return; +} + +if (gamepad.buttons == null || gamepad.buttons[buttonId] == null) { + console.error('Buttons on the gamepad are not accessible in condition: "Gamepad button pressed"'); + eventsFunctionContext.returnValue = false; + return; +} + +//When a button is pressed, save the button in lastButtonUsed for each players +if (gamepad.buttons[buttonId].pressed) gdjs._extensionController.players[playerId].lastButtonUsed = buttonId; +eventsFunctionContext.returnValue = gamepad.buttons[buttonId].pressed; + + + + +}; +gdjs.evtsExt__Gamepads__C_Button_pressed.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Gamepads__C_Button_pressed.userFunc0x19c0790(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__C_Button_pressed.func = function(runtimeScene, player_ID, button, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "player_ID") return player_ID; +if (argName === "button") return button; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__C_Button_pressed.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__Gamepads__C_Button_pressed.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__c_button_released-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__c_button_released-func.js new file mode 100644 index 0000000..9efc265 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__c_button_released-func.js @@ -0,0 +1,214 @@ + +if (typeof gdjs.evtsExt__Gamepads__C_Button_released !== "undefined") { + gdjs.evtsExt__Gamepads__C_Button_released.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__C_Button_released = {}; + + +gdjs.evtsExt__Gamepads__C_Button_released.userFunc0xbdc768 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +/** @type {Gamepad[]} */ +const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []); + +//Get function parameters +const playerId = eventsFunctionContext.getArgument("player_ID") - 1; +const button = eventsFunctionContext.getArgument("button").toUpperCase(); + +if (playerId < 0 || playerId > 4) { + console.error('Parameter gamepad identifier in condition: "Gamepad button released", is not valid number, must be between 0 and 4.'); + return; +} +if (button === "") { + console.error('Parameter button is not valid in condition: "Gamepad button released"'); + return; +} + +const gamepad = gamepads[playerId]; + +//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable. +if (gamepad == null) return; + +let buttonId; + +switch (button) { + case 'A': + case 'CROSS': + buttonId = 0; + break; + case 'B': + case 'CIRCLE': + buttonId = 1; + break; + case 'X': + case 'SQUARE': + buttonId = 2; + break; + case 'Y': + case 'TRIANGLE': + buttonId = 3; + break; + case 'LB': + case 'L1': + buttonId = 4; + break; + case 'RB': + case 'R1': + buttonId = 5; + break; + case 'LT': + case 'L2': + buttonId = 6; + break; + case 'RT': + case 'R2': + buttonId = 7; + break; + + case 'UP': + buttonId = 12; + break; + case 'DOWN': + buttonId = 13; + break; + case 'LEFT': + buttonId = 14; + break; + case 'RIGHT': + buttonId = 15; + break; + + case 'BACK': + case 'SHARE': + buttonId = 8; + break; + case 'START': + case 'OPTIONS': + buttonId = 9; + break; + + case 'CLICK_STICK_LEFT': + buttonId = 10; + break; + case 'CLICK_STICK_RIGHT': + buttonId = 11; + break; + + //PS4 + case 'PS_BUTTON': + buttonId = 16; + break; + case 'CLICK_TOUCHPAD': + buttonId = 17; + break; + + default: + console.error('The button: ' + button + ' in condition: "Gamepad button released" is not valid.'); + break; +} + +if (buttonId === undefined) { + console.error('There is no buttons valid in condition: "Gamepad button released"'); + eventsFunctionContext.returnValue = false; + return; +} + +if (gamepad.buttons == null || gamepad.buttons[buttonId] == null) { + console.error('Buttons on the gamepad are not accessible in condition: "Gamepad button released"'); + eventsFunctionContext.returnValue = false; + return; +} + +//Define default value on pressed button or use previous value +gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] || { pressed: false }; + +//Get state of button at previous frame +const previousStateButton = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed; + +//When previousStateButton is true and actual button state is not pressed +//Player have release the button +if (previousStateButton === true && gamepad.buttons[buttonId].pressed === false) { + // Save the last button used for the player + gdjs._extensionController.players[playerId].lastButtonUsed = buttonId; + gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = true; + eventsFunctionContext.returnValue = true; + +} else { + gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = false; + eventsFunctionContext.returnValue = false; +} + +}; +gdjs.evtsExt__Gamepads__C_Button_released.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Gamepads__C_Button_released.userFunc0xbdc768(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__C_Button_released.func = function(runtimeScene, player_ID, button, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "player_ID") return player_ID; +if (argName === "button") return button; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__C_Button_released.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__Gamepads__C_Button_released.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__c_controller_type-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__c_controller_type-func.js new file mode 100644 index 0000000..8441b32 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__c_controller_type-func.js @@ -0,0 +1,111 @@ + +if (typeof gdjs.evtsExt__Gamepads__C_Controller_type !== "undefined") { + gdjs.evtsExt__Gamepads__C_Controller_type.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__C_Controller_type = {}; + + +gdjs.evtsExt__Gamepads__C_Controller_type.userFunc0x19cad60 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +/** @type {Gamepad[]} */ +const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []); + +//Get function parameters +const playerId = eventsFunctionContext.getArgument("player_ID") - 1; +const controllerType = eventsFunctionContext.getArgument("controller_type").toUpperCase(); + +if (playerId < 0 || playerId > 4) { + console.error('Parameter gamepad identifier in condition: "Gamepad type", is not valid number, must be between 0 and 4.'); + return; +} +if (controllerType === "") { + console.error('Parameter type in condition: "Gamepad type", is not a string.'); + return; +} + +const gamepad = gamepads[playerId]; + +//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable. +if (gamepad == null) return; + + +if (controllerType == "XBOX") { + eventsFunctionContext.returnValue = gdjs._extensionController.isXbox(gamepad); +} else { + eventsFunctionContext.returnValue = gamepad ? gamepad.id.toUpperCase().indexOf(controllerType) !== -1 : false; +} +}; +gdjs.evtsExt__Gamepads__C_Controller_type.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Gamepads__C_Controller_type.userFunc0x19cad60(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__C_Controller_type.func = function(runtimeScene, player_ID, controller_type, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "player_ID") return player_ID; +if (argName === "controller_type") return controller_type; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__C_Controller_type.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__Gamepads__C_Controller_type.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__c_controller_x_is_connected-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__c_controller_x_is_connected-func.js new file mode 100644 index 0000000..6b64865 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__c_controller_x_is_connected-func.js @@ -0,0 +1,97 @@ + +if (typeof gdjs.evtsExt__Gamepads__C_Controller_X_is_connected !== "undefined") { + gdjs.evtsExt__Gamepads__C_Controller_X_is_connected.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__C_Controller_X_is_connected = {}; + + +gdjs.evtsExt__Gamepads__C_Controller_X_is_connected.userFunc0x19cc8f8 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +/** @type {Gamepad[]} */ +const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []); + +//Get function parameter +const playerId = eventsFunctionContext.getArgument("player_ID") - 1; + +if (playerId < 0 || playerId > 4) { + console.error('Parameter gamepad identifier in condition: "Gamepad connected", is not valid number, must be between 0 and 4.'); + return; +} + +// If gamepad was disconnected it will be null (so this will return false) +// If gamepad was never connected it will be undefined (so this will return false) +eventsFunctionContext.returnValue = !!gamepads[playerId]; +}; +gdjs.evtsExt__Gamepads__C_Controller_X_is_connected.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Gamepads__C_Controller_X_is_connected.userFunc0x19cc8f8(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__C_Controller_X_is_connected.func = function(runtimeScene, player_ID, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "player_ID") return player_ID; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__C_Controller_X_is_connected.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__Gamepads__C_Controller_X_is_connected.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__connectedgamepadscount-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__connectedgamepadscount-func.js new file mode 100644 index 0000000..53b5191 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__connectedgamepadscount-func.js @@ -0,0 +1,98 @@ + +if (typeof gdjs.evtsExt__Gamepads__ConnectedGamepadsCount !== "undefined") { + gdjs.evtsExt__Gamepads__ConnectedGamepadsCount.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__ConnectedGamepadsCount = {}; + + +gdjs.evtsExt__Gamepads__ConnectedGamepadsCount.userFunc0x19c2e68 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +/** @type {Gamepad[]} */ +const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []); + +// Gamepads can be disconnected and become null, so we have to filter them. +eventsFunctionContext.returnValue = Object.keys(gamepads).filter(key => !!gamepads[key]).length; + +}; +gdjs.evtsExt__Gamepads__ConnectedGamepadsCount.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +} + +} + + +{ + + +gdjs.evtsExt__Gamepads__ConnectedGamepadsCount.userFunc0x19c2e68(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__ConnectedGamepadsCount.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__ConnectedGamepadsCount.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__Gamepads__ConnectedGamepadsCount.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__deadzone-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__deadzone-func.js new file mode 100644 index 0000000..9571fc7 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__deadzone-func.js @@ -0,0 +1,102 @@ + +if (typeof gdjs.evtsExt__Gamepads__Deadzone !== "undefined") { + gdjs.evtsExt__Gamepads__Deadzone.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__Deadzone = {}; + + +gdjs.evtsExt__Gamepads__Deadzone.userFunc0x19bf668 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +//Get function parameter +const playerId = eventsFunctionContext.getArgument("player_ID") - 1; + +if (playerId < 0 || playerId > 4) { + console.error('Parameter gamepad identifier in expression: "Gamepad deadzone for sticks", is not valid number, must be between 0 and 4.'); + return; +} +///Return the deadzone value for a given player +eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].deadzone; +}; +gdjs.evtsExt__Gamepads__Deadzone.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +} + +} + + +{ + + +gdjs.evtsExt__Gamepads__Deadzone.userFunc0x19bf668(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__Deadzone.func = function(runtimeScene, player_ID, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "player_ID") return player_ID; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__Deadzone.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__Gamepads__Deadzone.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__gamepadcount-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__gamepadcount-func.js new file mode 100644 index 0000000..10e4147 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__gamepadcount-func.js @@ -0,0 +1,96 @@ + +if (typeof gdjs.evtsExt__Gamepads__GamepadCount !== "undefined") { + gdjs.evtsExt__Gamepads__GamepadCount.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__GamepadCount = {}; + + +gdjs.evtsExt__Gamepads__GamepadCount.userFunc0x19be710 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []); + +//Get the last activated controller +const controllerId = gdjs._extensionController.lastActiveController; + +// Check if controller is active +const gamepad = gamepads[controllerId]; +if (gamepad == null) { + eventsFunctionContext.returnValue = 0; +} else { + // Return active controller id + eventsFunctionContext.returnValue = controllerId + 1; +} + +}; +gdjs.evtsExt__Gamepads__GamepadCount.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Gamepads__GamepadCount.userFunc0x19be710(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__GamepadCount.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__GamepadCount.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__Gamepads__GamepadCount.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__gamepadtype-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__gamepadtype-func.js new file mode 100644 index 0000000..1a52557 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__gamepadtype-func.js @@ -0,0 +1,101 @@ + +if (typeof gdjs.evtsExt__Gamepads__GamepadType !== "undefined") { + gdjs.evtsExt__Gamepads__GamepadType.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__GamepadType = {}; + + +gdjs.evtsExt__Gamepads__GamepadType.userFunc0x19c8810 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +/** @type {Gamepad[]} */ +const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []); + +//Get function parameter +const playerId = eventsFunctionContext.getArgument("player_ID") - 1; + +if (playerId < 0 || playerId > 4) { + console.error('Parameter gamepad identifier in string expression: "Gamepad type", is not valid number, must be between 0 and 4'); + return; +} + +const gamepad = gamepads[playerId]; + +//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable. +if (gamepad == null) return; + +eventsFunctionContext.returnValue = (gamepad && gamepad.id) ? gamepad.id : "No information for player " + (playerId + 1) + +}; +gdjs.evtsExt__Gamepads__GamepadType.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Gamepads__GamepadType.userFunc0x19c8810(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__GamepadType.func = function(runtimeScene, player_ID, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "player_ID") return player_ID; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__GamepadType.eventsList0(runtimeScene, eventsFunctionContext); + +return "" + eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__Gamepads__GamepadType.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__lastbuttonid-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__lastbuttonid-func.js new file mode 100644 index 0000000..41cb6fc --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__lastbuttonid-func.js @@ -0,0 +1,94 @@ + +if (typeof gdjs.evtsExt__Gamepads__LastButtonID !== "undefined") { + gdjs.evtsExt__Gamepads__LastButtonID.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__LastButtonID = {}; + + +gdjs.evtsExt__Gamepads__LastButtonID.userFunc0xc77d08 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +//Get function parameter +const playerId = eventsFunctionContext.getArgument("player_ID") - 1; + +//Player id is not valid +if (playerId < 0 || playerId > 4) { + console.error('Parameter gamepad identifier in expression: "Last pressed button (id)", is not valid number, must be between 0 and 4.'); + return; +} + +//Return the last button used by the player +eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].lastButtonUsed; +}; +gdjs.evtsExt__Gamepads__LastButtonID.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Gamepads__LastButtonID.userFunc0xc77d08(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__LastButtonID.func = function(runtimeScene, player_ID, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "player_ID") return player_ID; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__LastButtonID.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__Gamepads__LastButtonID.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__lastbuttonstring-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__lastbuttonstring-func.js new file mode 100644 index 0000000..b51708a --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__lastbuttonstring-func.js @@ -0,0 +1,113 @@ + +if (typeof gdjs.evtsExt__Gamepads__LastButtonString !== "undefined") { + gdjs.evtsExt__Gamepads__LastButtonString.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__LastButtonString = {}; + + +gdjs.evtsExt__Gamepads__LastButtonString.userFunc0x19bdb58 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +/** @type {Gamepad[]} */ +const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []); + +//Get function parameters +const playerId = eventsFunctionContext.getArgument("player_ID") - 1; +const controllerType = eventsFunctionContext.getArgument("controller_type").toUpperCase(); + +if (playerId < 0 || playerId > 4) { + console.error('Parameter gamepad identifier in string expression: "Last pressed button (LastButtonString)", is not valid number, must be between 0 and 4.'); + return; +} +if (controllerType === "") { + console.error('Parameter controller type is not valid in string expression: "Last pressed button (LastButtonString)"'); + return; +} + +const gamepad = gamepads[playerId]; + +if (gamepad !== null) { //Gamepad exist + //Get last btn id + const lastButtonUsedID = gdjs._extensionController.players[playerId].lastButtonUsed; + + //Return last button as string + eventsFunctionContext.returnValue = gdjs._extensionController.getInputString(controllerType, lastButtonUsedID); + +} else { //Gamepad dosen't exist + console.error('Your controller is not supported or the gamepad wasn\'t detected in string expression: "Last pressed button (LastButtonString)"'); + eventsFunctionContext.returnValue = "Gamepad not connected"; +} +}; +gdjs.evtsExt__Gamepads__LastButtonString.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Gamepads__LastButtonString.userFunc0x19bdb58(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__LastButtonString.func = function(runtimeScene, player_ID, controller_type, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "player_ID") return player_ID; +if (argName === "controller_type") return controller_type; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__LastButtonString.eventsList0(runtimeScene, eventsFunctionContext); + +return "" + eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__Gamepads__LastButtonString.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__onfirstsceneloaded-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__onfirstsceneloaded-func.js new file mode 100644 index 0000000..935cba0 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__onfirstsceneloaded-func.js @@ -0,0 +1,211 @@ + +if (typeof gdjs.evtsExt__Gamepads__onFirstSceneLoaded !== "undefined") { + gdjs.evtsExt__Gamepads__onFirstSceneLoaded.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__onFirstSceneLoaded = {}; + + +gdjs.evtsExt__Gamepads__onFirstSceneLoaded.userFunc0x19cc8f8 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +//Define an new private object javascript for the gamepad extension +gdjs._extensionController = { + players: { + 0: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} }, + 1: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} }, + 2: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} }, + 3: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} }, + }, + lastActiveController: -1, // Last active controller + controllerButtonNames: { //Map associating controller button ids to button names + "XBOX": { + 0: "A", + 1: "B", + 2: "X", + 3: "Y", + 4: "LB", + 5: "RB", + 6: "LT", + 7: "RT", + 8: "BACK", + 9: "START", + 10: "CLICK_STICK_LEFT", + 11: "CLICK_STICK_RIGHT", + 12: "UP", + 13: "DOWN", + 14: "LEFT", + 15: "RIGHT", + 16: "NONE", + 17: "NONE" + }, + "PS4": { + 0: "CROSS", + 1: "CIRCLE", + 2: "SQUARE", + 3: "TRIANGLE", + 4: "L1", + 5: "R1", + 6: "L2", + 7: "R2", + 8: "SHARE", + 9: "OPTIONS", + 10: "CLICK_STICK_LEFT", + 11: "CLICK_STICK_RIGHT", + 12: "UP", + 13: "DOWN", + 14: "LEFT", + 15: "RIGHT", + 16: "PS_BUTTON", + 17: "CLICK_TOUCHPAD" + } + } +}; + +gdjs._extensionController.getInputString = function (type, buttonId) { + const controllerButtonNames = gdjs._extensionController.controllerButtonNames; + if (controllerButtonNames[type] !== undefined) { + return controllerButtonNames[type][buttonId]; + } + + return "UNKNOWN_BUTTON"; +} + +gdjs._extensionController.axisToAngle = function (deltaX, deltaY) { + const rad = Math.atan2(deltaY, deltaX); + const deg = rad * (180 / Math.PI); + return deg; +} + +gdjs._extensionController.isXbox = function (gamepad) { + return (gamepad ? ( + gamepad.id.toUpperCase().indexOf("XBOX") !== -1 + // "XINPUT" cannot be used to check if it is a xbox controller is just a generic + // name reported in Firefox corresponding to the driver being used by the controller + // https://gamefaqs.gamespot.com/boards/916373-pc/73341312?page=1 + ) : false); +} + +//Returns the new value taking into account the dead zone for the player_ID given +gdjs._extensionController.getNormalizedAxisValue = function (v, player_ID) { + // gdjs._extensionController = gdjs._extensionController || { deadzone: 0.2 }; + + // Anything smaller than this is assumed to be 0,0 + const DEADZONE = gdjs._extensionController.players[player_ID].deadzone; + + if (Math.abs(v) < DEADZONE) { + // In the dead zone, set to 0 + v = 0; + + if (v == null) { + return 0; + } else { + return v; + } + + } else { + // We're outside the dead zone, but we'd like to smooth + // this value out so it still runs nicely between 0..1. + // That is, we don't want it to jump suddenly from 0 to + // DEADZONE. + + // Remap v from + // DEADZONE..1 to 0..(1-DEADZONE) + // or from + // -1..-DEADZONE to -(1-DEADZONE)..0 + + v = v - Math.sign(v) * DEADZONE; + + // Remap v from + // 0..(1-DEADZONE) to 0..1 + // or from + // -(1-DEADZONE)..0 to -1..0 + + return v / (1 - DEADZONE); + } +}; +}; +gdjs.evtsExt__Gamepads__onFirstSceneLoaded.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +} + +} + + +{ + + +gdjs.evtsExt__Gamepads__onFirstSceneLoaded.userFunc0x19cc8f8(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__onFirstSceneLoaded.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__onFirstSceneLoaded.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__Gamepads__onFirstSceneLoaded.registeredGdjsCallbacks = []; +gdjs.evtsExt__Gamepads__onFirstSceneLoaded.registeredGdjsCallbacks.push((runtimeScene) => { + gdjs.evtsExt__Gamepads__onFirstSceneLoaded.func(runtimeScene, runtimeScene); +}) +gdjs.registerFirstRuntimeSceneLoadedCallback(gdjs.evtsExt__Gamepads__onFirstSceneLoaded.registeredGdjsCallbacks[gdjs.evtsExt__Gamepads__onFirstSceneLoaded.registeredGdjsCallbacks.length - 1]); diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__onscenepostevents-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__onscenepostevents-func.js new file mode 100644 index 0000000..04186d1 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__onscenepostevents-func.js @@ -0,0 +1,139 @@ + +if (typeof gdjs.evtsExt__Gamepads__onScenePostEvents !== "undefined") { + gdjs.evtsExt__Gamepads__onScenePostEvents.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__onScenePostEvents = {}; + + +gdjs.evtsExt__Gamepads__onScenePostEvents.userFunc0x19d47d8 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +//Each time a player press a button i save the last button pressed for the next frame +/** @type {Gamepad[]} */ +const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []); + +//Get function parameter +let countPlayers = Object.keys(gdjs._extensionController.players).length; + +//Repeat for each players +for (let i = 0; i < countPlayers; i++) { + let gamepad = gamepads[i]; // Get the gamepad of the player + + //We have to keep this condition because if the user hasn't plugged in his controller yet, we can't get the controller in the gamepad variable. + if (gamepad == null) { + continue; + } + + for (let b = 0; b < Object.keys(gamepad.buttons).length; b++) { //For each buttons + if (gamepad.buttons[b].pressed) { //One of them is pressed + gdjs._extensionController.players[i].lastButtonUsed = b; //Save the button pressed + + //Save the state of the button for the next frame. + gdjs._extensionController.players[i].previousFrameStateButtons[b] = { pressed: true }; + + // Update Last Active Controller + gdjs._extensionController.lastActiveController = i; + } else { + gdjs._extensionController.players[i].previousFrameStateButtons[b] = { pressed: false }; + } + } + + + gdjs._extensionController.players[i].rumble.elapsedTime += runtimeScene.getElapsedTime(runtimeScene) / 1000; + if ( + gdjs._extensionController.players[i].rumble.duration - gdjs._extensionController.players[i].rumble.elapsedTime <= 0 && + (gdjs._extensionController.players[i].rumble.weakMagnitude || gdjs._extensionController.players[i].rumble.strongMagnitude) + ) { + gdjs._extensionController.players[i].rumble.weakMagnitude = 0; + gdjs._extensionController.players[i].rumble.strongMagnitude = 0; + } + + +} + +}; +gdjs.evtsExt__Gamepads__onScenePostEvents.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +} + +} + + +{ + + +gdjs.evtsExt__Gamepads__onScenePostEvents.userFunc0x19d47d8(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__onScenePostEvents.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__onScenePostEvents.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__Gamepads__onScenePostEvents.registeredGdjsCallbacks = []; +gdjs.evtsExt__Gamepads__onScenePostEvents.registeredGdjsCallbacks.push((runtimeScene) => { + gdjs.evtsExt__Gamepads__onScenePostEvents.func(runtimeScene, runtimeScene); +}) +gdjs.registerRuntimeScenePostEventsCallback(gdjs.evtsExt__Gamepads__onScenePostEvents.registeredGdjsCallbacks[gdjs.evtsExt__Gamepads__onScenePostEvents.registeredGdjsCallbacks.length - 1]); diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__stickangle-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__stickangle-func.js new file mode 100644 index 0000000..0ced30b --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__stickangle-func.js @@ -0,0 +1,118 @@ + +if (typeof gdjs.evtsExt__Gamepads__StickAngle !== "undefined") { + gdjs.evtsExt__Gamepads__StickAngle.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__StickAngle = {}; + + +gdjs.evtsExt__Gamepads__StickAngle.userFunc0xc77d08 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +/** @type {Gamepad[]} */ +const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []); + +//Get function parameters +const playerId = eventsFunctionContext.getArgument("player_ID") - 1; +const stick = eventsFunctionContext.getArgument("stick").toUpperCase(); + + +if (playerId < 0 || playerId > 4) { + console.error('Parameter gamepad identifier is not valid in expression: "Value of a stick rotation"'); + return; +} +if (stick !== "LEFT" && stick !== "RIGHT") { + console.error('Parameter stick is not valid in expression: "Value of a stick rotation"'); + return; +} +const gamepad = gamepads[playerId]; + +//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable. +if (gamepad == null) return; + +switch (stick) { + case 'LEFT': + eventsFunctionContext.returnValue = gdjs._extensionController.axisToAngle(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId), gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId)); + break; + + case 'RIGHT': + eventsFunctionContext.returnValue = gdjs._extensionController.axisToAngle(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId), gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId)); + break; + + default: + eventsFunctionContext.returnValue = -1; + break; +} +}; +gdjs.evtsExt__Gamepads__StickAngle.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Gamepads__StickAngle.userFunc0xc77d08(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__StickAngle.func = function(runtimeScene, player_ID, stick, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "player_ID") return player_ID; +if (argName === "stick") return stick; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__StickAngle.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__Gamepads__StickAngle.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__stickforce-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__stickforce-func.js new file mode 100644 index 0000000..25017a5 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__stickforce-func.js @@ -0,0 +1,121 @@ + +if (typeof gdjs.evtsExt__Gamepads__StickForce !== "undefined") { + gdjs.evtsExt__Gamepads__StickForce.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__StickForce = {}; + + +gdjs.evtsExt__Gamepads__StickForce.userFunc0xbb8cd8 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +/** @type {Gamepad[]} */ +const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []); + +//Get function parameters +const playerId = eventsFunctionContext.getArgument("player_ID") - 1; +const stick = eventsFunctionContext.getArgument("stick").toUpperCase(); + + +if (playerId < 0 || playerId > 4) { + console.error('Parameter gamepad identifier is not valid in expression: "Value of a stick force"'); + return; +} + +if (stick !== "LEFT" && stick !== "RIGHT") { + console.error('Parameter stick is not valid in expression: "Value of a stick force"'); + return; +} + +const gamepad = gamepads[playerId]; + +//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable. +if (gamepad == null) return; + + +switch (stick) { + case 'LEFT': + eventsFunctionContext.returnValue = gdjs.evtTools.common.clamp(Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId)) + Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId)), 0, 1); + break; + + case 'RIGHT': + eventsFunctionContext.returnValue = gdjs.evtTools.common.clamp(Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId)) + Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId)), 0, 1); + break; + + default: + eventsFunctionContext.returnValue = -1; + break; +} +}; +gdjs.evtsExt__Gamepads__StickForce.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Gamepads__StickForce.userFunc0xbb8cd8(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__StickForce.func = function(runtimeScene, player_ID, stick, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "player_ID") return player_ID; +if (argName === "stick") return stick; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__StickForce.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__Gamepads__StickForce.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__stickforcex-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__stickforcex-func.js new file mode 100644 index 0000000..ea1dccd --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__stickforcex-func.js @@ -0,0 +1,107 @@ + +if (typeof gdjs.evtsExt__Gamepads__StickForceX !== "undefined") { + gdjs.evtsExt__Gamepads__StickForceX.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__StickForceX = {}; + + +gdjs.evtsExt__Gamepads__StickForceX.userFunc0xa64968 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +/** @type {Gamepad[]} */ +const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []); + +//Get function parameters +const playerId = eventsFunctionContext.getArgument("Gamepad") - 1; +const stick = eventsFunctionContext.getArgument("Stick").toLowerCase(); + +if (playerId < 0 || playerId > 4) { + console.error('Parameter gamepad identifier is not valid in expression: "Value of a gamepad axis"'); + return; +} +if (stick != "left" && stick != "right") { + console.error('Parameter stick is not valid in expression: "Value of a gamepad axis"'); + return; +} +const gamepad = gamepads[playerId]; + +//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable. +if (gamepad == null) return; + +const axisIndex = stick === 'right' ? 2 : 0; +eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[axisIndex], playerId); + +}; +gdjs.evtsExt__Gamepads__StickForceX.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Gamepads__StickForceX.userFunc0xa64968(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__StickForceX.func = function(runtimeScene, Gamepad, Stick, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Gamepad") return Gamepad; +if (argName === "Stick") return Stick; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__StickForceX.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__Gamepads__StickForceX.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__stickforcey-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__stickforcey-func.js new file mode 100644 index 0000000..4cb2c3d --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__stickforcey-func.js @@ -0,0 +1,107 @@ + +if (typeof gdjs.evtsExt__Gamepads__StickForceY !== "undefined") { + gdjs.evtsExt__Gamepads__StickForceY.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__StickForceY = {}; + + +gdjs.evtsExt__Gamepads__StickForceY.userFunc0x19b0568 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +/** @type {Gamepad[]} */ +const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []); + +//Get function parameters +const playerId = eventsFunctionContext.getArgument("Gamepad") - 1; +const stick = eventsFunctionContext.getArgument("Stick").toLowerCase(); + +if (playerId < 0 || playerId > 4) { + console.error('Parameter gamepad identifier is not valid in expression: "Value of a gamepad axis"'); + return; +} +if (stick != "left" && stick != "right") { + console.error('Parameter stick is not valid in expression: "Value of a gamepad axis"'); + return; +} +const gamepad = gamepads[playerId]; + +//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable. +if (gamepad == null) return; + +const axisIndex = stick === 'right' ? 3 : 1; +eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[axisIndex], playerId); + +}; +gdjs.evtsExt__Gamepads__StickForceY.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Gamepads__StickForceY.userFunc0x19b0568(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__StickForceY.func = function(runtimeScene, Gamepad, Stick, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Gamepad") return Gamepad; +if (argName === "Stick") return Stick; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__StickForceY.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__Gamepads__StickForceY.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__stickrotationvalue-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__stickrotationvalue-func.js new file mode 100644 index 0000000..05f5418 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__stickrotationvalue-func.js @@ -0,0 +1,83 @@ + +if (typeof gdjs.evtsExt__Gamepads__StickRotationValue !== "undefined") { + gdjs.evtsExt__Gamepads__StickRotationValue.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__StickRotationValue = {}; + + +gdjs.evtsExt__Gamepads__StickRotationValue.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtsExt__Gamepads__StickAngle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("player_ID")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("stick") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); }}} + +} + + +}; + +gdjs.evtsExt__Gamepads__StickRotationValue.func = function(runtimeScene, player_ID, stick, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "player_ID") return player_ID; +if (argName === "stick") return stick; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__StickRotationValue.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__Gamepads__StickRotationValue.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__strongvibrationmagnitude-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__strongvibrationmagnitude-func.js new file mode 100644 index 0000000..f171dff --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__strongvibrationmagnitude-func.js @@ -0,0 +1,85 @@ + +if (typeof gdjs.evtsExt__Gamepads__StrongVibrationMagnitude !== "undefined") { + gdjs.evtsExt__Gamepads__StrongVibrationMagnitude.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__StrongVibrationMagnitude = {}; + + +gdjs.evtsExt__Gamepads__StrongVibrationMagnitude.userFunc0x19da158 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +const playerId = eventsFunctionContext.getArgument("Player_ID") - 1; +eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].rumble.strongMagnitude; +}; +gdjs.evtsExt__Gamepads__StrongVibrationMagnitude.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Gamepads__StrongVibrationMagnitude.userFunc0x19da158(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__StrongVibrationMagnitude.func = function(runtimeScene, Player_ID, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Player_ID") return Player_ID; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__StrongVibrationMagnitude.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__Gamepads__StrongVibrationMagnitude.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__triggerpressure-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__triggerpressure-func.js new file mode 100644 index 0000000..74a240a --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__triggerpressure-func.js @@ -0,0 +1,120 @@ + +if (typeof gdjs.evtsExt__Gamepads__TriggerPressure !== "undefined") { + gdjs.evtsExt__Gamepads__TriggerPressure.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__TriggerPressure = {}; + + +gdjs.evtsExt__Gamepads__TriggerPressure.userFunc0x1263d50 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +/** @type {Gamepad[]} */ +const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []); + +//Get function parameters +const playerId = eventsFunctionContext.getArgument("player_ID") - 1; +const trigger = eventsFunctionContext.getArgument("trigger").toUpperCase(); + +if (playerId < 0 || playerId > 4) { + console.error('Parameter gamepad identifier in expression: "Pressure on a gamepad trigger", is not valid number, must be between 0 and 4.'); + return; +} +if (trigger != "LT" && trigger != "RT" && trigger != "L2" && trigger != "R2") { + console.error('Parameter trigger is not valid in expression: "Pressure on a gamepad trigger"'); + return; +} + +const gamepad = gamepads[playerId]; + +//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable. +if (gamepad == null) return; + +switch (trigger) { + case 'LT': + case 'L2': + eventsFunctionContext.returnValue = gamepad.buttons[6].value; + break; + + case 'RT': + case 'R2': + eventsFunctionContext.returnValue = gamepad.buttons[7].value; + break; + + default: + eventsFunctionContext.returnValue = -1; + break; +} +}; +gdjs.evtsExt__Gamepads__TriggerPressure.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Gamepads__TriggerPressure.userFunc0x1263d50(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__TriggerPressure.func = function(runtimeScene, player_ID, trigger, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "player_ID") return player_ID; +if (argName === "trigger") return trigger; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__TriggerPressure.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__Gamepads__TriggerPressure.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__weakvibrationmagnitude-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__weakvibrationmagnitude-func.js new file mode 100644 index 0000000..7a00dad --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__gamepads__weakvibrationmagnitude-func.js @@ -0,0 +1,85 @@ + +if (typeof gdjs.evtsExt__Gamepads__WeakVibrationMagnitude !== "undefined") { + gdjs.evtsExt__Gamepads__WeakVibrationMagnitude.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Gamepads__WeakVibrationMagnitude = {}; + + +gdjs.evtsExt__Gamepads__WeakVibrationMagnitude.userFunc0x19d9f48 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +const playerId = eventsFunctionContext.getArgument("Player_ID") - 1; +eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].rumble.weakMagnitude; +}; +gdjs.evtsExt__Gamepads__WeakVibrationMagnitude.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Gamepads__WeakVibrationMagnitude.userFunc0x19d9f48(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Gamepads__WeakVibrationMagnitude.func = function(runtimeScene, Player_ID, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Player_ID") return Player_ID; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Gamepads__WeakVibrationMagnitude.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__Gamepads__WeakVibrationMagnitude.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__health__health.js b/desktop/apps/dezunkrr/gdjs-evtsext__health__health.js new file mode 100644 index 0000000..963df09 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__health__health.js @@ -0,0 +1,7415 @@ + +gdjs.evtsExt__Health__Health = gdjs.evtsExt__Health__Health || {}; + +/** + * Behavior generated from Health + */ +gdjs.evtsExt__Health__Health.Health = class Health extends gdjs.RuntimeBehavior { + constructor(instanceContainer, behaviorData, owner) { + super(instanceContainer, behaviorData, owner); + this._runtimeScene = instanceContainer; + + this._onceTriggers = new gdjs.OnceTriggers(); + this._behaviorData = {}; + this._sharedData = gdjs.evtsExt__Health__Health.Health.getSharedData( + instanceContainer, + behaviorData.name + ); + + this._behaviorData.Health = behaviorData.Health !== undefined ? behaviorData.Health : Number("100") || 0; + this._behaviorData.CurrentHealth = Number("0") || 0; + this._behaviorData.MaxHealth = behaviorData.MaxHealth !== undefined ? behaviorData.MaxHealth : Number("100") || 0; + this._behaviorData.DamageCooldown = behaviorData.DamageCooldown !== undefined ? behaviorData.DamageCooldown : Number("0") || 0; + this._behaviorData.IsHealthJustDamaged = false; + this._behaviorData.HealthRegenRate = behaviorData.HealthRegenRate !== undefined ? behaviorData.HealthRegenRate : Number("0") || 0; + this._behaviorData.HealthRegenDelay = behaviorData.HealthRegenDelay !== undefined ? behaviorData.HealthRegenDelay : Number("0") || 0; + this._behaviorData.AllowOverHealing = behaviorData.AllowOverHealing !== undefined ? behaviorData.AllowOverHealing : false; + this._behaviorData.HitAtLeastOnce = false; + this._behaviorData.IsJustHealed = false; + this._behaviorData.CurrentShieldPoints = Number("") || 0; + this._behaviorData.MaxShieldPoints = behaviorData.MaxShieldPoints !== undefined ? behaviorData.MaxShieldPoints : Number("0") || 0; + this._behaviorData.ShieldDuration = behaviorData.ShieldDuration !== undefined ? behaviorData.ShieldDuration : Number("5") || 0; + this._behaviorData.ShieldRegenRate = behaviorData.ShieldRegenRate !== undefined ? behaviorData.ShieldRegenRate : Number("0") || 0; + this._behaviorData.BlockExcessDamage = behaviorData.BlockExcessDamage !== undefined ? behaviorData.BlockExcessDamage : false; + this._behaviorData.ShieldRegenDelay = behaviorData.ShieldRegenDelay !== undefined ? behaviorData.ShieldRegenDelay : Number("0") || 0; + this._behaviorData.IsShieldJustDamaged = false; + this._behaviorData.ChanceToDodge = behaviorData.ChanceToDodge !== undefined ? behaviorData.ChanceToDodge : Number("0") || 0; + this._behaviorData.DamageToBeApplied = Number("0") || 0; + this._behaviorData.FlatDamageReduction = behaviorData.FlatDamageReduction !== undefined ? behaviorData.FlatDamageReduction : Number("0") || 0; + this._behaviorData.PercentDamageReduction = behaviorData.PercentDamageReduction !== undefined ? behaviorData.PercentDamageReduction : Number("0") || 0; + this._behaviorData.IsJustDodged = false; + this._behaviorData.ShieldDamageTaken = Number("") || 0; + this._behaviorData.HealToBeApplied = Number("0") || 0; + } + + // Hot-reload: + updateFromBehaviorData(oldBehaviorData, newBehaviorData) { + + if (oldBehaviorData.Health !== newBehaviorData.Health) + this._behaviorData.Health = newBehaviorData.Health; + if (oldBehaviorData.CurrentHealth !== newBehaviorData.CurrentHealth) + this._behaviorData.CurrentHealth = newBehaviorData.CurrentHealth; + if (oldBehaviorData.MaxHealth !== newBehaviorData.MaxHealth) + this._behaviorData.MaxHealth = newBehaviorData.MaxHealth; + if (oldBehaviorData.DamageCooldown !== newBehaviorData.DamageCooldown) + this._behaviorData.DamageCooldown = newBehaviorData.DamageCooldown; + if (oldBehaviorData.IsHealthJustDamaged !== newBehaviorData.IsHealthJustDamaged) + this._behaviorData.IsHealthJustDamaged = newBehaviorData.IsHealthJustDamaged; + if (oldBehaviorData.HealthRegenRate !== newBehaviorData.HealthRegenRate) + this._behaviorData.HealthRegenRate = newBehaviorData.HealthRegenRate; + if (oldBehaviorData.HealthRegenDelay !== newBehaviorData.HealthRegenDelay) + this._behaviorData.HealthRegenDelay = newBehaviorData.HealthRegenDelay; + if (oldBehaviorData.AllowOverHealing !== newBehaviorData.AllowOverHealing) + this._behaviorData.AllowOverHealing = newBehaviorData.AllowOverHealing; + if (oldBehaviorData.HitAtLeastOnce !== newBehaviorData.HitAtLeastOnce) + this._behaviorData.HitAtLeastOnce = newBehaviorData.HitAtLeastOnce; + if (oldBehaviorData.IsJustHealed !== newBehaviorData.IsJustHealed) + this._behaviorData.IsJustHealed = newBehaviorData.IsJustHealed; + if (oldBehaviorData.CurrentShieldPoints !== newBehaviorData.CurrentShieldPoints) + this._behaviorData.CurrentShieldPoints = newBehaviorData.CurrentShieldPoints; + if (oldBehaviorData.MaxShieldPoints !== newBehaviorData.MaxShieldPoints) + this._behaviorData.MaxShieldPoints = newBehaviorData.MaxShieldPoints; + if (oldBehaviorData.ShieldDuration !== newBehaviorData.ShieldDuration) + this._behaviorData.ShieldDuration = newBehaviorData.ShieldDuration; + if (oldBehaviorData.ShieldRegenRate !== newBehaviorData.ShieldRegenRate) + this._behaviorData.ShieldRegenRate = newBehaviorData.ShieldRegenRate; + if (oldBehaviorData.BlockExcessDamage !== newBehaviorData.BlockExcessDamage) + this._behaviorData.BlockExcessDamage = newBehaviorData.BlockExcessDamage; + if (oldBehaviorData.ShieldRegenDelay !== newBehaviorData.ShieldRegenDelay) + this._behaviorData.ShieldRegenDelay = newBehaviorData.ShieldRegenDelay; + if (oldBehaviorData.IsShieldJustDamaged !== newBehaviorData.IsShieldJustDamaged) + this._behaviorData.IsShieldJustDamaged = newBehaviorData.IsShieldJustDamaged; + if (oldBehaviorData.ChanceToDodge !== newBehaviorData.ChanceToDodge) + this._behaviorData.ChanceToDodge = newBehaviorData.ChanceToDodge; + if (oldBehaviorData.DamageToBeApplied !== newBehaviorData.DamageToBeApplied) + this._behaviorData.DamageToBeApplied = newBehaviorData.DamageToBeApplied; + if (oldBehaviorData.FlatDamageReduction !== newBehaviorData.FlatDamageReduction) + this._behaviorData.FlatDamageReduction = newBehaviorData.FlatDamageReduction; + if (oldBehaviorData.PercentDamageReduction !== newBehaviorData.PercentDamageReduction) + this._behaviorData.PercentDamageReduction = newBehaviorData.PercentDamageReduction; + if (oldBehaviorData.IsJustDodged !== newBehaviorData.IsJustDodged) + this._behaviorData.IsJustDodged = newBehaviorData.IsJustDodged; + if (oldBehaviorData.ShieldDamageTaken !== newBehaviorData.ShieldDamageTaken) + this._behaviorData.ShieldDamageTaken = newBehaviorData.ShieldDamageTaken; + if (oldBehaviorData.HealToBeApplied !== newBehaviorData.HealToBeApplied) + this._behaviorData.HealToBeApplied = newBehaviorData.HealToBeApplied; + + return true; + } + + // Properties: + + _getHealth() { + return this._behaviorData.Health !== undefined ? this._behaviorData.Health : Number("100") || 0; + } + _setHealth(newValue) { + this._behaviorData.Health = newValue; + } + _getCurrentHealth() { + return this._behaviorData.CurrentHealth !== undefined ? this._behaviorData.CurrentHealth : Number("0") || 0; + } + _setCurrentHealth(newValue) { + this._behaviorData.CurrentHealth = newValue; + } + _getMaxHealth() { + return this._behaviorData.MaxHealth !== undefined ? this._behaviorData.MaxHealth : Number("100") || 0; + } + _setMaxHealth(newValue) { + this._behaviorData.MaxHealth = newValue; + } + _getDamageCooldown() { + return this._behaviorData.DamageCooldown !== undefined ? this._behaviorData.DamageCooldown : Number("0") || 0; + } + _setDamageCooldown(newValue) { + this._behaviorData.DamageCooldown = newValue; + } + _getIsHealthJustDamaged() { + return this._behaviorData.IsHealthJustDamaged !== undefined ? this._behaviorData.IsHealthJustDamaged : false; + } + _setIsHealthJustDamaged(newValue) { + this._behaviorData.IsHealthJustDamaged = newValue; + } + _toggleIsHealthJustDamaged() { + this._setIsHealthJustDamaged(!this._getIsHealthJustDamaged()); + } + _getHealthRegenRate() { + return this._behaviorData.HealthRegenRate !== undefined ? this._behaviorData.HealthRegenRate : Number("0") || 0; + } + _setHealthRegenRate(newValue) { + this._behaviorData.HealthRegenRate = newValue; + } + _getHealthRegenDelay() { + return this._behaviorData.HealthRegenDelay !== undefined ? this._behaviorData.HealthRegenDelay : Number("0") || 0; + } + _setHealthRegenDelay(newValue) { + this._behaviorData.HealthRegenDelay = newValue; + } + _getAllowOverHealing() { + return this._behaviorData.AllowOverHealing !== undefined ? this._behaviorData.AllowOverHealing : false; + } + _setAllowOverHealing(newValue) { + this._behaviorData.AllowOverHealing = newValue; + } + _toggleAllowOverHealing() { + this._setAllowOverHealing(!this._getAllowOverHealing()); + } + _getHitAtLeastOnce() { + return this._behaviorData.HitAtLeastOnce !== undefined ? this._behaviorData.HitAtLeastOnce : false; + } + _setHitAtLeastOnce(newValue) { + this._behaviorData.HitAtLeastOnce = newValue; + } + _toggleHitAtLeastOnce() { + this._setHitAtLeastOnce(!this._getHitAtLeastOnce()); + } + _getIsJustHealed() { + return this._behaviorData.IsJustHealed !== undefined ? this._behaviorData.IsJustHealed : false; + } + _setIsJustHealed(newValue) { + this._behaviorData.IsJustHealed = newValue; + } + _toggleIsJustHealed() { + this._setIsJustHealed(!this._getIsJustHealed()); + } + _getCurrentShieldPoints() { + return this._behaviorData.CurrentShieldPoints !== undefined ? this._behaviorData.CurrentShieldPoints : Number("") || 0; + } + _setCurrentShieldPoints(newValue) { + this._behaviorData.CurrentShieldPoints = newValue; + } + _getMaxShieldPoints() { + return this._behaviorData.MaxShieldPoints !== undefined ? this._behaviorData.MaxShieldPoints : Number("0") || 0; + } + _setMaxShieldPoints(newValue) { + this._behaviorData.MaxShieldPoints = newValue; + } + _getShieldDuration() { + return this._behaviorData.ShieldDuration !== undefined ? this._behaviorData.ShieldDuration : Number("5") || 0; + } + _setShieldDuration(newValue) { + this._behaviorData.ShieldDuration = newValue; + } + _getShieldRegenRate() { + return this._behaviorData.ShieldRegenRate !== undefined ? this._behaviorData.ShieldRegenRate : Number("0") || 0; + } + _setShieldRegenRate(newValue) { + this._behaviorData.ShieldRegenRate = newValue; + } + _getBlockExcessDamage() { + return this._behaviorData.BlockExcessDamage !== undefined ? this._behaviorData.BlockExcessDamage : false; + } + _setBlockExcessDamage(newValue) { + this._behaviorData.BlockExcessDamage = newValue; + } + _toggleBlockExcessDamage() { + this._setBlockExcessDamage(!this._getBlockExcessDamage()); + } + _getShieldRegenDelay() { + return this._behaviorData.ShieldRegenDelay !== undefined ? this._behaviorData.ShieldRegenDelay : Number("0") || 0; + } + _setShieldRegenDelay(newValue) { + this._behaviorData.ShieldRegenDelay = newValue; + } + _getIsShieldJustDamaged() { + return this._behaviorData.IsShieldJustDamaged !== undefined ? this._behaviorData.IsShieldJustDamaged : false; + } + _setIsShieldJustDamaged(newValue) { + this._behaviorData.IsShieldJustDamaged = newValue; + } + _toggleIsShieldJustDamaged() { + this._setIsShieldJustDamaged(!this._getIsShieldJustDamaged()); + } + _getChanceToDodge() { + return this._behaviorData.ChanceToDodge !== undefined ? this._behaviorData.ChanceToDodge : Number("0") || 0; + } + _setChanceToDodge(newValue) { + this._behaviorData.ChanceToDodge = newValue; + } + _getDamageToBeApplied() { + return this._behaviorData.DamageToBeApplied !== undefined ? this._behaviorData.DamageToBeApplied : Number("0") || 0; + } + _setDamageToBeApplied(newValue) { + this._behaviorData.DamageToBeApplied = newValue; + } + _getFlatDamageReduction() { + return this._behaviorData.FlatDamageReduction !== undefined ? this._behaviorData.FlatDamageReduction : Number("0") || 0; + } + _setFlatDamageReduction(newValue) { + this._behaviorData.FlatDamageReduction = newValue; + } + _getPercentDamageReduction() { + return this._behaviorData.PercentDamageReduction !== undefined ? this._behaviorData.PercentDamageReduction : Number("0") || 0; + } + _setPercentDamageReduction(newValue) { + this._behaviorData.PercentDamageReduction = newValue; + } + _getIsJustDodged() { + return this._behaviorData.IsJustDodged !== undefined ? this._behaviorData.IsJustDodged : false; + } + _setIsJustDodged(newValue) { + this._behaviorData.IsJustDodged = newValue; + } + _toggleIsJustDodged() { + this._setIsJustDodged(!this._getIsJustDodged()); + } + _getShieldDamageTaken() { + return this._behaviorData.ShieldDamageTaken !== undefined ? this._behaviorData.ShieldDamageTaken : Number("") || 0; + } + _setShieldDamageTaken(newValue) { + this._behaviorData.ShieldDamageTaken = newValue; + } + _getHealToBeApplied() { + return this._behaviorData.HealToBeApplied !== undefined ? this._behaviorData.HealToBeApplied : Number("0") || 0; + } + _setHealToBeApplied(newValue) { + this._behaviorData.HealToBeApplied = newValue; + } +} + +/** + * Shared data generated from Health + */ +gdjs.evtsExt__Health__Health.Health.SharedData = class HealthSharedData { + constructor(sharedData) { + + } + + // Shared properties: + +} + +gdjs.evtsExt__Health__Health.Health.getSharedData = function(instanceContainer, behaviorName) { + if (!instanceContainer._Health_HealthSharedData) { + const initialData = instanceContainer.getInitialSharedDataForBehavior( + behaviorName + ); + instanceContainer._Health_HealthSharedData = new gdjs.evtsExt__Health__Health.Health.SharedData( + initialData + ); + } + return instanceContainer._Health_HealthSharedData; +} + +// Methods: +gdjs.evtsExt__Health__Health.Health.prototype.onCreatedContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.onCreatedContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.onCreatedContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.onCreatedContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.onCreatedContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.onCreatedContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.onCreatedContext.GDObjectObjects1[i].resetTimer("__Health.TimeSinceLastHit"); +} +}{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.onCreatedContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.onCreatedContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetCurrentHealth((gdjs.evtsExt__Health__Health.Health.prototype.onCreatedContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getHealth()), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.onCreated = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.onCreatedContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.onCreatedContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.onCreatedContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2= []; +gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects3= []; +gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects4= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + + +} + + +{ + +/* Reuse gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2 */ + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2.length;i (gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).MaxHealth((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))) ) { + isConditionTrue_0 = true; + gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2[k] = gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2[i]; + ++k; + } +} +gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2.length = k; +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2 */ +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setCurrentHealth((gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getMaxHealth())); +} +}} + +} + + +};gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2.length;i (gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getHealthRegenDelay()) ) { + isConditionTrue_0 = true; + gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2[k] = gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2[i]; + ++k; + } +} +gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2.length = k; +} +} +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2 */ +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setCurrentHealth(gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getCurrentHealth() + ((gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getHealthRegenRate()) * gdjs.evtTools.runtimeScene.getElapsedTimeInSeconds(runtimeScene))); +} +} +{ //Subevents +gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.eventsList2 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setIsHealthJustDamaged(false); +} +}{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setIsJustHealed(false); +} +}{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setIsJustDodged(false); +} +}} + +} + + +};gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.eventsList3 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.eventsList1(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.eventsList2(runtimeScene, eventsFunctionContext); +} + + +};gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.eventsList4 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2, gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects3); + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects3.length;i (gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getMaxShieldPoints()) ) { + isConditionTrue_0 = true; + gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2[k] = gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2[i]; + ++k; + } +} +gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2.length = k; +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2 */ +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setCurrentShieldPoints((gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getMaxShieldPoints())); +} +}} + +} + + +};gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.eventsList5 = function(runtimeScene, eventsFunctionContext) { + +{ + + + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2.length;i (gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getShieldRegenDelay()) ) { + isConditionTrue_0 = true; + gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2[k] = gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2[i]; + ++k; + } +} +gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2.length = k; +} +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.eventsList4(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.eventsList6 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__Health__Health.Health.prototype.doStepPreEventsContext.GDObjectObjects2.length;i 0 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2[k] = gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2[i]; + ++k; + } +} +gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2.length = k; +if (isConditionTrue_0) { +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2.length;i 0 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2[k] = gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2[i]; + ++k; + } +} +gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2.length = k; +} +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2 */ +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setDamageToBeApplied(gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getDamageToBeApplied() * (1 - Math.min(1, (gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getPercentDamageReduction())))); +} +}} + +} + + +};gdjs.evtsExt__Health__Health.Health.prototype.HitContext.eventsList3 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Health__Health.Health.prototype.HitContext.eventsList1(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__Health__Health.Health.prototype.HitContext.eventsList2(runtimeScene, eventsFunctionContext); +} + + +};gdjs.evtsExt__Health__Health.Health.prototype.HitContext.eventsList4 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects1, gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2); + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("UseArmor") : false); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2.length;i 0 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2[k] = gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2[i]; + ++k; + } +} +gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2.length = k; +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__Health__Health.Health.prototype.HitContext.eventsList3(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__Health__Health.Health.prototype.HitContext.eventsList5 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2, gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects3); + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects3.length;i (gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getCurrentShieldPoints()) ) { + isConditionTrue_0 = true; + gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2[k] = gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2[i]; + ++k; + } +} +gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2.length = k; +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2 */ +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setShieldDamageTaken((gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getCurrentShieldPoints())); +} +} +{ //Subevents +gdjs.evtsExt__Health__Health.Health.prototype.HitContext.eventsList5(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__Health__Health.Health.prototype.HitContext.eventsList7 = function(runtimeScene, eventsFunctionContext) { + +{ + + + +} + + +{ + +gdjs.copyArray(gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects1, gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2); + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("UseShield") : false); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2.length;i 0 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2[k] = gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2[i]; + ++k; + } +} +gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2.length = k; +} +} +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2 */ +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setIsShieldJustDamaged(true); +} +}{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).TriggerDamageCooldown((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +} +{ //Subevents +gdjs.evtsExt__Health__Health.Health.prototype.HitContext.eventsList6(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__Health__Health.Health.prototype.HitContext.eventsList8 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +/* Reuse gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects1 */ +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetCurrentHealth((gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getCurrentHealth()) - (gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getDamageToBeApplied()), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +};gdjs.evtsExt__Health__Health.Health.prototype.HitContext.eventsList9 = function(runtimeScene, eventsFunctionContext) { + +{ + +/* Reuse gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects1 */ + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects1.length;i 0 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects1[k] = gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects1[i]; + ++k; + } +} +gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects1.length = k; +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects1 */ +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetJustDamaged(true, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).TriggerDamageCooldown((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +} +{ //Subevents +gdjs.evtsExt__Health__Health.Health.prototype.HitContext.eventsList8(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__Health__Health.Health.prototype.HitContext.eventsList10 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Health__Health.Health.prototype.HitContext.eventsList0(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__Health__Health.Health.prototype.HitContext.eventsList4(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__Health__Health.Health.prototype.HitContext.eventsList7(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__Health__Health.Health.prototype.HitContext.eventsList9(runtimeScene, eventsFunctionContext); +} + + +};gdjs.evtsExt__Health__Health.Health.prototype.HitContext.eventsList11 = function(runtimeScene, eventsFunctionContext) { + +{ + + + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__Health__Health.Health.prototype.HitContext.GDObjectObjects1.length;i 0 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__Health__Health.Health.prototype.SetHealthContext.GDObjectObjects1[k] = gdjs.evtsExt__Health__Health.Health.prototype.SetHealthContext.GDObjectObjects1[i]; + ++k; + } +} +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthContext.GDObjectObjects1.length = k; +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__Health__Health.Health.prototype.SetHealthContext.GDObjectObjects1 */ +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.SetHealthContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.SetHealthContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setCurrentHealth(Math.min((gdjs.evtsExt__Health__Health.Health.prototype.SetHealthContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getCurrentHealth()), (gdjs.evtsExt__Health__Health.Health.prototype.SetHealthContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getMaxHealth()))); +} +}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetHealth = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Health__Health.Health.prototype.SetCurrentHealthContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.SetCurrentHealthContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.SetCurrentHealthContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.SetCurrentHealthContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.SetCurrentHealthContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.SetCurrentHealthContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.SetCurrentHealthContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetHealth((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetCurrentHealth = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetCurrentHealthContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.SetCurrentHealthContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.SetCurrentHealthContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Health__Health.Health.prototype.HealContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.HealContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.HealContext.GDObjectObjects2= []; +gdjs.evtsExt__Health__Health.Health.prototype.HealContext.GDObjectObjects3= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.HealContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.HealContext.GDObjectObjects2); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__Health__Health.Health.prototype.HealContext.GDObjectObjects2.length;i 0 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__Health__Health.Health.prototype.HealContext.GDObjectObjects2[k] = gdjs.evtsExt__Health__Health.Health.prototype.HealContext.GDObjectObjects2[i]; + ++k; + } +} +gdjs.evtsExt__Health__Health.Health.prototype.HealContext.GDObjectObjects2.length = k; +if (isConditionTrue_0) { +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__Health__Health.Health.prototype.HealContext.GDObjectObjects2.length;i (gdjs.evtsExt__Health__Health.Health.prototype.SetMaxHealthOpContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).MaxHealth((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))) ) { + isConditionTrue_0 = true; + gdjs.evtsExt__Health__Health.Health.prototype.SetMaxHealthOpContext.GDObjectObjects1[k] = gdjs.evtsExt__Health__Health.Health.prototype.SetMaxHealthOpContext.GDObjectObjects1[i]; + ++k; + } +} +gdjs.evtsExt__Health__Health.Health.prototype.SetMaxHealthOpContext.GDObjectObjects1.length = k; +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__Health__Health.Health.prototype.SetMaxHealthOpContext.GDObjectObjects1 */ +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.SetMaxHealthOpContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.SetMaxHealthOpContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setCurrentHealth((gdjs.evtsExt__Health__Health.Health.prototype.SetMaxHealthOpContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).MaxHealth((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)))); +} +}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetMaxHealthOp = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetMaxHealthOpContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.SetMaxHealthOpContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.SetMaxHealthOpContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Health__Health.Health.prototype.SetMaxHealthContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.SetMaxHealthContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.SetMaxHealthContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.SetMaxHealthContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.SetMaxHealthContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.SetMaxHealthContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.SetMaxHealthContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetMaxHealthOp((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetMaxHealth = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetMaxHealthContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.SetMaxHealthContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.SetMaxHealthContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Health__Health.Health.prototype.HealthRegenRateContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.HealthRegenRateContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.HealthRegenRateContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.HealthRegenRateContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.HealthRegenRateContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__Health__Health.Health.prototype.HealthRegenRateContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__Health__Health.Health.prototype.HealthRegenRateContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getHealthRegenRate()); }}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.HealthRegenRate = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.HealthRegenRateContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.HealthRegenRateContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.HealthRegenRateContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenRateOpContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenRateOpContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenRateOpContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenRateOpContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenRateOpContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenRateOpContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenRateOpContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setHealthRegenRate((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0)); +} +}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenRateOp = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenRateOpContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenRateOpContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenRateOpContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenRateContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenRateContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenRateContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenRateContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenRateContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenRateContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenRateContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetHealthRegenRateOp((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenRate = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenRateContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenRateContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenRateContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Health__Health.Health.prototype.DamageCooldownDurationContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.DamageCooldownDurationContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.DamageCooldownDurationContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.DamageCooldownDurationContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.DamageCooldownDurationContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__Health__Health.Health.prototype.DamageCooldownDurationContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__Health__Health.Health.prototype.DamageCooldownDurationContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getDamageCooldown()); }}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.DamageCooldownDuration = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.DamageCooldownDurationContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.DamageCooldownDurationContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.DamageCooldownDurationContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__Health__Health.Health.prototype.SetCooldownDurationOpContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.SetCooldownDurationOpContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.SetCooldownDurationOpContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.SetCooldownDurationOpContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.SetCooldownDurationOpContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.SetCooldownDurationOpContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.SetCooldownDurationOpContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setDamageCooldown((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0)); +} +}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetCooldownDurationOp = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetCooldownDurationOpContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.SetCooldownDurationOpContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.SetCooldownDurationOpContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Health__Health.Health.prototype.SetCooldownDurationContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.SetCooldownDurationContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.SetCooldownDurationContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.SetCooldownDurationContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.SetCooldownDurationContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.SetCooldownDurationContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.SetCooldownDurationContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetCooldownDurationOp((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetCooldownDuration = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetCooldownDurationContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.SetCooldownDurationContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.SetCooldownDurationContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Health__Health.Health.prototype.HealthRegenDelayContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.HealthRegenDelayContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.HealthRegenDelayContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.HealthRegenDelayContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.HealthRegenDelayContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__Health__Health.Health.prototype.HealthRegenDelayContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__Health__Health.Health.prototype.HealthRegenDelayContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getHealthRegenDelay()); }}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.HealthRegenDelay = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.HealthRegenDelayContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.HealthRegenDelayContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.HealthRegenDelayContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenDelayOpContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenDelayOpContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenDelayOpContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenDelayOpContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenDelayOpContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenDelayOpContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenDelayOpContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setHealthRegenDelay((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0)); +} +}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenDelayOp = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenDelayOpContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenDelayOpContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenDelayOpContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenDelayContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenDelayContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenDelayContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenDelayContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenDelayContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenDelayContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenDelayContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetHealthRegenDelayOp((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenDelay = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenDelayContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenDelayContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.SetHealthRegenDelayContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Health__Health.Health.prototype.ChanceToDodgeContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.ChanceToDodgeContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.ChanceToDodgeContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.ChanceToDodgeContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.ChanceToDodgeContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__Health__Health.Health.prototype.ChanceToDodgeContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__Health__Health.Health.prototype.ChanceToDodgeContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getChanceToDodge()); }}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.ChanceToDodge = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.ChanceToDodgeContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.ChanceToDodgeContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.ChanceToDodgeContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__Health__Health.Health.prototype.SetChanceToDodgeOpContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.SetChanceToDodgeOpContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.SetChanceToDodgeOpContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.SetChanceToDodgeOpContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.SetChanceToDodgeOpContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.SetChanceToDodgeOpContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.SetChanceToDodgeOpContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setChanceToDodge((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0)); +} +}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetChanceToDodgeOp = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetChanceToDodgeOpContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.SetChanceToDodgeOpContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.SetChanceToDodgeOpContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Health__Health.Health.prototype.SetChanceToDodgeContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.SetChanceToDodgeContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.SetChanceToDodgeContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.SetChanceToDodgeContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.SetChanceToDodgeContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.SetChanceToDodgeContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.SetChanceToDodgeContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetChanceToDodgeOp((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetChanceToDodge = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetChanceToDodgeContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.SetChanceToDodgeContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.SetChanceToDodgeContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Health__Health.Health.prototype.FlatDamageReductionContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.FlatDamageReductionContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.FlatDamageReductionContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.FlatDamageReductionContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.FlatDamageReductionContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__Health__Health.Health.prototype.FlatDamageReductionContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__Health__Health.Health.prototype.FlatDamageReductionContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getFlatDamageReduction()); }}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.FlatDamageReduction = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.FlatDamageReductionContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.FlatDamageReductionContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.FlatDamageReductionContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__Health__Health.Health.prototype.SetFlatDamageReductionOpContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.SetFlatDamageReductionOpContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.SetFlatDamageReductionOpContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.SetFlatDamageReductionOpContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.SetFlatDamageReductionOpContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.SetFlatDamageReductionOpContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.SetFlatDamageReductionOpContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setFlatDamageReduction((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0)); +} +}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetFlatDamageReductionOp = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetFlatDamageReductionOpContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.SetFlatDamageReductionOpContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.SetFlatDamageReductionOpContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Health__Health.Health.prototype.SetFlatDamageReductionContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.SetFlatDamageReductionContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.SetFlatDamageReductionContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.SetFlatDamageReductionContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.SetFlatDamageReductionContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.SetFlatDamageReductionContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.SetFlatDamageReductionContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetFlatDamageReductionOp((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetFlatDamageReduction = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetFlatDamageReductionContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.SetFlatDamageReductionContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.SetFlatDamageReductionContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Health__Health.Health.prototype.PercentDamageReductionContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.PercentDamageReductionContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.PercentDamageReductionContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.PercentDamageReductionContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.PercentDamageReductionContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__Health__Health.Health.prototype.PercentDamageReductionContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__Health__Health.Health.prototype.PercentDamageReductionContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getPercentDamageReduction()); }}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.PercentDamageReduction = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.PercentDamageReductionContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.PercentDamageReductionContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.PercentDamageReductionContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__Health__Health.Health.prototype.SetPercentDamageReductionOpContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.SetPercentDamageReductionOpContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.SetPercentDamageReductionOpContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.SetPercentDamageReductionOpContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.SetPercentDamageReductionOpContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.SetPercentDamageReductionOpContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.SetPercentDamageReductionOpContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setPercentDamageReduction((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0)); +} +}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetPercentDamageReductionOp = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetPercentDamageReductionOpContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.SetPercentDamageReductionOpContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.SetPercentDamageReductionOpContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Health__Health.Health.prototype.SetPercentDamageReductionContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.SetPercentDamageReductionContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.SetPercentDamageReductionContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.SetPercentDamageReductionContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.SetPercentDamageReductionContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.SetPercentDamageReductionContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.SetPercentDamageReductionContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetPercentDamageReductionOp((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetPercentDamageReduction = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetPercentDamageReductionContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.SetPercentDamageReductionContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.SetPercentDamageReductionContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Health__Health.Health.prototype.AllowOverHealingContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.AllowOverHealingContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.AllowOverHealingContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.AllowOverHealingContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.AllowOverHealingContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.AllowOverHealingContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.AllowOverHealingContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setAllowOverHealing(false); +} +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("Value") : false); +} +if (isConditionTrue_0) { +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.AllowOverHealingContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.AllowOverHealingContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.AllowOverHealingContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setAllowOverHealing(true); +} +}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.AllowOverHealing = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.AllowOverHealingContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.AllowOverHealingContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.AllowOverHealingContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Health__Health.Health.prototype.SetHitAtLeastOnceContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.SetHitAtLeastOnceContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.SetHitAtLeastOnceContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.SetHitAtLeastOnceContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.SetHitAtLeastOnceContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.SetHitAtLeastOnceContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.SetHitAtLeastOnceContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setHitAtLeastOnce(false); +} +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("Value") : false); +} +if (isConditionTrue_0) { +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.SetHitAtLeastOnceContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.SetHitAtLeastOnceContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.SetHitAtLeastOnceContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setHitAtLeastOnce(true); +} +}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetHitAtLeastOnce = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetHitAtLeastOnceContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.SetHitAtLeastOnceContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.SetHitAtLeastOnceContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Health__Health.Health.prototype.SetJustDamagedContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.SetJustDamagedContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.SetJustDamagedContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.SetJustDamagedContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.SetJustDamagedContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.SetJustDamagedContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.SetJustDamagedContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setIsHealthJustDamaged(false); +} +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("Value") : false); +} +if (isConditionTrue_0) { +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.SetJustDamagedContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.SetJustDamagedContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.SetJustDamagedContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setIsHealthJustDamaged(true); +} +}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetJustDamaged = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetJustDamagedContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.SetJustDamagedContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.SetJustDamagedContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Health__Health.Health.prototype.TriggerDamageCooldownContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.TriggerDamageCooldownContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.TriggerDamageCooldownContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.TriggerDamageCooldownContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.TriggerDamageCooldownContext.GDObjectObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__Health__Health.Health.prototype.TriggerDamageCooldownContext.GDObjectObjects1.length;i 0 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__Health__Health.Health.prototype.IsDamageCooldownActiveContext.GDObjectObjects1[k] = gdjs.evtsExt__Health__Health.Health.prototype.IsDamageCooldownActiveContext.GDObjectObjects1[i]; + ++k; + } +} +gdjs.evtsExt__Health__Health.Health.prototype.IsDamageCooldownActiveContext.GDObjectObjects1.length = k; +if (isConditionTrue_0) { +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__Health__Health.Health.prototype.IsDamageCooldownActiveContext.GDObjectObjects1.length;i 0 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__Health__Health.Health.prototype.ActivateShieldContext.GDObjectObjects1[k] = gdjs.evtsExt__Health__Health.Health.prototype.ActivateShieldContext.GDObjectObjects1[i]; + ++k; + } +} +gdjs.evtsExt__Health__Health.Health.prototype.ActivateShieldContext.GDObjectObjects1.length = k; +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__Health__Health.Health.prototype.ActivateShieldContext.GDObjectObjects1 */ +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.ActivateShieldContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.ActivateShieldContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setCurrentShieldPoints(Math.min((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("ShieldPoints")) || 0 : 0), (gdjs.evtsExt__Health__Health.Health.prototype.ActivateShieldContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).MaxShield((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))))); +} +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("RenewShieldDuration") : false); +} +if (isConditionTrue_0) { +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.ActivateShieldContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.ActivateShieldContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.ActivateShieldContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).RenewShieldDuration((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.ActivateShield = function(ShieldPoints, RenewShieldDuration, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ShieldPoints") return ShieldPoints; +if (argName === "RenewShieldDuration") return RenewShieldDuration; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.ActivateShieldContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.ActivateShieldContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.ActivateShieldContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Health__Health.Health.prototype.SetShieldBlockExcessDamageContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.SetShieldBlockExcessDamageContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.SetShieldBlockExcessDamageContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.SetShieldBlockExcessDamageContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.SetShieldBlockExcessDamageContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.SetShieldBlockExcessDamageContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.SetShieldBlockExcessDamageContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setBlockExcessDamage(false); +} +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("Value") : false); +} +if (isConditionTrue_0) { +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.SetShieldBlockExcessDamageContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Health__Health.Health.prototype.SetShieldBlockExcessDamageContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Health__Health.Health.prototype.SetShieldBlockExcessDamageContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setBlockExcessDamage(true); +} +}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetShieldBlockExcessDamage = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.SetShieldBlockExcessDamageContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.SetShieldBlockExcessDamageContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.SetShieldBlockExcessDamageContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Health__Health.Health.prototype.IsShieldJustDamagedContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.IsShieldJustDamagedContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.IsShieldJustDamagedContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.IsShieldJustDamagedContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = false; }}} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.IsShieldJustDamagedContext.GDObjectObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__Health__Health.Health.prototype.IsShieldJustDamagedContext.GDObjectObjects1.length;i 0 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__Health__Health.Health.prototype.IsShieldActiveContext.GDObjectObjects1[k] = gdjs.evtsExt__Health__Health.Health.prototype.IsShieldActiveContext.GDObjectObjects1[i]; + ++k; + } +} +gdjs.evtsExt__Health__Health.Health.prototype.IsShieldActiveContext.GDObjectObjects1.length = k; +if (isConditionTrue_0) { +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__Health__Health.Health.prototype.IsShieldActiveContext.GDObjectObjects1.length;i 0 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__Health__Health.Health.prototype.IsShieldActiveContext.GDObjectObjects1[k] = gdjs.evtsExt__Health__Health.Health.prototype.IsShieldActiveContext.GDObjectObjects1[i]; + ++k; + } +} +gdjs.evtsExt__Health__Health.Health.prototype.IsShieldActiveContext.GDObjectObjects1.length = k; +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__Health__Health.Health.prototype.IsShieldActiveContext.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.IsShieldActive = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.IsShieldActiveContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.IsShieldActiveContext.GDObjectObjects2.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.IsShieldActiveContext.GDObjectObjects3.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.IsShieldActiveContext.eventsList1(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} +gdjs.evtsExt__Health__Health.Health.prototype.ShieldTimeRemainingContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.ShieldTimeRemainingContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.ShieldTimeRemainingContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.ShieldTimeRemainingContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = 0; }}} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.ShieldTimeRemainingContext.GDObjectObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__Health__Health.Health.prototype.ShieldTimeRemainingContext.GDObjectObjects1.length;i 0 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__Health__Health.Health.prototype.ShieldTimeRemainingContext.GDObjectObjects1[k] = gdjs.evtsExt__Health__Health.Health.prototype.ShieldTimeRemainingContext.GDObjectObjects1[i]; + ++k; + } +} +gdjs.evtsExt__Health__Health.Health.prototype.ShieldTimeRemainingContext.GDObjectObjects1.length = k; +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__Health__Health.Health.prototype.ShieldTimeRemainingContext.GDObjectObjects1 */ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = Math.max(0, (( gdjs.evtsExt__Health__Health.Health.prototype.ShieldTimeRemainingContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__Health__Health.Health.prototype.ShieldTimeRemainingContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getShieldDuration()) - (( gdjs.evtsExt__Health__Health.Health.prototype.ShieldTimeRemainingContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__Health__Health.Health.prototype.ShieldTimeRemainingContext.GDObjectObjects1[0].getTimerElapsedTimeInSeconds("__Health.ShieldDuration"))); }}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.ShieldTimeRemaining = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.ShieldTimeRemainingContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.ShieldTimeRemainingContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.ShieldTimeRemainingContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__Health__Health.Health.prototype.PreviousDamageToShieldContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.PreviousDamageToShieldContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.PreviousDamageToShieldContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.PreviousDamageToShieldContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.PreviousDamageToShieldContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__Health__Health.Health.prototype.PreviousDamageToShieldContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__Health__Health.Health.prototype.PreviousDamageToShieldContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getShieldDamageTaken()); }}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.PreviousDamageToShield = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.PreviousDamageToShieldContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.PreviousDamageToShieldContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.PreviousDamageToShieldContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__Health__Health.Health.prototype.PreviousHealAmountContext = {}; +gdjs.evtsExt__Health__Health.Health.prototype.PreviousHealAmountContext.GDObjectObjects1= []; +gdjs.evtsExt__Health__Health.Health.prototype.PreviousHealAmountContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Health__Health.Health.prototype.PreviousHealAmountContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Health__Health.Health.prototype.PreviousHealAmountContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__Health__Health.Health.prototype.PreviousHealAmountContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__Health__Health.Health.prototype.PreviousHealAmountContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getHealToBeApplied()); }}} + +} + + +}; + +gdjs.evtsExt__Health__Health.Health.prototype.PreviousHealAmount = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Health__Health.Health.prototype.PreviousHealAmountContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Health__Health.Health.prototype.PreviousHealAmountContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Health__Health.Health.prototype.PreviousHealAmountContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + + +gdjs.registerBehavior("Health::Health", gdjs.evtsExt__Health__Health.Health); diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__mousepointerlock__exitpointerlock-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__mousepointerlock__exitpointerlock-func.js new file mode 100644 index 0000000..384ce6b --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__mousepointerlock__exitpointerlock-func.js @@ -0,0 +1,83 @@ + +if (typeof gdjs.evtsExt__MousePointerLock__ExitPointerLock !== "undefined") { + gdjs.evtsExt__MousePointerLock__ExitPointerLock.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__MousePointerLock__ExitPointerLock = {}; + + +gdjs.evtsExt__MousePointerLock__ExitPointerLock.userFunc0x1992370 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +document.exitPointerLock(); +}; +gdjs.evtsExt__MousePointerLock__ExitPointerLock.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__MousePointerLock__ExitPointerLock.userFunc0x1992370(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__MousePointerLock__ExitPointerLock.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__MousePointerLock__ExitPointerLock.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__MousePointerLock__ExitPointerLock.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__mousepointerlock__ispointerlocked-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__mousepointerlock__ispointerlocked-func.js new file mode 100644 index 0000000..c00ef72 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__mousepointerlock__ispointerlocked-func.js @@ -0,0 +1,83 @@ + +if (typeof gdjs.evtsExt__MousePointerLock__isPointerLocked !== "undefined") { + gdjs.evtsExt__MousePointerLock__isPointerLocked.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__MousePointerLock__isPointerLocked = {}; + + +gdjs.evtsExt__MousePointerLock__isPointerLocked.userFunc0x19a26e8 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +eventsFunctionContext.returnValue = document.pointerLockElement ? true : false; +}; +gdjs.evtsExt__MousePointerLock__isPointerLocked.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__MousePointerLock__isPointerLocked.userFunc0x19a26e8(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__MousePointerLock__isPointerLocked.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__MousePointerLock__isPointerLocked.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__MousePointerLock__isPointerLocked.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__mousepointerlock__movementx-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__mousepointerlock__movementx-func.js new file mode 100644 index 0000000..b55a2e5 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__mousepointerlock__movementx-func.js @@ -0,0 +1,83 @@ + +if (typeof gdjs.evtsExt__MousePointerLock__MovementX !== "undefined") { + gdjs.evtsExt__MousePointerLock__MovementX.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__MousePointerLock__MovementX = {}; + + +gdjs.evtsExt__MousePointerLock__MovementX.userFunc0x1992370 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +eventsFunctionContext.returnValue = gdjs._MousePointerLockExtension.movement.x || 0; +}; +gdjs.evtsExt__MousePointerLock__MovementX.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__MousePointerLock__MovementX.userFunc0x1992370(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__MousePointerLock__MovementX.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__MousePointerLock__MovementX.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__MousePointerLock__MovementX.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__mousepointerlock__movementy-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__mousepointerlock__movementy-func.js new file mode 100644 index 0000000..6efeca4 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__mousepointerlock__movementy-func.js @@ -0,0 +1,83 @@ + +if (typeof gdjs.evtsExt__MousePointerLock__MovementY !== "undefined") { + gdjs.evtsExt__MousePointerLock__MovementY.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__MousePointerLock__MovementY = {}; + + +gdjs.evtsExt__MousePointerLock__MovementY.userFunc0x19a5a58 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +eventsFunctionContext.returnValue = gdjs._MousePointerLockExtension.movement.y || 0; +}; +gdjs.evtsExt__MousePointerLock__MovementY.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__MousePointerLock__MovementY.userFunc0x19a5a58(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__MousePointerLock__MovementY.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__MousePointerLock__MovementY.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__MousePointerLock__MovementY.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__mousepointerlock__onfirstsceneloaded-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__mousepointerlock__onfirstsceneloaded-func.js new file mode 100644 index 0000000..24223eb --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__mousepointerlock__onfirstsceneloaded-func.js @@ -0,0 +1,95 @@ + +if (typeof gdjs.evtsExt__MousePointerLock__onFirstSceneLoaded !== "undefined") { + gdjs.evtsExt__MousePointerLock__onFirstSceneLoaded.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__MousePointerLock__onFirstSceneLoaded = {}; + + +gdjs.evtsExt__MousePointerLock__onFirstSceneLoaded.userFunc0x1992370 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +const canvas = runtimeScene.getGame().getRenderer().getCanvas(); + +gdjs._MousePointerLockExtension = {}; +gdjs._MousePointerLockExtension.movement = { x: 0, y: 0 }; + +canvas.addEventListener("mousemove", (e) => { + gdjs._MousePointerLockExtension.movement.x += e.movementX || 0; + gdjs._MousePointerLockExtension.movement.y += e.movementY || 0; +}, false); +}; +gdjs.evtsExt__MousePointerLock__onFirstSceneLoaded.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__MousePointerLock__onFirstSceneLoaded.userFunc0x1992370(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__MousePointerLock__onFirstSceneLoaded.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__MousePointerLock__onFirstSceneLoaded.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__MousePointerLock__onFirstSceneLoaded.registeredGdjsCallbacks = []; +gdjs.evtsExt__MousePointerLock__onFirstSceneLoaded.registeredGdjsCallbacks.push((runtimeScene) => { + gdjs.evtsExt__MousePointerLock__onFirstSceneLoaded.func(runtimeScene, runtimeScene); +}) +gdjs.registerFirstRuntimeSceneLoadedCallback(gdjs.evtsExt__MousePointerLock__onFirstSceneLoaded.registeredGdjsCallbacks[gdjs.evtsExt__MousePointerLock__onFirstSceneLoaded.registeredGdjsCallbacks.length - 1]); diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__mousepointerlock__onscenepostevents-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__mousepointerlock__onscenepostevents-func.js new file mode 100644 index 0000000..cf3b223 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__mousepointerlock__onscenepostevents-func.js @@ -0,0 +1,87 @@ + +if (typeof gdjs.evtsExt__MousePointerLock__onScenePostEvents !== "undefined") { + gdjs.evtsExt__MousePointerLock__onScenePostEvents.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__MousePointerLock__onScenePostEvents = {}; + + +gdjs.evtsExt__MousePointerLock__onScenePostEvents.userFunc0x1992370 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +gdjs._MousePointerLockExtension.movement = { x: 0, y: 0 }; +}; +gdjs.evtsExt__MousePointerLock__onScenePostEvents.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__MousePointerLock__onScenePostEvents.userFunc0x1992370(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__MousePointerLock__onScenePostEvents.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__MousePointerLock__onScenePostEvents.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__MousePointerLock__onScenePostEvents.registeredGdjsCallbacks = []; +gdjs.evtsExt__MousePointerLock__onScenePostEvents.registeredGdjsCallbacks.push((runtimeScene) => { + gdjs.evtsExt__MousePointerLock__onScenePostEvents.func(runtimeScene, runtimeScene); +}) +gdjs.registerRuntimeScenePostEventsCallback(gdjs.evtsExt__MousePointerLock__onScenePostEvents.registeredGdjsCallbacks[gdjs.evtsExt__MousePointerLock__onScenePostEvents.registeredGdjsCallbacks.length - 1]); diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__mousepointerlock__requestpointerlock-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__mousepointerlock__requestpointerlock-func.js new file mode 100644 index 0000000..45cc980 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__mousepointerlock__requestpointerlock-func.js @@ -0,0 +1,84 @@ + +if (typeof gdjs.evtsExt__MousePointerLock__RequestPointerLock !== "undefined") { + gdjs.evtsExt__MousePointerLock__RequestPointerLock.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__MousePointerLock__RequestPointerLock = {}; + + +gdjs.evtsExt__MousePointerLock__RequestPointerLock.userFunc0x1992370 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +const canvas = runtimeScene.getGame().getRenderer().getCanvas(); +canvas.requestPointerLock(); +}; +gdjs.evtsExt__MousePointerLock__RequestPointerLock.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__MousePointerLock__RequestPointerLock.userFunc0x1992370(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__MousePointerLock__RequestPointerLock.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__MousePointerLock__RequestPointerLock.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__MousePointerLock__RequestPointerLock.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__panelspritebutton__buttonfsm.js b/desktop/apps/dezunkrr/gdjs-evtsext__panelspritebutton__buttonfsm.js new file mode 100644 index 0000000..f25d329 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__panelspritebutton__buttonfsm.js @@ -0,0 +1,1626 @@ + +gdjs.evtsExt__PanelSpriteButton__ButtonFSM = gdjs.evtsExt__PanelSpriteButton__ButtonFSM || {}; + +/** + * Behavior generated from Button finite state machine + */ +gdjs.evtsExt__PanelSpriteButton__ButtonFSM.ButtonFSM = class ButtonFSM extends gdjs.RuntimeBehavior { + constructor(instanceContainer, behaviorData, owner) { + super(instanceContainer, behaviorData, owner); + this._runtimeScene = instanceContainer; + + this._onceTriggers = new gdjs.OnceTriggers(); + this._behaviorData = {}; + this._sharedData = gdjs.evtsExt__PanelSpriteButton__ButtonFSM.ButtonFSM.getSharedData( + instanceContainer, + behaviorData.name + ); + + this._behaviorData.ShouldCheckHovering = true; + this._behaviorData.State = "Idle"; + this._behaviorData.TouchId = Number("0") || 0; + this._behaviorData.TouchIsInside = false; + this._behaviorData.MouseIsInside = false; + this._behaviorData.Index = Number("") || 0; + } + + // Hot-reload: + updateFromBehaviorData(oldBehaviorData, newBehaviorData) { + + if (oldBehaviorData.ShouldCheckHovering !== newBehaviorData.ShouldCheckHovering) + this._behaviorData.ShouldCheckHovering = newBehaviorData.ShouldCheckHovering; + if (oldBehaviorData.State !== newBehaviorData.State) + this._behaviorData.State = newBehaviorData.State; + if (oldBehaviorData.TouchId !== newBehaviorData.TouchId) + this._behaviorData.TouchId = newBehaviorData.TouchId; + if (oldBehaviorData.TouchIsInside !== newBehaviorData.TouchIsInside) + this._behaviorData.TouchIsInside = newBehaviorData.TouchIsInside; + if (oldBehaviorData.MouseIsInside !== newBehaviorData.MouseIsInside) + this._behaviorData.MouseIsInside = newBehaviorData.MouseIsInside; + if (oldBehaviorData.Index !== newBehaviorData.Index) + this._behaviorData.Index = newBehaviorData.Index; + + return true; + } + + // Properties: + + _getShouldCheckHovering() { + return this._behaviorData.ShouldCheckHovering !== undefined ? this._behaviorData.ShouldCheckHovering : true; + } + _setShouldCheckHovering(newValue) { + this._behaviorData.ShouldCheckHovering = newValue; + } + _toggleShouldCheckHovering() { + this._setShouldCheckHovering(!this._getShouldCheckHovering()); + } + _getState() { + return this._behaviorData.State !== undefined ? this._behaviorData.State : "Idle"; + } + _setState(newValue) { + this._behaviorData.State = newValue; + } + _getTouchId() { + return this._behaviorData.TouchId !== undefined ? this._behaviorData.TouchId : Number("0") || 0; + } + _setTouchId(newValue) { + this._behaviorData.TouchId = newValue; + } + _getTouchIsInside() { + return this._behaviorData.TouchIsInside !== undefined ? this._behaviorData.TouchIsInside : false; + } + _setTouchIsInside(newValue) { + this._behaviorData.TouchIsInside = newValue; + } + _toggleTouchIsInside() { + this._setTouchIsInside(!this._getTouchIsInside()); + } + _getMouseIsInside() { + return this._behaviorData.MouseIsInside !== undefined ? this._behaviorData.MouseIsInside : false; + } + _setMouseIsInside(newValue) { + this._behaviorData.MouseIsInside = newValue; + } + _toggleMouseIsInside() { + this._setMouseIsInside(!this._getMouseIsInside()); + } + _getIndex() { + return this._behaviorData.Index !== undefined ? this._behaviorData.Index : Number("") || 0; + } + _setIndex(newValue) { + this._behaviorData.Index = newValue; + } +} + +/** + * Shared data generated from Button finite state machine + */ +gdjs.evtsExt__PanelSpriteButton__ButtonFSM.ButtonFSM.SharedData = class ButtonFSMSharedData { + constructor(sharedData) { + + } + + // Shared properties: + +} + +gdjs.evtsExt__PanelSpriteButton__ButtonFSM.ButtonFSM.getSharedData = function(instanceContainer, behaviorName) { + if (!instanceContainer._PanelSpriteButton_ButtonFSMSharedData) { + const initialData = instanceContainer.getInitialSharedDataForBehavior( + behaviorName + ); + instanceContainer._PanelSpriteButton_ButtonFSMSharedData = new gdjs.evtsExt__PanelSpriteButton__ButtonFSM.ButtonFSM.SharedData( + initialData + ); + } + return instanceContainer._PanelSpriteButton_ButtonFSMSharedData; +} + +// Methods: +gdjs.evtsExt__PanelSpriteButton__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext = {}; +gdjs.evtsExt__PanelSpriteButton__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext.GDObjectObjects4_1final = []; + +gdjs.evtsExt__PanelSpriteButton__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext.GDObjectObjects1= []; +gdjs.evtsExt__PanelSpriteButton__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext.GDObjectObjects2= []; +gdjs.evtsExt__PanelSpriteButton__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext.GDObjectObjects3= []; +gdjs.evtsExt__PanelSpriteButton__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext.GDObjectObjects4= []; +gdjs.evtsExt__PanelSpriteButton__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext.GDObjectObjects5= []; + + +gdjs.evtsExt__PanelSpriteButton__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + + +} + + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__PanelSpriteButton__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext.GDObjectObjects3); +{for(var i = 0, len = gdjs.evtsExt__PanelSpriteButton__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext.GDObjectObjects3.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteButton__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext.GDObjectObjects3[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setMouseIsInside(false); +} +}} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__PanelSpriteButton__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext.GDObjectObjects3); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__PanelSpriteButton__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext.GDObjectObjects3.length;i 0 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__PanelSpriteButton__PanelSpriteButton.PanelSpriteButton.prototype.doStepPostEventsContext.GDObjectObjects3[k] = gdjs.evtsExt__PanelSpriteButton__PanelSpriteButton.PanelSpriteButton.prototype.doStepPostEventsContext.GDObjectObjects3[i]; + ++k; + } +} +gdjs.evtsExt__PanelSpriteButton__PanelSpriteButton.PanelSpriteButton.prototype.doStepPostEventsContext.GDObjectObjects3.length = k; +} +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__PanelSpriteButton__PanelSpriteButton.PanelSpriteButton.prototype.doStepPostEventsContext.GDHoveredObjects3 */ +/* Reuse gdjs.evtsExt__PanelSpriteButton__PanelSpriteButton.PanelSpriteButton.prototype.doStepPostEventsContext.GDObjectObjects3 */ +{for(var i = 0, len = gdjs.evtsExt__PanelSpriteButton__PanelSpriteButton.PanelSpriteButton.prototype.doStepPostEventsContext.GDHoveredObjects3.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteButton__PanelSpriteButton.PanelSpriteButton.prototype.doStepPostEventsContext.GDHoveredObjects3[i].getBehavior(eventsFunctionContext.getBehaviorName("Tween")).addObjectOpacityTween("Fadeout", 0, "linear", (( gdjs.evtsExt__PanelSpriteButton__PanelSpriteButton.PanelSpriteButton.prototype.doStepPostEventsContext.GDObjectObjects3.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteButton__PanelSpriteButton.PanelSpriteButton.prototype.doStepPostEventsContext.GDObjectObjects3[0]._getHoveredFadeOutDuration()) * 1000, false); +} +}} + +} + + +{ + +/* Reuse gdjs.evtsExt__PanelSpriteButton__PanelSpriteButton.PanelSpriteButton.prototype.doStepPostEventsContext.GDObjectObjects2 */ + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__PanelSpriteButton__PanelSpriteButton.PanelSpriteButton.prototype.doStepPostEventsContext.GDObjectObjects2.length;i 0 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.onCreatedContext.GDObjectObjects1[k] = gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.onCreatedContext.GDObjectObjects1[i]; + ++k; + } +} +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.onCreatedContext.GDObjectObjects1.length = k; +if (isConditionTrue_0) { +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.onCreatedContext.GDBufferObjects1.length = 0; + +{gdjs.evtTools.object.createObjectOnScene((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : runtimeScene), gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.onCreatedContext.mapOfGDgdjs_46evtsExt_95_95PanelSpriteContinuousBar_95_95PanelSpriteContinuousBar_46PanelSpriteContinuousBar_46prototype_46onCreatedContext_46GDBufferObjects1Objects, 0, 0, ""); +}{for(var i = 0, len = gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.onCreatedContext.GDBufferObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.onCreatedContext.GDBufferObjects1[i].setZOrder(2); +} +}} + +} + + +{ + + + +} + + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.onCreatedContext.GDLabelObjects1.length = 0; + +{gdjs.evtTools.object.createObjectOnScene((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : runtimeScene), gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.onCreatedContext.mapOfGDgdjs_46evtsExt_95_95PanelSpriteContinuousBar_95_95PanelSpriteContinuousBar_46PanelSpriteContinuousBar_46prototype_46onCreatedContext_46GDLabelObjects1Objects, 0, 0, ""); +}{for(var i = 0, len = gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.onCreatedContext.GDLabelObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.onCreatedContext.GDLabelObjects1[i].setZOrder(4); +} +}{for(var i = 0, len = gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.onCreatedContext.GDLabelObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.onCreatedContext.GDLabelObjects1[i].setTextAlignment("center"); +} +}{for(var i = 0, len = gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.onCreatedContext.GDLabelObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.onCreatedContext.GDLabelObjects1[i].setWrapping(true); +} +}} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.onCreatedContext.GDObjectObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.onCreatedContext.GDObjectObjects1.length;i= (( gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.doStepPostEventsContext.GDBufferObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.doStepPostEventsContext.GDBufferObjects1[0].getWidth()) ) { + isConditionTrue_0 = true; + gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.doStepPostEventsContext.GDFillBarObjects1[k] = gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.doStepPostEventsContext.GDFillBarObjects1[i]; + ++k; + } +} +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.doStepPostEventsContext.GDFillBarObjects1.length = k; +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.doStepPostEventsContext.GDBufferObjects1 */ +{for(var i = 0, len = gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.doStepPostEventsContext.GDBufferObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.doStepPostEventsContext.GDBufferObjects1[i].hide(); +} +}} + +} + + +}; + +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.doStepPostEvents = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._instanceContainer; +var thisObjectList = [this]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var thisGDLabelObjectsList = [...runtimeScene.getObjects("Label")]; +var GDLabelObjects = Hashtable.newFrom({"Label": thisGDLabelObjectsList}); +var thisGDFillBarObjectsList = [...runtimeScene.getObjects("FillBar")]; +var GDFillBarObjects = Hashtable.newFrom({"FillBar": thisGDFillBarObjectsList}); +var thisGDBufferObjectsList = [...runtimeScene.getObjects("Buffer")]; +var GDBufferObjects = Hashtable.newFrom({"Buffer": thisGDBufferObjectsList}); +var thisGDBackgroundObjectsList = [...runtimeScene.getObjects("Background")]; +var GDBackgroundObjects = Hashtable.newFrom({"Background": thisGDBackgroundObjectsList}); +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +, "Label": GDLabelObjects +, "FillBar": GDFillBarObjects +, "Buffer": GDBufferObjects +, "Background": GDBackgroundObjects +}, + _objectArraysMap: { +"Object": thisObjectList +, "Label": thisGDLabelObjectsList +, "FillBar": thisGDFillBarObjectsList +, "Buffer": thisGDBufferObjectsList +, "Background": thisGDBackgroundObjectsList +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.doStepPostEventsContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.doStepPostEventsContext.GDObjectObjects2.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.doStepPostEventsContext.GDLabelObjects1.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.doStepPostEventsContext.GDLabelObjects2.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.doStepPostEventsContext.GDFillBarObjects1.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.doStepPostEventsContext.GDFillBarObjects2.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.doStepPostEventsContext.GDBufferObjects1.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.doStepPostEventsContext.GDBufferObjects2.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.doStepPostEventsContext.GDBackgroundObjects1.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.doStepPostEventsContext.GDBackgroundObjects2.length = 0; + +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.doStepPostEventsContext.eventsList1(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext = {}; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects1= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects2= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDLabelObjects1= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDLabelObjects2= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDFillBarObjects1= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDFillBarObjects2= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDBufferObjects1= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDBufferObjects2= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDBackgroundObjects1= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDBackgroundObjects2= []; + + +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Background"), gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDBackgroundObjects1); +gdjs.copyArray(eventsFunctionContext.getObjects("FillBar"), gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDFillBarObjects1); +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDFillBarObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDFillBarObjects1[i].setPosition((( gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects1[0]._getBarLeftPadding()),(( gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects1[0]._getBarTopPadding())); +} +}{for(var i = 0, len = gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDFillBarObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDFillBarObjects1[i].setWidth((( gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects1[0].WidthForValue((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)))); +} +}{for(var i = 0, len = gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDFillBarObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDFillBarObjects1[i].setHeight(Math.round((( gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDBackgroundObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDBackgroundObjects1[0].getHeight()) - (( gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects1[0]._getBarTopPadding()) - (( gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects1[0]._getBarBottomPadding()))); +} +}} + +} + + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Buffer"), gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDBufferObjects1); +gdjs.copyArray(eventsFunctionContext.getObjects("FillBar"), gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDFillBarObjects1); +{for(var i = 0, len = gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDBufferObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDBufferObjects1[i].setPosition((( gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDFillBarObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDFillBarObjects1[0].getX()),(( gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDFillBarObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDFillBarObjects1[0].getY())); +} +}{for(var i = 0, len = gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDBufferObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDBufferObjects1[i].setWidth((( gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDFillBarObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDFillBarObjects1[0].getWidth())); +} +}{for(var i = 0, len = gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDBufferObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDBufferObjects1[i].setHeight((( gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDFillBarObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDFillBarObjects1[0].getHeight())); +} +}} + +} + + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Background"), gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDBackgroundObjects1); +gdjs.copyArray(eventsFunctionContext.getObjects("FillBar"), gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDFillBarObjects1); +gdjs.copyArray(eventsFunctionContext.getObjects("Label"), gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDLabelObjects1); +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDLabelObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDLabelObjects1[i].setPosition((( gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects1[0]._getBarLeftPadding()),(( gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects1[0]._getBarTopPadding())); +} +}{for(var i = 0, len = gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDLabelObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDLabelObjects1[i].setWrappingWidth((( gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects1[0].FullBarWidth((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)))); +} +}{for(var i = 0, len = gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDLabelObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDLabelObjects1[i].setCenterYInScene((( gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDFillBarObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDFillBarObjects1[0].getCenterYInScene())); +} +}{for(var i = 0, len = gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDLabelObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDLabelObjects1[i].setCenterXInScene((( gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDBackgroundObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDBackgroundObjects1[0].getCenterXInScene()) + ((( gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects1[0]._getBarLeftPadding()) - (( gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects1[0]._getBarRightPadding())) / 2); +} +}} + +} + + +}; + +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayout = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._instanceContainer; +var thisObjectList = [this]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var thisGDLabelObjectsList = [...runtimeScene.getObjects("Label")]; +var GDLabelObjects = Hashtable.newFrom({"Label": thisGDLabelObjectsList}); +var thisGDFillBarObjectsList = [...runtimeScene.getObjects("FillBar")]; +var GDFillBarObjects = Hashtable.newFrom({"FillBar": thisGDFillBarObjectsList}); +var thisGDBufferObjectsList = [...runtimeScene.getObjects("Buffer")]; +var GDBufferObjects = Hashtable.newFrom({"Buffer": thisGDBufferObjectsList}); +var thisGDBackgroundObjectsList = [...runtimeScene.getObjects("Background")]; +var GDBackgroundObjects = Hashtable.newFrom({"Background": thisGDBackgroundObjectsList}); +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +, "Label": GDLabelObjects +, "FillBar": GDFillBarObjects +, "Buffer": GDBufferObjects +, "Background": GDBackgroundObjects +}, + _objectArraysMap: { +"Object": thisObjectList +, "Label": thisGDLabelObjectsList +, "FillBar": thisGDFillBarObjectsList +, "Buffer": thisGDBufferObjectsList +, "Background": thisGDBackgroundObjectsList +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDObjectObjects2.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDLabelObjects1.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDLabelObjects2.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDFillBarObjects1.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDFillBarObjects2.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDBufferObjects1.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDBufferObjects2.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDBackgroundObjects1.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.GDBackgroundObjects2.length = 0; + +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.UpdateLayoutContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext = {}; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext.GDObjectObjects1= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext.GDObjectObjects2= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext.GDLabelObjects1= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext.GDLabelObjects2= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext.GDFillBarObjects1= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext.GDFillBarObjects2= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext.GDBufferObjects1= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext.GDBufferObjects2= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext.GDBackgroundObjects1= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext.GDBackgroundObjects2= []; + + +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("FillBar"), gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext.GDFillBarObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext.GDFillBarObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext.GDFillBarObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("ResourceBar")).Value((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))); }}} + +} + + +}; + +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.Value = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._instanceContainer; +var thisObjectList = [this]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var thisGDLabelObjectsList = [...runtimeScene.getObjects("Label")]; +var GDLabelObjects = Hashtable.newFrom({"Label": thisGDLabelObjectsList}); +var thisGDFillBarObjectsList = [...runtimeScene.getObjects("FillBar")]; +var GDFillBarObjects = Hashtable.newFrom({"FillBar": thisGDFillBarObjectsList}); +var thisGDBufferObjectsList = [...runtimeScene.getObjects("Buffer")]; +var GDBufferObjects = Hashtable.newFrom({"Buffer": thisGDBufferObjectsList}); +var thisGDBackgroundObjectsList = [...runtimeScene.getObjects("Background")]; +var GDBackgroundObjects = Hashtable.newFrom({"Background": thisGDBackgroundObjectsList}); +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +, "Label": GDLabelObjects +, "FillBar": GDFillBarObjects +, "Buffer": GDBufferObjects +, "Background": GDBackgroundObjects +}, + _objectArraysMap: { +"Object": thisObjectList +, "Label": thisGDLabelObjectsList +, "FillBar": thisGDFillBarObjectsList +, "Buffer": thisGDBufferObjectsList +, "Background": thisGDBackgroundObjectsList +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext.GDObjectObjects2.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext.GDLabelObjects1.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext.GDLabelObjects2.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext.GDFillBarObjects1.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext.GDFillBarObjects2.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext.GDBufferObjects1.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext.GDBufferObjects2.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext.GDBackgroundObjects1.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext.GDBackgroundObjects2.length = 0; + +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.ValueContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext = {}; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDObjectObjects1= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDObjectObjects2= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDLabelObjects1= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDLabelObjects2= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDFillBarObjects1= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDFillBarObjects2= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDBufferObjects1= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDBufferObjects2= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDBackgroundObjects1= []; +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDBackgroundObjects2= []; + + +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("FillBar"), gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDFillBarObjects1); +{for(var i = 0, len = gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDFillBarObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDFillBarObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("ResourceBar")).SetValue((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDObjectObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDObjectObjects1.length;i 0 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDObjectObjects1[k] = gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDObjectObjects1[i]; + ++k; + } +} +gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDObjectObjects1.length = k; +if (isConditionTrue_0) { +gdjs.copyArray(eventsFunctionContext.getObjects("FillBar"), gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDFillBarObjects1); +/* Reuse gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDObjectObjects1 */ +{for(var i = 0, len = gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDFillBarObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDFillBarObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Tween")).addObjectWidthTween("ChangeValue", (( gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDObjectObjects1[0].WidthForValue((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))), "linear", (( gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDObjectObjects1[0]._getEasingDuration()) * 1000, false); +} +}} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDObjectObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__PanelSpriteContinuousBar__PanelSpriteContinuousBar.PanelSpriteContinuousBar.prototype.SetValueContext.GDObjectObjects1.length;i= (gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.SetValueContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getPreviousHighValue()) ) { + isConditionTrue_0 = true; + gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.SetValueContext.GDObjectObjects1[k] = gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.SetValueContext.GDObjectObjects1[i]; + ++k; + } +} +gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.SetValueContext.GDObjectObjects1.length = k; +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.SetValueContext.GDObjectObjects1 */ +{for(var i = 0, len = gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.SetValueContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.SetValueContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).UpdatePreviousHighValue((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +}; + +gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.SetValue = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.SetValueContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.SetValueContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.SetValueContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.MaxValueContext = {}; +gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.MaxValueContext.GDObjectObjects1= []; +gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.MaxValueContext.GDObjectObjects2= []; + + +gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.MaxValueContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.MaxValueContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.MaxValueContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.MaxValueContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getMaxValue()); }}} + +} + + +}; + +gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.MaxValue = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.MaxValueContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.MaxValueContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.MaxValueContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.SetMaxValueContext = {}; +gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.SetMaxValueContext.GDObjectObjects1= []; +gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.SetMaxValueContext.GDObjectObjects2= []; + + +gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.SetMaxValueContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.SetMaxValueContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.SetMaxValueContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.SetMaxValueContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setMaxValue((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0)); +} +}} + +} + + +}; + +gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.SetMaxValue = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.SetMaxValueContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.SetMaxValueContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.SetMaxValueContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.IsEmptyContext = {}; +gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.IsEmptyContext.GDObjectObjects1= []; +gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.IsEmptyContext.GDObjectObjects2= []; + + +gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.IsEmptyContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.IsEmptyContext.GDObjectObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__PanelSpriteContinuousBar__ResourceBar.ResourceBar.prototype.IsEmptyContext.GDObjectObjects1.length;i 0.5 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.doStepPostEventsContext.GDLabelObjects1[k] = gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.doStepPostEventsContext.GDLabelObjects1[i]; + ++k; + } +} +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.doStepPostEventsContext.GDLabelObjects1.length = k; +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.doStepPostEventsContext.GDLabelObjects1 */ +{for(var i = 0, len = gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.doStepPostEventsContext.GDLabelObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.doStepPostEventsContext.GDLabelObjects1[i].hide(); +} +}{for(var i = 0, len = gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.doStepPostEventsContext.GDLabelObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.doStepPostEventsContext.GDLabelObjects1[i].removeTimer("HideBack"); +} +}} + +} + + +};gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.doStepPostEventsContext.eventsList3 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Background"), gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.doStepPostEventsContext.GDBackgroundObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.doStepPostEventsContext.GDBackgroundObjects1.length;i 0 ) { + isConditionTrue_0 = true; + gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateThumbPositionContext.GDFillBarObjects1[k] = gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateThumbPositionContext.GDFillBarObjects1[i]; + ++k; + } +} +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateThumbPositionContext.GDFillBarObjects1.length = k; +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateThumbPositionContext.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateThumbPosition = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._instanceContainer; +var thisObjectList = [this]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var thisGDLabelObjectsList = [...runtimeScene.getObjects("Label")]; +var GDLabelObjects = Hashtable.newFrom({"Label": thisGDLabelObjectsList}); +var thisGDThumbObjectsList = [...runtimeScene.getObjects("Thumb")]; +var GDThumbObjects = Hashtable.newFrom({"Thumb": thisGDThumbObjectsList}); +var thisGDFillBarObjectsList = [...runtimeScene.getObjects("FillBar")]; +var GDFillBarObjects = Hashtable.newFrom({"FillBar": thisGDFillBarObjectsList}); +var thisGDBackgroundObjectsList = [...runtimeScene.getObjects("Background")]; +var GDBackgroundObjects = Hashtable.newFrom({"Background": thisGDBackgroundObjectsList}); +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +, "Label": GDLabelObjects +, "Thumb": GDThumbObjects +, "FillBar": GDFillBarObjects +, "Background": GDBackgroundObjects +}, + _objectArraysMap: { +"Object": thisObjectList +, "Label": thisGDLabelObjectsList +, "Thumb": thisGDThumbObjectsList +, "FillBar": thisGDFillBarObjectsList +, "Background": thisGDBackgroundObjectsList +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateThumbPositionContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateThumbPositionContext.GDObjectObjects2.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateThumbPositionContext.GDObjectObjects3.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateThumbPositionContext.GDLabelObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateThumbPositionContext.GDLabelObjects2.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateThumbPositionContext.GDLabelObjects3.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateThumbPositionContext.GDThumbObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateThumbPositionContext.GDThumbObjects2.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateThumbPositionContext.GDThumbObjects3.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateThumbPositionContext.GDFillBarObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateThumbPositionContext.GDFillBarObjects2.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateThumbPositionContext.GDFillBarObjects3.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateThumbPositionContext.GDBackgroundObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateThumbPositionContext.GDBackgroundObjects2.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateThumbPositionContext.GDBackgroundObjects3.length = 0; + +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateThumbPositionContext.eventsList1(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext = {}; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext.GDObjectObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext.GDObjectObjects2= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext.GDLabelObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext.GDLabelObjects2= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext.GDThumbObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext.GDThumbObjects2= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext.GDFillBarObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext.GDFillBarObjects2= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext.GDBackgroundObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext.GDBackgroundObjects2= []; + + +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext.GDObjectObjects1[0]._getBarLeftPadding()); }}} + +} + + +}; + +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeft = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._instanceContainer; +var thisObjectList = [this]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var thisGDLabelObjectsList = [...runtimeScene.getObjects("Label")]; +var GDLabelObjects = Hashtable.newFrom({"Label": thisGDLabelObjectsList}); +var thisGDThumbObjectsList = [...runtimeScene.getObjects("Thumb")]; +var GDThumbObjects = Hashtable.newFrom({"Thumb": thisGDThumbObjectsList}); +var thisGDFillBarObjectsList = [...runtimeScene.getObjects("FillBar")]; +var GDFillBarObjects = Hashtable.newFrom({"FillBar": thisGDFillBarObjectsList}); +var thisGDBackgroundObjectsList = [...runtimeScene.getObjects("Background")]; +var GDBackgroundObjects = Hashtable.newFrom({"Background": thisGDBackgroundObjectsList}); +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +, "Label": GDLabelObjects +, "Thumb": GDThumbObjects +, "FillBar": GDFillBarObjects +, "Background": GDBackgroundObjects +}, + _objectArraysMap: { +"Object": thisObjectList +, "Label": thisGDLabelObjectsList +, "Thumb": thisGDThumbObjectsList +, "FillBar": thisGDFillBarObjectsList +, "Background": thisGDBackgroundObjectsList +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext.GDObjectObjects2.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext.GDLabelObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext.GDLabelObjects2.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext.GDThumbObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext.GDThumbObjects2.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext.GDFillBarObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext.GDFillBarObjects2.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext.GDBackgroundObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext.GDBackgroundObjects2.length = 0; + +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarLeftContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext = {}; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDObjectObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDObjectObjects2= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDLabelObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDLabelObjects2= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDThumbObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDThumbObjects2= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDFillBarObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDFillBarObjects2= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDBackgroundObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDBackgroundObjects2= []; + + +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Background"), gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDBackgroundObjects1); +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDBackgroundObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDBackgroundObjects1[0].getWidth()) - (( gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDObjectObjects1[0]._getBarRightPadding()); }}} + +} + + +}; + +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRight = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._instanceContainer; +var thisObjectList = [this]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var thisGDLabelObjectsList = [...runtimeScene.getObjects("Label")]; +var GDLabelObjects = Hashtable.newFrom({"Label": thisGDLabelObjectsList}); +var thisGDThumbObjectsList = [...runtimeScene.getObjects("Thumb")]; +var GDThumbObjects = Hashtable.newFrom({"Thumb": thisGDThumbObjectsList}); +var thisGDFillBarObjectsList = [...runtimeScene.getObjects("FillBar")]; +var GDFillBarObjects = Hashtable.newFrom({"FillBar": thisGDFillBarObjectsList}); +var thisGDBackgroundObjectsList = [...runtimeScene.getObjects("Background")]; +var GDBackgroundObjects = Hashtable.newFrom({"Background": thisGDBackgroundObjectsList}); +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +, "Label": GDLabelObjects +, "Thumb": GDThumbObjects +, "FillBar": GDFillBarObjects +, "Background": GDBackgroundObjects +}, + _objectArraysMap: { +"Object": thisObjectList +, "Label": thisGDLabelObjectsList +, "Thumb": thisGDThumbObjectsList +, "FillBar": thisGDFillBarObjectsList +, "Background": thisGDBackgroundObjectsList +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDObjectObjects2.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDLabelObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDLabelObjects2.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDThumbObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDThumbObjects2.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDFillBarObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDFillBarObjects2.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDBackgroundObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.GDBackgroundObjects2.length = 0; + +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarRightContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext = {}; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDObjectObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDObjectObjects2= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDLabelObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDLabelObjects2= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDThumbObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDThumbObjects2= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDFillBarObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDFillBarObjects2= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDBackgroundObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDBackgroundObjects2= []; + + +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Background"), gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDBackgroundObjects1); +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDBackgroundObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDBackgroundObjects1[0].getWidth()) - (( gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDObjectObjects1[0]._getBarLeftPadding()) - (( gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDObjectObjects1[0]._getBarRightPadding()); }}} + +} + + +}; + +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidth = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._instanceContainer; +var thisObjectList = [this]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var thisGDLabelObjectsList = [...runtimeScene.getObjects("Label")]; +var GDLabelObjects = Hashtable.newFrom({"Label": thisGDLabelObjectsList}); +var thisGDThumbObjectsList = [...runtimeScene.getObjects("Thumb")]; +var GDThumbObjects = Hashtable.newFrom({"Thumb": thisGDThumbObjectsList}); +var thisGDFillBarObjectsList = [...runtimeScene.getObjects("FillBar")]; +var GDFillBarObjects = Hashtable.newFrom({"FillBar": thisGDFillBarObjectsList}); +var thisGDBackgroundObjectsList = [...runtimeScene.getObjects("Background")]; +var GDBackgroundObjects = Hashtable.newFrom({"Background": thisGDBackgroundObjectsList}); +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +, "Label": GDLabelObjects +, "Thumb": GDThumbObjects +, "FillBar": GDFillBarObjects +, "Background": GDBackgroundObjects +}, + _objectArraysMap: { +"Object": thisObjectList +, "Label": thisGDLabelObjectsList +, "Thumb": thisGDThumbObjectsList +, "FillBar": thisGDFillBarObjectsList +, "Background": thisGDBackgroundObjectsList +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDObjectObjects2.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDLabelObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDLabelObjects2.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDThumbObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDThumbObjects2.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDFillBarObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDFillBarObjects2.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDBackgroundObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.GDBackgroundObjects2.length = 0; + +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.FullBarWidthContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext = {}; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDObjectObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDObjectObjects2= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDLabelObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDLabelObjects2= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDThumbObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDThumbObjects2= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDFillBarObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDFillBarObjects2= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDBackgroundObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDBackgroundObjects2= []; + + +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + + +} + + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDObjectObjects1[i].SetMinValue((gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDObjectObjects1[i]._getMinValue()), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}{for(var i = 0, len = gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDObjectObjects1[i].SetMaxValue((gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDObjectObjects1[i]._getMaxValue()), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}{for(var i = 0, len = gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDObjectObjects1[i].SetStepSize((gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDObjectObjects1[i]._getStepSize()), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +}; + +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfiguration = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._instanceContainer; +var thisObjectList = [this]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var thisGDLabelObjectsList = [...runtimeScene.getObjects("Label")]; +var GDLabelObjects = Hashtable.newFrom({"Label": thisGDLabelObjectsList}); +var thisGDThumbObjectsList = [...runtimeScene.getObjects("Thumb")]; +var GDThumbObjects = Hashtable.newFrom({"Thumb": thisGDThumbObjectsList}); +var thisGDFillBarObjectsList = [...runtimeScene.getObjects("FillBar")]; +var GDFillBarObjects = Hashtable.newFrom({"FillBar": thisGDFillBarObjectsList}); +var thisGDBackgroundObjectsList = [...runtimeScene.getObjects("Background")]; +var GDBackgroundObjects = Hashtable.newFrom({"Background": thisGDBackgroundObjectsList}); +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +, "Label": GDLabelObjects +, "Thumb": GDThumbObjects +, "FillBar": GDFillBarObjects +, "Background": GDBackgroundObjects +}, + _objectArraysMap: { +"Object": thisObjectList +, "Label": thisGDLabelObjectsList +, "Thumb": thisGDThumbObjectsList +, "FillBar": thisGDFillBarObjectsList +, "Background": thisGDBackgroundObjectsList +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDObjectObjects2.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDLabelObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDLabelObjects2.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDThumbObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDThumbObjects2.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDFillBarObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDFillBarObjects2.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDBackgroundObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.GDBackgroundObjects2.length = 0; + +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.UpdateSliderConfigurationContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext = {}; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDObjectObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDObjectObjects2= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDLabelObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDLabelObjects2= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDThumbObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDThumbObjects2= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDFillBarObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDFillBarObjects2= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDBackgroundObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDBackgroundObjects2= []; + + +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("ShouldActivate") : false); +} +if (isConditionTrue_0) { +gdjs.copyArray(eventsFunctionContext.getObjects("Background"), gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDBackgroundObjects1); +gdjs.copyArray(eventsFunctionContext.getObjects("Thumb"), gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDThumbObjects1); +{for(var i = 0, len = gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDThumbObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDThumbObjects1[i].activateBehavior(eventsFunctionContext.getBehaviorName("Draggable"), true); +} +}{for(var i = 0, len = gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDBackgroundObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDBackgroundObjects1[i].activateBehavior(eventsFunctionContext.getBehaviorName("ButtonFSM"), true); +} +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = !(typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("ShouldActivate") : false); +} +if (isConditionTrue_0) { +gdjs.copyArray(eventsFunctionContext.getObjects("Background"), gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDBackgroundObjects1); +gdjs.copyArray(eventsFunctionContext.getObjects("Label"), gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDLabelObjects1); +gdjs.copyArray(eventsFunctionContext.getObjects("Thumb"), gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDThumbObjects1); +{for(var i = 0, len = gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDThumbObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDThumbObjects1[i].activateBehavior(eventsFunctionContext.getBehaviorName("Draggable"), false); +} +}{for(var i = 0, len = gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDBackgroundObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDBackgroundObjects1[i].activateBehavior(eventsFunctionContext.getBehaviorName("ButtonFSM"), false); +} +}{for(var i = 0, len = gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDLabelObjects1.length ;i < len;++i) { + gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDLabelObjects1[i].hide(); +} +}} + +} + + +}; + +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.Activate = function(ShouldActivate, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._instanceContainer; +var thisObjectList = [this]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var thisGDLabelObjectsList = [...runtimeScene.getObjects("Label")]; +var GDLabelObjects = Hashtable.newFrom({"Label": thisGDLabelObjectsList}); +var thisGDThumbObjectsList = [...runtimeScene.getObjects("Thumb")]; +var GDThumbObjects = Hashtable.newFrom({"Thumb": thisGDThumbObjectsList}); +var thisGDFillBarObjectsList = [...runtimeScene.getObjects("FillBar")]; +var GDFillBarObjects = Hashtable.newFrom({"FillBar": thisGDFillBarObjectsList}); +var thisGDBackgroundObjectsList = [...runtimeScene.getObjects("Background")]; +var GDBackgroundObjects = Hashtable.newFrom({"Background": thisGDBackgroundObjectsList}); +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +, "Label": GDLabelObjects +, "Thumb": GDThumbObjects +, "FillBar": GDFillBarObjects +, "Background": GDBackgroundObjects +}, + _objectArraysMap: { +"Object": thisObjectList +, "Label": thisGDLabelObjectsList +, "Thumb": thisGDThumbObjectsList +, "FillBar": thisGDFillBarObjectsList +, "Background": thisGDBackgroundObjectsList +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ShouldActivate") return ShouldActivate; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDObjectObjects2.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDLabelObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDLabelObjects2.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDThumbObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDThumbObjects2.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDFillBarObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDFillBarObjects2.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDBackgroundObjects1.length = 0; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.GDBackgroundObjects2.length = 0; + +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.ActivateContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.IsActivatedContext = {}; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.IsActivatedContext.GDObjectObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.IsActivatedContext.GDObjectObjects2= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.IsActivatedContext.GDLabelObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.IsActivatedContext.GDLabelObjects2= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.IsActivatedContext.GDThumbObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.IsActivatedContext.GDThumbObjects2= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.IsActivatedContext.GDFillBarObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.IsActivatedContext.GDFillBarObjects2= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.IsActivatedContext.GDBackgroundObjects1= []; +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.IsActivatedContext.GDBackgroundObjects2= []; + + +gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.IsActivatedContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Background"), gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.IsActivatedContext.GDBackgroundObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__PanelSpriteSlider__PanelSpriteSlider.PanelSpriteSlider.prototype.IsActivatedContext.GDBackgroundObjects1.length;i + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Physics3dExtension__AnimateBullets = {}; +gdjs.evtsExt__Physics3dExtension__AnimateBullets.GDTargetObjects1= []; + + +gdjs.evtsExt__Physics3dExtension__AnimateBullets.userFunc0x1544878 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +if (!window.balls) { + window.balls = []; +} + +if (!window.ballMeshes) { + window.ballMeshes = []; +} + +// Update ball positions +for(var i=0; i + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Physics3dExtension__CreateBullet = {}; +gdjs.evtsExt__Physics3dExtension__CreateBullet.GDSteveObjects1= []; + + +gdjs.evtsExt__Physics3dExtension__CreateBullet.userFunc0x13e7f88 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + return; +} + +if (!window.balls) { + window.balls = []; +} + +if (!window.ballMeshes) { + window.ballMeshes = []; +} + +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Camera = gdjs.__WithThreeJS.get("Camera"); +const Renderer = gdjs.__WithThreeJS.get("Renderer"); +const World = gdjs.__Physics3DExtension.get("World"); +const Size = eventsFunctionContext.getArgument("Size"); +const Force = eventsFunctionContext.getArgument("Force"); + +var ballShape = new CANNON.Sphere(Size); +var ballGeometry = new THREE.SphereGeometry(ballShape.radius, 32, 32); +var shootDirection = new THREE.Vector3( 0,0, -1 ); // infront of the player +shootDirection.applyQuaternion( Camera.quaternion ); +var shootVelo = Force; + +var behaviorName = objects[0].getVariables().get("Physics3dBehavior").getAsString(); +var Physics3dBehavior = objects[0].getBehavior(behaviorName); +var sphereBody = Physics3dBehavior.body; +var sphereShape = Physics3dBehavior.shape; + +var x = sphereBody.position.x; +var y = sphereBody.position.y; +var z = sphereBody.position.z; +var ballBody = new CANNON.Body({ mass: 0.5 }); +ballBody.addShape(ballShape); +const material = new THREE.MeshLambertMaterial( { color: 0xdddddd } ); +var ballMesh = new THREE.Mesh( ballGeometry, material ); +World.add(ballBody); +Scene.add(ballMesh); +ballMesh.castShadow = true; +ballMesh.receiveShadow = true; +balls.push(ballBody); +ballMeshes.push(ballMesh); + +ballBody.velocity.set( shootDirection.x * shootVelo, + shootDirection.y * shootVelo, + shootDirection.z * shootVelo); + +// Move the ball outside the player sphere +x += shootDirection.x * (sphereShape.radius*1.02 + ballShape.radius); +y += shootDirection.y * (sphereShape.radius*1.02 + ballShape.radius); +z += shootDirection.z * (sphereShape.radius*1.02 + ballShape.radius); +ballBody.position.set(x,y,z); +ballMesh.position.set(x,y,z); +}; +gdjs.evtsExt__Physics3dExtension__CreateBullet.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Steve"), gdjs.evtsExt__Physics3dExtension__CreateBullet.GDSteveObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__CreateBullet.GDSteveObjects1); +gdjs.evtsExt__Physics3dExtension__CreateBullet.userFunc0x13e7f88(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__CreateBullet.func = function(runtimeScene, Force, Size, Steve, PhysicsEnginePlayerController, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +"Steve": Steve +}, + _objectArraysMap: { +"Steve": gdjs.objectsListsToArray(Steve) +}, + _behaviorNamesMap: { +"PhysicsEnginePlayerController": PhysicsEnginePlayerController +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Force") return Force; +if (argName === "Size") return Size; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + +gdjs.evtsExt__Physics3dExtension__CreateBullet.GDSteveObjects1.length = 0; + +gdjs.evtsExt__Physics3dExtension__CreateBullet.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__Physics3dExtension__CreateBullet.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__createworld-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__createworld-func.js new file mode 100644 index 0000000..4fe72c1 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__createworld-func.js @@ -0,0 +1,114 @@ + +if (typeof gdjs.evtsExt__Physics3dExtension__CreateWorld !== "undefined") { + gdjs.evtsExt__Physics3dExtension__CreateWorld.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Physics3dExtension__CreateWorld = {}; + + +gdjs.evtsExt__Physics3dExtension__CreateWorld.userFunc0x13f3a20 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if(!CANNON) { + console.log("!") + return; +} + +const world = new CANNON.World() +world.gravity.set(0, eventsFunctionContext.getArgument("Gravity")*-1, 0); + +// Enable collision detection +world.collisionResponse = true; + +gdjs.__Physics3DExtension.set("World", world); + +runtimeScene.getVariables().get("__PhysicsEngine3D").getChild("WorldInitiated").setNumber(1); +}; +gdjs.evtsExt__Physics3dExtension__CreateWorld.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Physics3dExtension__CreateWorld.userFunc0x13f3a20(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +};gdjs.evtsExt__Physics3dExtension__CreateWorld.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.getVariableNumber(runtimeScene.getScene().getVariables().get("__PhysicsEngine3D").getChild("WorldInitiated")) == 0; +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__Physics3dExtension__CreateWorld.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__CreateWorld.func = function(runtimeScene, Gravity, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Gravity") return Gravity; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Physics3dExtension__CreateWorld.eventsList1(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__Physics3dExtension__CreateWorld.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__explosionatposition-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__explosionatposition-func.js new file mode 100644 index 0000000..fc10e49 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__explosionatposition-func.js @@ -0,0 +1,132 @@ + +if (typeof gdjs.evtsExt__Physics3dExtension__ExplosionAtPosition !== "undefined") { + gdjs.evtsExt__Physics3dExtension__ExplosionAtPosition.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Physics3dExtension__ExplosionAtPosition = {}; +gdjs.evtsExt__Physics3dExtension__ExplosionAtPosition.GDBlocksObjects1= []; +gdjs.evtsExt__Physics3dExtension__ExplosionAtPosition.GDBlocksObjects2= []; + + +gdjs.evtsExt__Physics3dExtension__ExplosionAtPosition.userFunc0x14c1a60 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +// define the position and radius of the explosion +const x = eventsFunctionContext.getArgument("X"); +const y = eventsFunctionContext.getArgument("Y"); +const z = eventsFunctionContext.getArgument("Z"); + +var explosionPosition = new CANNON.Vec3(x, y, z); +var explosionRadius = eventsFunctionContext.getArgument("Radius"); +var explosionForce = eventsFunctionContext.getArgument("Force"); + +// loop through all objects in the world +objects.forEach(object => { + var behaviorName = object.getVariables().get("Physics3dBehavior").getAsString(); + var Physics3dBehavior = object.getBehavior(behaviorName); + + var body = Physics3dBehavior.body; + // calculate the distance from the object to the explosion + var distance = body.position.distanceTo(explosionPosition); + // check if the object is within the explosion radius + if (distance < explosionRadius) { + // calculate the direction of the impulse force + var impulseDirection = body.position.vsub(explosionPosition); + impulseDirection.normalize(); + // apply the impulse force to the object + body.applyImpulse(impulseDirection.scale(explosionForce), body.position); + } +}); +}; +gdjs.evtsExt__Physics3dExtension__ExplosionAtPosition.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Blocks"), gdjs.evtsExt__Physics3dExtension__ExplosionAtPosition.GDBlocksObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__ExplosionAtPosition.GDBlocksObjects1); +gdjs.evtsExt__Physics3dExtension__ExplosionAtPosition.userFunc0x14c1a60(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__ExplosionAtPosition.func = function(runtimeScene, X, Y, Z, Blocks, Force, Radius, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +"Blocks": Blocks +}, + _objectArraysMap: { +"Blocks": gdjs.objectsListsToArray(Blocks) +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "X") return X; +if (argName === "Y") return Y; +if (argName === "Z") return Z; +if (argName === "Force") return Force; +if (argName === "Radius") return Radius; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + +gdjs.evtsExt__Physics3dExtension__ExplosionAtPosition.GDBlocksObjects1.length = 0; +gdjs.evtsExt__Physics3dExtension__ExplosionAtPosition.GDBlocksObjects2.length = 0; + +gdjs.evtsExt__Physics3dExtension__ExplosionAtPosition.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__Physics3dExtension__ExplosionAtPosition.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__loadgltfloaderlibrary-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__loadgltfloaderlibrary-func.js new file mode 100644 index 0000000..a360bc2 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__loadgltfloaderlibrary-func.js @@ -0,0 +1,4183 @@ + +if (typeof gdjs.evtsExt__Physics3dExtension__LoadGLTFLoaderLibrary !== "undefined") { + gdjs.evtsExt__Physics3dExtension__LoadGLTFLoaderLibrary.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Physics3dExtension__LoadGLTFLoaderLibrary = {}; + + +gdjs.evtsExt__Physics3dExtension__LoadGLTFLoaderLibrary.userFunc0x15341d0 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if(!THREE) return; +if(THREE.GLTFLoader) return; +( function () { + + class GLTFLoader extends THREE.Loader { + + constructor( manager ) { + + super( manager ); + this.dracoLoader = null; + this.ktx2Loader = null; + this.meshoptDecoder = null; + this.pluginCallbacks = []; + this.register( function ( parser ) { + + return new GLTFMaterialsClearcoatExtension( parser ); + + } ); + this.register( function ( parser ) { + + return new GLTFTextureBasisUExtension( parser ); + + } ); + this.register( function ( parser ) { + + return new GLTFTextureWebPExtension( parser ); + + } ); + this.register( function ( parser ) { + + return new GLTFMaterialsSheenExtension( parser ); + + } ); + this.register( function ( parser ) { + + return new GLTFMaterialsTransmissionExtension( parser ); + + } ); + this.register( function ( parser ) { + + return new GLTFMaterialsVolumeExtension( parser ); + + } ); + this.register( function ( parser ) { + + return new GLTFMaterialsIorExtension( parser ); + + } ); + this.register( function ( parser ) { + + return new GLTFMaterialsEmissiveStrengthExtension( parser ); + + } ); + this.register( function ( parser ) { + + return new GLTFMaterialsSpecularExtension( parser ); + + } ); + this.register( function ( parser ) { + + return new GLTFMaterialsIridescenceExtension( parser ); + + } ); + this.register( function ( parser ) { + + return new GLTFLightsExtension( parser ); + + } ); + this.register( function ( parser ) { + + return new GLTFMeshoptCompression( parser ); + + } ); + this.register( function ( parser ) { + + return new GLTFMeshGpuInstancing( parser ); + + } ); + + } + load( url, onLoad, onProgress, onError ) { + + const scope = this; + let resourcePath; + if ( this.resourcePath !== '' ) { + + resourcePath = this.resourcePath; + + } else if ( this.path !== '' ) { + + resourcePath = this.path; + + } else { + + resourcePath = THREE.LoaderUtils.extractUrlBase( url ); + + } + + // Tells the LoadingManager to track an extra item, which resolves after + // the model is fully loaded. This means the count of items loaded will + // be incorrect, but ensures manager.onLoad() does not fire early. + this.manager.itemStart( url ); + const _onError = function ( e ) { + + if ( onError ) { + + onError( e ); + + } else { + + console.error( e ); + + } + + scope.manager.itemError( url ); + scope.manager.itemEnd( url ); + + }; + + const loader = new THREE.FileLoader( this.manager ); + loader.setPath( this.path ); + loader.setResponseType( 'arraybuffer' ); + loader.setRequestHeader( this.requestHeader ); + loader.setWithCredentials( this.withCredentials ); + loader.load( url, function ( data ) { + + try { + + scope.parse( data, resourcePath, function ( gltf ) { + + onLoad( gltf ); + scope.manager.itemEnd( url ); + + }, _onError ); + + } catch ( e ) { + + _onError( e ); + + } + + }, onProgress, _onError ); + + } + setDRACOLoader( dracoLoader ) { + + this.dracoLoader = dracoLoader; + return this; + + } + setDDSLoader() { + + throw new Error( 'THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".' ); + + } + setKTX2Loader( ktx2Loader ) { + + this.ktx2Loader = ktx2Loader; + return this; + + } + setMeshoptDecoder( meshoptDecoder ) { + + this.meshoptDecoder = meshoptDecoder; + return this; + + } + register( callback ) { + + if ( this.pluginCallbacks.indexOf( callback ) === - 1 ) { + + this.pluginCallbacks.push( callback ); + + } + + return this; + + } + unregister( callback ) { + + if ( this.pluginCallbacks.indexOf( callback ) !== - 1 ) { + + this.pluginCallbacks.splice( this.pluginCallbacks.indexOf( callback ), 1 ); + + } + + return this; + + } + parse( data, path, onLoad, onError ) { + + let json; + const extensions = {}; + const plugins = {}; + if ( typeof data === 'string' ) { + + json = JSON.parse( data ); + + } else if ( data instanceof ArrayBuffer ) { + + const magic = THREE.LoaderUtils.decodeText( new Uint8Array( data, 0, 4 ) ); + if ( magic === BINARY_EXTENSION_HEADER_MAGIC ) { + + try { + + extensions[ EXTENSIONS.KHR_BINARY_GLTF ] = new GLTFBinaryExtension( data ); + + } catch ( error ) { + + if ( onError ) onError( error ); + return; + + } + + json = JSON.parse( extensions[ EXTENSIONS.KHR_BINARY_GLTF ].content ); + + } else { + + json = JSON.parse( THREE.LoaderUtils.decodeText( new Uint8Array( data ) ) ); + + } + + } else { + + json = data; + + } + + if ( json.asset === undefined || json.asset.version[ 0 ] < 2 ) { + + if ( onError ) onError( new Error( 'THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.' ) ); + return; + + } + + const parser = new GLTFParser( json, { + path: path || this.resourcePath || '', + crossOrigin: this.crossOrigin, + requestHeader: this.requestHeader, + manager: this.manager, + ktx2Loader: this.ktx2Loader, + meshoptDecoder: this.meshoptDecoder + } ); + parser.fileLoader.setRequestHeader( this.requestHeader ); + for ( let i = 0; i < this.pluginCallbacks.length; i ++ ) { + + const plugin = this.pluginCallbacks[ i ]( parser ); + plugins[ plugin.name ] = plugin; + + // Workaround to avoid determining as unknown extension + // in addUnknownExtensionsToUserData(). + // Remove this workaround if we move all the existing + // extension handlers to plugin system + extensions[ plugin.name ] = true; + + } + + if ( json.extensionsUsed ) { + + for ( let i = 0; i < json.extensionsUsed.length; ++ i ) { + + const extensionName = json.extensionsUsed[ i ]; + const extensionsRequired = json.extensionsRequired || []; + switch ( extensionName ) { + + case EXTENSIONS.KHR_MATERIALS_UNLIT: + extensions[ extensionName ] = new GLTFMaterialsUnlitExtension(); + break; + case EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: + extensions[ extensionName ] = new GLTFMaterialsPbrSpecularGlossinessExtension(); + break; + case EXTENSIONS.KHR_DRACO_MESH_COMPRESSION: + extensions[ extensionName ] = new GLTFDracoMeshCompressionExtension( json, this.dracoLoader ); + break; + case EXTENSIONS.KHR_TEXTURE_TRANSFORM: + extensions[ extensionName ] = new GLTFTextureTransformExtension(); + break; + case EXTENSIONS.KHR_MESH_QUANTIZATION: + extensions[ extensionName ] = new GLTFMeshQuantizationExtension(); + break; + default: + if ( extensionsRequired.indexOf( extensionName ) >= 0 && plugins[ extensionName ] === undefined ) { + + console.warn( 'THREE.GLTFLoader: Unknown extension "' + extensionName + '".' ); + + } + + } + + } + + } + + parser.setExtensions( extensions ); + parser.setPlugins( plugins ); + parser.parse( onLoad, onError ); + + } + parseAsync( data, path ) { + + const scope = this; + return new Promise( function ( resolve, reject ) { + + scope.parse( data, path, resolve, reject ); + + } ); + + } + + } + + /* GLTFREGISTRY */ + + function GLTFRegistry() { + + let objects = {}; + return { + get: function ( key ) { + + return objects[ key ]; + + }, + add: function ( key, object ) { + + objects[ key ] = object; + + }, + remove: function ( key ) { + + delete objects[ key ]; + + }, + removeAll: function () { + + objects = {}; + + } + }; + + } + + /*********************************/ + /********** EXTENSIONS ***********/ + /*********************************/ + + const EXTENSIONS = { + KHR_BINARY_GLTF: 'KHR_binary_glTF', + KHR_DRACO_MESH_COMPRESSION: 'KHR_draco_mesh_compression', + KHR_LIGHTS_PUNCTUAL: 'KHR_lights_punctual', + KHR_MATERIALS_CLEARCOAT: 'KHR_materials_clearcoat', + KHR_MATERIALS_IOR: 'KHR_materials_ior', + KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: 'KHR_materials_pbrSpecularGlossiness', + KHR_MATERIALS_SHEEN: 'KHR_materials_sheen', + KHR_MATERIALS_SPECULAR: 'KHR_materials_specular', + KHR_MATERIALS_TRANSMISSION: 'KHR_materials_transmission', + KHR_MATERIALS_IRIDESCENCE: 'KHR_materials_iridescence', + KHR_MATERIALS_UNLIT: 'KHR_materials_unlit', + KHR_MATERIALS_VOLUME: 'KHR_materials_volume', + KHR_TEXTURE_BASISU: 'KHR_texture_basisu', + KHR_TEXTURE_TRANSFORM: 'KHR_texture_transform', + KHR_MESH_QUANTIZATION: 'KHR_mesh_quantization', + KHR_MATERIALS_EMISSIVE_STRENGTH: 'KHR_materials_emissive_strength', + EXT_TEXTURE_WEBP: 'EXT_texture_webp', + EXT_MESHOPT_COMPRESSION: 'EXT_meshopt_compression', + EXT_MESH_GPU_INSTANCING: 'EXT_mesh_gpu_instancing' + }; + + /** + * Punctual Lights Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_lights_punctual + */ + class GLTFLightsExtension { + + constructor( parser ) { + + this.parser = parser; + this.name = EXTENSIONS.KHR_LIGHTS_PUNCTUAL; + + // THREE.Object3D instance caches + this.cache = { + refs: {}, + uses: {} + }; + + } + _markDefs() { + + const parser = this.parser; + const nodeDefs = this.parser.json.nodes || []; + for ( let nodeIndex = 0, nodeLength = nodeDefs.length; nodeIndex < nodeLength; nodeIndex ++ ) { + + const nodeDef = nodeDefs[ nodeIndex ]; + if ( nodeDef.extensions && nodeDef.extensions[ this.name ] && nodeDef.extensions[ this.name ].light !== undefined ) { + + parser._addNodeRef( this.cache, nodeDef.extensions[ this.name ].light ); + + } + + } + + } + _loadLight( lightIndex ) { + + const parser = this.parser; + const cacheKey = 'light:' + lightIndex; + let dependency = parser.cache.get( cacheKey ); + if ( dependency ) return dependency; + const json = parser.json; + const extensions = json.extensions && json.extensions[ this.name ] || {}; + const lightDefs = extensions.lights || []; + const lightDef = lightDefs[ lightIndex ]; + let lightNode; + const color = new THREE.Color( 0xffffff ); + if ( lightDef.color !== undefined ) color.fromArray( lightDef.color ); + const range = lightDef.range !== undefined ? lightDef.range : 0; + switch ( lightDef.type ) { + + case 'directional': + lightNode = new THREE.DirectionalLight( color ); + lightNode.target.position.set( 0, 0, - 1 ); + lightNode.add( lightNode.target ); + break; + case 'point': + lightNode = new THREE.PointLight( color ); + lightNode.distance = range; + break; + case 'spot': + lightNode = new THREE.SpotLight( color ); + lightNode.distance = range; + // Handle spotlight properties. + lightDef.spot = lightDef.spot || {}; + lightDef.spot.innerConeAngle = lightDef.spot.innerConeAngle !== undefined ? lightDef.spot.innerConeAngle : 0; + lightDef.spot.outerConeAngle = lightDef.spot.outerConeAngle !== undefined ? lightDef.spot.outerConeAngle : Math.PI / 4.0; + lightNode.angle = lightDef.spot.outerConeAngle; + lightNode.penumbra = 1.0 - lightDef.spot.innerConeAngle / lightDef.spot.outerConeAngle; + lightNode.target.position.set( 0, 0, - 1 ); + lightNode.add( lightNode.target ); + break; + default: + throw new Error( 'THREE.GLTFLoader: Unexpected light type: ' + lightDef.type ); + + } + + // Some lights (e.g. spot) default to a position other than the origin. Reset the position + // here, because node-level parsing will only override position if explicitly specified. + lightNode.position.set( 0, 0, 0 ); + lightNode.decay = 2; + if ( lightDef.intensity !== undefined ) lightNode.intensity = lightDef.intensity; + lightNode.name = parser.createUniqueName( lightDef.name || 'light_' + lightIndex ); + dependency = Promise.resolve( lightNode ); + parser.cache.add( cacheKey, dependency ); + return dependency; + + } + createNodeAttachment( nodeIndex ) { + + const self = this; + const parser = this.parser; + const json = parser.json; + const nodeDef = json.nodes[ nodeIndex ]; + const lightDef = nodeDef.extensions && nodeDef.extensions[ this.name ] || {}; + const lightIndex = lightDef.light; + if ( lightIndex === undefined ) return null; + return this._loadLight( lightIndex ).then( function ( light ) { + + return parser._getNodeRef( self.cache, lightIndex, light ); + + } ); + + } + + } + + /** + * Unlit Materials Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit + */ + class GLTFMaterialsUnlitExtension { + + constructor() { + + this.name = EXTENSIONS.KHR_MATERIALS_UNLIT; + + } + getMaterialType() { + + return THREE.MeshBasicMaterial; + + } + extendParams( materialParams, materialDef, parser ) { + + const pending = []; + materialParams.color = new THREE.Color( 1.0, 1.0, 1.0 ); + materialParams.opacity = 1.0; + const metallicRoughness = materialDef.pbrMetallicRoughness; + if ( metallicRoughness ) { + + if ( Array.isArray( metallicRoughness.baseColorFactor ) ) { + + const array = metallicRoughness.baseColorFactor; + materialParams.color.fromArray( array ); + materialParams.opacity = array[ 3 ]; + + } + + if ( metallicRoughness.baseColorTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'map', metallicRoughness.baseColorTexture, THREE.sRGBEncoding ) ); + + } + + } + + return Promise.all( pending ); + + } + + } + + /** + * Materials Emissive Strength Extension + * + * Specification: https://github.com/KhronosGroup/glTF/blob/5768b3ce0ef32bc39cdf1bef10b948586635ead3/extensions/2.0/Khronos/KHR_materials_emissive_strength/README.md + */ + class GLTFMaterialsEmissiveStrengthExtension { + + constructor( parser ) { + + this.parser = parser; + this.name = EXTENSIONS.KHR_MATERIALS_EMISSIVE_STRENGTH; + + } + extendMaterialParams( materialIndex, materialParams ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) { + + return Promise.resolve(); + + } + + const emissiveStrength = materialDef.extensions[ this.name ].emissiveStrength; + if ( emissiveStrength !== undefined ) { + + materialParams.emissiveIntensity = emissiveStrength; + + } + + return Promise.resolve(); + + } + + } + + /** + * Clearcoat Materials Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_clearcoat + */ + class GLTFMaterialsClearcoatExtension { + + constructor( parser ) { + + this.parser = parser; + this.name = EXTENSIONS.KHR_MATERIALS_CLEARCOAT; + + } + getMaterialType( materialIndex ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null; + return THREE.MeshPhysicalMaterial; + + } + extendMaterialParams( materialIndex, materialParams ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) { + + return Promise.resolve(); + + } + + const pending = []; + const extension = materialDef.extensions[ this.name ]; + if ( extension.clearcoatFactor !== undefined ) { + + materialParams.clearcoat = extension.clearcoatFactor; + + } + + if ( extension.clearcoatTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'clearcoatMap', extension.clearcoatTexture ) ); + + } + + if ( extension.clearcoatRoughnessFactor !== undefined ) { + + materialParams.clearcoatRoughness = extension.clearcoatRoughnessFactor; + + } + + if ( extension.clearcoatRoughnessTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'clearcoatRoughnessMap', extension.clearcoatRoughnessTexture ) ); + + } + + if ( extension.clearcoatNormalTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'clearcoatNormalMap', extension.clearcoatNormalTexture ) ); + if ( extension.clearcoatNormalTexture.scale !== undefined ) { + + const scale = extension.clearcoatNormalTexture.scale; + materialParams.clearcoatNormalScale = new THREE.Vector2( scale, scale ); + + } + + } + + return Promise.all( pending ); + + } + + } + + /** + * Iridescence Materials Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_iridescence + */ + class GLTFMaterialsIridescenceExtension { + + constructor( parser ) { + + this.parser = parser; + this.name = EXTENSIONS.KHR_MATERIALS_IRIDESCENCE; + + } + getMaterialType( materialIndex ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null; + return THREE.MeshPhysicalMaterial; + + } + extendMaterialParams( materialIndex, materialParams ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) { + + return Promise.resolve(); + + } + + const pending = []; + const extension = materialDef.extensions[ this.name ]; + if ( extension.iridescenceFactor !== undefined ) { + + materialParams.iridescence = extension.iridescenceFactor; + + } + + if ( extension.iridescenceTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'iridescenceMap', extension.iridescenceTexture ) ); + + } + + if ( extension.iridescenceIor !== undefined ) { + + materialParams.iridescenceIOR = extension.iridescenceIor; + + } + + if ( materialParams.iridescenceThicknessRange === undefined ) { + + materialParams.iridescenceThicknessRange = [ 100, 400 ]; + + } + + if ( extension.iridescenceThicknessMinimum !== undefined ) { + + materialParams.iridescenceThicknessRange[ 0 ] = extension.iridescenceThicknessMinimum; + + } + + if ( extension.iridescenceThicknessMaximum !== undefined ) { + + materialParams.iridescenceThicknessRange[ 1 ] = extension.iridescenceThicknessMaximum; + + } + + if ( extension.iridescenceThicknessTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'iridescenceThicknessMap', extension.iridescenceThicknessTexture ) ); + + } + + return Promise.all( pending ); + + } + + } + + /** + * Sheen Materials Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_sheen + */ + class GLTFMaterialsSheenExtension { + + constructor( parser ) { + + this.parser = parser; + this.name = EXTENSIONS.KHR_MATERIALS_SHEEN; + + } + getMaterialType( materialIndex ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null; + return THREE.MeshPhysicalMaterial; + + } + extendMaterialParams( materialIndex, materialParams ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) { + + return Promise.resolve(); + + } + + const pending = []; + materialParams.sheenColor = new THREE.Color( 0, 0, 0 ); + materialParams.sheenRoughness = 0; + materialParams.sheen = 1; + const extension = materialDef.extensions[ this.name ]; + if ( extension.sheenColorFactor !== undefined ) { + + materialParams.sheenColor.fromArray( extension.sheenColorFactor ); + + } + + if ( extension.sheenRoughnessFactor !== undefined ) { + + materialParams.sheenRoughness = extension.sheenRoughnessFactor; + + } + + if ( extension.sheenColorTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'sheenColorMap', extension.sheenColorTexture, THREE.sRGBEncoding ) ); + + } + + if ( extension.sheenRoughnessTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'sheenRoughnessMap', extension.sheenRoughnessTexture ) ); + + } + + return Promise.all( pending ); + + } + + } + + /** + * Transmission Materials Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_transmission + * Draft: https://github.com/KhronosGroup/glTF/pull/1698 + */ + class GLTFMaterialsTransmissionExtension { + + constructor( parser ) { + + this.parser = parser; + this.name = EXTENSIONS.KHR_MATERIALS_TRANSMISSION; + + } + getMaterialType( materialIndex ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null; + return THREE.MeshPhysicalMaterial; + + } + extendMaterialParams( materialIndex, materialParams ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) { + + return Promise.resolve(); + + } + + const pending = []; + const extension = materialDef.extensions[ this.name ]; + if ( extension.transmissionFactor !== undefined ) { + + materialParams.transmission = extension.transmissionFactor; + + } + + if ( extension.transmissionTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'transmissionMap', extension.transmissionTexture ) ); + + } + + return Promise.all( pending ); + + } + + } + + /** + * Materials Volume Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_volume + */ + class GLTFMaterialsVolumeExtension { + + constructor( parser ) { + + this.parser = parser; + this.name = EXTENSIONS.KHR_MATERIALS_VOLUME; + + } + getMaterialType( materialIndex ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null; + return THREE.MeshPhysicalMaterial; + + } + extendMaterialParams( materialIndex, materialParams ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) { + + return Promise.resolve(); + + } + + const pending = []; + const extension = materialDef.extensions[ this.name ]; + materialParams.thickness = extension.thicknessFactor !== undefined ? extension.thicknessFactor : 0; + if ( extension.thicknessTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'thicknessMap', extension.thicknessTexture ) ); + + } + + materialParams.attenuationDistance = extension.attenuationDistance || Infinity; + const colorArray = extension.attenuationColor || [ 1, 1, 1 ]; + materialParams.attenuationColor = new THREE.Color( colorArray[ 0 ], colorArray[ 1 ], colorArray[ 2 ] ); + return Promise.all( pending ); + + } + + } + + /** + * Materials ior Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_ior + */ + class GLTFMaterialsIorExtension { + + constructor( parser ) { + + this.parser = parser; + this.name = EXTENSIONS.KHR_MATERIALS_IOR; + + } + getMaterialType( materialIndex ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null; + return THREE.MeshPhysicalMaterial; + + } + extendMaterialParams( materialIndex, materialParams ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) { + + return Promise.resolve(); + + } + + const extension = materialDef.extensions[ this.name ]; + materialParams.ior = extension.ior !== undefined ? extension.ior : 1.5; + return Promise.resolve(); + + } + + } + + /** + * Materials specular Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_specular + */ + class GLTFMaterialsSpecularExtension { + + constructor( parser ) { + + this.parser = parser; + this.name = EXTENSIONS.KHR_MATERIALS_SPECULAR; + + } + getMaterialType( materialIndex ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null; + return THREE.MeshPhysicalMaterial; + + } + extendMaterialParams( materialIndex, materialParams ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) { + + return Promise.resolve(); + + } + + const pending = []; + const extension = materialDef.extensions[ this.name ]; + materialParams.specularIntensity = extension.specularFactor !== undefined ? extension.specularFactor : 1.0; + if ( extension.specularTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'specularIntensityMap', extension.specularTexture ) ); + + } + + const colorArray = extension.specularColorFactor || [ 1, 1, 1 ]; + materialParams.specularColor = new THREE.Color( colorArray[ 0 ], colorArray[ 1 ], colorArray[ 2 ] ); + if ( extension.specularColorTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'specularColorMap', extension.specularColorTexture, THREE.sRGBEncoding ) ); + + } + + return Promise.all( pending ); + + } + + } + + /** + * BasisU THREE.Texture Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu + */ + class GLTFTextureBasisUExtension { + + constructor( parser ) { + + this.parser = parser; + this.name = EXTENSIONS.KHR_TEXTURE_BASISU; + + } + loadTexture( textureIndex ) { + + const parser = this.parser; + const json = parser.json; + const textureDef = json.textures[ textureIndex ]; + if ( ! textureDef.extensions || ! textureDef.extensions[ this.name ] ) { + + return null; + + } + + const extension = textureDef.extensions[ this.name ]; + const loader = parser.options.ktx2Loader; + if ( ! loader ) { + + if ( json.extensionsRequired && json.extensionsRequired.indexOf( this.name ) >= 0 ) { + + throw new Error( 'THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures' ); + + } else { + + // Assumes that the extension is optional and that a fallback texture is present + return null; + + } + + } + + return parser.loadTextureImage( textureIndex, extension.source, loader ); + + } + + } + + /** + * WebP THREE.Texture Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_texture_webp + */ + class GLTFTextureWebPExtension { + + constructor( parser ) { + + this.parser = parser; + this.name = EXTENSIONS.EXT_TEXTURE_WEBP; + this.isSupported = null; + + } + loadTexture( textureIndex ) { + + const name = this.name; + const parser = this.parser; + const json = parser.json; + const textureDef = json.textures[ textureIndex ]; + if ( ! textureDef.extensions || ! textureDef.extensions[ name ] ) { + + return null; + + } + + const extension = textureDef.extensions[ name ]; + const source = json.images[ extension.source ]; + let loader = parser.textureLoader; + if ( source.uri ) { + + const handler = parser.options.manager.getHandler( source.uri ); + if ( handler !== null ) loader = handler; + + } + + return this.detectSupport().then( function ( isSupported ) { + + if ( isSupported ) return parser.loadTextureImage( textureIndex, extension.source, loader ); + if ( json.extensionsRequired && json.extensionsRequired.indexOf( name ) >= 0 ) { + + throw new Error( 'THREE.GLTFLoader: WebP required by asset but unsupported.' ); + + } + + // Fall back to PNG or JPEG. + return parser.loadTexture( textureIndex ); + + } ); + + } + detectSupport() { + + if ( ! this.isSupported ) { + + this.isSupported = new Promise( function ( resolve ) { + + const image = new Image(); + + // Lossy test image. Support for lossy images doesn't guarantee support for all + // WebP images, unfortunately. + image.src = 'data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA'; + image.onload = image.onerror = function () { + + resolve( image.height === 1 ); + + }; + + } ); + + } + + return this.isSupported; + + } + + } + + /** + * meshopt BufferView Compression Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_meshopt_compression + */ + class GLTFMeshoptCompression { + + constructor( parser ) { + + this.name = EXTENSIONS.EXT_MESHOPT_COMPRESSION; + this.parser = parser; + + } + loadBufferView( index ) { + + const json = this.parser.json; + const bufferView = json.bufferViews[ index ]; + if ( bufferView.extensions && bufferView.extensions[ this.name ] ) { + + const extensionDef = bufferView.extensions[ this.name ]; + const buffer = this.parser.getDependency( 'buffer', extensionDef.buffer ); + const decoder = this.parser.options.meshoptDecoder; + if ( ! decoder || ! decoder.supported ) { + + if ( json.extensionsRequired && json.extensionsRequired.indexOf( this.name ) >= 0 ) { + + throw new Error( 'THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files' ); + + } else { + + // Assumes that the extension is optional and that fallback buffer data is present + return null; + + } + + } + + return buffer.then( function ( res ) { + + const byteOffset = extensionDef.byteOffset || 0; + const byteLength = extensionDef.byteLength || 0; + const count = extensionDef.count; + const stride = extensionDef.byteStride; + const source = new Uint8Array( res, byteOffset, byteLength ); + if ( decoder.decodeGltfBufferAsync ) { + + return decoder.decodeGltfBufferAsync( count, stride, source, extensionDef.mode, extensionDef.filter ).then( function ( res ) { + + return res.buffer; + + } ); + + } else { + + // Support for MeshoptDecoder 0.18 or earlier, without decodeGltfBufferAsync + return decoder.ready.then( function () { + + const result = new ArrayBuffer( count * stride ); + decoder.decodeGltfBuffer( new Uint8Array( result ), count, stride, source, extensionDef.mode, extensionDef.filter ); + return result; + + } ); + + } + + } ); + + } else { + + return null; + + } + + } + + } + + /** + * GPU Instancing Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_mesh_gpu_instancing + * + */ + class GLTFMeshGpuInstancing { + + constructor( parser ) { + + this.name = EXTENSIONS.EXT_MESH_GPU_INSTANCING; + this.parser = parser; + + } + createNodeMesh( nodeIndex ) { + + const json = this.parser.json; + const nodeDef = json.nodes[ nodeIndex ]; + if ( ! nodeDef.extensions || ! nodeDef.extensions[ this.name ] || nodeDef.mesh === undefined ) { + + return null; + + } + + const meshDef = json.meshes[ nodeDef.mesh ]; + + // No THREE.Points or Lines + Instancing support yet + + for ( const primitive of meshDef.primitives ) { + + if ( primitive.mode !== WEBGL_CONSTANTS.TRIANGLES && primitive.mode !== WEBGL_CONSTANTS.TRIANGLE_STRIP && primitive.mode !== WEBGL_CONSTANTS.TRIANGLE_FAN && primitive.mode !== undefined ) { + + return null; + + } + + } + + const extensionDef = nodeDef.extensions[ this.name ]; + const attributesDef = extensionDef.attributes; + + // @TODO: Can we support THREE.InstancedMesh + THREE.SkinnedMesh? + + const pending = []; + const attributes = {}; + for ( const key in attributesDef ) { + + pending.push( this.parser.getDependency( 'accessor', attributesDef[ key ] ).then( accessor => { + + attributes[ key ] = accessor; + return attributes[ key ]; + + } ) ); + + } + + if ( pending.length < 1 ) { + + return null; + + } + + pending.push( this.parser.createNodeMesh( nodeIndex ) ); + return Promise.all( pending ).then( results => { + + const nodeObject = results.pop(); + const meshes = nodeObject.isGroup ? nodeObject.children : [ nodeObject ]; + const count = results[ 0 ].count; // All attribute counts should be same + const instancedMeshes = []; + for ( const mesh of meshes ) { + + // Temporal variables + const m = new THREE.Matrix4(); + const p = new THREE.Vector3(); + const q = new THREE.Quaternion(); + const s = new THREE.Vector3( 1, 1, 1 ); + const instancedMesh = new THREE.InstancedMesh( mesh.geometry, mesh.material, count ); + for ( let i = 0; i < count; i ++ ) { + + if ( attributes.TRANSLATION ) { + + p.fromBufferAttribute( attributes.TRANSLATION, i ); + + } + + if ( attributes.ROTATION ) { + + q.fromBufferAttribute( attributes.ROTATION, i ); + + } + + if ( attributes.SCALE ) { + + s.fromBufferAttribute( attributes.SCALE, i ); + + } + + instancedMesh.setMatrixAt( i, m.compose( p, q, s ) ); + + } + + // Add instance attributes to the geometry, excluding TRS. + for ( const attributeName in attributes ) { + + if ( attributeName !== 'TRANSLATION' && attributeName !== 'ROTATION' && attributeName !== 'SCALE' ) { + + mesh.geometry.setAttribute( attributeName, attributes[ attributeName ] ); + + } + + } + + // Just in case + THREE.Object3D.prototype.copy.call( instancedMesh, mesh ); + + // https://github.com/mrdoob/three.js/issues/18334 + instancedMesh.frustumCulled = false; + this.parser.assignFinalMaterial( instancedMesh ); + instancedMeshes.push( instancedMesh ); + + } + + if ( nodeObject.isGroup ) { + + nodeObject.clear(); + nodeObject.add( ...instancedMeshes ); + return nodeObject; + + } + + return instancedMeshes[ 0 ]; + + } ); + + } + + } + + /* BINARY EXTENSION */ + const BINARY_EXTENSION_HEADER_MAGIC = 'glTF'; + const BINARY_EXTENSION_HEADER_LENGTH = 12; + const BINARY_EXTENSION_CHUNK_TYPES = { + JSON: 0x4E4F534A, + BIN: 0x004E4942 + }; + class GLTFBinaryExtension { + + constructor( data ) { + + this.name = EXTENSIONS.KHR_BINARY_GLTF; + this.content = null; + this.body = null; + const headerView = new DataView( data, 0, BINARY_EXTENSION_HEADER_LENGTH ); + this.header = { + magic: THREE.LoaderUtils.decodeText( new Uint8Array( data.slice( 0, 4 ) ) ), + version: headerView.getUint32( 4, true ), + length: headerView.getUint32( 8, true ) + }; + if ( this.header.magic !== BINARY_EXTENSION_HEADER_MAGIC ) { + + throw new Error( 'THREE.GLTFLoader: Unsupported glTF-Binary header.' ); + + } else if ( this.header.version < 2.0 ) { + + throw new Error( 'THREE.GLTFLoader: Legacy binary file detected.' ); + + } + + const chunkContentsLength = this.header.length - BINARY_EXTENSION_HEADER_LENGTH; + const chunkView = new DataView( data, BINARY_EXTENSION_HEADER_LENGTH ); + let chunkIndex = 0; + while ( chunkIndex < chunkContentsLength ) { + + const chunkLength = chunkView.getUint32( chunkIndex, true ); + chunkIndex += 4; + const chunkType = chunkView.getUint32( chunkIndex, true ); + chunkIndex += 4; + if ( chunkType === BINARY_EXTENSION_CHUNK_TYPES.JSON ) { + + const contentArray = new Uint8Array( data, BINARY_EXTENSION_HEADER_LENGTH + chunkIndex, chunkLength ); + this.content = THREE.LoaderUtils.decodeText( contentArray ); + + } else if ( chunkType === BINARY_EXTENSION_CHUNK_TYPES.BIN ) { + + const byteOffset = BINARY_EXTENSION_HEADER_LENGTH + chunkIndex; + this.body = data.slice( byteOffset, byteOffset + chunkLength ); + + } + + // Clients must ignore chunks with unknown types. + + chunkIndex += chunkLength; + + } + + if ( this.content === null ) { + + throw new Error( 'THREE.GLTFLoader: JSON content not found.' ); + + } + + } + + } + + /** + * DRACO THREE.Mesh Compression Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression + */ + class GLTFDracoMeshCompressionExtension { + + constructor( json, dracoLoader ) { + + if ( ! dracoLoader ) { + + throw new Error( 'THREE.GLTFLoader: No DRACOLoader instance provided.' ); + + } + + this.name = EXTENSIONS.KHR_DRACO_MESH_COMPRESSION; + this.json = json; + this.dracoLoader = dracoLoader; + this.dracoLoader.preload(); + + } + decodePrimitive( primitive, parser ) { + + const json = this.json; + const dracoLoader = this.dracoLoader; + const bufferViewIndex = primitive.extensions[ this.name ].bufferView; + const gltfAttributeMap = primitive.extensions[ this.name ].attributes; + const threeAttributeMap = {}; + const attributeNormalizedMap = {}; + const attributeTypeMap = {}; + for ( const attributeName in gltfAttributeMap ) { + + const threeAttributeName = ATTRIBUTES[ attributeName ] || attributeName.toLowerCase(); + threeAttributeMap[ threeAttributeName ] = gltfAttributeMap[ attributeName ]; + + } + + for ( const attributeName in primitive.attributes ) { + + const threeAttributeName = ATTRIBUTES[ attributeName ] || attributeName.toLowerCase(); + if ( gltfAttributeMap[ attributeName ] !== undefined ) { + + const accessorDef = json.accessors[ primitive.attributes[ attributeName ] ]; + const componentType = WEBGL_COMPONENT_TYPES[ accessorDef.componentType ]; + attributeTypeMap[ threeAttributeName ] = componentType.name; + attributeNormalizedMap[ threeAttributeName ] = accessorDef.normalized === true; + + } + + } + + return parser.getDependency( 'bufferView', bufferViewIndex ).then( function ( bufferView ) { + + return new Promise( function ( resolve ) { + + dracoLoader.decodeDracoFile( bufferView, function ( geometry ) { + + for ( const attributeName in geometry.attributes ) { + + const attribute = geometry.attributes[ attributeName ]; + const normalized = attributeNormalizedMap[ attributeName ]; + if ( normalized !== undefined ) attribute.normalized = normalized; + + } + + resolve( geometry ); + + }, threeAttributeMap, attributeTypeMap ); + + } ); + + } ); + + } + + } + + /** + * THREE.Texture Transform Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_transform + */ + class GLTFTextureTransformExtension { + + constructor() { + + this.name = EXTENSIONS.KHR_TEXTURE_TRANSFORM; + + } + extendTexture( texture, transform ) { + + if ( transform.texCoord !== undefined ) { + + console.warn( 'THREE.GLTFLoader: Custom UV sets in "' + this.name + '" extension not yet supported.' ); + + } + + if ( transform.offset === undefined && transform.rotation === undefined && transform.scale === undefined ) { + + // See https://github.com/mrdoob/three.js/issues/21819. + return texture; + + } + + texture = texture.clone(); + if ( transform.offset !== undefined ) { + + texture.offset.fromArray( transform.offset ); + + } + + if ( transform.rotation !== undefined ) { + + texture.rotation = transform.rotation; + + } + + if ( transform.scale !== undefined ) { + + texture.repeat.fromArray( transform.scale ); + + } + + texture.needsUpdate = true; + return texture; + + } + + } + + /** + * Specular-Glossiness Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Archived/KHR_materials_pbrSpecularGlossiness + */ + + /** + * A sub class of StandardMaterial with some of the functionality + * changed via the `onBeforeCompile` callback + * @pailhead + */ + class GLTFMeshStandardSGMaterial extends THREE.MeshStandardMaterial { + + constructor( params ) { + + super(); + this.isGLTFSpecularGlossinessMaterial = true; + + //various chunks that need replacing + const specularMapParsFragmentChunk = [ '#ifdef USE_SPECULARMAP', ' uniform sampler2D specularMap;', '#endif' ].join( '\n' ); + const glossinessMapParsFragmentChunk = [ '#ifdef USE_GLOSSINESSMAP', ' uniform sampler2D glossinessMap;', '#endif' ].join( '\n' ); + const specularMapFragmentChunk = [ 'vec3 specularFactor = specular;', '#ifdef USE_SPECULARMAP', ' vec4 texelSpecular = texture2D( specularMap, vUv );', ' // reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture', ' specularFactor *= texelSpecular.rgb;', '#endif' ].join( '\n' ); + const glossinessMapFragmentChunk = [ 'float glossinessFactor = glossiness;', '#ifdef USE_GLOSSINESSMAP', ' vec4 texelGlossiness = texture2D( glossinessMap, vUv );', ' // reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture', ' glossinessFactor *= texelGlossiness.a;', '#endif' ].join( '\n' ); + const lightPhysicalFragmentChunk = [ 'PhysicalMaterial material;', 'material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );', 'vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );', 'float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );', 'material.roughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.', 'material.roughness += geometryRoughness;', 'material.roughness = min( material.roughness, 1.0 );', 'material.specularColor = specularFactor;' ].join( '\n' ); + const uniforms = { + specular: { + value: new THREE.Color().setHex( 0xffffff ) + }, + glossiness: { + value: 1 + }, + specularMap: { + value: null + }, + glossinessMap: { + value: null + } + }; + this._extraUniforms = uniforms; + this.onBeforeCompile = function ( shader ) { + + for ( const uniformName in uniforms ) { + + shader.uniforms[ uniformName ] = uniforms[ uniformName ]; + + } + + shader.fragmentShader = shader.fragmentShader.replace( 'uniform float roughness;', 'uniform vec3 specular;' ).replace( 'uniform float metalness;', 'uniform float glossiness;' ).replace( '#include ', specularMapParsFragmentChunk ).replace( '#include ', glossinessMapParsFragmentChunk ).replace( '#include ', specularMapFragmentChunk ).replace( '#include ', glossinessMapFragmentChunk ).replace( '#include ', lightPhysicalFragmentChunk ); + + }; + + Object.defineProperties( this, { + specular: { + get: function () { + + return uniforms.specular.value; + + }, + set: function ( v ) { + + uniforms.specular.value = v; + + } + }, + specularMap: { + get: function () { + + return uniforms.specularMap.value; + + }, + set: function ( v ) { + + uniforms.specularMap.value = v; + if ( v ) { + + this.defines.USE_SPECULARMAP = ''; // USE_UV is set by the renderer for specular maps + + } else { + + delete this.defines.USE_SPECULARMAP; + + } + + } + }, + glossiness: { + get: function () { + + return uniforms.glossiness.value; + + }, + set: function ( v ) { + + uniforms.glossiness.value = v; + + } + }, + glossinessMap: { + get: function () { + + return uniforms.glossinessMap.value; + + }, + set: function ( v ) { + + uniforms.glossinessMap.value = v; + if ( v ) { + + this.defines.USE_GLOSSINESSMAP = ''; + this.defines.USE_UV = ''; + + } else { + + delete this.defines.USE_GLOSSINESSMAP; + delete this.defines.USE_UV; + + } + + } + } + } ); + delete this.metalness; + delete this.roughness; + delete this.metalnessMap; + delete this.roughnessMap; + this.setValues( params ); + + } + copy( source ) { + + super.copy( source ); + this.specularMap = source.specularMap; + this.specular.copy( source.specular ); + this.glossinessMap = source.glossinessMap; + this.glossiness = source.glossiness; + delete this.metalness; + delete this.roughness; + delete this.metalnessMap; + delete this.roughnessMap; + return this; + + } + + } + class GLTFMaterialsPbrSpecularGlossinessExtension { + + constructor() { + + this.name = EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS; + this.specularGlossinessParams = [ 'color', 'map', 'lightMap', 'lightMapIntensity', 'aoMap', 'aoMapIntensity', 'emissive', 'emissiveIntensity', 'emissiveMap', 'bumpMap', 'bumpScale', 'normalMap', 'normalMapType', 'displacementMap', 'displacementScale', 'displacementBias', 'specularMap', 'specular', 'glossinessMap', 'glossiness', 'alphaMap', 'envMap', 'envMapIntensity' ]; + + } + getMaterialType() { + + return GLTFMeshStandardSGMaterial; + + } + extendParams( materialParams, materialDef, parser ) { + + const pbrSpecularGlossiness = materialDef.extensions[ this.name ]; + materialParams.color = new THREE.Color( 1.0, 1.0, 1.0 ); + materialParams.opacity = 1.0; + const pending = []; + if ( Array.isArray( pbrSpecularGlossiness.diffuseFactor ) ) { + + const array = pbrSpecularGlossiness.diffuseFactor; + materialParams.color.fromArray( array ); + materialParams.opacity = array[ 3 ]; + + } + + if ( pbrSpecularGlossiness.diffuseTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'map', pbrSpecularGlossiness.diffuseTexture, THREE.sRGBEncoding ) ); + + } + + materialParams.emissive = new THREE.Color( 0.0, 0.0, 0.0 ); + materialParams.glossiness = pbrSpecularGlossiness.glossinessFactor !== undefined ? pbrSpecularGlossiness.glossinessFactor : 1.0; + materialParams.specular = new THREE.Color( 1.0, 1.0, 1.0 ); + if ( Array.isArray( pbrSpecularGlossiness.specularFactor ) ) { + + materialParams.specular.fromArray( pbrSpecularGlossiness.specularFactor ); + + } + + if ( pbrSpecularGlossiness.specularGlossinessTexture !== undefined ) { + + const specGlossMapDef = pbrSpecularGlossiness.specularGlossinessTexture; + pending.push( parser.assignTexture( materialParams, 'glossinessMap', specGlossMapDef ) ); + pending.push( parser.assignTexture( materialParams, 'specularMap', specGlossMapDef, THREE.sRGBEncoding ) ); + + } + + return Promise.all( pending ); + + } + createMaterial( materialParams ) { + + const material = new GLTFMeshStandardSGMaterial( materialParams ); + material.fog = true; + material.color = materialParams.color; + material.map = materialParams.map === undefined ? null : materialParams.map; + material.lightMap = null; + material.lightMapIntensity = 1.0; + material.aoMap = materialParams.aoMap === undefined ? null : materialParams.aoMap; + material.aoMapIntensity = 1.0; + material.emissive = materialParams.emissive; + material.emissiveIntensity = materialParams.emissiveIntensity === undefined ? 1.0 : materialParams.emissiveIntensity; + material.emissiveMap = materialParams.emissiveMap === undefined ? null : materialParams.emissiveMap; + material.bumpMap = materialParams.bumpMap === undefined ? null : materialParams.bumpMap; + material.bumpScale = 1; + material.normalMap = materialParams.normalMap === undefined ? null : materialParams.normalMap; + material.normalMapType = THREE.TangentSpaceNormalMap; + if ( materialParams.normalScale ) material.normalScale = materialParams.normalScale; + material.displacementMap = null; + material.displacementScale = 1; + material.displacementBias = 0; + material.specularMap = materialParams.specularMap === undefined ? null : materialParams.specularMap; + material.specular = materialParams.specular; + material.glossinessMap = materialParams.glossinessMap === undefined ? null : materialParams.glossinessMap; + material.glossiness = materialParams.glossiness; + material.alphaMap = null; + material.envMap = materialParams.envMap === undefined ? null : materialParams.envMap; + material.envMapIntensity = 1.0; + return material; + + } + + } + + /** + * THREE.Mesh Quantization Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization + */ + class GLTFMeshQuantizationExtension { + + constructor() { + + this.name = EXTENSIONS.KHR_MESH_QUANTIZATION; + + } + + } + + /*********************************/ + /********** INTERPOLATION ********/ + /*********************************/ + + // Spline Interpolation + // Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#appendix-c-spline-interpolation + class GLTFCubicSplineInterpolant extends THREE.Interpolant { + + constructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) { + + super( parameterPositions, sampleValues, sampleSize, resultBuffer ); + + } + copySampleValue_( index ) { + + // Copies a sample value to the result buffer. See description of glTF + // CUBICSPLINE values layout in interpolate_() function below. + + const result = this.resultBuffer, + values = this.sampleValues, + valueSize = this.valueSize, + offset = index * valueSize * 3 + valueSize; + for ( let i = 0; i !== valueSize; i ++ ) { + + result[ i ] = values[ offset + i ]; + + } + + return result; + + } + interpolate_( i1, t0, t, t1 ) { + + const result = this.resultBuffer; + const values = this.sampleValues; + const stride = this.valueSize; + const stride2 = stride * 2; + const stride3 = stride * 3; + const td = t1 - t0; + const p = ( t - t0 ) / td; + const pp = p * p; + const ppp = pp * p; + const offset1 = i1 * stride3; + const offset0 = offset1 - stride3; + const s2 = - 2 * ppp + 3 * pp; + const s3 = ppp - pp; + const s0 = 1 - s2; + const s1 = s3 - pp + p; + + // Layout of keyframe output values for CUBICSPLINE animations: + // [ inTangent_1, splineVertex_1, outTangent_1, inTangent_2, splineVertex_2, ... ] + for ( let i = 0; i !== stride; i ++ ) { + + const p0 = values[ offset0 + i + stride ]; // splineVertex_k + const m0 = values[ offset0 + i + stride2 ] * td; // outTangent_k * (t_k+1 - t_k) + const p1 = values[ offset1 + i + stride ]; // splineVertex_k+1 + const m1 = values[ offset1 + i ] * td; // inTangent_k+1 * (t_k+1 - t_k) + + result[ i ] = s0 * p0 + s1 * m0 + s2 * p1 + s3 * m1; + + } + + return result; + + } + + } + const _q = new THREE.Quaternion(); + class GLTFCubicSplineQuaternionInterpolant extends GLTFCubicSplineInterpolant { + + interpolate_( i1, t0, t, t1 ) { + + const result = super.interpolate_( i1, t0, t, t1 ); + _q.fromArray( result ).normalize().toArray( result ); + return result; + + } + + } + + /*********************************/ + /********** INTERNALS ************/ + /*********************************/ + + /* CONSTANTS */ + + const WEBGL_CONSTANTS = { + FLOAT: 5126, + //FLOAT_MAT2: 35674, + FLOAT_MAT3: 35675, + FLOAT_MAT4: 35676, + FLOAT_VEC2: 35664, + FLOAT_VEC3: 35665, + FLOAT_VEC4: 35666, + LINEAR: 9729, + REPEAT: 10497, + SAMPLER_2D: 35678, + POINTS: 0, + LINES: 1, + LINE_LOOP: 2, + LINE_STRIP: 3, + TRIANGLES: 4, + TRIANGLE_STRIP: 5, + TRIANGLE_FAN: 6, + UNSIGNED_BYTE: 5121, + UNSIGNED_SHORT: 5123 + }; + const WEBGL_COMPONENT_TYPES = { + 5120: Int8Array, + 5121: Uint8Array, + 5122: Int16Array, + 5123: Uint16Array, + 5125: Uint32Array, + 5126: Float32Array + }; + const WEBGL_FILTERS = { + 9728: THREE.NearestFilter, + 9729: THREE.LinearFilter, + 9984: THREE.NearestMipmapNearestFilter, + 9985: THREE.LinearMipmapNearestFilter, + 9986: THREE.NearestMipmapLinearFilter, + 9987: THREE.LinearMipmapLinearFilter + }; + const WEBGL_WRAPPINGS = { + 33071: THREE.ClampToEdgeWrapping, + 33648: THREE.MirroredRepeatWrapping, + 10497: THREE.RepeatWrapping + }; + const WEBGL_TYPE_SIZES = { + 'SCALAR': 1, + 'VEC2': 2, + 'VEC3': 3, + 'VEC4': 4, + 'MAT2': 4, + 'MAT3': 9, + 'MAT4': 16 + }; + const ATTRIBUTES = { + POSITION: 'position', + NORMAL: 'normal', + TANGENT: 'tangent', + TEXCOORD_0: 'uv', + TEXCOORD_1: 'uv2', + COLOR_0: 'color', + WEIGHTS_0: 'skinWeight', + JOINTS_0: 'skinIndex' + }; + const PATH_PROPERTIES = { + scale: 'scale', + translation: 'position', + rotation: 'quaternion', + weights: 'morphTargetInfluences' + }; + const INTERPOLATION = { + CUBICSPLINE: undefined, + // We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each + // keyframe track will be initialized with a default interpolation type, then modified. + LINEAR: THREE.InterpolateLinear, + STEP: THREE.InterpolateDiscrete + }; + const ALPHA_MODES = { + OPAQUE: 'OPAQUE', + MASK: 'MASK', + BLEND: 'BLEND' + }; + + /** + * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#default-material + */ + function createDefaultMaterial( cache ) { + + if ( cache[ 'DefaultMaterial' ] === undefined ) { + + cache[ 'DefaultMaterial' ] = new THREE.MeshStandardMaterial( { + color: 0xFFFFFF, + emissive: 0x000000, + metalness: 1, + roughness: 1, + transparent: false, + depthTest: true, + side: THREE.FrontSide + } ); + + } + + return cache[ 'DefaultMaterial' ]; + + } + + function addUnknownExtensionsToUserData( knownExtensions, object, objectDef ) { + + // Add unknown glTF extensions to an object's userData. + + for ( const name in objectDef.extensions ) { + + if ( knownExtensions[ name ] === undefined ) { + + object.userData.gltfExtensions = object.userData.gltfExtensions || {}; + object.userData.gltfExtensions[ name ] = objectDef.extensions[ name ]; + + } + + } + + } + + /** + * @param {Object3D|Material|BufferGeometry} object + * @param {GLTF.definition} gltfDef + */ + function assignExtrasToUserData( object, gltfDef ) { + + if ( gltfDef.extras !== undefined ) { + + if ( typeof gltfDef.extras === 'object' ) { + + Object.assign( object.userData, gltfDef.extras ); + + } else { + + console.warn( 'THREE.GLTFLoader: Ignoring primitive type .extras, ' + gltfDef.extras ); + + } + + } + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#morph-targets + * + * @param {BufferGeometry} geometry + * @param {Array} targets + * @param {GLTFParser} parser + * @return {Promise} + */ + function addMorphTargets( geometry, targets, parser ) { + + let hasMorphPosition = false; + let hasMorphNormal = false; + let hasMorphColor = false; + for ( let i = 0, il = targets.length; i < il; i ++ ) { + + const target = targets[ i ]; + if ( target.POSITION !== undefined ) hasMorphPosition = true; + if ( target.NORMAL !== undefined ) hasMorphNormal = true; + if ( target.COLOR_0 !== undefined ) hasMorphColor = true; + if ( hasMorphPosition && hasMorphNormal && hasMorphColor ) break; + + } + + if ( ! hasMorphPosition && ! hasMorphNormal && ! hasMorphColor ) return Promise.resolve( geometry ); + const pendingPositionAccessors = []; + const pendingNormalAccessors = []; + const pendingColorAccessors = []; + for ( let i = 0, il = targets.length; i < il; i ++ ) { + + const target = targets[ i ]; + if ( hasMorphPosition ) { + + const pendingAccessor = target.POSITION !== undefined ? parser.getDependency( 'accessor', target.POSITION ) : geometry.attributes.position; + pendingPositionAccessors.push( pendingAccessor ); + + } + + if ( hasMorphNormal ) { + + const pendingAccessor = target.NORMAL !== undefined ? parser.getDependency( 'accessor', target.NORMAL ) : geometry.attributes.normal; + pendingNormalAccessors.push( pendingAccessor ); + + } + + if ( hasMorphColor ) { + + const pendingAccessor = target.COLOR_0 !== undefined ? parser.getDependency( 'accessor', target.COLOR_0 ) : geometry.attributes.color; + pendingColorAccessors.push( pendingAccessor ); + + } + + } + + return Promise.all( [ Promise.all( pendingPositionAccessors ), Promise.all( pendingNormalAccessors ), Promise.all( pendingColorAccessors ) ] ).then( function ( accessors ) { + + const morphPositions = accessors[ 0 ]; + const morphNormals = accessors[ 1 ]; + const morphColors = accessors[ 2 ]; + if ( hasMorphPosition ) geometry.morphAttributes.position = morphPositions; + if ( hasMorphNormal ) geometry.morphAttributes.normal = morphNormals; + if ( hasMorphColor ) geometry.morphAttributes.color = morphColors; + geometry.morphTargetsRelative = true; + return geometry; + + } ); + + } + + /** + * @param {Mesh} mesh + * @param {GLTF.Mesh} meshDef + */ + function updateMorphTargets( mesh, meshDef ) { + + mesh.updateMorphTargets(); + if ( meshDef.weights !== undefined ) { + + for ( let i = 0, il = meshDef.weights.length; i < il; i ++ ) { + + mesh.morphTargetInfluences[ i ] = meshDef.weights[ i ]; + + } + + } + + // .extras has user-defined data, so check that .extras.targetNames is an array. + if ( meshDef.extras && Array.isArray( meshDef.extras.targetNames ) ) { + + const targetNames = meshDef.extras.targetNames; + if ( mesh.morphTargetInfluences.length === targetNames.length ) { + + mesh.morphTargetDictionary = {}; + for ( let i = 0, il = targetNames.length; i < il; i ++ ) { + + mesh.morphTargetDictionary[ targetNames[ i ] ] = i; + + } + + } else { + + console.warn( 'THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.' ); + + } + + } + + } + + function createPrimitiveKey( primitiveDef ) { + + const dracoExtension = primitiveDef.extensions && primitiveDef.extensions[ EXTENSIONS.KHR_DRACO_MESH_COMPRESSION ]; + let geometryKey; + if ( dracoExtension ) { + + geometryKey = 'draco:' + dracoExtension.bufferView + ':' + dracoExtension.indices + ':' + createAttributesKey( dracoExtension.attributes ); + + } else { + + geometryKey = primitiveDef.indices + ':' + createAttributesKey( primitiveDef.attributes ) + ':' + primitiveDef.mode; + + } + + return geometryKey; + + } + + function createAttributesKey( attributes ) { + + let attributesKey = ''; + const keys = Object.keys( attributes ).sort(); + for ( let i = 0, il = keys.length; i < il; i ++ ) { + + attributesKey += keys[ i ] + ':' + attributes[ keys[ i ] ] + ';'; + + } + + return attributesKey; + + } + + function getNormalizedComponentScale( constructor ) { + + // Reference: + // https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization#encoding-quantized-data + + switch ( constructor ) { + + case Int8Array: + return 1 / 127; + case Uint8Array: + return 1 / 255; + case Int16Array: + return 1 / 32767; + case Uint16Array: + return 1 / 65535; + default: + throw new Error( 'THREE.GLTFLoader: Unsupported normalized accessor component type.' ); + + } + + } + + function getImageURIMimeType( uri ) { + + if ( uri.search( /\.jpe?g($|\?)/i ) > 0 || uri.search( /^data\:image\/jpeg/ ) === 0 ) return 'image/jpeg'; + if ( uri.search( /\.webp($|\?)/i ) > 0 || uri.search( /^data\:image\/webp/ ) === 0 ) return 'image/webp'; + return 'image/png'; + + } + + /* GLTF PARSER */ + + class GLTFParser { + + constructor( json = {}, options = {} ) { + + this.json = json; + this.extensions = {}; + this.plugins = {}; + this.options = options; + + // loader object cache + this.cache = new GLTFRegistry(); + + // associations between Three.js objects and glTF elements + this.associations = new Map(); + + // THREE.BufferGeometry caching + this.primitiveCache = {}; + + // THREE.Object3D instance caches + this.meshCache = { + refs: {}, + uses: {} + }; + this.cameraCache = { + refs: {}, + uses: {} + }; + this.lightCache = { + refs: {}, + uses: {} + }; + this.sourceCache = {}; + this.textureCache = {}; + + // Track node names, to ensure no duplicates + this.nodeNamesUsed = {}; + + // Use an THREE.ImageBitmapLoader if imageBitmaps are supported. Moves much of the + // expensive work of uploading a texture to the GPU off the main thread. + + const isSafari = /^((?!chrome|android).)*safari/i.test( navigator.userAgent ) === true; + const isFirefox = navigator.userAgent.indexOf( 'Firefox' ) > - 1; + const firefoxVersion = isFirefox ? navigator.userAgent.match( /Firefox\/([0-9]+)\./ )[ 1 ] : - 1; + if ( typeof createImageBitmap === 'undefined' || isSafari || isFirefox && firefoxVersion < 98 ) { + + this.textureLoader = new THREE.TextureLoader( this.options.manager ); + + } else { + + this.textureLoader = new THREE.ImageBitmapLoader( this.options.manager ); + + } + + this.textureLoader.setCrossOrigin( this.options.crossOrigin ); + this.textureLoader.setRequestHeader( this.options.requestHeader ); + this.fileLoader = new THREE.FileLoader( this.options.manager ); + this.fileLoader.setResponseType( 'arraybuffer' ); + if ( this.options.crossOrigin === 'use-credentials' ) { + + this.fileLoader.setWithCredentials( true ); + + } + + } + setExtensions( extensions ) { + + this.extensions = extensions; + + } + setPlugins( plugins ) { + + this.plugins = plugins; + + } + parse( onLoad, onError ) { + + const parser = this; + const json = this.json; + const extensions = this.extensions; + + // Clear the loader cache + this.cache.removeAll(); + + // Mark the special nodes/meshes in json for efficient parse + this._invokeAll( function ( ext ) { + + return ext._markDefs && ext._markDefs(); + + } ); + Promise.all( this._invokeAll( function ( ext ) { + + return ext.beforeRoot && ext.beforeRoot(); + + } ) ).then( function () { + + return Promise.all( [ parser.getDependencies( 'scene' ), parser.getDependencies( 'animation' ), parser.getDependencies( 'camera' ) ] ); + + } ).then( function ( dependencies ) { + + const result = { + scene: dependencies[ 0 ][ json.scene || 0 ], + scenes: dependencies[ 0 ], + animations: dependencies[ 1 ], + cameras: dependencies[ 2 ], + asset: json.asset, + parser: parser, + userData: {} + }; + addUnknownExtensionsToUserData( extensions, result, json ); + assignExtrasToUserData( result, json ); + Promise.all( parser._invokeAll( function ( ext ) { + + return ext.afterRoot && ext.afterRoot( result ); + + } ) ).then( function () { + + onLoad( result ); + + } ); + + } ).catch( onError ); + + } + + /** + * Marks the special nodes/meshes in json for efficient parse. + */ + _markDefs() { + + const nodeDefs = this.json.nodes || []; + const skinDefs = this.json.skins || []; + const meshDefs = this.json.meshes || []; + + // Nothing in the node definition indicates whether it is a THREE.Bone or an + // THREE.Object3D. Use the skins' joint references to mark bones. + for ( let skinIndex = 0, skinLength = skinDefs.length; skinIndex < skinLength; skinIndex ++ ) { + + const joints = skinDefs[ skinIndex ].joints; + for ( let i = 0, il = joints.length; i < il; i ++ ) { + + nodeDefs[ joints[ i ] ].isBone = true; + + } + + } + + // Iterate over all nodes, marking references to shared resources, + // as well as skeleton joints. + for ( let nodeIndex = 0, nodeLength = nodeDefs.length; nodeIndex < nodeLength; nodeIndex ++ ) { + + const nodeDef = nodeDefs[ nodeIndex ]; + if ( nodeDef.mesh !== undefined ) { + + this._addNodeRef( this.meshCache, nodeDef.mesh ); + + // Nothing in the mesh definition indicates whether it is + // a THREE.SkinnedMesh or THREE.Mesh. Use the node's mesh reference + // to mark THREE.SkinnedMesh if node has skin. + if ( nodeDef.skin !== undefined ) { + + meshDefs[ nodeDef.mesh ].isSkinnedMesh = true; + + } + + } + + if ( nodeDef.camera !== undefined ) { + + this._addNodeRef( this.cameraCache, nodeDef.camera ); + + } + + } + + } + + /** + * Counts references to shared node / THREE.Object3D resources. These resources + * can be reused, or "instantiated", at multiple nodes in the scene + * hierarchy. THREE.Mesh, Camera, and Light instances are instantiated and must + * be marked. Non-scenegraph resources (like Materials, Geometries, and + * Textures) can be reused directly and are not marked here. + * + * Example: CesiumMilkTruck sample model reuses "Wheel" meshes. + */ + _addNodeRef( cache, index ) { + + if ( index === undefined ) return; + if ( cache.refs[ index ] === undefined ) { + + cache.refs[ index ] = cache.uses[ index ] = 0; + + } + + cache.refs[ index ] ++; + + } + + /** Returns a reference to a shared resource, cloning it if necessary. */ + _getNodeRef( cache, index, object ) { + + if ( cache.refs[ index ] <= 1 ) return object; + const ref = object.clone(); + + // Propagates mappings to the cloned object, prevents mappings on the + // original object from being lost. + const updateMappings = ( original, clone ) => { + + const mappings = this.associations.get( original ); + if ( mappings != null ) { + + this.associations.set( clone, mappings ); + + } + + for ( const [ i, child ] of original.children.entries() ) { + + updateMappings( child, clone.children[ i ] ); + + } + + }; + + updateMappings( object, ref ); + ref.name += '_instance_' + cache.uses[ index ] ++; + return ref; + + } + _invokeOne( func ) { + + const extensions = Object.values( this.plugins ); + extensions.push( this ); + for ( let i = 0; i < extensions.length; i ++ ) { + + const result = func( extensions[ i ] ); + if ( result ) return result; + + } + + return null; + + } + _invokeAll( func ) { + + const extensions = Object.values( this.plugins ); + extensions.unshift( this ); + const pending = []; + for ( let i = 0; i < extensions.length; i ++ ) { + + const result = func( extensions[ i ] ); + if ( result ) pending.push( result ); + + } + + return pending; + + } + + /** + * Requests the specified dependency asynchronously, with caching. + * @param {string} type + * @param {number} index + * @return {Promise} + */ + getDependency( type, index ) { + + const cacheKey = type + ':' + index; + let dependency = this.cache.get( cacheKey ); + if ( ! dependency ) { + + switch ( type ) { + + case 'scene': + dependency = this.loadScene( index ); + break; + case 'node': + dependency = this.loadNode( index ); + break; + case 'mesh': + dependency = this._invokeOne( function ( ext ) { + + return ext.loadMesh && ext.loadMesh( index ); + + } ); + break; + case 'accessor': + dependency = this.loadAccessor( index ); + break; + case 'bufferView': + dependency = this._invokeOne( function ( ext ) { + + return ext.loadBufferView && ext.loadBufferView( index ); + + } ); + break; + case 'buffer': + dependency = this.loadBuffer( index ); + break; + case 'material': + dependency = this._invokeOne( function ( ext ) { + + return ext.loadMaterial && ext.loadMaterial( index ); + + } ); + break; + case 'texture': + dependency = this._invokeOne( function ( ext ) { + + return ext.loadTexture && ext.loadTexture( index ); + + } ); + break; + case 'skin': + dependency = this.loadSkin( index ); + break; + case 'animation': + dependency = this._invokeOne( function ( ext ) { + + return ext.loadAnimation && ext.loadAnimation( index ); + + } ); + break; + case 'camera': + dependency = this.loadCamera( index ); + break; + default: + throw new Error( 'Unknown type: ' + type ); + + } + + this.cache.add( cacheKey, dependency ); + + } + + return dependency; + + } + + /** + * Requests all dependencies of the specified type asynchronously, with caching. + * @param {string} type + * @return {Promise>} + */ + getDependencies( type ) { + + let dependencies = this.cache.get( type ); + if ( ! dependencies ) { + + const parser = this; + const defs = this.json[ type + ( type === 'mesh' ? 'es' : 's' ) ] || []; + dependencies = Promise.all( defs.map( function ( def, index ) { + + return parser.getDependency( type, index ); + + } ) ); + this.cache.add( type, dependencies ); + + } + + return dependencies; + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views + * @param {number} bufferIndex + * @return {Promise} + */ + loadBuffer( bufferIndex ) { + + const bufferDef = this.json.buffers[ bufferIndex ]; + const loader = this.fileLoader; + if ( bufferDef.type && bufferDef.type !== 'arraybuffer' ) { + + throw new Error( 'THREE.GLTFLoader: ' + bufferDef.type + ' buffer type is not supported.' ); + + } + + // If present, GLB container is required to be the first buffer. + if ( bufferDef.uri === undefined && bufferIndex === 0 ) { + + return Promise.resolve( this.extensions[ EXTENSIONS.KHR_BINARY_GLTF ].body ); + + } + + const options = this.options; + return new Promise( function ( resolve, reject ) { + + loader.load( THREE.LoaderUtils.resolveURL( bufferDef.uri, options.path ), resolve, undefined, function () { + + reject( new Error( 'THREE.GLTFLoader: Failed to load buffer "' + bufferDef.uri + '".' ) ); + + } ); + + } ); + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views + * @param {number} bufferViewIndex + * @return {Promise} + */ + loadBufferView( bufferViewIndex ) { + + const bufferViewDef = this.json.bufferViews[ bufferViewIndex ]; + return this.getDependency( 'buffer', bufferViewDef.buffer ).then( function ( buffer ) { + + const byteLength = bufferViewDef.byteLength || 0; + const byteOffset = bufferViewDef.byteOffset || 0; + return buffer.slice( byteOffset, byteOffset + byteLength ); + + } ); + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#accessors + * @param {number} accessorIndex + * @return {Promise} + */ + loadAccessor( accessorIndex ) { + + const parser = this; + const json = this.json; + const accessorDef = this.json.accessors[ accessorIndex ]; + if ( accessorDef.bufferView === undefined && accessorDef.sparse === undefined ) { + + // Ignore empty accessors, which may be used to declare runtime + // information about attributes coming from another source (e.g. Draco + // compression extension). + return Promise.resolve( null ); + + } + + const pendingBufferViews = []; + if ( accessorDef.bufferView !== undefined ) { + + pendingBufferViews.push( this.getDependency( 'bufferView', accessorDef.bufferView ) ); + + } else { + + pendingBufferViews.push( null ); + + } + + if ( accessorDef.sparse !== undefined ) { + + pendingBufferViews.push( this.getDependency( 'bufferView', accessorDef.sparse.indices.bufferView ) ); + pendingBufferViews.push( this.getDependency( 'bufferView', accessorDef.sparse.values.bufferView ) ); + + } + + return Promise.all( pendingBufferViews ).then( function ( bufferViews ) { + + const bufferView = bufferViews[ 0 ]; + const itemSize = WEBGL_TYPE_SIZES[ accessorDef.type ]; + const TypedArray = WEBGL_COMPONENT_TYPES[ accessorDef.componentType ]; + + // For VEC3: itemSize is 3, elementBytes is 4, itemBytes is 12. + const elementBytes = TypedArray.BYTES_PER_ELEMENT; + const itemBytes = elementBytes * itemSize; + const byteOffset = accessorDef.byteOffset || 0; + const byteStride = accessorDef.bufferView !== undefined ? json.bufferViews[ accessorDef.bufferView ].byteStride : undefined; + const normalized = accessorDef.normalized === true; + let array, bufferAttribute; + + // The buffer is not interleaved if the stride is the item size in bytes. + if ( byteStride && byteStride !== itemBytes ) { + + // Each "slice" of the buffer, as defined by 'count' elements of 'byteStride' bytes, gets its own THREE.InterleavedBuffer + // This makes sure that IBA.count reflects accessor.count properly + const ibSlice = Math.floor( byteOffset / byteStride ); + const ibCacheKey = 'InterleavedBuffer:' + accessorDef.bufferView + ':' + accessorDef.componentType + ':' + ibSlice + ':' + accessorDef.count; + let ib = parser.cache.get( ibCacheKey ); + if ( ! ib ) { + + array = new TypedArray( bufferView, ibSlice * byteStride, accessorDef.count * byteStride / elementBytes ); + + // Integer parameters to IB/IBA are in array elements, not bytes. + ib = new THREE.InterleavedBuffer( array, byteStride / elementBytes ); + parser.cache.add( ibCacheKey, ib ); + + } + + bufferAttribute = new THREE.InterleavedBufferAttribute( ib, itemSize, byteOffset % byteStride / elementBytes, normalized ); + + } else { + + if ( bufferView === null ) { + + array = new TypedArray( accessorDef.count * itemSize ); + + } else { + + array = new TypedArray( bufferView, byteOffset, accessorDef.count * itemSize ); + + } + + bufferAttribute = new THREE.BufferAttribute( array, itemSize, normalized ); + + } + + // https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#sparse-accessors + if ( accessorDef.sparse !== undefined ) { + + const itemSizeIndices = WEBGL_TYPE_SIZES.SCALAR; + const TypedArrayIndices = WEBGL_COMPONENT_TYPES[ accessorDef.sparse.indices.componentType ]; + const byteOffsetIndices = accessorDef.sparse.indices.byteOffset || 0; + const byteOffsetValues = accessorDef.sparse.values.byteOffset || 0; + const sparseIndices = new TypedArrayIndices( bufferViews[ 1 ], byteOffsetIndices, accessorDef.sparse.count * itemSizeIndices ); + const sparseValues = new TypedArray( bufferViews[ 2 ], byteOffsetValues, accessorDef.sparse.count * itemSize ); + if ( bufferView !== null ) { + + // Avoid modifying the original ArrayBuffer, if the bufferView wasn't initialized with zeroes. + bufferAttribute = new THREE.BufferAttribute( bufferAttribute.array.slice(), bufferAttribute.itemSize, bufferAttribute.normalized ); + + } + + for ( let i = 0, il = sparseIndices.length; i < il; i ++ ) { + + const index = sparseIndices[ i ]; + bufferAttribute.setX( index, sparseValues[ i * itemSize ] ); + if ( itemSize >= 2 ) bufferAttribute.setY( index, sparseValues[ i * itemSize + 1 ] ); + if ( itemSize >= 3 ) bufferAttribute.setZ( index, sparseValues[ i * itemSize + 2 ] ); + if ( itemSize >= 4 ) bufferAttribute.setW( index, sparseValues[ i * itemSize + 3 ] ); + if ( itemSize >= 5 ) throw new Error( 'THREE.GLTFLoader: Unsupported itemSize in sparse THREE.BufferAttribute.' ); + + } + + } + + return bufferAttribute; + + } ); + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#textures + * @param {number} textureIndex + * @return {Promise} + */ + loadTexture( textureIndex ) { + + const json = this.json; + const options = this.options; + const textureDef = json.textures[ textureIndex ]; + const sourceIndex = textureDef.source; + const sourceDef = json.images[ sourceIndex ]; + let loader = this.textureLoader; + if ( sourceDef.uri ) { + + const handler = options.manager.getHandler( sourceDef.uri ); + if ( handler !== null ) loader = handler; + + } + + return this.loadTextureImage( textureIndex, sourceIndex, loader ); + + } + loadTextureImage( textureIndex, sourceIndex, loader ) { + + const parser = this; + const json = this.json; + const textureDef = json.textures[ textureIndex ]; + const sourceDef = json.images[ sourceIndex ]; + const cacheKey = ( sourceDef.uri || sourceDef.bufferView ) + ':' + textureDef.sampler; + if ( this.textureCache[ cacheKey ] ) { + + // See https://github.com/mrdoob/three.js/issues/21559. + return this.textureCache[ cacheKey ]; + + } + + const promise = this.loadImageSource( sourceIndex, loader ).then( function ( texture ) { + + texture.flipY = false; + texture.name = textureDef.name || sourceDef.name || ''; + const samplers = json.samplers || {}; + const sampler = samplers[ textureDef.sampler ] || {}; + texture.magFilter = WEBGL_FILTERS[ sampler.magFilter ] || THREE.LinearFilter; + texture.minFilter = WEBGL_FILTERS[ sampler.minFilter ] || THREE.LinearMipmapLinearFilter; + texture.wrapS = WEBGL_WRAPPINGS[ sampler.wrapS ] || THREE.RepeatWrapping; + texture.wrapT = WEBGL_WRAPPINGS[ sampler.wrapT ] || THREE.RepeatWrapping; + parser.associations.set( texture, { + textures: textureIndex + } ); + return texture; + + } ).catch( function () { + + return null; + + } ); + this.textureCache[ cacheKey ] = promise; + return promise; + + } + loadImageSource( sourceIndex, loader ) { + + const parser = this; + const json = this.json; + const options = this.options; + if ( this.sourceCache[ sourceIndex ] !== undefined ) { + + return this.sourceCache[ sourceIndex ].then( texture => texture.clone() ); + + } + + const sourceDef = json.images[ sourceIndex ]; + const URL = self.URL || self.webkitURL; + let sourceURI = sourceDef.uri || ''; + let isObjectURL = false; + if ( sourceDef.bufferView !== undefined ) { + + // Load binary image data from bufferView, if provided. + + sourceURI = parser.getDependency( 'bufferView', sourceDef.bufferView ).then( function ( bufferView ) { + + isObjectURL = true; + const blob = new Blob( [ bufferView ], { + type: sourceDef.mimeType + } ); + sourceURI = URL.createObjectURL( blob ); + return sourceURI; + + } ); + + } else if ( sourceDef.uri === undefined ) { + + throw new Error( 'THREE.GLTFLoader: Image ' + sourceIndex + ' is missing URI and bufferView' ); + + } + + const promise = Promise.resolve( sourceURI ).then( function ( sourceURI ) { + + return new Promise( function ( resolve, reject ) { + + let onLoad = resolve; + if ( loader.isImageBitmapLoader === true ) { + + onLoad = function ( imageBitmap ) { + + const texture = new THREE.Texture( imageBitmap ); + texture.needsUpdate = true; + resolve( texture ); + + }; + + } + + loader.load( THREE.LoaderUtils.resolveURL( sourceURI, options.path ), onLoad, undefined, reject ); + + } ); + + } ).then( function ( texture ) { + + // Clean up resources and configure THREE.Texture. + + if ( isObjectURL === true ) { + + URL.revokeObjectURL( sourceURI ); + + } + + texture.userData.mimeType = sourceDef.mimeType || getImageURIMimeType( sourceDef.uri ); + return texture; + + } ).catch( function ( error ) { + + console.error( 'THREE.GLTFLoader: Couldn\'t load texture', sourceURI ); + throw error; + + } ); + this.sourceCache[ sourceIndex ] = promise; + return promise; + + } + + /** + * Asynchronously assigns a texture to the given material parameters. + * @param {Object} materialParams + * @param {string} mapName + * @param {Object} mapDef + * @return {Promise} + */ + assignTexture( materialParams, mapName, mapDef, encoding ) { + + const parser = this; + return this.getDependency( 'texture', mapDef.index ).then( function ( texture ) { + + // Materials sample aoMap from UV set 1 and other maps from UV set 0 - this can't be configured + // However, we will copy UV set 0 to UV set 1 on demand for aoMap + if ( mapDef.texCoord !== undefined && mapDef.texCoord != 0 && ! ( mapName === 'aoMap' && mapDef.texCoord == 1 ) ) { + + console.warn( 'THREE.GLTFLoader: Custom UV set ' + mapDef.texCoord + ' for texture ' + mapName + ' not yet supported.' ); + + } + + if ( parser.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ] ) { + + const transform = mapDef.extensions !== undefined ? mapDef.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ] : undefined; + if ( transform ) { + + const gltfReference = parser.associations.get( texture ); + texture = parser.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ].extendTexture( texture, transform ); + parser.associations.set( texture, gltfReference ); + + } + + } + + if ( encoding !== undefined ) { + + texture.encoding = encoding; + + } + + materialParams[ mapName ] = texture; + return texture; + + } ); + + } + + /** + * Assigns final material to a THREE.Mesh, THREE.Line, or THREE.Points instance. The instance + * already has a material (generated from the glTF material options alone) + * but reuse of the same glTF material may require multiple threejs materials + * to accommodate different primitive types, defines, etc. New materials will + * be created if necessary, and reused from a cache. + * @param {Object3D} mesh THREE.Mesh, THREE.Line, or THREE.Points instance. + */ + assignFinalMaterial( mesh ) { + + const geometry = mesh.geometry; + let material = mesh.material; + const useDerivativeTangents = geometry.attributes.tangent === undefined; + const useVertexColors = geometry.attributes.color !== undefined; + const useFlatShading = geometry.attributes.normal === undefined; + if ( mesh.isPoints ) { + + const cacheKey = 'PointsMaterial:' + material.uuid; + let pointsMaterial = this.cache.get( cacheKey ); + if ( ! pointsMaterial ) { + + pointsMaterial = new THREE.PointsMaterial(); + THREE.Material.prototype.copy.call( pointsMaterial, material ); + pointsMaterial.color.copy( material.color ); + pointsMaterial.map = material.map; + pointsMaterial.sizeAttenuation = false; // glTF spec says points should be 1px + + this.cache.add( cacheKey, pointsMaterial ); + + } + + material = pointsMaterial; + + } else if ( mesh.isLine ) { + + const cacheKey = 'LineBasicMaterial:' + material.uuid; + let lineMaterial = this.cache.get( cacheKey ); + if ( ! lineMaterial ) { + + lineMaterial = new THREE.LineBasicMaterial(); + THREE.Material.prototype.copy.call( lineMaterial, material ); + lineMaterial.color.copy( material.color ); + this.cache.add( cacheKey, lineMaterial ); + + } + + material = lineMaterial; + + } + + // Clone the material if it will be modified + if ( useDerivativeTangents || useVertexColors || useFlatShading ) { + + let cacheKey = 'ClonedMaterial:' + material.uuid + ':'; + if ( material.isGLTFSpecularGlossinessMaterial ) cacheKey += 'specular-glossiness:'; + if ( useDerivativeTangents ) cacheKey += 'derivative-tangents:'; + if ( useVertexColors ) cacheKey += 'vertex-colors:'; + if ( useFlatShading ) cacheKey += 'flat-shading:'; + let cachedMaterial = this.cache.get( cacheKey ); + if ( ! cachedMaterial ) { + + cachedMaterial = material.clone(); + if ( useVertexColors ) cachedMaterial.vertexColors = true; + if ( useFlatShading ) cachedMaterial.flatShading = true; + if ( useDerivativeTangents ) { + + // https://github.com/mrdoob/three.js/issues/11438#issuecomment-507003995 + if ( cachedMaterial.normalScale ) cachedMaterial.normalScale.y *= - 1; + if ( cachedMaterial.clearcoatNormalScale ) cachedMaterial.clearcoatNormalScale.y *= - 1; + + } + + this.cache.add( cacheKey, cachedMaterial ); + this.associations.set( cachedMaterial, this.associations.get( material ) ); + + } + + material = cachedMaterial; + + } + + // workarounds for mesh and geometry + + if ( material.aoMap && geometry.attributes.uv2 === undefined && geometry.attributes.uv !== undefined ) { + + geometry.setAttribute( 'uv2', geometry.attributes.uv ); + + } + + mesh.material = material; + + } + getMaterialType() { + + return THREE.MeshStandardMaterial; + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials + * @param {number} materialIndex + * @return {Promise} + */ + loadMaterial( materialIndex ) { + + const parser = this; + const json = this.json; + const extensions = this.extensions; + const materialDef = json.materials[ materialIndex ]; + let materialType; + const materialParams = {}; + const materialExtensions = materialDef.extensions || {}; + const pending = []; + if ( materialExtensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ] ) { + + const sgExtension = extensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ]; + materialType = sgExtension.getMaterialType(); + pending.push( sgExtension.extendParams( materialParams, materialDef, parser ) ); + + } else if ( materialExtensions[ EXTENSIONS.KHR_MATERIALS_UNLIT ] ) { + + const kmuExtension = extensions[ EXTENSIONS.KHR_MATERIALS_UNLIT ]; + materialType = kmuExtension.getMaterialType(); + pending.push( kmuExtension.extendParams( materialParams, materialDef, parser ) ); + + } else { + + // Specification: + // https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#metallic-roughness-material + + const metallicRoughness = materialDef.pbrMetallicRoughness || {}; + materialParams.color = new THREE.Color( 1.0, 1.0, 1.0 ); + materialParams.opacity = 1.0; + if ( Array.isArray( metallicRoughness.baseColorFactor ) ) { + + const array = metallicRoughness.baseColorFactor; + materialParams.color.fromArray( array ); + materialParams.opacity = array[ 3 ]; + + } + + if ( metallicRoughness.baseColorTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'map', metallicRoughness.baseColorTexture, THREE.sRGBEncoding ) ); + + } + + materialParams.metalness = metallicRoughness.metallicFactor !== undefined ? metallicRoughness.metallicFactor : 1.0; + materialParams.roughness = metallicRoughness.roughnessFactor !== undefined ? metallicRoughness.roughnessFactor : 1.0; + if ( metallicRoughness.metallicRoughnessTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'metalnessMap', metallicRoughness.metallicRoughnessTexture ) ); + pending.push( parser.assignTexture( materialParams, 'roughnessMap', metallicRoughness.metallicRoughnessTexture ) ); + + } + + materialType = this._invokeOne( function ( ext ) { + + return ext.getMaterialType && ext.getMaterialType( materialIndex ); + + } ); + pending.push( Promise.all( this._invokeAll( function ( ext ) { + + return ext.extendMaterialParams && ext.extendMaterialParams( materialIndex, materialParams ); + + } ) ) ); + + } + + if ( materialDef.doubleSided === true ) { + + materialParams.side = THREE.DoubleSide; + + } + + const alphaMode = materialDef.alphaMode || ALPHA_MODES.OPAQUE; + if ( alphaMode === ALPHA_MODES.BLEND ) { + + materialParams.transparent = true; + + // See: https://github.com/mrdoob/three.js/issues/17706 + materialParams.depthWrite = false; + + } else { + + materialParams.transparent = false; + if ( alphaMode === ALPHA_MODES.MASK ) { + + materialParams.alphaTest = materialDef.alphaCutoff !== undefined ? materialDef.alphaCutoff : 0.5; + + } + + } + + if ( materialDef.normalTexture !== undefined && materialType !== THREE.MeshBasicMaterial ) { + + pending.push( parser.assignTexture( materialParams, 'normalMap', materialDef.normalTexture ) ); + materialParams.normalScale = new THREE.Vector2( 1, 1 ); + if ( materialDef.normalTexture.scale !== undefined ) { + + const scale = materialDef.normalTexture.scale; + materialParams.normalScale.set( scale, scale ); + + } + + } + + if ( materialDef.occlusionTexture !== undefined && materialType !== THREE.MeshBasicMaterial ) { + + pending.push( parser.assignTexture( materialParams, 'aoMap', materialDef.occlusionTexture ) ); + if ( materialDef.occlusionTexture.strength !== undefined ) { + + materialParams.aoMapIntensity = materialDef.occlusionTexture.strength; + + } + + } + + if ( materialDef.emissiveFactor !== undefined && materialType !== THREE.MeshBasicMaterial ) { + + materialParams.emissive = new THREE.Color().fromArray( materialDef.emissiveFactor ); + + } + + if ( materialDef.emissiveTexture !== undefined && materialType !== THREE.MeshBasicMaterial ) { + + pending.push( parser.assignTexture( materialParams, 'emissiveMap', materialDef.emissiveTexture, THREE.sRGBEncoding ) ); + + } + + return Promise.all( pending ).then( function () { + + let material; + if ( materialType === GLTFMeshStandardSGMaterial ) { + + material = extensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ].createMaterial( materialParams ); + + } else { + + material = new materialType( materialParams ); + + } + + if ( materialDef.name ) material.name = materialDef.name; + assignExtrasToUserData( material, materialDef ); + parser.associations.set( material, { + materials: materialIndex + } ); + if ( materialDef.extensions ) addUnknownExtensionsToUserData( extensions, material, materialDef ); + return material; + + } ); + + } + + /** When THREE.Object3D instances are targeted by animation, they need unique names. */ + createUniqueName( originalName ) { + + const sanitizedName = THREE.PropertyBinding.sanitizeNodeName( originalName || '' ); + let name = sanitizedName; + for ( let i = 1; this.nodeNamesUsed[ name ]; ++ i ) { + + name = sanitizedName + '_' + i; + + } + + this.nodeNamesUsed[ name ] = true; + return name; + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#geometry + * + * Creates BufferGeometries from primitives. + * + * @param {Array} primitives + * @return {Promise>} + */ + loadGeometries( primitives ) { + + const parser = this; + const extensions = this.extensions; + const cache = this.primitiveCache; + function createDracoPrimitive( primitive ) { + + return extensions[ EXTENSIONS.KHR_DRACO_MESH_COMPRESSION ].decodePrimitive( primitive, parser ).then( function ( geometry ) { + + return addPrimitiveAttributes( geometry, primitive, parser ); + + } ); + + } + + const pending = []; + for ( let i = 0, il = primitives.length; i < il; i ++ ) { + + const primitive = primitives[ i ]; + const cacheKey = createPrimitiveKey( primitive ); + + // See if we've already created this geometry + const cached = cache[ cacheKey ]; + if ( cached ) { + + // Use the cached geometry if it exists + pending.push( cached.promise ); + + } else { + + let geometryPromise; + if ( primitive.extensions && primitive.extensions[ EXTENSIONS.KHR_DRACO_MESH_COMPRESSION ] ) { + + // Use DRACO geometry if available + geometryPromise = createDracoPrimitive( primitive ); + + } else { + + // Otherwise create a new geometry + geometryPromise = addPrimitiveAttributes( new THREE.BufferGeometry(), primitive, parser ); + + } + + // Cache this geometry + cache[ cacheKey ] = { + primitive: primitive, + promise: geometryPromise + }; + pending.push( geometryPromise ); + + } + + } + + return Promise.all( pending ); + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#meshes + * @param {number} meshIndex + * @return {Promise} + */ + loadMesh( meshIndex ) { + + const parser = this; + const json = this.json; + const extensions = this.extensions; + const meshDef = json.meshes[ meshIndex ]; + const primitives = meshDef.primitives; + const pending = []; + for ( let i = 0, il = primitives.length; i < il; i ++ ) { + + const material = primitives[ i ].material === undefined ? createDefaultMaterial( this.cache ) : this.getDependency( 'material', primitives[ i ].material ); + pending.push( material ); + + } + + pending.push( parser.loadGeometries( primitives ) ); + return Promise.all( pending ).then( function ( results ) { + + const materials = results.slice( 0, results.length - 1 ); + const geometries = results[ results.length - 1 ]; + const meshes = []; + for ( let i = 0, il = geometries.length; i < il; i ++ ) { + + const geometry = geometries[ i ]; + const primitive = primitives[ i ]; + + // 1. create THREE.Mesh + + let mesh; + const material = materials[ i ]; + if ( primitive.mode === WEBGL_CONSTANTS.TRIANGLES || primitive.mode === WEBGL_CONSTANTS.TRIANGLE_STRIP || primitive.mode === WEBGL_CONSTANTS.TRIANGLE_FAN || primitive.mode === undefined ) { + + // .isSkinnedMesh isn't in glTF spec. See ._markDefs() + mesh = meshDef.isSkinnedMesh === true ? new THREE.SkinnedMesh( geometry, material ) : new THREE.Mesh( geometry, material ); + if ( mesh.isSkinnedMesh === true && ! mesh.geometry.attributes.skinWeight.normalized ) { + + // we normalize floating point skin weight array to fix malformed assets (see #15319) + // it's important to skip this for non-float32 data since normalizeSkinWeights assumes non-normalized inputs + mesh.normalizeSkinWeights(); + + } + + if ( primitive.mode === WEBGL_CONSTANTS.TRIANGLE_STRIP ) { + + mesh.geometry = toTrianglesDrawMode( mesh.geometry, THREE.TriangleStripDrawMode ); + + } else if ( primitive.mode === WEBGL_CONSTANTS.TRIANGLE_FAN ) { + + mesh.geometry = toTrianglesDrawMode( mesh.geometry, THREE.TriangleFanDrawMode ); + + } + + } else if ( primitive.mode === WEBGL_CONSTANTS.LINES ) { + + mesh = new THREE.LineSegments( geometry, material ); + + } else if ( primitive.mode === WEBGL_CONSTANTS.LINE_STRIP ) { + + mesh = new THREE.Line( geometry, material ); + + } else if ( primitive.mode === WEBGL_CONSTANTS.LINE_LOOP ) { + + mesh = new THREE.LineLoop( geometry, material ); + + } else if ( primitive.mode === WEBGL_CONSTANTS.POINTS ) { + + mesh = new THREE.Points( geometry, material ); + + } else { + + throw new Error( 'THREE.GLTFLoader: Primitive mode unsupported: ' + primitive.mode ); + + } + + if ( Object.keys( mesh.geometry.morphAttributes ).length > 0 ) { + + updateMorphTargets( mesh, meshDef ); + + } + + mesh.name = parser.createUniqueName( meshDef.name || 'mesh_' + meshIndex ); + assignExtrasToUserData( mesh, meshDef ); + if ( primitive.extensions ) addUnknownExtensionsToUserData( extensions, mesh, primitive ); + parser.assignFinalMaterial( mesh ); + meshes.push( mesh ); + + } + + for ( let i = 0, il = meshes.length; i < il; i ++ ) { + + parser.associations.set( meshes[ i ], { + meshes: meshIndex, + primitives: i + } ); + + } + + if ( meshes.length === 1 ) { + + return meshes[ 0 ]; + + } + + const group = new THREE.Group(); + parser.associations.set( group, { + meshes: meshIndex + } ); + for ( let i = 0, il = meshes.length; i < il; i ++ ) { + + group.add( meshes[ i ] ); + + } + + return group; + + } ); + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#cameras + * @param {number} cameraIndex + * @return {Promise} + */ + loadCamera( cameraIndex ) { + + let camera; + const cameraDef = this.json.cameras[ cameraIndex ]; + const params = cameraDef[ cameraDef.type ]; + if ( ! params ) { + + console.warn( 'THREE.GLTFLoader: Missing camera parameters.' ); + return; + + } + + if ( cameraDef.type === 'perspective' ) { + + camera = new THREE.PerspectiveCamera( THREE.MathUtils.radToDeg( params.yfov ), params.aspectRatio || 1, params.znear || 1, params.zfar || 2e6 ); + + } else if ( cameraDef.type === 'orthographic' ) { + + camera = new THREE.OrthographicCamera( - params.xmag, params.xmag, params.ymag, - params.ymag, params.znear, params.zfar ); + + } + + if ( cameraDef.name ) camera.name = this.createUniqueName( cameraDef.name ); + assignExtrasToUserData( camera, cameraDef ); + return Promise.resolve( camera ); + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins + * @param {number} skinIndex + * @return {Promise} + */ + loadSkin( skinIndex ) { + + const skinDef = this.json.skins[ skinIndex ]; + const skinEntry = { + joints: skinDef.joints + }; + if ( skinDef.inverseBindMatrices === undefined ) { + + return Promise.resolve( skinEntry ); + + } + + return this.getDependency( 'accessor', skinDef.inverseBindMatrices ).then( function ( accessor ) { + + skinEntry.inverseBindMatrices = accessor; + return skinEntry; + + } ); + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#animations + * @param {number} animationIndex + * @return {Promise} + */ + loadAnimation( animationIndex ) { + + const json = this.json; + const animationDef = json.animations[ animationIndex ]; + const pendingNodes = []; + const pendingInputAccessors = []; + const pendingOutputAccessors = []; + const pendingSamplers = []; + const pendingTargets = []; + for ( let i = 0, il = animationDef.channels.length; i < il; i ++ ) { + + const channel = animationDef.channels[ i ]; + const sampler = animationDef.samplers[ channel.sampler ]; + const target = channel.target; + const name = target.node; + const input = animationDef.parameters !== undefined ? animationDef.parameters[ sampler.input ] : sampler.input; + const output = animationDef.parameters !== undefined ? animationDef.parameters[ sampler.output ] : sampler.output; + pendingNodes.push( this.getDependency( 'node', name ) ); + pendingInputAccessors.push( this.getDependency( 'accessor', input ) ); + pendingOutputAccessors.push( this.getDependency( 'accessor', output ) ); + pendingSamplers.push( sampler ); + pendingTargets.push( target ); + + } + + return Promise.all( [ Promise.all( pendingNodes ), Promise.all( pendingInputAccessors ), Promise.all( pendingOutputAccessors ), Promise.all( pendingSamplers ), Promise.all( pendingTargets ) ] ).then( function ( dependencies ) { + + const nodes = dependencies[ 0 ]; + const inputAccessors = dependencies[ 1 ]; + const outputAccessors = dependencies[ 2 ]; + const samplers = dependencies[ 3 ]; + const targets = dependencies[ 4 ]; + const tracks = []; + for ( let i = 0, il = nodes.length; i < il; i ++ ) { + + const node = nodes[ i ]; + const inputAccessor = inputAccessors[ i ]; + const outputAccessor = outputAccessors[ i ]; + const sampler = samplers[ i ]; + const target = targets[ i ]; + if ( node === undefined ) continue; + node.updateMatrix(); + let TypedKeyframeTrack; + switch ( PATH_PROPERTIES[ target.path ] ) { + + case PATH_PROPERTIES.weights: + TypedKeyframeTrack = THREE.NumberKeyframeTrack; + break; + case PATH_PROPERTIES.rotation: + TypedKeyframeTrack = THREE.QuaternionKeyframeTrack; + break; + case PATH_PROPERTIES.position: + case PATH_PROPERTIES.scale: + default: + TypedKeyframeTrack = THREE.VectorKeyframeTrack; + break; + + } + + const targetName = node.name ? node.name : node.uuid; + const interpolation = sampler.interpolation !== undefined ? INTERPOLATION[ sampler.interpolation ] : THREE.InterpolateLinear; + const targetNames = []; + if ( PATH_PROPERTIES[ target.path ] === PATH_PROPERTIES.weights ) { + + node.traverse( function ( object ) { + + if ( object.morphTargetInfluences ) { + + targetNames.push( object.name ? object.name : object.uuid ); + + } + + } ); + + } else { + + targetNames.push( targetName ); + + } + + let outputArray = outputAccessor.array; + if ( outputAccessor.normalized ) { + + const scale = getNormalizedComponentScale( outputArray.constructor ); + const scaled = new Float32Array( outputArray.length ); + for ( let j = 0, jl = outputArray.length; j < jl; j ++ ) { + + scaled[ j ] = outputArray[ j ] * scale; + + } + + outputArray = scaled; + + } + + for ( let j = 0, jl = targetNames.length; j < jl; j ++ ) { + + const track = new TypedKeyframeTrack( targetNames[ j ] + '.' + PATH_PROPERTIES[ target.path ], inputAccessor.array, outputArray, interpolation ); + + // Override interpolation with custom factory method. + if ( sampler.interpolation === 'CUBICSPLINE' ) { + + track.createInterpolant = function InterpolantFactoryMethodGLTFCubicSpline( result ) { + + // A CUBICSPLINE keyframe in glTF has three output values for each input value, + // representing inTangent, splineVertex, and outTangent. As a result, track.getValueSize() + // must be divided by three to get the interpolant's sampleSize argument. + + const interpolantType = this instanceof THREE.QuaternionKeyframeTrack ? GLTFCubicSplineQuaternionInterpolant : GLTFCubicSplineInterpolant; + return new interpolantType( this.times, this.values, this.getValueSize() / 3, result ); + + }; + + // Mark as CUBICSPLINE. `track.getInterpolation()` doesn't support custom interpolants. + track.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = true; + + } + + tracks.push( track ); + + } + + } + + const name = animationDef.name ? animationDef.name : 'animation_' + animationIndex; + return new THREE.AnimationClip( name, undefined, tracks ); + + } ); + + } + createNodeMesh( nodeIndex ) { + + const json = this.json; + const parser = this; + const nodeDef = json.nodes[ nodeIndex ]; + if ( nodeDef.mesh === undefined ) return null; + return parser.getDependency( 'mesh', nodeDef.mesh ).then( function ( mesh ) { + + const node = parser._getNodeRef( parser.meshCache, nodeDef.mesh, mesh ); + + // if weights are provided on the node, override weights on the mesh. + if ( nodeDef.weights !== undefined ) { + + node.traverse( function ( o ) { + + if ( ! o.isMesh ) return; + for ( let i = 0, il = nodeDef.weights.length; i < il; i ++ ) { + + o.morphTargetInfluences[ i ] = nodeDef.weights[ i ]; + + } + + } ); + + } + + return node; + + } ); + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#nodes-and-hierarchy + * @param {number} nodeIndex + * @return {Promise} + */ + loadNode( nodeIndex ) { + + const json = this.json; + const extensions = this.extensions; + const parser = this; + const nodeDef = json.nodes[ nodeIndex ]; + + // reserve node's name before its dependencies, so the root has the intended name. + const nodeName = nodeDef.name ? parser.createUniqueName( nodeDef.name ) : ''; + return function () { + + const pending = []; + const meshPromise = parser._invokeOne( function ( ext ) { + + return ext.createNodeMesh && ext.createNodeMesh( nodeIndex ); + + } ); + if ( meshPromise ) { + + pending.push( meshPromise ); + + } + + if ( nodeDef.camera !== undefined ) { + + pending.push( parser.getDependency( 'camera', nodeDef.camera ).then( function ( camera ) { + + return parser._getNodeRef( parser.cameraCache, nodeDef.camera, camera ); + + } ) ); + + } + + parser._invokeAll( function ( ext ) { + + return ext.createNodeAttachment && ext.createNodeAttachment( nodeIndex ); + + } ).forEach( function ( promise ) { + + pending.push( promise ); + + } ); + return Promise.all( pending ); + + }().then( function ( objects ) { + + let node; + + // .isBone isn't in glTF spec. See ._markDefs + if ( nodeDef.isBone === true ) { + + node = new THREE.Bone(); + + } else if ( objects.length > 1 ) { + + node = new THREE.Group(); + + } else if ( objects.length === 1 ) { + + node = objects[ 0 ]; + + } else { + + node = new THREE.Object3D(); + + } + + if ( node !== objects[ 0 ] ) { + + for ( let i = 0, il = objects.length; i < il; i ++ ) { + + node.add( objects[ i ] ); + + } + + } + + if ( nodeDef.name ) { + + node.userData.name = nodeDef.name; + node.name = nodeName; + + } + + assignExtrasToUserData( node, nodeDef ); + if ( nodeDef.extensions ) addUnknownExtensionsToUserData( extensions, node, nodeDef ); + if ( nodeDef.matrix !== undefined ) { + + const matrix = new THREE.Matrix4(); + matrix.fromArray( nodeDef.matrix ); + node.applyMatrix4( matrix ); + + } else { + + if ( nodeDef.translation !== undefined ) { + + node.position.fromArray( nodeDef.translation ); + + } + + if ( nodeDef.rotation !== undefined ) { + + node.quaternion.fromArray( nodeDef.rotation ); + + } + + if ( nodeDef.scale !== undefined ) { + + node.scale.fromArray( nodeDef.scale ); + + } + + } + + if ( ! parser.associations.has( node ) ) { + + parser.associations.set( node, {} ); + + } + + parser.associations.get( node ).nodes = nodeIndex; + return node; + + } ); + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#scenes + * @param {number} sceneIndex + * @return {Promise} + */ + loadScene( sceneIndex ) { + + const json = this.json; + const extensions = this.extensions; + const sceneDef = this.json.scenes[ sceneIndex ]; + const parser = this; + + // THREE.Loader returns THREE.Group, not Scene. + // See: https://github.com/mrdoob/three.js/issues/18342#issuecomment-578981172 + const scene = new THREE.Group(); + if ( sceneDef.name ) scene.name = parser.createUniqueName( sceneDef.name ); + assignExtrasToUserData( scene, sceneDef ); + if ( sceneDef.extensions ) addUnknownExtensionsToUserData( extensions, scene, sceneDef ); + const nodeIds = sceneDef.nodes || []; + const pending = []; + for ( let i = 0, il = nodeIds.length; i < il; i ++ ) { + + pending.push( buildNodeHierarchy( nodeIds[ i ], scene, json, parser ) ); + + } + + return Promise.all( pending ).then( function () { + + // Removes dangling associations, associations that reference a node that + // didn't make it into the scene. + const reduceAssociations = node => { + + const reducedAssociations = new Map(); + for ( const [ key, value ] of parser.associations ) { + + if ( key instanceof THREE.Material || key instanceof THREE.Texture ) { + + reducedAssociations.set( key, value ); + + } + + } + + node.traverse( node => { + + const mappings = parser.associations.get( node ); + if ( mappings != null ) { + + reducedAssociations.set( node, mappings ); + + } + + } ); + return reducedAssociations; + + }; + + parser.associations = reduceAssociations( scene ); + return scene; + + } ); + + } + + } + function buildNodeHierarchy( nodeId, parentObject, json, parser ) { + + const nodeDef = json.nodes[ nodeId ]; + return parser.getDependency( 'node', nodeId ).then( function ( node ) { + + if ( nodeDef.skin === undefined ) return node; + + // build skeleton here as well + + let skinEntry; + return parser.getDependency( 'skin', nodeDef.skin ).then( function ( skin ) { + + skinEntry = skin; + const pendingJoints = []; + for ( let i = 0, il = skinEntry.joints.length; i < il; i ++ ) { + + pendingJoints.push( parser.getDependency( 'node', skinEntry.joints[ i ] ) ); + + } + + return Promise.all( pendingJoints ); + + } ).then( function ( jointNodes ) { + + node.traverse( function ( mesh ) { + + if ( ! mesh.isMesh ) return; + const bones = []; + const boneInverses = []; + for ( let j = 0, jl = jointNodes.length; j < jl; j ++ ) { + + const jointNode = jointNodes[ j ]; + if ( jointNode ) { + + bones.push( jointNode ); + const mat = new THREE.Matrix4(); + if ( skinEntry.inverseBindMatrices !== undefined ) { + + mat.fromArray( skinEntry.inverseBindMatrices.array, j * 16 ); + + } + + boneInverses.push( mat ); + + } else { + + console.warn( 'THREE.GLTFLoader: Joint "%s" could not be found.', skinEntry.joints[ j ] ); + + } + + } + + mesh.bind( new THREE.Skeleton( bones, boneInverses ), mesh.matrixWorld ); + + } ); + return node; + + } ); + + } ).then( function ( node ) { + + // build node hierachy + + parentObject.add( node ); + const pending = []; + if ( nodeDef.children ) { + + const children = nodeDef.children; + for ( let i = 0, il = children.length; i < il; i ++ ) { + + const child = children[ i ]; + pending.push( buildNodeHierarchy( child, node, json, parser ) ); + + } + + } + + return Promise.all( pending ); + + } ); + + } + + /** + * @param {BufferGeometry} geometry + * @param {GLTF.Primitive} primitiveDef + * @param {GLTFParser} parser + */ + function computeBounds( geometry, primitiveDef, parser ) { + + const attributes = primitiveDef.attributes; + const box = new THREE.Box3(); + if ( attributes.POSITION !== undefined ) { + + const accessor = parser.json.accessors[ attributes.POSITION ]; + const min = accessor.min; + const max = accessor.max; + + // glTF requires 'min' and 'max', but VRM (which extends glTF) currently ignores that requirement. + + if ( min !== undefined && max !== undefined ) { + + box.set( new THREE.Vector3( min[ 0 ], min[ 1 ], min[ 2 ] ), new THREE.Vector3( max[ 0 ], max[ 1 ], max[ 2 ] ) ); + if ( accessor.normalized ) { + + const boxScale = getNormalizedComponentScale( WEBGL_COMPONENT_TYPES[ accessor.componentType ] ); + box.min.multiplyScalar( boxScale ); + box.max.multiplyScalar( boxScale ); + + } + + } else { + + console.warn( 'THREE.GLTFLoader: Missing min/max properties for accessor POSITION.' ); + return; + + } + + } else { + + return; + + } + + const targets = primitiveDef.targets; + if ( targets !== undefined ) { + + const maxDisplacement = new THREE.Vector3(); + const vector = new THREE.Vector3(); + for ( let i = 0, il = targets.length; i < il; i ++ ) { + + const target = targets[ i ]; + if ( target.POSITION !== undefined ) { + + const accessor = parser.json.accessors[ target.POSITION ]; + const min = accessor.min; + const max = accessor.max; + + // glTF requires 'min' and 'max', but VRM (which extends glTF) currently ignores that requirement. + + if ( min !== undefined && max !== undefined ) { + + // we need to get max of absolute components because target weight is [-1,1] + vector.setX( Math.max( Math.abs( min[ 0 ] ), Math.abs( max[ 0 ] ) ) ); + vector.setY( Math.max( Math.abs( min[ 1 ] ), Math.abs( max[ 1 ] ) ) ); + vector.setZ( Math.max( Math.abs( min[ 2 ] ), Math.abs( max[ 2 ] ) ) ); + if ( accessor.normalized ) { + + const boxScale = getNormalizedComponentScale( WEBGL_COMPONENT_TYPES[ accessor.componentType ] ); + vector.multiplyScalar( boxScale ); + + } + + // Note: this assumes that the sum of all weights is at most 1. This isn't quite correct - it's more conservative + // to assume that each target can have a max weight of 1. However, for some use cases - notably, when morph targets + // are used to implement key-frame animations and as such only two are active at a time - this results in very large + // boxes. So for now we make a box that's sometimes a touch too small but is hopefully mostly of reasonable size. + maxDisplacement.max( vector ); + + } else { + + console.warn( 'THREE.GLTFLoader: Missing min/max properties for accessor POSITION.' ); + + } + + } + + } + + // As per comment above this box isn't conservative, but has a reasonable size for a very large number of morph targets. + box.expandByVector( maxDisplacement ); + + } + + geometry.boundingBox = box; + const sphere = new THREE.Sphere(); + box.getCenter( sphere.center ); + sphere.radius = box.min.distanceTo( box.max ) / 2; + geometry.boundingSphere = sphere; + + } + + /** + * @param {BufferGeometry} geometry + * @param {GLTF.Primitive} primitiveDef + * @param {GLTFParser} parser + * @return {Promise} + */ + function addPrimitiveAttributes( geometry, primitiveDef, parser ) { + + const attributes = primitiveDef.attributes; + const pending = []; + function assignAttributeAccessor( accessorIndex, attributeName ) { + + return parser.getDependency( 'accessor', accessorIndex ).then( function ( accessor ) { + + geometry.setAttribute( attributeName, accessor ); + + } ); + + } + + for ( const gltfAttributeName in attributes ) { + + const threeAttributeName = ATTRIBUTES[ gltfAttributeName ] || gltfAttributeName.toLowerCase(); + + // Skip attributes already provided by e.g. Draco extension. + if ( threeAttributeName in geometry.attributes ) continue; + pending.push( assignAttributeAccessor( attributes[ gltfAttributeName ], threeAttributeName ) ); + + } + + if ( primitiveDef.indices !== undefined && ! geometry.index ) { + + const accessor = parser.getDependency( 'accessor', primitiveDef.indices ).then( function ( accessor ) { + + geometry.setIndex( accessor ); + + } ); + pending.push( accessor ); + + } + + assignExtrasToUserData( geometry, primitiveDef ); + computeBounds( geometry, primitiveDef, parser ); + return Promise.all( pending ).then( function () { + + return primitiveDef.targets !== undefined ? addMorphTargets( geometry, primitiveDef.targets, parser ) : geometry; + + } ); + + } + + /** + * @param {BufferGeometry} geometry + * @param {Number} drawMode + * @return {BufferGeometry} + */ + function toTrianglesDrawMode( geometry, drawMode ) { + + let index = geometry.getIndex(); + + // generate index if not present + + if ( index === null ) { + + const indices = []; + const position = geometry.getAttribute( 'position' ); + if ( position !== undefined ) { + + for ( let i = 0; i < position.count; i ++ ) { + + indices.push( i ); + + } + + geometry.setIndex( indices ); + index = geometry.getIndex(); + + } else { + + console.error( 'THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.' ); + return geometry; + + } + + } + + // + + const numberOfTriangles = index.count - 2; + const newIndices = []; + if ( drawMode === THREE.TriangleFanDrawMode ) { + + // gl.TRIANGLE_FAN + + for ( let i = 1; i <= numberOfTriangles; i ++ ) { + + newIndices.push( index.getX( 0 ) ); + newIndices.push( index.getX( i ) ); + newIndices.push( index.getX( i + 1 ) ); + + } + + } else { + + // gl.TRIANGLE_STRIP + + for ( let i = 0; i < numberOfTriangles; i ++ ) { + + if ( i % 2 === 0 ) { + + newIndices.push( index.getX( i ) ); + newIndices.push( index.getX( i + 1 ) ); + newIndices.push( index.getX( i + 2 ) ); + + } else { + + newIndices.push( index.getX( i + 2 ) ); + newIndices.push( index.getX( i + 1 ) ); + newIndices.push( index.getX( i ) ); + + } + + } + + } + + if ( newIndices.length / 3 !== numberOfTriangles ) { + + console.error( 'THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.' ); + + } + + // build final geometry + + const newGeometry = geometry.clone(); + newGeometry.setIndex( newIndices ); + return newGeometry; + + } + + THREE.GLTFLoader = GLTFLoader; + +} )(); +}; +gdjs.evtsExt__Physics3dExtension__LoadGLTFLoaderLibrary.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +} + +} + + +{ + + +gdjs.evtsExt__Physics3dExtension__LoadGLTFLoaderLibrary.userFunc0x15341d0(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__LoadGLTFLoaderLibrary.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Physics3dExtension__LoadGLTFLoaderLibrary.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__Physics3dExtension__LoadGLTFLoaderLibrary.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__loadlighting-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__loadlighting-func.js new file mode 100644 index 0000000..334a303 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__loadlighting-func.js @@ -0,0 +1,118 @@ + +if (typeof gdjs.evtsExt__Physics3dExtension__LoadLighting !== "undefined") { + gdjs.evtsExt__Physics3dExtension__LoadLighting.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Physics3dExtension__LoadLighting = {}; + + +gdjs.evtsExt__Physics3dExtension__LoadLighting.userFunc0x15341d0 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__Physics3DExtension.has("World")) { + console.warn("!"); + return; +} + +const Scene = gdjs.__WithThreeJS.get("Scene"); + +// Renderer.outputEncoding = THREE.sRGBEncoding; +if(!gdjs.__WithThreeJS.lightLoaded) { + const hemiLight = new THREE.HemisphereLight( 0xffffff, 0x444444 ); + hemiLight.position.set( 0, 20, 0 ); + Scene.add( hemiLight ); + + const dirLight = new THREE.DirectionalLight( 0xffffff ); + dirLight.position.set( - 3, 10, - 10 ); + dirLight.castShadow = true; + dirLight.shadow.camera.top = 2; + dirLight.shadow.camera.bottom = - 2; + dirLight.shadow.camera.left = - 2; + dirLight.shadow.camera.right = 2; + dirLight.shadow.camera.near = 0.1; + dirLight.shadow.camera.far = 40; + Scene.add( dirLight ); + + gdjs.__WithThreeJS.lightLoaded = true; +} +}; +gdjs.evtsExt__Physics3dExtension__LoadLighting.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +} + +} + + +{ + + +gdjs.evtsExt__Physics3dExtension__LoadLighting.userFunc0x15341d0(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__LoadLighting.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Physics3dExtension__LoadLighting.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__Physics3dExtension__LoadLighting.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__loadphysicslibrary-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__loadphysicslibrary-func.js new file mode 100644 index 0000000..5cbb8d5 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__loadphysicslibrary-func.js @@ -0,0 +1,130 @@ + +if (typeof gdjs.evtsExt__Physics3dExtension__LoadPhysicsLibrary !== "undefined") { + gdjs.evtsExt__Physics3dExtension__LoadPhysicsLibrary.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Physics3dExtension__LoadPhysicsLibrary = {}; + + +gdjs.evtsExt__Physics3dExtension__LoadPhysicsLibrary.userFunc0x13f3a20 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +/* + * Copyright (c) 2015 cannon.js Authors + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&false)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.CANNON=e()}}(function(){return function e(f,n,o){function d(t,l){if(!n[t]){if(!f[t]){var u="function"==typeof require&&require;if(!l&&u)return u(t,!0);if(i)return i(t,!0);throw new Error("Cannot find module '"+t+"'")}var p=n[t]={exports:{}};f[t][0].call(p.exports,function(e){var n=f[t][1][e];return d(n?n:e)},p,p.exports,e,f,n,o)}return n[t].exports}for(var i="function"==typeof require&&require,t=0;t (http://steffe.se)",keywords:["cannon.js","cannon","physics","engine","3d"],main:"./build/cannon.js",engines:{node:"*"},repository:{type:"git",url:"https://github.com/schteppe/cannon.js.git"},bugs:{url:"https://github.com/schteppe/cannon.js/issues"},licenses:[{type:"MIT"}],devDependencies:{jshint:"latest","uglify-js":"latest",nodeunit:"^0.9.0",grunt:"~0.4.0","grunt-contrib-jshint":"~0.1.1","grunt-contrib-nodeunit":"^0.4.1","grunt-contrib-concat":"~0.1.3","grunt-contrib-uglify":"^0.5.1","grunt-browserify":"^2.1.4","grunt-contrib-yuidoc":"^0.5.2",browserify:"*"},dependencies:{}}},{}],2:[function(e,f){f.exports={version:e("../package.json").version,AABB:e("./collision/AABB"),ArrayCollisionMatrix:e("./collision/ArrayCollisionMatrix"),Body:e("./objects/Body"),Box:e("./shapes/Box"),Broadphase:e("./collision/Broadphase"),Constraint:e("./constraints/Constraint"),ContactEquation:e("./equations/ContactEquation"),Narrowphase:e("./world/Narrowphase"),ConeTwistConstraint:e("./constraints/ConeTwistConstraint"),ContactMaterial:e("./material/ContactMaterial"),ConvexPolyhedron:e("./shapes/ConvexPolyhedron"),Cylinder:e("./shapes/Cylinder"),DistanceConstraint:e("./constraints/DistanceConstraint"),Equation:e("./equations/Equation"),EventTarget:e("./utils/EventTarget"),FrictionEquation:e("./equations/FrictionEquation"),GSSolver:e("./solver/GSSolver"),GridBroadphase:e("./collision/GridBroadphase"),Heightfield:e("./shapes/Heightfield"),HingeConstraint:e("./constraints/HingeConstraint"),LockConstraint:e("./constraints/LockConstraint"),Mat3:e("./math/Mat3"),Material:e("./material/Material"),NaiveBroadphase:e("./collision/NaiveBroadphase"),ObjectCollisionMatrix:e("./collision/ObjectCollisionMatrix"),Pool:e("./utils/Pool"),Particle:e("./shapes/Particle"),Plane:e("./shapes/Plane"),PointToPointConstraint:e("./constraints/PointToPointConstraint"),Quaternion:e("./math/Quaternion"),Ray:e("./collision/Ray"),RaycastVehicle:e("./objects/RaycastVehicle"),RaycastResult:e("./collision/RaycastResult"),RigidVehicle:e("./objects/RigidVehicle"),RotationalEquation:e("./equations/RotationalEquation"),RotationalMotorEquation:e("./equations/RotationalMotorEquation"),SAPBroadphase:e("./collision/SAPBroadphase"),SPHSystem:e("./objects/SPHSystem"),Shape:e("./shapes/Shape"),Solver:e("./solver/Solver"),Sphere:e("./shapes/Sphere"),SplitSolver:e("./solver/SplitSolver"),Spring:e("./objects/Spring"),Trimesh:e("./shapes/Trimesh"),Vec3:e("./math/Vec3"),Vec3Pool:e("./utils/Vec3Pool"),World:e("./world/World")}},{"../package.json":1,"./collision/AABB":3,"./collision/ArrayCollisionMatrix":4,"./collision/Broadphase":5,"./collision/GridBroadphase":6,"./collision/NaiveBroadphase":7,"./collision/ObjectCollisionMatrix":8,"./collision/Ray":9,"./collision/RaycastResult":10,"./collision/SAPBroadphase":11,"./constraints/ConeTwistConstraint":12,"./constraints/Constraint":13,"./constraints/DistanceConstraint":14,"./constraints/HingeConstraint":15,"./constraints/LockConstraint":16,"./constraints/PointToPointConstraint":17,"./equations/ContactEquation":19,"./equations/Equation":20,"./equations/FrictionEquation":21,"./equations/RotationalEquation":22,"./equations/RotationalMotorEquation":23,"./material/ContactMaterial":24,"./material/Material":25,"./math/Mat3":27,"./math/Quaternion":28,"./math/Vec3":30,"./objects/Body":31,"./objects/RaycastVehicle":32,"./objects/RigidVehicle":33,"./objects/SPHSystem":34,"./objects/Spring":35,"./shapes/Box":37,"./shapes/ConvexPolyhedron":38,"./shapes/Cylinder":39,"./shapes/Heightfield":40,"./shapes/Particle":41,"./shapes/Plane":42,"./shapes/Shape":43,"./shapes/Sphere":44,"./shapes/Trimesh":45,"./solver/GSSolver":46,"./solver/Solver":47,"./solver/SplitSolver":48,"./utils/EventTarget":49,"./utils/Pool":51,"./utils/Vec3Pool":54,"./world/Narrowphase":55,"./world/World":56}],3:[function(e,f){function n(e){e=e||{},this.lowerBound=new o,e.lowerBound&&this.lowerBound.copy(e.lowerBound),this.upperBound=new o,e.upperBound&&this.upperBound.copy(e.upperBound)}{var o=e("../math/Vec3");e("../utils/Utils")}f.exports=n;var d=new o;n.prototype.setFromPoints=function(e,f,n,o){var i=this.lowerBound,t=this.upperBound,l=n;i.copy(e[0]),l&&l.vmult(i,i),t.copy(i);for(var u=1;ut.x&&(t.x=p.x),p.xt.y&&(t.y=p.y),p.yt.z&&(t.z=p.z),p.zf&&(this.lowerBound.x=f);var n=e.upperBound.x;this.upperBound.xf&&(this.lowerBound.y=f);var n=e.upperBound.y;this.upperBound.yf&&(this.lowerBound.z=f);var n=e.upperBound.z;this.upperBound.z=d.x&&f.y<=o.y&&n.y>=d.y&&f.z<=o.z&&n.z>=d.z},n.prototype.getCorners=function(e,f,n,o,d,i,t,l){var u=this.lowerBound,p=this.upperBound;e.copy(u),f.set(p.x,u.y,u.z),n.set(p.x,p.y,u.z),o.set(u.x,p.y,p.z),d.set(p.x,u.y,u.z),i.set(u.x,p.y,u.z),t.set(u.x,u.y,p.z),l.copy(p)};var i=[new o,new o,new o,new o,new o,new o,new o,new o];n.prototype.toLocalFrame=function(e,f){var n=i,o=n[0],d=n[1],t=n[2],l=n[3],u=n[4],p=n[5],s=n[6],y=n[7];this.getCorners(o,d,t,l,u,p,s,y);for(var c=0;8!==c;c++){var a=n[c];e.pointToLocal(a,a)}return f.setFromPoints(n)},n.prototype.toWorldFrame=function(e,f){var n=i,o=n[0],d=n[1],t=n[2],l=n[3],u=n[4],p=n[5],s=n[6],y=n[7];this.getCorners(o,d,t,l,u,p,s,y);for(var c=0;8!==c;c++){var a=n[c];e.pointToWorld(a,a)}return f.setFromPoints(n)}},{"../math/Vec3":30,"../utils/Utils":53}],4:[function(e,f){function n(){this.matrix=[]}f.exports=n,n.prototype.get=function(e,f){if(e=e.index,f=f.index,f>e){var n=f;f=e,e=n}return this.matrix[(e*(e+1)>>1)+f-1]},n.prototype.set=function(e,f,n){if(e=e.index,f=f.index,f>e){var o=f;f=e,e=o}this.matrix[(e*(e+1)>>1)+f-1]=n?1:0},n.prototype.reset=function(){for(var e=0,f=this.matrix.length;e!==f;e++)this.matrix[e]=0},n.prototype.setNumObjects=function(e){this.matrix.length=e*(e-1)>>1}},{}],5:[function(e,f){function n(){this.world=null,this.useBoundingBoxes=!1,this.dirty=!0}{var o=e("../objects/Body"),d=e("../math/Vec3"),i=e("../math/Quaternion");e("../shapes/Shape"),e("../shapes/Plane")}f.exports=n,n.prototype.collisionPairs=function(){throw new Error("collisionPairs not implemented for this BroadPhase class!")};var t=o.STATIC|o.KINEMATIC;n.prototype.needBroadphaseCollision=function(e,f){return 0===(e.collisionFilterGroup&f.collisionFilterMask)||0===(f.collisionFilterGroup&e.collisionFilterMask)?!1:0===(e.type&t)&&e.sleepState!==o.SLEEPING||0===(f.type&t)&&f.sleepState!==o.SLEEPING?!0:!1},n.prototype.intersectionTest=function(e,f,n,o){this.useBoundingBoxes?this.doBoundingBoxBroadphase(e,f,n,o):this.doBoundingSphereBroadphase(e,f,n,o)};{var l=new d;new d,new i,new d}n.prototype.doBoundingSphereBroadphase=function(e,f,n,o){var d=l;f.position.vsub(e.position,d);var i=Math.pow(e.boundingRadius+f.boundingRadius,2),t=d.norm2();i>t&&(n.push(e),o.push(f))},n.prototype.doBoundingBoxBroadphase=function(e,f,n,o){e.aabbNeedsUpdate&&e.computeAABB(),f.aabbNeedsUpdate&&f.computeAABB(),e.aabb.overlaps(f.aabb)&&(n.push(e),o.push(f))};var u={keys:[]},p=[],s=[];n.prototype.makePairsUnique=function(e,f){for(var n=u,o=p,d=s,i=e.length,t=0;t!==i;t++)o[t]=e[t],d[t]=f[t];e.length=0,f.length=0;for(var t=0;t!==i;t++){var l=o[t].id,y=d[t].id,c=y>l?l+","+y:y+","+l;n[c]=t,n.keys.push(c)}for(var t=0;t!==n.keys.length;t++){var c=n.keys.pop(),a=n[c];e.push(o[a]),f.push(d[a]),delete n[c]}},n.prototype.setWorld=function(){};var y=new d;n.boundingSphereCheck=function(e,f){var n=y;return e.position.vsub(f.position,n),Math.pow(e.shape.boundingSphereRadius+f.shape.boundingSphereRadius,2)>n.norm2()},n.prototype.aabbQuery=function(){return console.warn(".aabbQuery is not implemented in this Broadphase subclass."),[]}},{"../math/Quaternion":28,"../math/Vec3":30,"../objects/Body":31,"../shapes/Plane":42,"../shapes/Shape":43}],6:[function(e,f){function n(e,f,n,i,t){o.apply(this),this.nx=n||10,this.ny=i||10,this.nz=t||10,this.aabbMin=e||new d(100,100,100),this.aabbMax=f||new d(-100,-100,-100);var l=this.nx*this.ny*this.nz;if(0>=l)throw"GridBroadphase: Each dimension's n must be >0";this.bins=[],this.binLengths=[],this.bins.length=l,this.binLengths.length=l;for(var u=0;l>u;u++)this.bins[u]=[],this.binLengths[u]=0}f.exports=n;var o=e("./Broadphase"),d=e("../math/Vec3"),i=e("../shapes/Shape");n.prototype=new o,n.prototype.constructor=n;{var t=new d;new d}n.prototype.collisionPairs=function(e,f,n){function o(e,f,n,o,d,i,t){var l=(e-g)*v|0,u=(f-x)*A|0,p=(n-j)*C|0,b=I((o-g)*v),m=I((d-x)*A),N=I((i-j)*C);0>l?l=0:l>=s&&(l=s-1),0>u?u=0:u>=y&&(u=y-1),0>p?p=0:p>=c&&(p=c-1),0>b?b=0:b>=s&&(b=s-1),0>m?m=0:m>=y&&(m=y-1),0>N?N=0:N>=c&&(N=c-1),l*=a,u*=r,p*=w,b*=a,m*=r,N*=w;for(var O=l;b>=O;O+=a)for(var h=u;m>=h;h+=r)for(var k=p;N>=k;k+=w){var q=O+h+k;E[q][F[q]++]=t}}for(var d=e.numObjects(),l=e.bodies,u=this.aabbMax,p=this.aabbMin,s=this.nx,y=this.ny,c=this.nz,a=y*c,r=c,w=1,b=u.x,m=u.y,N=u.z,g=p.x,x=p.y,j=p.z,v=s/(b-g),A=y/(m-x),C=c/(N-j),O=(b-g)/s,h=(m-x)/y,k=(N-j)/c,q=.5*Math.sqrt(O*O+h*h+k*k),z=i.types,B=z.SPHERE,D=z.PLANE,E=(z.BOX,z.COMPOUND,z.CONVEXPOLYHEDRON,this.bins),F=this.binLengths,G=this.bins.length,H=0;H!==G;H++)F[H]=0;for(var I=Math.ceil,p=Math.min,u=Math.max,H=0;H!==d;H++){var J=l[H],K=J.shape;switch(K.type){case B:var L=J.position.x,M=J.position.y,P=J.position.z,Q=K.radius;o(L-Q,M-Q,P-Q,L+Q,M+Q,P+Q,J);break;case D:K.worldNormalNeedsUpdate&&K.computeWorldNormal(J.quaternion);var R=K.worldNormal,S=g+.5*O-J.position.x,T=x+.5*h-J.position.y,U=j+.5*k-J.position.z,V=t;V.set(S,T,U);for(var W=0,X=0;W!==s;W++,X+=a,V.y=T,V.x+=O)for(var Y=0,Z=0;Y!==y;Y++,Z+=r,V.z=U,V.y+=h)for(var $=0,_=0;$!==c;$++,_+=w,V.z+=k)if(V.dot(R)1)for(var nf=E[H],W=0;W!==ff;W++)for(var J=nf[W],Y=0;Y!==W;Y++){var of=nf[Y];this.needBroadphaseCollision(J,of)&&this.intersectionTest(J,of,f,n)}}this.makePairsUnique(f,n)}},{"../math/Vec3":30,"../shapes/Shape":43,"./Broadphase":5}],7:[function(e,f){function n(){o.apply(this)}f.exports=n;var o=e("./Broadphase"),d=e("./AABB");n.prototype=new o,n.prototype.constructor=n,n.prototype.collisionPairs=function(e,f,n){var o,d,i,t,l=e.bodies,u=l.length;for(o=0;o!==u;o++)for(d=0;d!==o;d++)i=l[o],t=l[d],this.needBroadphaseCollision(i,t)&&this.intersectionTest(i,t,f,n)};new d;n.prototype.aabbQuery=function(e,f,n){n=n||[];for(var o=0;oe){var n=f;f=e,e=n}return e+"-"+f in this.matrix},n.prototype.set=function(e,f,n){if(e=e.id,f=f.id,f>e){var o=f;f=e,e=o}n?this.matrix[e+"-"+f]=!0:delete this.matrix[e+"-"+f]},n.prototype.reset=function(){this.matrix={}},n.prototype.setNumObjects=function(){}},{}],9:[function(e,f){function n(e,f){this.from=e?e.clone():new i,this.to=f?f.clone():new i,this._direction=new i,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=n.ANY,this.result=new u,this.hasHit=!1,this.callback=function(){}}function o(e,f,n,o){o.vsub(f,G),n.vsub(f,a),e.vsub(f,r);var d,i,t=G.dot(G),l=G.dot(a),u=G.dot(r),p=a.dot(a),s=a.dot(r);return(d=p*u-l*s)>=0&&(i=t*s-l*u)>=0&&t*p-l*l>d+i}function d(e,f,n){n.vsub(e,G);var o=G.dot(f);f.mult(o,H),H.vadd(e,H);var d=n.distanceTo(H);return d}f.exports=n;var i=e("../math/Vec3"),t=e("../math/Quaternion"),l=e("../math/Transform"),u=(e("../shapes/ConvexPolyhedron"),e("../shapes/Box"),e("../collision/RaycastResult")),p=e("../shapes/Shape"),s=e("../collision/AABB");n.prototype.constructor=n,n.CLOSEST=1,n.ANY=2,n.ALL=4;var y=new s,c=[];n.prototype.intersectWorld=function(e,f){return this.mode=f.mode||n.ANY,this.result=f.result||new u,this.skipBackfaces=!!f.skipBackfaces,this.collisionFilterMask="undefined"!=typeof f.collisionFilterMask?f.collisionFilterMask:-1,this.collisionFilterGroup="undefined"!=typeof f.collisionFilterGroup?f.collisionFilterGroup:-1,f.from&&this.from.copy(f.from),f.to&&this.to.copy(f.to),this.callback=f.callback||function(){},this.hasHit=!1,this.result.reset(),this._updateDirection(),this.getAABB(y),c.length=0,e.broadphase.aabbQuery(e,y,c),this.intersectBodies(c),this.hasHit};var a=new i,r=new i;n.pointInTriangle=o;var w=new i,b=new t;n.prototype.intersectBody=function(e,f){f&&(this.result=f,this._updateDirection());var n=this.checkCollisionResponse;if((!n||e.collisionResponse)&&0!==(this.collisionFilterGroup&e.collisionFilterMask)&&0!==(e.collisionFilterGroup&this.collisionFilterMask))for(var o=w,d=b,i=0,t=e.shapes.length;t>i;i++){var l=e.shapes[i];if((!n||l.collisionResponse)&&(e.quaternion.mult(e.shapeOrientations[i],d),e.quaternion.vmult(e.shapeOffsets[i],o),o.vadd(e.position,o),this.intersectShape(l,d,o,e),this.result._shouldStop))break}},n.prototype.intersectBodies=function(e,f){f&&(this.result=f,this._updateDirection());for(var n=0,o=e.length;!this.result._shouldStop&&o>n;n++)this.intersectBody(e[n])},n.prototype._updateDirection=function(){this.to.vsub(this.from,this._direction),this._direction.normalize()},n.prototype.intersectShape=function(e,f,n,o){var i=this.from,t=d(i,this._direction,n);if(!(t>e.boundingSphereRadius)){var l=this[e.type];l&&l.call(this,e,f,n,o)}};{var m=(new i,new i,new i),N=new i,g=new i,x=new i;new i,new u}n.prototype.intersectBox=function(e,f,n,o){return this.intersectConvex(e.convexPolyhedronRepresentation,f,n,o)},n.prototype[p.types.BOX]=n.prototype.intersectBox,n.prototype.intersectPlane=function(e,f,n,o){var d=this.from,t=this.to,l=this._direction,u=new i(0,0,1);f.vmult(u,u);var p=new i;d.vsub(n,p);var s=p.dot(u);t.vsub(n,p);var y=p.dot(u);if(!(s*y>0||d.distanceTo(t)c)&&(c=p[0]),(null===y||p[1]a)&&(a=p[1])),null!==s){var w=[];e.getRectMinMax(s,y,c,a,w);for(var b=(w[0],w[1],s);c>=b;b++)for(var m=y;a>=m;m++){if(this.result._shouldStop)return;if(e.getConvexTrianglePillar(b,m,!1),l.pointToWorldFrame(o,f,e.pillarOffset,t),this.intersectConvex(e.pillarConvex,f,t,d,j),this.result._shouldStop)return;e.getConvexTrianglePillar(b,m,!0),l.pointToWorldFrame(o,f,e.pillarOffset,t),this.intersectConvex(e.pillarConvex,f,t,d,j)}}},n.prototype[p.types.HEIGHTFIELD]=n.prototype.intersectHeightfield;var v=new i,A=new i;n.prototype.intersectSphere=function(e,f,n,o){var d=this.from,i=this.to,t=e.radius,l=Math.pow(i.x-d.x,2)+Math.pow(i.y-d.y,2)+Math.pow(i.z-d.z,2),u=2*((i.x-d.x)*(d.x-n.x)+(i.y-d.y)*(d.y-n.y)+(i.z-d.z)*(d.z-n.z)),p=Math.pow(d.x-n.x,2)+Math.pow(d.y-n.y,2)+Math.pow(d.z-n.z,2)-Math.pow(t,2),s=Math.pow(u,2)-4*l*p,y=v,c=A;if(!(0>s))if(0===s)d.lerp(i,s,y),y.vsub(n,c),c.normalize(),this.reportIntersection(c,y,e,o,-1);else{var a=(-u-Math.sqrt(s))/(2*l),r=(-u+Math.sqrt(s))/(2*l);if(a>=0&&1>=a&&(d.lerp(i,a,y),y.vsub(n,c),c.normalize(),this.reportIntersection(c,y,e,o,-1)),this.result._shouldStop)return;r>=0&&1>=r&&(d.lerp(i,r,y),y.vsub(n,c),c.normalize(),this.reportIntersection(c,y,e,o,-1))}},n.prototype[p.types.SPHERE]=n.prototype.intersectSphere;var C=new i,O=(new i,new i,new i);n.prototype.intersectConvex=function(e,f,n,d,i){for(var t=C,l=O,u=i&&i.faceList||null,p=e.faces,s=e.vertices,y=e.faceNormals,c=this._direction,a=this.from,r=this.to,w=a.distanceTo(r),b=u?u.length:p.length,j=this.result,v=0;!j._shouldStop&&b>v;v++){var A=u?u[v]:v,h=p[A],k=y[A],q=f,z=n;l.copy(s[h[0]]),q.vmult(l,l),l.vadd(z,l),l.vsub(a,l),q.vmult(k,t);var B=c.dot(t);if(!(Math.abs(B)D)){c.mult(D,m),m.vadd(a,m),N.copy(s[h[0]]),q.vmult(N,N),z.vadd(N,N);for(var E=1;!j._shouldStop&&Ew||this.reportIntersection(t,m,e,d,A)}}}}},n.prototype[p.types.CONVEXPOLYHEDRON]=n.prototype.intersectConvex;var h=new i,k=new i,q=new i,z=new i,B=new i,D=new i,E=(new s,[]),F=new l;n.prototype.intersectTrimesh=function(e,f,n,d,i){var t=h,u=E,p=F,s=O,y=k,c=q,a=z,r=D,w=B,b=(i&&i.faceList||null,e.indices),j=(e.vertices,e.faceNormals,this.from),v=this.to,A=this._direction;p.position.copy(n),p.quaternion.copy(f),l.vectorToLocalFrame(n,f,A,y),l.pointToLocalFrame(n,f,j,c),l.pointToLocalFrame(n,f,v,a);var C=c.distanceSquared(a);e.tree.rayQuery(this,p,u);for(var G=0,H=u.length;!this.result._shouldStop&&G!==H;G++){var I=u[G];e.getNormal(I,t),e.getVertex(b[3*I],N),N.vsub(c,s);var J=y.dot(t),K=t.dot(s)/J;if(!(0>K)){y.scale(K,m),m.vadd(c,m),e.getVertex(b[3*I+1],g),e.getVertex(b[3*I+2],x);var L=m.distanceSquared(c);!o(m,g,N,x)&&!o(m,N,g,x)||L>C||(l.vectorToWorldFrame(f,t,w),l.pointToWorldFrame(n,f,m,r),this.reportIntersection(w,r,e,d,I))}}u.length=0},n.prototype[p.types.TRIMESH]=n.prototype.intersectTrimesh,n.prototype.reportIntersection=function(e,f,o,d,i){var t=this.from,l=this.to,u=t.distanceTo(f),p=this.result;if(!(this.skipBackfaces&&e.dot(this._direction)>0))switch(p.hitFaceIndex="undefined"!=typeof i?i:-1,this.mode){case n.ALL:this.hasHit=!0,p.set(t,l,e,f,o,d,u),p.hasHit=!0,this.callback(p);break;case n.CLOSEST:(uf;f++){for(var o=e[f],d=f-1;d>=0&&!(e[d].aabb.lowerBound.x<=o.aabb.lowerBound.x);d--)e[d+1]=e[d];e[d+1]=o}return e},n.insertionSortY=function(e){for(var f=1,n=e.length;n>f;f++){for(var o=e[f],d=f-1;d>=0&&!(e[d].aabb.lowerBound.y<=o.aabb.lowerBound.y);d--)e[d+1]=e[d];e[d+1]=o}return e},n.insertionSortZ=function(e){for(var f=1,n=e.length;n>f;f++){for(var o=e[f],d=f-1;d>=0&&!(e[d].aabb.lowerBound.z<=o.aabb.lowerBound.z);d--)e[d+1]=e[d];e[d+1]=o}return e},n.prototype.collisionPairs=function(e,f,o){var d,i,t=this.axisList,l=t.length,u=this.axisIndex;for(this.dirty&&(this.sortList(),this.dirty=!1),d=0;d!==l;d++){var p=t[d];for(i=d+1;l>i;i++){var s=t[i];if(this.needBroadphaseCollision(p,s)){if(!n.checkBounds(p,s,u))break;this.intersectionTest(p,s,f,o)}}}},n.prototype.sortList=function(){for(var e=this.axisList,f=this.axisIndex,o=e.length,d=0;d!==o;d++){var i=e[d];i.aabbNeedsUpdate&&i.computeAABB()}0===f?n.insertionSortX(e):1===f?n.insertionSortY(e):2===f&&n.insertionSortZ(e)},n.checkBounds=function(e,f,n){var o,d;0===n?(o=e.position.x,d=f.position.x):1===n?(o=e.position.y,d=f.position.y):2===n&&(o=e.position.z,d=f.position.z);var i=e.boundingRadius,t=f.boundingRadius,l=o+i,u=d-t;return l>u},n.prototype.autoDetectAxis=function(){for(var e=0,f=0,n=0,o=0,d=0,i=0,t=this.axisList,l=t.length,u=1/l,p=0;p!==l;p++){var s=t[p],y=s.position.x;e+=y,f+=y*y;var c=s.position.y;n+=c,o+=c*c;var a=s.position.z;d+=a,i+=a*a}var r=f-e*e*u,w=o-n*n*u,b=i-d*d*u;this.axisIndex=r>w?r>b?0:2:w>b?1:2},n.prototype.aabbQuery=function(e,f,n){n=n||[],this.dirty&&(this.sortList(),this.dirty=!1);var o=this.axisIndex,d="x";1===o&&(d="y"),2===o&&(d="z");for(var i=this.axisList,t=(f.lowerBound[d],f.upperBound[d],0);td;d++)for(var i=0;3>i;i++){for(var t=0,l=0;3>l;l++)t+=e.elements[d+3*l]*this.elements[l+3*i];o.elements[d+3*i]=t}return o},n.prototype.scale=function(e,f){f=f||new n;for(var o=this.elements,d=f.elements,i=0;3!==i;i++)d[3*i+0]=e.x*o[3*i+0],d[3*i+1]=e.y*o[3*i+1],d[3*i+2]=e.z*o[3*i+2];return f},n.prototype.solve=function(e,f){f=f||new o;for(var n=3,d=4,i=[],t=0;n*d>t;t++)i.push(0);var t,l;for(t=0;3>t;t++)for(l=0;3>l;l++)i[t+d*l]=this.elements[t+3*l];i[3]=e.x,i[7]=e.y,i[11]=e.z;var u,p,s=3,y=s,c=4;do{if(t=y-s,0===i[t+d*t])for(l=t+1;y>l;l++)if(0!==i[t+d*l]){u=c;do p=c-u,i[p+d*t]+=i[p+d*l];while(--u);break}if(0!==i[t+d*t])for(l=t+1;y>l;l++){var a=i[t+d*l]/i[t+d*t];u=c;do p=c-u,i[p+d*l]=t>=p?0:i[p+d*l]-i[p+d*t]*a;while(--u)}}while(--s);if(f.z=i[2*d+3]/i[2*d+2],f.y=(i[1*d+3]-i[1*d+2]*f.z)/i[1*d+1],f.x=(i[0*d+3]-i[0*d+2]*f.z-i[0*d+1]*f.y)/i[0*d+0],isNaN(f.x)||isNaN(f.y)||isNaN(f.z)||1/0===f.x||1/0===f.y||1/0===f.z)throw"Could not solve equation! Got x=["+f.toString()+"], b=["+e.toString()+"], A=["+this.toString()+"]";return f},n.prototype.e=function(e,f,n){return void 0===n?this.elements[f+3*e]:void(this.elements[f+3*e]=n)},n.prototype.copy=function(e){for(var f=0;fn;n++)e+=this.elements[n]+f;return e},n.prototype.reverse=function(e){e=e||new n;for(var f=3,o=6,d=[],i=0;f*o>i;i++)d.push(0);var i,t;for(i=0;3>i;i++)for(t=0;3>t;t++)d[i+o*t]=this.elements[i+3*t];d[3]=1,d[9]=0,d[15]=0,d[4]=0,d[10]=1,d[16]=0,d[5]=0,d[11]=0,d[17]=1;var l,u,p=3,s=p,y=o;do{if(i=s-p,0===d[i+o*i])for(t=i+1;s>t;t++)if(0!==d[i+o*t]){l=y;do u=y-l,d[u+o*i]+=d[u+o*t];while(--l);break}if(0!==d[i+o*i])for(t=i+1;s>t;t++){var c=d[i+o*t]/d[i+o*i];l=y;do u=y-l,d[u+o*t]=i>=u?0:d[u+o*t]-d[u+o*i]*c;while(--l)}}while(--p);i=2;do{t=i-1;do{var c=d[i+o*t]/d[i+o*i];l=o;do u=o-l,d[u+o*t]=d[u+o*t]-d[u+o*i]*c;while(--l)}while(t--)}while(--i);i=2;do{var c=1/d[i+o*i];l=o;do u=o-l,d[u+o*i]=d[u+o*i]*c;while(--l)}while(i--);i=2;do{t=2;do{if(u=d[f+t+o*i],isNaN(u)||1/0===u)throw"Could not reverse! A=["+this.toString()+"]";e.e(i,t,u)}while(t--)}while(i--);return e},n.prototype.setRotationFromQuaternion=function(e){var f=e.x,n=e.y,o=e.z,d=e.w,i=f+f,t=n+n,l=o+o,u=f*i,p=f*t,s=f*l,y=n*t,c=n*l,a=o*l,r=d*i,w=d*t,b=d*l,m=this.elements;return m[0]=1-(y+a),m[1]=p-b,m[2]=s+w,m[3]=p+b,m[4]=1-(u+a),m[5]=c-r,m[6]=s-w,m[7]=c+r,m[8]=1-(u+y),this},n.prototype.transpose=function(e){e=e||new n;for(var f=e.elements,o=this.elements,d=0;3!==d;d++)for(var i=0;3!==i;i++)f[3*d+i]=o[3*i+d];return e}},{"./Vec3":30}],28:[function(e,f){function n(e,f,n,o){this.x=void 0!==e?e:0,this.y=void 0!==f?f:0,this.z=void 0!==n?n:0,this.w=void 0!==o?o:1}f.exports=n;var o=e("./Vec3");n.prototype.set=function(e,f,n,o){this.x=e,this.y=f,this.z=n,this.w=o},n.prototype.toString=function(){return this.x+","+this.y+","+this.z+","+this.w},n.prototype.toArray=function(){return[this.x,this.y,this.z,this.w]},n.prototype.setFromAxisAngle=function(e,f){var n=Math.sin(.5*f);this.x=e.x*n,this.y=e.y*n,this.z=e.z*n,this.w=Math.cos(.5*f)},n.prototype.toAxisAngle=function(e){e=e||new o,this.normalize();var f=2*Math.acos(this.w),n=Math.sqrt(1-this.w*this.w);return.001>n?(e.x=this.x,e.y=this.y,e.z=this.z):(e.x=this.x/n,e.y=this.y/n,e.z=this.z/n),[e,f]};var d=new o,i=new o;n.prototype.setFromVectors=function(e,f){if(e.isAntiparallelTo(f)){var n=d,o=i;e.tangents(n,o),this.setFromAxisAngle(n,Math.PI)}else{var t=e.cross(f);this.x=t.x,this.y=t.y,this.z=t.z,this.w=Math.sqrt(Math.pow(e.norm(),2)*Math.pow(f.norm(),2))+e.dot(f),this.normalize()}};var t=new o,l=new o,u=new o;n.prototype.mult=function(e,f){f=f||new n;var o=this.w,d=t,i=l,p=u;return d.set(this.x,this.y,this.z),i.set(e.x,e.y,e.z),f.w=o*e.w-d.dot(i),d.cross(i,p),f.x=o*i.x+e.w*d.x+p.x,f.y=o*i.y+e.w*d.y+p.y,f.z=o*i.z+e.w*d.z+p.z,f},n.prototype.inverse=function(e){var f=this.x,o=this.y,d=this.z,i=this.w;e=e||new n,this.conjugate(e);var t=1/(f*f+o*o+d*d+i*i);return e.x*=t,e.y*=t,e.z*=t,e.w*=t,e},n.prototype.conjugate=function(e){return e=e||new n,e.x=-this.x,e.y=-this.y,e.z=-this.z,e.w=this.w,e},n.prototype.normalize=function(){var e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(e=1/e,this.x*=e,this.y*=e,this.z*=e,this.w*=e)},n.prototype.normalizeFast=function(){var e=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(this.x*=e,this.y*=e,this.z*=e,this.w*=e)},n.prototype.vmult=function(e,f){f=f||new o;var n=e.x,d=e.y,i=e.z,t=this.x,l=this.y,u=this.z,p=this.w,s=p*n+l*i-u*d,y=p*d+u*n-t*i,c=p*i+t*d-l*n,a=-t*n-l*d-u*i;return f.x=s*p+a*-t+y*-u-c*-l,f.y=y*p+a*-l+c*-t-s*-u,f.z=c*p+a*-u+s*-l-y*-t,f},n.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this},n.prototype.toEuler=function(e,f){f=f||"YZX";var n,o,d,i=this.x,t=this.y,l=this.z,u=this.w;switch(f){case"YZX":var p=i*t+l*u;if(p>.499&&(n=2*Math.atan2(i,u),o=Math.PI/2,d=0),-.499>p&&(n=-2*Math.atan2(i,u),o=-Math.PI/2,d=0),isNaN(n)){var s=i*i,y=t*t,c=l*l;n=Math.atan2(2*t*u-2*i*l,1-2*y-2*c),o=Math.asin(2*p),d=Math.atan2(2*i*u-2*t*l,1-2*s-2*c)}break;default:throw new Error("Euler order "+f+" not supported yet.")}e.y=n,e.z=o,e.x=d},n.prototype.setFromEuler=function(e,f,n,o){o=o||"XYZ";var d=Math.cos(e/2),i=Math.cos(f/2),t=Math.cos(n/2),l=Math.sin(e/2),u=Math.sin(f/2),p=Math.sin(n/2);return"XYZ"===o?(this.x=l*i*t+d*u*p,this.y=d*u*t-l*i*p,this.z=d*i*p+l*u*t,this.w=d*i*t-l*u*p):"YXZ"===o?(this.x=l*i*t+d*u*p,this.y=d*u*t-l*i*p,this.z=d*i*p-l*u*t,this.w=d*i*t+l*u*p):"ZXY"===o?(this.x=l*i*t-d*u*p,this.y=d*u*t+l*i*p,this.z=d*i*p+l*u*t,this.w=d*i*t-l*u*p):"ZYX"===o?(this.x=l*i*t-d*u*p,this.y=d*u*t+l*i*p,this.z=d*i*p-l*u*t,this.w=d*i*t+l*u*p):"YZX"===o?(this.x=l*i*t+d*u*p,this.y=d*u*t+l*i*p,this.z=d*i*p-l*u*t,this.w=d*i*t-l*u*p):"XZY"===o&&(this.x=l*i*t-d*u*p,this.y=d*u*t-l*i*p,this.z=d*i*p+l*u*t,this.w=d*i*t+l*u*p),this},n.prototype.clone=function(){return new n(this.x,this.y,this.z,this.w)}},{"./Vec3":30}],29:[function(e,f){function n(e){e=e||{},this.position=new o,e.position&&this.position.copy(e.position),this.quaternion=new d,e.quaternion&&this.quaternion.copy(e.quaternion)}var o=e("./Vec3"),d=e("./Quaternion");f.exports=n;var i=new d;n.pointToLocalFrame=function(e,f,n,d){var d=d||new o;return n.vsub(e,d),f.conjugate(i),i.vmult(d,d),d},n.prototype.pointToLocal=function(e,f){return n.pointToLocalFrame(this.position,this.quaternion,e,f)},n.pointToWorldFrame=function(e,f,n,d){var d=d||new o;return f.vmult(n,d),d.vadd(e,d),d},n.prototype.pointToWorld=function(e,f){return n.pointToWorldFrame(this.position,this.quaternion,e,f)},n.prototype.vectorToWorldFrame=function(e,f){var f=f||new o;return this.quaternion.vmult(e,f),f},n.vectorToWorldFrame=function(e,f,n){return e.vmult(f,n),n},n.vectorToLocalFrame=function(e,f,n,d){var d=d||new o;return f.w*=-1,f.vmult(n,d),f.w*=-1,d}},{"./Quaternion":28,"./Vec3":30}],30:[function(e,f){function n(e,f,n){this.x=e||0,this.y=f||0,this.z=n||0}f.exports=n;var o=e("./Mat3");n.ZERO=new n(0,0,0),n.UNIT_X=new n(1,0,0),n.UNIT_Y=new n(0,1,0),n.UNIT_Z=new n(0,0,1),n.prototype.cross=function(e,f){var o=e.x,d=e.y,i=e.z,t=this.x,l=this.y,u=this.z;return f=f||new n,f.x=l*i-u*d,f.y=u*o-t*i,f.z=t*d-l*o,f},n.prototype.set=function(e,f,n){return this.x=e,this.y=f,this.z=n,this},n.prototype.setZero=function(){this.x=this.y=this.z=0},n.prototype.vadd=function(e,f){return f?(f.x=e.x+this.x,f.y=e.y+this.y,f.z=e.z+this.z,void 0):new n(this.x+e.x,this.y+e.y,this.z+e.z)},n.prototype.vsub=function(e,f){return f?(f.x=this.x-e.x,f.y=this.y-e.y,f.z=this.z-e.z,void 0):new n(this.x-e.x,this.y-e.y,this.z-e.z)},n.prototype.crossmat=function(){return new o([0,-this.z,this.y,this.z,0,-this.x,-this.y,this.x,0])},n.prototype.normalize=function(){var e=this.x,f=this.y,n=this.z,o=Math.sqrt(e*e+f*f+n*n);if(o>0){var d=1/o;this.x*=d,this.y*=d,this.z*=d}else this.x=0,this.y=0,this.z=0;return o},n.prototype.unit=function(e){e=e||new n;var f=this.x,o=this.y,d=this.z,i=Math.sqrt(f*f+o*o+d*d);return i>0?(i=1/i,e.x=f*i,e.y=o*i,e.z=d*i):(e.x=1,e.y=0,e.z=0),e},n.prototype.norm=function(){var e=this.x,f=this.y,n=this.z;return Math.sqrt(e*e+f*f+n*n)},n.prototype.length=n.prototype.norm,n.prototype.norm2=function(){return this.dot(this)},n.prototype.lengthSquared=n.prototype.norm2,n.prototype.distanceTo=function(e){var f=this.x,n=this.y,o=this.z,d=e.x,i=e.y,t=e.z;return Math.sqrt((d-f)*(d-f)+(i-n)*(i-n)+(t-o)*(t-o))},n.prototype.distanceSquared=function(e){var f=this.x,n=this.y,o=this.z,d=e.x,i=e.y,t=e.z;return(d-f)*(d-f)+(i-n)*(i-n)+(t-o)*(t-o)},n.prototype.mult=function(e,f){f=f||new n;var o=this.x,d=this.y,i=this.z;return f.x=e*o,f.y=e*d,f.z=e*i,f},n.prototype.scale=n.prototype.mult,n.prototype.dot=function(e){return this.x*e.x+this.y*e.y+this.z*e.z},n.prototype.isZero=function(){return 0===this.x&&0===this.y&&0===this.z},n.prototype.negate=function(e){return e=e||new n,e.x=-this.x,e.y=-this.y,e.z=-this.z,e};var d=new n,i=new n;n.prototype.tangents=function(e,f){var n=this.norm();if(n>0){var o=d,t=1/n;o.set(this.x*t,this.y*t,this.z*t);var l=i;Math.abs(o.x)<.9?(l.set(1,0,0),o.cross(l,e)):(l.set(0,1,0),o.cross(l,e)),o.cross(e,f)}else e.set(1,0,0),f.set(0,1,0)},n.prototype.toString=function(){return this.x+","+this.y+","+this.z},n.prototype.toArray=function(){return[this.x,this.y,this.z]},n.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},n.prototype.lerp=function(e,f,n){var o=this.x,d=this.y,i=this.z;n.x=o+(e.x-o)*f,n.y=d+(e.y-d)*f,n.z=i+(e.z-i)*f},n.prototype.almostEquals=function(e,f){return void 0===f&&(f=1e-6),Math.abs(this.x-e.x)>f||Math.abs(this.y-e.y)>f||Math.abs(this.z-e.z)>f?!1:!0},n.prototype.almostZero=function(e){return void 0===e&&(e=1e-6),Math.abs(this.x)>e||Math.abs(this.y)>e||Math.abs(this.z)>e?!1:!0};var t=new n;n.prototype.isAntiparallelTo=function(e,f){return this.negate(t),t.almostEquals(e,f)},n.prototype.clone=function(){return new n(this.x,this.y,this.z)}},{"./Mat3":27}],31:[function(e,f){function n(e){e=e||{},o.apply(this),this.id=n.idCounter++,this.world=null,this.preStep=null,this.postStep=null,this.vlambda=new d,this.collisionFilterGroup="number"==typeof e.collisionFilterGroup?e.collisionFilterGroup:1,this.collisionFilterMask="number"==typeof e.collisionFilterMask?e.collisionFilterMask:1,this.collisionResponse=!0,this.position=new d,e.position&&this.position.copy(e.position),this.previousPosition=new d,this.initPosition=new d,this.velocity=new d,e.velocity&&this.velocity.copy(e.velocity),this.initVelocity=new d,this.force=new d;var f="number"==typeof e.mass?e.mass:0;this.mass=f,this.invMass=f>0?1/f:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=0>=f?n.STATIC:n.DYNAMIC,typeof e.type==typeof n.STATIC&&(this.type=e.type),this.allowSleep="undefined"!=typeof e.allowSleep?e.allowSleep:!0,this.sleepState=0,this.sleepSpeedLimit="undefined"!=typeof e.sleepSpeedLimit?e.sleepSpeedLimit:.1,this.sleepTimeLimit="undefined"!=typeof e.sleepTimeLimit?e.sleepTimeLimit:1,this.timeLastSleepy=0,this._wakeUpAfterNarrowphase=!1,this.torque=new d,this.quaternion=new t,e.quaternion&&this.quaternion.copy(e.quaternion),this.initQuaternion=new t,this.angularVelocity=new d,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new d,this.interpolatedPosition=new d,this.interpolatedQuaternion=new t,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new d,this.invInertia=new d,this.invInertiaWorld=new i,this.invMassSolve=0,this.invInertiaSolve=new d,this.invInertiaWorldSolve=new i,this.fixedRotation="undefined"!=typeof e.fixedRotation?e.fixedRotation:!1,this.angularDamping="undefined"!=typeof e.angularDamping?e.angularDamping:.01,this.aabb=new l,this.aabbNeedsUpdate=!0,this.wlambda=new d,e.shape&&this.addShape(e.shape),this.updateMassProperties()}f.exports=n;var o=e("../utils/EventTarget"),d=(e("../shapes/Shape"),e("../math/Vec3")),i=e("../math/Mat3"),t=e("../math/Quaternion"),l=(e("../material/Material"),e("../collision/AABB")),u=e("../shapes/Box");n.prototype=new o,n.prototype.constructor=n,n.DYNAMIC=1,n.STATIC=2,n.KINEMATIC=4,n.AWAKE=0,n.SLEEPY=1,n.SLEEPING=2,n.idCounter=0,n.prototype.wakeUp=function(){var e=this.sleepState;this.sleepState=0,e===n.SLEEPING&&this.dispatchEvent({type:"wakeup"})},n.prototype.sleep=function(){this.sleepState=n.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0)},n.sleepyEvent={type:"sleepy"},n.sleepEvent={type:"sleep"},n.prototype.sleepTick=function(e){if(this.allowSleep){var f=this.sleepState,o=this.velocity.norm2()+this.angularVelocity.norm2(),d=Math.pow(this.sleepSpeedLimit,2);f===n.AWAKE&&d>o?(this.sleepState=n.SLEEPY,this.timeLastSleepy=e,this.dispatchEvent(n.sleepyEvent)):f===n.SLEEPY&&o>d?this.wakeUp():f===n.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(n.sleepEvent))}},n.prototype.updateSolveMassProperties=function(){this.sleepState===n.SLEEPING||this.type===n.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))},n.prototype.pointToLocalFrame=function(e,f){var f=f||new d;return e.vsub(this.position,f),this.quaternion.conjugate().vmult(f,f),f},n.prototype.vectorToLocalFrame=function(e,f){var f=f||new d;return this.quaternion.conjugate().vmult(e,f),f},n.prototype.pointToWorldFrame=function(e,f){var f=f||new d;return this.quaternion.vmult(e,f),f.vadd(this.position,f),f},n.prototype.vectorToWorldFrame=function(e,f){var f=f||new d;return this.quaternion.vmult(e,f),f};var p=new d,s=new t;n.prototype.addShape=function(e,f,n){var o=new d,i=new t;return f&&o.copy(f),n&&i.copy(n),this.shapes.push(e),this.shapeOffsets.push(o),this.shapeOrientations.push(i),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,this},n.prototype.updateBoundingRadius=function(){for(var e=this.shapes,f=this.shapeOffsets,n=e.length,o=0,d=0;d!==n;d++){var i=e[d];i.updateBoundingSphereRadius();var t=f[d].norm(),l=i.boundingSphereRadius;t+l>o&&(o=t+l)}this.boundingRadius=o};var y=new l;n.prototype.computeAABB=function(){for(var e=this.shapes,f=this.shapeOffsets,n=this.shapeOrientations,o=e.length,d=p,i=s,t=this.quaternion,l=this.aabb,u=y,c=0;c!==o;c++){var a=e[c];n[c].mult(t,i),i.vmult(f[c],d),d.vadd(this.position,d),a.calculateWorldAABB(d,i,u.lowerBound,u.upperBound),0===c?l.copy(u):l.extend(u)}this.aabbNeedsUpdate=!1};{var c=new i,a=new i;new i}n.prototype.updateInertiaWorld=function(e){var f=this.invInertia;if(f.x!==f.y||f.y!==f.z||e){var n=c,o=a;n.setRotationFromQuaternion(this.quaternion),n.transpose(o),n.scale(f,n),n.mmult(o,this.invInertiaWorld)}else;};var r=new d,w=new d;n.prototype.applyForce=function(e,f){if(this.type===n.DYNAMIC){var o=r;f.vsub(this.position,o);var d=w;o.cross(e,d),this.force.vadd(e,this.force),this.torque.vadd(d,this.torque)}};var b=new d,m=new d;n.prototype.applyLocalForce=function(e,f){if(this.type===n.DYNAMIC){var o=b,d=m;this.vectorToWorldFrame(e,o),this.pointToWorldFrame(f,d),this.applyForce(o,d)}};var N=new d,g=new d,x=new d;n.prototype.applyImpulse=function(e,f){if(this.type===n.DYNAMIC){var o=N;f.vsub(this.position,o);var d=g;d.copy(e),d.mult(this.invMass,d),this.velocity.vadd(d,this.velocity);var i=x;o.cross(e,i),this.invInertiaWorld.vmult(i,i),this.angularVelocity.vadd(i,this.angularVelocity)}};var j=new d,v=new d;n.prototype.applyLocalImpulse=function(e,f){if(this.type===n.DYNAMIC){var o=j,d=v;this.vectorToWorldFrame(e,o),this.pointToWorldFrame(f,d),this.applyImpulse(o,d)}};var A=new d;n.prototype.updateMassProperties=function(){var e=A;this.invMass=this.mass>0?1/this.mass:0;var f=this.inertia,n=this.fixedRotation;this.computeAABB(),e.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),u.calculateInertia(e,this.mass,f),this.invInertia.set(f.x>0&&!n?1/f.x:0,f.y>0&&!n?1/f.y:0,f.z>0&&!n?1/f.z:0),this.updateInertiaWorld(!0)},n.prototype.getVelocityAtWorldPoint=function(e,f){var n=new d;return e.vsub(this.position,n),this.angularVelocity.cross(n,f),this.velocity.vadd(f,f),f}},{"../collision/AABB":3,"../material/Material":25,"../math/Mat3":27,"../math/Quaternion":28,"../math/Vec3":30,"../shapes/Box":37,"../shapes/Shape":43,"../utils/EventTarget":49}],32:[function(e,f){function n(e){this.chassisBody=e.chassisBody,this.wheelInfos=[],this.sliding=!1,this.world=null,this.indexRightAxis="undefined"!=typeof e.indexRightAxis?e.indexRightAxis:1,this.indexForwardAxis="undefined"!=typeof e.indexForwardAxis?e.indexForwardAxis:0,this.indexUpAxis="undefined"!=typeof e.indexUpAxis?e.indexUpAxis:2}function o(e,f,n,o,i){var t=0,l=n,u=x,p=j,s=v;e.getVelocityAtWorldPoint(l,u),f.getVelocityAtWorldPoint(l,p),u.vsub(p,s);var y=o.dot(s),c=d(e,n,o),a=d(f,n,o),r=1,w=r/(c+a);return t=-y*w,t>i&&(t=i),-i>t&&(t=-i),t}function d(e,f,n){var o=A,d=C,i=O,t=h;return f.vsub(e.position,o),o.cross(n,d),e.invInertiaWorld.vmult(d,t),t.cross(o,i),e.invMass+n.dot(i)}function i(e,f,n,o,d,i){var t=d.norm2();if(t>1.1)return 0;var l=k,u=q,p=z;e.getVelocityAtWorldPoint(f,l),n.getVelocityAtWorldPoint(o,u),l.vsub(u,p);var s=d.dot(p),y=.2,c=1/(e.invMass+n.invMass),i=-y*s*c;return i}var t=(e("./Body"),e("../math/Vec3")),l=e("../math/Quaternion"),u=(e("../collision/RaycastResult"),e("../collision/Ray")),p=e("../objects/WheelInfo");f.exports=n;{var s=(new t,new t,new t,new t),y=new t,c=new t;new u}n.prototype.addWheel=function(e){e=e||{};var f=new p(e),n=this.wheelInfos.length;return this.wheelInfos.push(f),n},n.prototype.setSteeringValue=function(e,f){var n=this.wheelInfos[f];n.steering=e};new t;n.prototype.applyEngineForce=function(e,f){this.wheelInfos[f].engineForce=e},n.prototype.setBrake=function(e,f){this.wheelInfos[f].brake=e},n.prototype.addToWorld=function(e){this.constraints;e.add(this.chassisBody);var f=this;this.preStepCallback=function(){f.updateVehicle(e.dt)},e.addEventListener("preStep",this.preStepCallback),this.world=e},n.prototype.getVehicleAxisWorld=function(e,f){f.set(0===e?1:0,1===e?1:0,2===e?1:0),this.chassisBody.vectorToWorldFrame(f,f)},n.prototype.updateVehicle=function(e){for(var f=this.wheelInfos,n=f.length,o=this.chassisBody,d=0;n>d;d++)this.updateWheelTransform(d);this.currentVehicleSpeedKmHour=3.6*o.velocity.norm();var i=new t;this.getVehicleAxisWorld(this.indexForwardAxis,i),i.dot(o.velocity)<0&&(this.currentVehicleSpeedKmHour*=-1);for(var d=0;n>d;d++)this.castRay(f[d]);this.updateSuspension(e);for(var l=new t,u=new t,d=0;n>d;d++){var p=f[d],s=p.suspensionForce;s>p.maxSuspensionForce&&(s=p.maxSuspensionForce),p.raycastResult.hitNormalWorld.scale(s*e,l),p.raycastResult.hitPointWorld.vsub(o.position,u),o.applyImpulse(l,p.raycastResult.hitPointWorld)}this.updateFriction(e);var y=new t,c=new t,a=new t;for(d=0;n>d;d++){var p=f[d];o.getVelocityAtWorldPoint(p.chassisConnectionPointWorld,a);var r=1;switch(this.indexUpAxis){case 1:r=-1}if(p.isInContact){this.getVehicleAxisWorld(this.indexForwardAxis,c);var w=c.dot(p.raycastResult.hitNormalWorld);p.raycastResult.hitNormalWorld.scale(w,y),c.vsub(y,c);var b=c.dot(a);p.deltaRotation=r*b*e/p.radius}!p.sliding&&p.isInContact||0===p.engineForce||!p.useCustomSlidingRotationalSpeed||(p.deltaRotation=(p.engineForce>0?1:-1)*p.customSlidingRotationalSpeed*e),Math.abs(p.brake)>Math.abs(p.engineForce)&&(p.deltaRotation=0),p.rotation+=p.deltaRotation,p.deltaRotation*=.99}},n.prototype.updateSuspension=function(){for(var e=this.chassisBody,f=e.mass,n=this.wheelInfos,o=n.length,d=0;o>d;d++){var i=n[d];if(i.isInContact){var t,l=i.suspensionRestLength,u=i.suspensionLength,p=l-u;t=i.suspensionStiffness*p*i.clippedInvContactDotSuspension;var s,y=i.suspensionRelativeVelocity;s=0>y?i.dampingCompression:i.dampingRelaxation,t-=s*y,i.suspensionForce=t*f,i.suspensionForce<0&&(i.suspensionForce=0)}else i.suspensionForce=0}},n.prototype.removeFromWorld=function(e){this.constraints;e.remove(this.chassisBody),e.removeEventListener("preStep",this.preStepCallback),this.world=null};var a=new t,r=new t;n.prototype.castRay=function(e){var f=a,n=r;this.updateWheelTransformWorld(e);var o=this.chassisBody,d=-1,i=e.suspensionRestLength+e.radius;e.directionWorld.scale(i,f);var l=e.chassisConnectionPointWorld;l.vadd(f,n);var u=e.raycastResult;u.reset();var p=o.collisionResponse;o.collisionResponse=!1,this.world.rayTest(l,n,u),o.collisionResponse=p;var s=u.body;if(e.raycastResult.groundObject=0,s){d=u.distance,e.raycastResult.hitNormalWorld=u.hitNormalWorld,e.isInContact=!0;var y=u.distance;e.suspensionLength=y-e.radius;var c=e.suspensionRestLength-e.maxSuspensionTravel,w=e.suspensionRestLength+e.maxSuspensionTravel;e.suspensionLengthw&&(e.suspensionLength=w,e.raycastResult.reset());var b=e.raycastResult.hitNormalWorld.dot(e.directionWorld),m=new t;o.getVelocityAtWorldPoint(e.raycastResult.hitPointWorld,m);var N=e.raycastResult.hitNormalWorld.dot(m);if(b>=-.1)e.suspensionRelativeVelocity=0,e.clippedInvContactDotSuspension=10;else{var g=-1/b;e.suspensionRelativeVelocity=N*g,e.clippedInvContactDotSuspension=g}}else e.suspensionLength=e.suspensionRestLength+0*e.maxSuspensionTravel,e.suspensionRelativeVelocity=0,e.directionWorld.scale(-1,e.raycastResult.hitNormalWorld),e.clippedInvContactDotSuspension=1;return d},n.prototype.updateWheelTransformWorld=function(e){e.isInContact=!1;var f=this.chassisBody;f.pointToWorldFrame(e.chassisConnectionPointLocal,e.chassisConnectionPointWorld),f.vectorToWorldFrame(e.directionLocal,e.directionWorld),f.vectorToWorldFrame(e.axleLocal,e.axleWorld)},n.prototype.updateWheelTransform=function(e){var f=s,n=y,o=c,d=this.wheelInfos[e];this.updateWheelTransformWorld(d),d.directionLocal.scale(-1,f),n.copy(d.axleLocal),f.cross(n,o),o.normalize(),n.normalize();var i=d.steering,t=new l;t.setFromAxisAngle(f,i);var u=new l;u.setFromAxisAngle(n,d.rotation);var p=d.worldTransform.quaternion;this.chassisBody.quaternion.mult(t,p),p.mult(u,p),p.normalize();var a=d.worldTransform.position;a.copy(d.directionWorld),a.scale(d.suspensionLength,a),a.vadd(d.chassisConnectionPointWorld,a)};var w=[new t(1,0,0),new t(0,1,0),new t(0,0,1)];n.prototype.getWheelTransformWorld=function(e){return this.wheelInfos[e].worldTransform};var b=new t,m=[],N=[],g=1;n.prototype.updateFriction=function(e){for(var f=b,n=this.wheelInfos,d=n.length,l=this.chassisBody,u=N,p=m,s=0,y=0;d>y;y++){var c=n[y],a=c.raycastResult.body;a&&s++,c.sideImpulse=0,c.forwardImpulse=0,u[y]||(u[y]=new t),p[y]||(p[y]=new t)}for(var y=0;d>y;y++){var c=n[y],a=c.raycastResult.body;if(a){var r=p[y],x=this.getWheelTransformWorld(y);x.vectorToWorldFrame(w[this.indexRightAxis],r);var j=c.raycastResult.hitNormalWorld,v=r.dot(j);j.scale(v,f),r.vsub(f,r),r.normalize(),j.cross(r,u[y]),u[y].normalize(),c.sideImpulse=i(l,c.raycastResult.hitPointWorld,a,c.raycastResult.hitPointWorld,r),c.sideImpulse*=g}}var A=1,C=.5;this.sliding=!1;for(var y=0;d>y;y++){var c=n[y],a=c.raycastResult.body,O=0;if(c.slipInfo=1,a){var h=0,k=c.brake?c.brake:h;O=o(l,a,c.raycastResult.hitPointWorld,u[y],k),O+=c.engineForce*e;var q=k/O;c.slipInfo*=q}if(c.forwardImpulse=0,c.skidInfo=1,a){c.skidInfo=1;var z=c.suspensionForce*e*c.frictionSlip,B=z,D=z*B;c.forwardImpulse=O;var E=c.forwardImpulse*C,F=c.sideImpulse*A,G=E*E+F*F;if(c.sliding=!1,G>D){this.sliding=!0,c.sliding=!0;var q=z/Math.sqrt(G);c.skidInfo*=q}}}if(this.sliding)for(var y=0;d>y;y++){var c=n[y];0!==c.sideImpulse&&c.skidInfo<1&&(c.forwardImpulse*=c.skidInfo,c.sideImpulse*=c.skidInfo)}for(var y=0;d>y;y++){var c=n[y],H=new t;if(H.copy(c.raycastResult.hitPointWorld),0!==c.forwardImpulse){var I=new t;u[y].scale(c.forwardImpulse,I),l.applyImpulse(I,H)}if(0!==c.sideImpulse){var a=c.raycastResult.body,J=new t;J.copy(c.raycastResult.hitPointWorld);var K=new t;p[y].scale(c.sideImpulse,K),l.pointToLocalFrame(H,H),H["xyz"[this.indexUpAxis]]*=c.rollInfluence,l.pointToWorldFrame(H,H),l.applyImpulse(K,H),K.scale(-1,K),a.applyImpulse(K,J)}}};var x=new t,j=new t,v=new t,A=new t,C=new t,O=new t,h=new t,k=new t,q=new t,z=new t},{"../collision/Ray":9,"../collision/RaycastResult":10,"../math/Quaternion":28,"../math/Vec3":30,"../objects/WheelInfo":36,"./Body":31}],33:[function(e,f){function n(e){if(this.wheelBodies=[],this.coordinateSystem="undefined"==typeof e.coordinateSystem?new t(1,2,3):e.coordinateSystem.clone(),this.chassisBody=e.chassisBody,!this.chassisBody){var f=new i(new t(5,2,.5));this.chassisBody=new o(1,f)}this.constraints=[],this.wheelAxes=[],this.wheelForces=[]}var o=e("./Body"),d=e("../shapes/Sphere"),i=e("../shapes/Box"),t=e("../math/Vec3"),l=e("../constraints/HingeConstraint");f.exports=n,n.prototype.addWheel=function(e){e=e||{};var f=e.body;f||(f=new o(1,new d(1.2))),this.wheelBodies.push(f),this.wheelForces.push(0);var n=(new t,"undefined"!=typeof e.position?e.position.clone():new t),i=new t;this.chassisBody.pointToWorldFrame(n,i),f.position.set(i.x,i.y,i.z);var u="undefined"!=typeof e.axis?e.axis.clone():new t(0,1,0);this.wheelAxes.push(u);var p=new l(this.chassisBody,f,{pivotA:n,axisA:u,pivotB:t.ZERO,axisB:u,collideConnected:!1});return this.constraints.push(p),this.wheelBodies.length-1},n.prototype.setSteeringValue=function(e,f){var n=this.wheelAxes[f],o=Math.cos(e),d=Math.sin(e),i=n.x,t=n.y;this.constraints[f].axisA.set(o*i-d*t,d*i+o*t,0)},n.prototype.setMotorSpeed=function(e,f){var n=this.constraints[f];n.enableMotor(),n.motorTargetVelocity=e},n.prototype.disableMotor=function(e){var f=this.constraints[e]; +f.disableMotor()};var u=new t;n.prototype.setWheelForce=function(e,f){this.wheelForces[f]=e},n.prototype.applyWheelForce=function(e,f){var n=this.wheelAxes[f],o=this.wheelBodies[f],d=o.torque;n.scale(e,u),o.vectorToWorldFrame(u,u),d.vadd(u,d)},n.prototype.addToWorld=function(e){for(var f=this.constraints,n=this.wheelBodies.concat([this.chassisBody]),o=0;othis.particles.length&&this.neighbors.pop())};var d=new o;n.prototype.getNeighbors=function(e,f){for(var n=this.particles.length,o=e.id,i=this.smoothingRadius*this.smoothingRadius,t=d,l=0;l!==n;l++){var u=this.particles[l];u.position.vsub(e.position,t),o!==u.id&&t.norm2()=-.1)this.suspensionRelativeVelocity=0,this.clippedInvContactDotSuspension=10;else{var d=-1/n;this.suspensionRelativeVelocity=o*d,this.clippedInvContactDotSuspension=d}}else f.suspensionLength=this.suspensionRestLength,this.suspensionRelativeVelocity=0,f.directionWorld.scale(-1,f.hitNormalWorld),this.clippedInvContactDotSuspension=1}},{"../collision/RaycastResult":10,"../math/Transform":29,"../math/Vec3":30,"../utils/Utils":53}],37:[function(e,f){function n(e){o.call(this),this.type=o.types.BOX,this.halfExtents=e,this.convexPolyhedronRepresentation=null,this.updateConvexPolyhedronRepresentation(),this.updateBoundingSphereRadius()}f.exports=n;var o=e("./Shape"),d=e("../math/Vec3"),i=e("./ConvexPolyhedron");n.prototype=new o,n.prototype.constructor=n,n.prototype.updateConvexPolyhedronRepresentation=function(){var e=this.halfExtents.x,f=this.halfExtents.y,n=this.halfExtents.z,o=d,t=[new o(-e,-f,-n),new o(e,-f,-n),new o(e,f,-n),new o(-e,f,-n),new o(-e,-f,n),new o(e,-f,n),new o(e,f,n),new o(-e,f,n)],l=[[3,2,1,0],[4,5,6,7],[5,4,0,1],[2,3,7,6],[0,4,7,3],[1,2,6,5]],u=([new o(0,0,1),new o(0,1,0),new o(1,0,0)],new i(t,l));this.convexPolyhedronRepresentation=u,u.material=this.material},n.prototype.calculateLocalInertia=function(e,f){return f=f||new d,n.calculateInertia(this.halfExtents,e,f),f},n.calculateInertia=function(e,f,n){var o=e;n.x=1/12*f*(2*o.y*2*o.y+2*o.z*2*o.z),n.y=1/12*f*(2*o.x*2*o.x+2*o.z*2*o.z),n.z=1/12*f*(2*o.y*2*o.y+2*o.x*2*o.x)},n.prototype.getSideNormals=function(e,f){var n=e,o=this.halfExtents;if(n[0].set(o.x,0,0),n[1].set(0,o.y,0),n[2].set(0,0,o.z),n[3].set(-o.x,0,0),n[4].set(0,-o.y,0),n[5].set(0,0,-o.z),void 0!==f)for(var d=0;d!==n.length;d++)f.vmult(n[d],n[d]);return n},n.prototype.volume=function(){return 8*this.halfExtents.x*this.halfExtents.y*this.halfExtents.z},n.prototype.updateBoundingSphereRadius=function(){this.boundingSphereRadius=this.halfExtents.norm()};{var t=new d;new d}n.prototype.forEachWorldCorner=function(e,f,n){for(var o=this.halfExtents,d=[[o.x,o.y,o.z],[-o.x,o.y,o.z],[-o.x,-o.y,o.z],[-o.x,-o.y,-o.z],[o.x,-o.y,-o.z],[o.x,o.y,-o.z],[-o.x,o.y,-o.z],[o.x,-o.y,o.z]],i=0;it;t++){var i=l[t];f.vmult(i,i),e.vadd(i,i);var u=i.x,p=i.y,s=i.z;u>o.x&&(o.x=u),p>o.y&&(o.y=p),s>o.z&&(o.z=s),ua&&(a=w,c=r)}for(var b=[],m=n.faces[c],N=m.length,g=0;N>g;g++){var x=n.vertices[m[g]],j=new d;j.copy(x),i.vmult(j,j),o.vadd(j,j),b.push(j)}c>=0&&this.clipFaceAgainstHull(t,e,f,b,l,u,s)};var s=new d,y=new d,c=new d,a=new d,r=new d,w=new d;n.prototype.findSeparatingAxis=function(e,f,n,o,d,i,t,l){var u=s,p=y,b=c,m=a,N=r,g=w,x=Number.MAX_VALUE,j=this,v=0;if(j.uniqueAxes)for(var A=0;A!==j.uniqueAxes.length;A++){n.vmult(j.uniqueAxes[A],u);var C=j.testSepAxis(u,e,f,n,o,d);if(C===!1)return!1;x>C&&(x=C,i.copy(u))}else for(var O=t?t.length:j.faces.length,A=0;O>A;A++){var h=t?t[A]:A;u.copy(j.faceNormals[h]),n.vmult(u,u);var C=j.testSepAxis(u,e,f,n,o,d);if(C===!1)return!1;x>C&&(x=C,i.copy(u))}if(e.uniqueAxes)for(var A=0;A!==e.uniqueAxes.length;A++){d.vmult(e.uniqueAxes[A],p),v++;var C=j.testSepAxis(p,e,f,n,o,d);if(C===!1)return!1;x>C&&(x=C,i.copy(p))}else for(var k=l?l.length:e.faces.length,A=0;k>A;A++){var h=l?l[A]:A;p.copy(e.faceNormals[h]),d.vmult(p,p),v++;var C=j.testSepAxis(p,e,f,n,o,d);if(C===!1)return!1;x>C&&(x=C,i.copy(p))}for(var q=0;q!==j.uniqueEdges.length;q++){n.vmult(j.uniqueEdges[q],m);for(var z=0;z!==e.uniqueEdges.length;z++)if(d.vmult(e.uniqueEdges[z],N),m.cross(N,g),!g.almostZero()){g.normalize();var B=j.testSepAxis(g,e,f,n,o,d);if(B===!1)return!1;x>B&&(x=B,i.copy(g))}}return o.vsub(f,b),b.dot(i)>0&&i.negate(i),!0};var b=[],m=[];n.prototype.testSepAxis=function(e,f,o,d,i,t){var l=this;n.project(l,e,o,d,b),n.project(f,e,i,t,m);var u=b[0],p=b[1],s=m[0],y=m[1];if(y>u||p>s)return!1;var c=u-y,a=s-p,r=a>c?c:a;return r};var N=new d,g=new d;n.prototype.calculateLocalInertia=function(e,f){this.computeLocalAABB(N,g);var n=g.x-N.x,o=g.y-N.y,d=g.z-N.z;f.x=1/12*e*(2*o*2*o+2*d*2*d),f.y=1/12*e*(2*n*2*n+2*d*2*d),f.z=1/12*e*(2*o*2*o+2*n*2*n)},n.prototype.getPlaneConstantOfFace=function(e){var f=this.faces[e],n=this.faceNormals[e],o=this.vertices[f[0]],d=-n.dot(o);return d};var x=new d,j=new d,v=new d,A=new d,C=new d,O=new d,h=new d,k=new d;n.prototype.clipFaceAgainstHull=function(e,f,n,o,d,i,t){for(var l=x,u=j,p=v,s=A,y=C,c=O,a=h,r=k,w=this,b=[],m=o,N=b,g=-1,q=Number.MAX_VALUE,z=0;zB&&(q=B,g=z)}if(!(0>g)){var D=w.faces[g];D.connectedFaces=[];for(var E=0;EH;H++){var I=w.vertices[D[H]],J=w.vertices[D[(H+1)%G]];I.vsub(J,u),p.copy(u),n.vmult(p,p),f.vadd(p,p),s.copy(this.faceNormals[g]),n.vmult(s,s),f.vadd(s,s),p.cross(s,y),y.negate(y),c.copy(I),n.vmult(c,c),f.vadd(c,c);var K,L=(-c.dot(y),D.connectedFaces[H]);a.copy(this.faceNormals[L]);var M=this.getPlaneConstantOfFace(L);r.copy(a),n.vmult(r,r);var K=M-r.dot(f);for(this.clipFaceAgainstPlane(m,N,r,K);m.length;)m.shift();for(;N.length;)m.push(N.shift())}a.copy(this.faceNormals[g]);var M=this.getPlaneConstantOfFace(g);r.copy(a),n.vmult(r,r);for(var K=M-r.dot(f),E=0;E=P&&(console.log("clamped: depth="+P+" to minDist="+(d+"")),P=d),i>=P){var Q=m[E];if(0>=P){var R={point:Q,normal:r,depth:P};t.push(R)}}}}},n.prototype.clipFaceAgainstPlane=function(e,f,n,o){var i,t,l=e.length;if(2>l)return f;var u=e[e.length-1],p=e[0];i=n.dot(u)+o;for(var s=0;l>s;s++){if(p=e[s],t=n.dot(p)+o,0>i)if(0>t){var y=new d;y.copy(p),f.push(y)}else{var y=new d;u.lerp(p,i/(i-t),y),f.push(y)}else if(0>t){var y=new d;u.lerp(p,i/(i-t),y),f.push(y),f.push(p)}u=p,i=t}return f},n.prototype.computeWorldVertices=function(e,f){for(var n=this.vertices.length;this.worldVertices.lengthd;d++){var i=o[d];i.xf.x&&(f.x=i.x),i.yf.y&&(f.y=i.y),i.zf.z&&(f.z=i.z)}},n.prototype.computeWorldFaceNormals=function(e){for(var f=this.faceNormals.length;this.worldFaceNormals.lengthe&&(e=d)}this.boundingSphereRadius=Math.sqrt(e)};var q=new d;n.prototype.calculateWorldAABB=function(e,f,n,o){for(var d,i,t,l,u,p,s=this.vertices.length,y=this.vertices,c=0;s>c;c++){q.copy(y[c]),f.vmult(q,q),e.vadd(q,q);var a=q;a.xl||void 0===l)&&(l=a.x),a.yu||void 0===u)&&(u=a.y),a.zp||void 0===p)&&(p=a.z)}n.set(d,i,t),o.set(l,u,p)},n.prototype.volume=function(){return 4*Math.PI*this.boundingSphereRadius/3},n.prototype.getAveragePointLocal=function(e){e=e||new d;for(var f=this.vertices.length,n=this.vertices,o=0;f>o;o++)e.vadd(n[o],e);return e.mult(1/f,e),e},n.prototype.transformAllPoints=function(e,f){var n=this.vertices.length,o=this.vertices;if(f){for(var d=0;n>d;d++){var i=o[d];f.vmult(i,i)}for(var d=0;dd;d++){var i=o[d];i.vadd(e,i)}};var z=new d,B=new d,D=new d;n.prototype.pointIsInside=function(e){var f=this.vertices.length,n=this.vertices,o=this.faces,d=this.faceNormals,i=null,t=this.faces.length,l=z;this.getAveragePointLocal(l);for(var u=0;t>u;u++){var f=(this.faces[u].length,d[u]),p=n[o[u][0]],s=B;e.vsub(p,s);var y=f.dot(s),c=D;l.vsub(p,c);var a=f.dot(c);if(0>y&&a>0||y>0&&0>a)return!1}return i?1:-1};var E=(new d,new d),F=new d;n.project=function(e,f,n,o,d){var t=e.vertices.length,l=E,u=0,p=0,s=F,y=e.vertices;s.setZero(),i.vectorToLocalFrame(n,o,f,l),i.pointToLocalFrame(n,o,s,s);var c=s.dot(l);p=u=y[0].dot(l);for(var a=1;t>a;a++){var r=y[a].dot(l);r>u&&(u=r),p>r&&(p=r)}if(p-=c,u-=c,p>u){var w=p;p=u,u=w}d[0]=u,d[1]=p}},{"../math/Quaternion":28,"../math/Transform":29,"../math/Vec3":30,"./Shape":43}],39:[function(e,f){function n(e,f,n,t){var l=t,u=[],p=[],s=[],y=[],c=[],a=Math.cos,r=Math.sin;u.push(new d(f*a(0),f*r(0),.5*-n)),y.push(0),u.push(new d(e*a(0),e*r(0),.5*n)),c.push(1);for(var w=0;l>w;w++){var b=2*Math.PI/l*(w+1),m=2*Math.PI/l*(w+.5);l-1>w?(u.push(new d(f*a(b),f*r(b),.5*-n)),y.push(2*w+2),u.push(new d(e*a(b),e*r(b),.5*n)),c.push(2*w+3),s.push([2*w+2,2*w+3,2*w+1,2*w])):s.push([0,1,2*w+1,2*w]),(l%2===1||l/2>w)&&p.push(new d(a(m),r(m),0))}s.push(c),p.push(new d(0,0,1));for(var N=[],w=0;wd&&(f=d)}this.minValue=f},n.prototype.updateMaxValue=function(){for(var e=this.data,f=e[0][0],n=0;n!==e.length;n++)for(var o=0;o!==e[n].length;o++){var d=e[n][o];d>f&&(f=d)}this.maxValue=f},n.prototype.setHeightValueAtIndex=function(e,f,n){var o=this.data;o[e][f]=n,this.clearCachedConvexTrianglePillar(e,f,!1),e>0&&(this.clearCachedConvexTrianglePillar(e-1,f,!0),this.clearCachedConvexTrianglePillar(e-1,f,!1)),f>0&&(this.clearCachedConvexTrianglePillar(e,f-1,!0),this.clearCachedConvexTrianglePillar(e,f-1,!1)),f>0&&e>0&&this.clearCachedConvexTrianglePillar(e-1,f-1,!0)},n.prototype.getRectMinMax=function(e,f,n,o,d){d=d||[];for(var i=this.data,t=this.minValue,l=e;n>=l;l++)for(var u=f;o>=u;u++){var p=i[l][u];p>t&&(t=p)}d[0]=this.minValue,d[1]=t},n.prototype.getIndexOfPosition=function(e,f,n,o){var d=this.elementSize,i=this.data,t=Math.floor(e/d),l=Math.floor(f/d);return n[0]=t,n[1]=l,o&&(0>t&&(t=0),0>l&&(l=0),t>=i.length-1&&(t=i.length-1),l>=i[0].length-1&&(l=i[0].length-1)),0>t||0>l||t>=i.length-1||l>=i[0].length-1?!1:!0},n.prototype.getHeightAt=function(e,f,n){var o=[];this.getIndexOfPosition(e,f,o,n);var d=[];return this.getRectMinMax(o[0],o[1]+1,o[0],o[1]+1,d),(d[0]+d[1])/2},n.prototype.getCacheConvexTrianglePillarKey=function(e,f,n){return e+"_"+f+"_"+(n?1:0)},n.prototype.getCachedConvexTrianglePillar=function(e,f,n){return this._cachedPillars[this.getCacheConvexTrianglePillarKey(e,f,n)]},n.prototype.setCachedConvexTrianglePillar=function(e,f,n,o,d){this._cachedPillars[this.getCacheConvexTrianglePillarKey(e,f,n)]={convex:o,offset:d}},n.prototype.clearCachedConvexTrianglePillar=function(e,f,n){delete this._cachedPillars[this.getCacheConvexTrianglePillarKey(e,f,n)]},n.prototype.getConvexTrianglePillar=function(e,f,n){var o=this.pillarConvex,t=this.pillarOffset;if(this.cacheEnabled){var l=this.getCachedConvexTrianglePillar(e,f,n);if(l)return this.pillarConvex=l.convex,void(this.pillarOffset=l.offset);o=new d,t=new i,this.pillarConvex=o,this.pillarOffset=t}var l=this.data,u=this.elementSize,p=o.faces;o.vertices.length=6;for(var s=0;6>s;s++)o.vertices[s]||(o.vertices[s]=new i);p.length=5;for(var s=0;5>s;s++)p[s]||(p[s]=[]);var y=o.vertices,c=(Math.min(l[e][f],l[e+1][f],l[e][f+1],l[e+1][f+1])-this.minValue)/2+this.minValue;n?(t.set((e+.75)*u,(f+.75)*u,c),y[0].set(.25*u,.25*u,l[e+1][f+1]-c),y[1].set(-.75*u,.25*u,l[e][f+1]-c),y[2].set(.25*u,-.75*u,l[e+1][f]-c),y[3].set(.25*u,.25*u,-c-1),y[4].set(-.75*u,.25*u,-c-1),y[5].set(.25*u,-.75*u,-c-1),p[0][0]=0,p[0][1]=1,p[0][2]=2,p[1][0]=5,p[1][1]=4,p[1][2]=3,p[2][0]=2,p[2][1]=5,p[2][2]=3,p[2][3]=0,p[3][0]=3,p[3][1]=4,p[3][2]=1,p[3][3]=0,p[4][0]=1,p[4][1]=4,p[4][2]=5,p[4][3]=2):(t.set((e+.25)*u,(f+.25)*u,c),y[0].set(-.25*u,-.25*u,l[e][f]-c),y[1].set(.75*u,-.25*u,l[e+1][f]-c),y[2].set(-.25*u,.75*u,l[e][f+1]-c),y[3].set(-.25*u,-.25*u,-c-1),y[4].set(.75*u,-.25*u,-c-1),y[5].set(-.25*u,.75*u,-c-1),p[0][0]=0,p[0][1]=1,p[0][2]=2,p[1][0]=5,p[1][1]=4,p[1][2]=3,p[2][0]=0,p[2][1]=2,p[2][2]=5,p[2][3]=3,p[3][0]=1,p[3][1]=0,p[3][2]=3,p[3][3]=4,p[4][0]=4,p[4][1]=5,p[4][2]=2,p[4][3]=1),o.computeNormals(),o.computeEdges(),o.updateBoundingSphereRadius(),this.setCachedConvexTrianglePillar(e,f,n,o,t)},n.prototype.calculateLocalInertia=function(e,f){return f=f||new i,f.set(0,0,0),f},n.prototype.volume=function(){return Number.MAX_VALUE},n.prototype.calculateWorldAABB=function(e,f,n,o){n.set(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),o.set(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)},n.prototype.updateBoundingSphereRadius=function(){var e=this.data,f=this.elementSize;this.boundingSphereRadius=new i(e.length*f,e[0].length*f,Math.max(Math.abs(this.maxValue),Math.abs(this.minValue))).norm()}},{"../math/Vec3":30,"../utils/Utils":53,"./ConvexPolyhedron":38,"./Shape":43}],41:[function(e,f){function n(){o.call(this),this.type=o.types.PARTICLE}f.exports=n;var o=e("./Shape"),d=e("../math/Vec3");n.prototype=new o,n.prototype.constructor=n,n.prototype.calculateLocalInertia=function(e,f){return f=f||new d,f.set(0,0,0),f},n.prototype.volume=function(){return 0},n.prototype.updateBoundingSphereRadius=function(){this.boundingSphereRadius=0},n.prototype.calculateWorldAABB=function(e,f,n,o){n.copy(e),o.copy(e)}},{"../math/Vec3":30,"./Shape":43}],42:[function(e,f){function n(){o.call(this),this.type=o.types.PLANE,this.worldNormal=new d,this.worldNormalNeedsUpdate=!0,this.boundingSphereRadius=Number.MAX_VALUE}f.exports=n;var o=e("./Shape"),d=e("../math/Vec3");n.prototype=new o,n.prototype.constructor=n,n.prototype.computeWorldNormal=function(e){var f=this.worldNormal;f.set(0,0,1),e.vmult(f,f),this.worldNormalNeedsUpdate=!1},n.prototype.calculateLocalInertia=function(e,f){return f=f||new d},n.prototype.volume=function(){return Number.MAX_VALUE};var i=new d;n.prototype.calculateWorldAABB=function(e,f,n,o){i.set(0,0,1),f.vmult(i,i);var d=Number.MAX_VALUE;n.set(-d,-d,-d),o.set(d,d,d),1===i.x&&(o.x=e.x),1===i.y&&(o.y=e.y),1===i.z&&(o.z=e.z),-1===i.x&&(n.x=e.x),-1===i.y&&(n.y=e.y),-1===i.z&&(n.z=e.z)},n.prototype.updateBoundingSphereRadius=function(){this.boundingSphereRadius=Number.MAX_VALUE}},{"../math/Vec3":30,"./Shape":43}],43:[function(e,f){function n(){this.id=n.idCounter++,this.type=0,this.boundingSphereRadius=0,this.collisionResponse=!0,this.material=null}f.exports=n;{var n=e("./Shape");e("../math/Vec3"),e("../math/Quaternion"),e("../material/Material")}n.prototype.constructor=n,n.prototype.updateBoundingSphereRadius=function(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type},n.prototype.volume=function(){throw"volume() not implemented for shape type "+this.type},n.prototype.calculateLocalInertia=function(){throw"calculateLocalInertia() not implemented for shape type "+this.type},n.idCounter=0,n.types={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256}},{"../material/Material":25,"../math/Quaternion":28,"../math/Vec3":30,"./Shape":43}],44:[function(e,f){function n(e){if(o.call(this),this.radius=void 0!==e?Number(e):1,this.type=o.types.SPHERE,this.radius<0)throw new Error("The sphere radius cannot be negative.");this.updateBoundingSphereRadius()}f.exports=n;var o=e("./Shape"),d=e("../math/Vec3");n.prototype=new o,n.prototype.constructor=n,n.prototype.calculateLocalInertia=function(e,f){f=f||new d;var n=2*e*this.radius*this.radius/5;return f.x=n,f.y=n,f.z=n,f},n.prototype.volume=function(){return 4*Math.PI*this.radius/3},n.prototype.updateBoundingSphereRadius=function(){this.boundingSphereRadius=this.radius},n.prototype.calculateWorldAABB=function(e,f,n,o){for(var d=this.radius,i=["x","y","z"],t=0;td?d+"_"+i:i+"_"+d;e[f]=!0},n=0;nn.x&&(n.x=d.x),d.yn.y&&(n.y=d.y),d.zn.z&&(n.z=d.z)},n.prototype.updateAABB=function(){this.computeLocalAABB(this.aabb)},n.prototype.updateBoundingSphereRadius=function(){for(var e=0,f=this.vertices,n=new d,o=0,i=f.length/3;o!==i;o++){this.getVertex(o,n);var t=n.norm2();t>e&&(e=t)}this.boundingSphereRadius=Math.sqrt(e)};var g=(new d,new i),x=new t;n.prototype.calculateWorldAABB=function(e,f,n,o){var d=g,i=x;d.position=e,d.quaternion=f,this.aabb.toWorldFrame(d,i),n.copy(i.lowerBound),o.copy(i.upperBound)},n.prototype.volume=function(){return 4*Math.PI*this.boundingSphereRadius/3},n.createTorus=function(e,f,o,d,i){e=e||1,f=f||.5,o=o||8,d=d||6,i=i||2*Math.PI;for(var t=[],l=[],u=0;o>=u;u++)for(var p=0;d>=p;p++){var s=p/d*i,y=u/o*Math.PI*2,c=(e+f*Math.cos(y))*Math.cos(s),a=(e+f*Math.cos(y))*Math.sin(s),r=f*Math.sin(y);t.push(c,a,r)}for(var u=1;o>=u;u++)for(var p=1;d>=p;p++){var w=(d+1)*u+p-1,b=(d+1)*(u-1)+p-1,m=(d+1)*(u-1)+p,N=(d+1)*u+p;l.push(w,b,N),l.push(b,m,N)}return new n(t,l)}},{"../collision/AABB":3,"../math/Quaternion":28,"../math/Transform":29,"../math/Vec3":30,"../utils/Octree":50,"./Shape":43}],46:[function(e,f){function n(){o.call(this),this.iterations=10,this.tolerance=1e-7}f.exports=n;var o=(e("../math/Vec3"),e("../math/Quaternion"),e("./Solver"));n.prototype=new o;var d=[],i=[],t=[];n.prototype.solve=function(e,f){var n,o,l,u,p,s,y=0,c=this.iterations,a=this.tolerance*this.tolerance,r=this.equations,w=r.length,b=f.bodies,m=b.length,N=e;if(0!==w)for(var g=0;g!==m;g++)b[g].updateSolveMassProperties();var x=i,j=t,v=d; +x.length=w,j.length=w,v.length=w;for(var g=0;g!==w;g++){var A=r[g];v[g]=0,j[g]=A.computeB(N),x[g]=1/A.computeC()}if(0!==w){for(var g=0;g!==m;g++){var C=b[g],O=C.vlambda,h=C.wlambda;O.set(0,0,0),h&&h.set(0,0,0)}for(y=0;y!==c;y++){u=0;for(var k=0;k!==w;k++){var A=r[k];n=j[k],o=x[k],s=v[k],p=A.computeGWlambda(),l=o*(n-p-A.eps*s),s+lA.maxForce&&(l=A.maxForce-s),v[k]+=l,u+=l>0?l:-l,A.addToWlambda(l)}if(a>u*u)break}for(var g=0;g!==m;g++){var C=b[g],q=C.velocity,z=C.angularVelocity;q.vadd(C.vlambda,q),z&&z.vadd(C.wlambda,z)}}return y}},{"../math/Quaternion":28,"../math/Vec3":30,"./Solver":47}],47:[function(e,f){function n(){this.equations=[]}f.exports=n,n.prototype.solve=function(){return 0},n.prototype.addEquation=function(e){e.enabled&&this.equations.push(e)},n.prototype.removeEquation=function(e){var f=this.equations,n=f.indexOf(e);-1!==n&&f.splice(n,1)},n.prototype.removeAllEquations=function(){this.equations.length=0}},{}],48:[function(e,f){function n(e){for(l.call(this),this.iterations=10,this.tolerance=1e-7,this.subsolver=e,this.nodes=[],this.nodePool=[];this.nodePool.length<128;)this.nodePool.push(this.createNode())}function o(e){for(var f=e.length,n=0;n!==f;n++){var o=e[n];if(!(o.visited||o.body.type&c))return o}return!1}function d(e,f,n,d){for(a.push(e),e.visited=!0,f(e,n,d);a.length;)for(var i,t=a.pop();i=o(t.children);)i.visited=!0,f(i,n,d),a.push(i)}function i(e,f,n){f.push(e.body);for(var o=e.eqs.length,d=0;d!==o;d++){var i=e.eqs[d];-1===n.indexOf(i)&&n.push(i)}}function t(e,f){return f.id-e.id}f.exports=n;var l=(e("../math/Vec3"),e("../math/Quaternion"),e("./Solver")),u=e("../objects/Body");n.prototype=new l;var p=[],s=[],y={bodies:[]},c=u.STATIC,a=[];n.prototype.createNode=function(){return{body:null,children:[],eqs:[],visited:!1}},n.prototype.solve=function(e,f){for(var n=p,l=this.nodePool,u=f.bodies,c=this.equations,a=c.length,r=u.length,w=this.subsolver;l.lengthb;b++)n[b]=l[b];for(var b=0;b!==r;b++){var m=n[b];m.body=u[b],m.children.length=0,m.eqs.length=0,m.visited=!1}for(var N=0;N!==a;N++){var g=c[N],b=u.indexOf(g.bi),x=u.indexOf(g.bj),j=n[b],v=n[x];j.children.push(v),j.eqs.push(g),v.children.push(j),v.eqs.push(g)}var A,C=0,O=s;w.tolerance=this.tolerance,w.iterations=this.iterations;for(var h=y;A=o(n);){O.length=0,h.bodies.length=0,d(A,i,h.bodies,O);var k=O.length;O=O.sort(t);for(var b=0;b!==k;b++)w.addEquation(O[b]);{w.solve(e,h)}w.removeAllEquations(),C++}return C}},{"../math/Quaternion":28,"../math/Vec3":30,"../objects/Body":31,"./Solver":47}],49:[function(e,f){var n=function(){};f.exports=n,n.prototype={constructor:n,addEventListener:function(e,f){void 0===this._listeners&&(this._listeners={});var n=this._listeners;return void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(f)&&n[e].push(f),this},hasEventListener:function(e,f){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(f)?!0:!1},removeEventListener:function(e,f){if(void 0===this._listeners)return this;var n=this._listeners;if(void 0===n[e])return this;var o=n[e].indexOf(f);return-1!==o&&n[e].splice(o,1),this},dispatchEvent:function(e){if(void 0===this._listeners)return this;var f=this._listeners,n=f[e.type];if(void 0!==n){e.target=this;for(var o=0,d=n.length;d>o;o++)n[o].call(this,e)}return this}}},{}],50:[function(e,f){function n(e){e=e||{},this.root=e.root||null,this.aabb=e.aabb?e.aabb.clone():new d,this.data=[],this.children=[]}function o(e,f){f=f||{},f.root=null,f.aabb=e,n.call(this,f),this.maxDepth="undefined"!=typeof f.maxDepth?f.maxDepth:8}var d=e("../collision/AABB"),i=e("../math/Vec3");f.exports=o,o.prototype=new n,n.prototype.reset=function(){this.children.length=this.data.length=0},n.prototype.insert=function(e,f,n){var o=this.data;if(n=n||0,!this.aabb.contains(e))return!1;var d=this.children;if(n<(this.maxDepth||this.root.maxDepth)){var i=!1;d.length||(this.subdivide(),i=!0);for(var t=0;8!==t;t++)if(d[t].insert(e,f,n+1))return!0;i&&(d.length=0)}return o.push(f),!0};var t=new i;n.prototype.subdivide=function(){var e=this.aabb,f=e.lowerBound,o=e.upperBound,l=this.children;l.push(new n({aabb:new d({lowerBound:new i(0,0,0)})}),new n({aabb:new d({lowerBound:new i(1,0,0)})}),new n({aabb:new d({lowerBound:new i(1,1,0)})}),new n({aabb:new d({lowerBound:new i(1,1,1)})}),new n({aabb:new d({lowerBound:new i(0,1,1)})}),new n({aabb:new d({lowerBound:new i(0,0,1)})}),new n({aabb:new d({lowerBound:new i(1,0,1)})}),new n({aabb:new d({lowerBound:new i(0,1,0)})})),o.vsub(f,t),t.scale(.5,t);for(var u=this.root||this,p=0;8!==p;p++){var s=l[p];s.root=u;var y=s.aabb.lowerBound;y.x*=t.x,y.y*=t.y,y.z*=t.z,y.vadd(f,y),y.vadd(t,s.aabb.upperBound)}},n.prototype.aabbQuery=function(e,f){for(var n=(this.data,this.children,[this]);n.length;){var o=n.pop();o.aabb.overlaps(e)&&Array.prototype.push.apply(f,o.data),Array.prototype.push.apply(n,o.children)}return f};var l=new d;n.prototype.rayQuery=function(e,f,n){return e.getAABB(l),l.toLocalFrame(f,l),this.aabbQuery(l,n),n},n.prototype.removeEmptyNodes=function(){for(var e=[this];e.length;){for(var f=e.pop(),n=f.children.length-1;n>=0;n--)f.children[n].data.length||f.children.splice(n,1);Array.prototype.push.apply(e,f.children)}}},{"../collision/AABB":3,"../math/Vec3":30}],51:[function(e,f){function n(){this.objects=[],this.type=Object}f.exports=n,n.prototype.release=function(){for(var e=arguments.length,f=0;f!==e;f++)this.objects.push(arguments[f])},n.prototype.get=function(){return 0===this.objects.length?this.constructObject():this.objects.pop()},n.prototype.constructObject=function(){throw new Error("constructObject() not implemented in this Pool subclass yet!")}},{}],52:[function(e,f){function n(){this.data={keys:[]}}f.exports=n,n.prototype.get=function(e,f){if(e>f){var n=f;f=e,e=n}return this.data[e+"-"+f]},n.prototype.set=function(e,f,n){if(e>f){var o=f;f=e,e=o}var d=e+"-"+f;this.get(e,f)||this.data.keys.push(d),this.data[d]=n},n.prototype.reset=function(){for(var e=this.data,f=e.keys;f.length>0;){var n=f.pop();delete e[n]}}},{}],53:[function(e,f){function n(){}f.exports=n,n.defaults=function(e,f){e=e||{};for(var n in f)n in e||(e[n]=f[n]);return e}},{}],54:[function(e,f){function n(){d.call(this),this.type=o}f.exports=n;var o=e("../math/Vec3"),d=e("./Pool");n.prototype=new d,n.prototype.constructObject=function(){return new o}},{"../math/Vec3":30,"./Pool":51}],55:[function(e,f){function n(e){this.contactPointPool=[],this.frictionEquationPool=[],this.result=[],this.frictionResult=[],this.v3pool=new s,this.world=e,this.currentContactMaterial=null,this.enableFrictionReduction=!1}function o(e,f,n){for(var o=null,d=e.length,i=0;i!==d;i++){var t=e[i],l=M;e[(i+1)%d].vsub(t,l);var u=P;l.cross(f,u);var p=Q;n.vsub(t,p);var s=u.dot(p);if(!(null===o||s>0&&o===!0||0>=s&&o===!1))return!1;null===o&&(o=s>0)}return!0}f.exports=n;var d=e("../collision/AABB"),i=e("../shapes/Shape"),t=e("../collision/Ray"),l=e("../math/Vec3"),u=e("../math/Transform"),p=(e("../shapes/ConvexPolyhedron"),e("../math/Quaternion")),s=(e("../solver/Solver"),e("../utils/Vec3Pool")),y=e("../equations/ContactEquation"),c=e("../equations/FrictionEquation");n.prototype.createContactEquation=function(e,f,n,o,d,i){var t;this.contactPointPool.length?(t=this.contactPointPool.pop(),t.bi=e,t.bj=f):t=new y(e,f),t.enabled=e.collisionResponse&&f.collisionResponse&&n.collisionResponse&&o.collisionResponse;var l=this.currentContactMaterial;t.restitution=l.restitution,t.setSpookParams(l.contactEquationStiffness,l.contactEquationRelaxation,this.world.dt);var u=n.material||e.material,p=o.material||f.material;return u&&p&&u.restitution>=0&&p.restitution>=0&&(t.restitution=u.restitution*p.restitution),t.si=d||n,t.sj=i||o,t},n.prototype.createFrictionEquationsFromContact=function(e,f){var n=e.bi,o=e.bj,d=e.si,i=e.sj,t=this.world,l=this.currentContactMaterial,u=l.friction,p=d.material||n.material,s=i.material||o.material;if(p&&s&&p.friction>=0&&s.friction>=0&&(u=p.friction*s.friction),u>0){var y=u*t.gravity.length(),a=n.invMass+o.invMass;a>0&&(a=1/a);var r=this.frictionEquationPool,w=r.length?r.pop():new c(n,o,y*a),b=r.length?r.pop():new c(n,o,y*a);return w.bi=b.bi=n,w.bj=b.bj=o,w.minForce=b.minForce=-y*a,w.maxForce=b.maxForce=y*a,w.ri.copy(e.ri),w.rj.copy(e.rj),b.ri.copy(e.ri),b.rj.copy(e.rj),e.ni.tangents(w.t,b.t),w.setSpookParams(l.frictionEquationStiffness,l.frictionEquationRelaxation,t.dt),b.setSpookParams(l.frictionEquationStiffness,l.frictionEquationRelaxation,t.dt),w.enabled=b.enabled=e.enabled,f.push(w,b),!0}return!1};var a=new l,r=new l,w=new l;n.prototype.createFrictionFromAverage=function(e){var f=this.result[this.result.length-1];if(this.createFrictionEquationsFromContact(f,this.frictionResult)&&1!==e){var n=this.frictionResult[this.frictionResult.length-2],o=this.frictionResult[this.frictionResult.length-1];a.setZero(),r.setZero(),w.setZero();for(var d=f.bi,i=(f.bj,0);i!==e;i++)f=this.result[this.result.length-1-i],f.bodyA!==d?(a.vadd(f.ni,a),r.vadd(f.ri,r),w.vadd(f.rj,w)):(a.vsub(f.ni,a),r.vadd(f.rj,r),w.vadd(f.ri,w));var t=1/e;r.scale(t,n.ri),w.scale(t,n.rj),o.ri.copy(n.ri),o.rj.copy(n.rj),a.normalize(),a.tangents(n.t,o.t)}};var b=new l,m=new l,N=new p,g=new p;n.prototype.getContacts=function(e,f,n,o,d,i,t){this.contactPointPool=d,this.frictionEquationPool=t,this.result=o,this.frictionResult=i;for(var l=N,u=g,p=b,s=m,y=0,c=e.length;y!==c;y++){var a=e[y],r=f[y],w=null;a.material&&r.material&&(w=n.getContactMaterial(a.material,r.material)||null);for(var x=0;xj.boundingSphereRadius+A.boundingSphereRadius)){var C=null;j.material&&A.material&&(C=n.getContactMaterial(j.material,A.material)||null),this.currentContactMaterial=C||w||n.defaultContactMaterial;var O=this[j.type|A.type];O&&(j.type=w){var b=this.createContactEquation(t,p,e,f);b.ni.copy(y);var m=v;y.scale(r.dot(y),m),s.vsub(m,m),b.ri.copy(m),b.ri.vsub(t.position,b.ri),b.rj.copy(s),b.rj.vsub(p.position,b.rj),this.result.push(b),this.createFrictionEquationsFromContact(b,this.frictionResult)}}};var A=new l,C=new l,O=(new l,new l),h=new l,k=new l,q=new l,z=new l,B=new l,D=new l,E=new l,F=new l,G=new l,H=new l,I=new d,J=[];n.prototype[i.types.SPHERE|i.types.TRIMESH]=n.prototype.sphereTrimesh=function(e,f,n,o,d,i,l,p){var s=k,y=q,c=z,a=B,r=D,w=E,b=I,m=h,N=C,g=J;u.pointToLocalFrame(o,i,n,r);var x=e.radius;b.lowerBound.set(r.x-x,r.y-x,r.z-x),b.upperBound.set(r.x+x,r.y+x,r.z+x),f.getTrianglesInAABB(b,g);for(var j=O,v=e.radius*e.radius,K=0;KL;L++)if(f.getVertex(f.indices[3*g[K]+L],j),j.vsub(r,N),N.norm2()<=v){m.copy(j),u.pointToWorldFrame(o,i,m,j),j.vsub(n,N);var M=this.createContactEquation(l,p,e,f);M.ni.copy(N),M.ni.normalize(),M.ri.copy(M.ni),M.ri.scale(e.radius,M.ri),M.ri.vadd(n,M.ri),M.ri.vsub(l.position,M.ri),M.rj.copy(j),M.rj.vsub(p.position,M.rj),this.result.push(M),this.createFrictionEquationsFromContact(M,this.frictionResult)}for(var K=0;KL;L++){f.getVertex(f.indices[3*g[K]+L],s),f.getVertex(f.indices[3*g[K]+(L+1)%3],y),y.vsub(s,c),r.vsub(y,w);var P=w.dot(c);r.vsub(s,w);var Q=w.dot(c);if(Q>0&&0>P){r.vsub(s,w),a.copy(c),a.normalize(),Q=w.dot(a),a.scale(Q,w),w.vadd(s,w);var R=w.distanceTo(r);if(RC&&C>0){var O=T,h=U;O.copy(p[(x+1)%3]),h.copy(p[(x+2)%3]);var k=O.norm(),q=h.norm();O.normalize(),h.normalize();var z=R.dot(O),B=R.dot(h);if(k>z&&z>-k&&q>B&&B>-q){var D=Math.abs(C-A-s);(null===g||g>D)&&(g=D,m=z,N=B,w=A,c.copy(v),a.copy(O),r.copy(h),b++)}}}if(b){y=!0;var E=this.createContactEquation(t,l,e,f);c.mult(-s,E.ri),E.ni.copy(c),E.ni.negate(E.ni),c.mult(w,c),a.mult(m,a),c.vadd(a,c),r.mult(N,r),c.vadd(r,E.rj),E.ri.vadd(n,E.ri),E.ri.vsub(t.position,E.ri),E.rj.vadd(o,E.rj),E.rj.vsub(l.position,E.rj),this.result.push(E),this.createFrictionEquationsFromContact(E,this.frictionResult)}for(var F=u.get(),G=W,H=0;2!==H&&!y;H++)for(var I=0;2!==I&&!y;I++)for(var J=0;2!==J&&!y;J++)if(F.set(0,0,0),H?F.vadd(p[0],F):F.vsub(p[0],F),I?F.vadd(p[1],F):F.vsub(p[1],F),J?F.vadd(p[2],F):F.vsub(p[2],F),o.vadd(F,G),G.vsub(n,G),G.norm2()_){y=!0;var ef=this.createContactEquation(t,l,e,f);L.vadd(M,ef.rj),ef.rj.copy(ef.rj),D.negate(ef.ni),ef.ni.normalize(),ef.ri.copy(ef.rj),ef.ri.vadd(o,ef.ri),ef.ri.vsub(n,ef.ri),ef.ri.normalize(),ef.ri.mult(s,ef.ri),ef.ri.vadd(n,ef.ri),ef.ri.vsub(t.position,ef.ri),ef.rj.vadd(o,ef.rj),ef.rj.vsub(l.position,ef.rj),this.result.push(ef),this.createFrictionEquationsFromContact(ef,this.frictionResult)}}u.release(K,L,E,M,D)};var $=new l,_=new l,ef=new l,ff=new l,nf=new l,of=new l,df=new l,tf=new l,lf=new l,uf=new l;n.prototype[i.types.SPHERE|i.types.CONVEXPOLYHEDRON]=n.prototype.sphereConvex=function(e,f,n,d,i,t,l,u){var p=this.v3pool;n.vsub(d,$);for(var s=f.faceNormals,y=f.faces,c=f.vertices,a=e.radius,r=0;r!==c.length;r++){var w=c[r],b=nf;t.vmult(w,b),d.vadd(b,b);var m=ff;if(b.vsub(n,m),m.norm2()k&&q.dot(A)>0){for(var z=[],B=0,D=v.length;B!==D;B++){var E=p.get();t.vmult(c[v[B]],E),d.vadd(E,E),z.push(E)}if(o(z,A,n)){g=!0;var N=this.createContactEquation(l,u,e,f);A.mult(-a,N.ri),A.negate(N.ni);var F=p.get();A.mult(-k,F);var G=p.get();A.mult(-a,G),n.vsub(d,N.rj),N.rj.vadd(G,N.rj),N.rj.vadd(F,N.rj),N.rj.vadd(d,N.rj),N.rj.vsub(u.position,N.rj),N.ri.vadd(n,N.ri),N.ri.vsub(l.position,N.ri),p.release(F),p.release(G),this.result.push(N),this.createFrictionEquationsFromContact(N,this.frictionResult);for(var B=0,H=z.length;B!==H;B++)p.release(z[B]);return}for(var B=0;B!==v.length;B++){var I=p.get(),J=p.get();t.vmult(c[v[(B+1)%v.length]],I),t.vmult(c[v[(B+2)%v.length]],J),d.vadd(I,I),d.vadd(J,J);var K=_;J.vsub(I,K);var L=ef;K.unit(L);var M=p.get(),P=p.get();n.vsub(I,P);var Q=P.dot(L);L.mult(Q,M),M.vadd(I,M);var R=p.get();if(M.vsub(n,R),Q>0&&Q*Q=a){var r=this.createContactEquation(t,l,e,f),w=cf;p.mult(p.dot(y),w),u.vsub(w,w),w.vsub(n,r.ri),r.ni.copy(p),u.vsub(o,r.rj),r.ri.vadd(n,r.ri),r.ri.vsub(t.position,r.ri),r.rj.vadd(o,r.rj),r.rj.vsub(l.position,r.rj),this.result.push(r),s++,this.enableFrictionReduction||this.createFrictionEquationsFromContact(r,this.frictionResult)}}this.enableFrictionReduction&&s&&this.createFrictionFromAverage(s)};var af=new l,rf=new l;n.prototype[i.types.CONVEXPOLYHEDRON]=n.prototype.convexConvex=function(e,f,n,o,d,i,t,l,u,p,s,y){var c=af;if(!(n.distanceTo(o)>e.boundingSphereRadius+f.boundingSphereRadius)&&e.findSeparatingAxis(f,n,d,o,i,c,s,y)){var a=[],r=rf;e.clipAgainstHull(n,d,f,o,i,c,-100,100,a);for(var w=0,b=0;b!==a.length;b++){var m=this.createContactEquation(t,l,e,f,u,p),N=m.ri,g=m.rj;c.negate(m.ni),a[b].normal.negate(r),r.mult(a[b].depth,r),a[b].point.vadd(r,N),g.copy(a[b].point),N.vsub(n,N),g.vsub(o,g),N.vadd(n,N),N.vsub(t.position,N),g.vadd(o,g),g.vsub(l.position,g),this.result.push(m),w++,this.enableFrictionReduction||this.createFrictionEquationsFromContact(m,this.frictionResult)}this.enableFrictionReduction&&w&&this.createFrictionFromAverage(w)}};var wf=new l,bf=new l,mf=new l;n.prototype[i.types.PLANE|i.types.PARTICLE]=n.prototype.planeParticle=function(e,f,n,o,d,i,t,l){var u=wf;u.set(0,0,1),t.quaternion.vmult(u,u);var p=bf;o.vsub(t.position,p);var s=u.dot(p);if(0>=s){var y=this.createContactEquation(l,t,f,e);y.ni.copy(u),y.ni.negate(y.ni),y.ri.set(0,0,0);var c=mf;u.mult(u.dot(o),c),o.vsub(c,c),y.rj.copy(c),this.result.push(y),this.createFrictionEquationsFromContact(y,this.frictionResult)}};var Nf=new l;n.prototype[i.types.PARTICLE|i.types.SPHERE]=n.prototype.sphereParticle=function(e,f,n,o,d,i,t,l){var u=Nf;u.set(0,0,1),o.vsub(n,u);var p=u.norm2();if(p<=e.radius*e.radius){var s=this.createContactEquation(l,t,f,e);u.normalize(),s.rj.copy(u),s.rj.mult(e.radius,s.rj),s.ni.copy(u),s.ni.negate(s.ni),s.ri.set(0,0,0),this.result.push(s),this.createFrictionEquationsFromContact(s,this.frictionResult)}};var gf=new p,xf=new l,jf=(new l,new l),vf=new l,Af=new l;n.prototype[i.types.PARTICLE|i.types.CONVEXPOLYHEDRON]=n.prototype.convexParticle=function(e,f,n,o,d,i,t,l){var u=-1,p=jf,s=Af,y=null,c=0,a=xf;if(a.copy(o),a.vsub(n,a),d.conjugate(gf),gf.vmult(a,a),e.pointIsInside(a)){e.worldVerticesNeedsUpdate&&e.computeWorldVertices(n,d),e.worldFaceNormalsNeedsUpdate&&e.computeWorldFaceNormals(d);for(var r=0,w=e.faces.length;r!==w;r++){var b=[e.worldVertices[e.faces[r][0]]],m=e.worldFaceNormals[r];o.vsub(b[0],vf);var N=-m.dot(vf);(null===y||Math.abs(N)b||0>N||w>p.length||m>p[0].length)){0>w&&(w=0),0>b&&(b=0),0>m&&(m=0),0>N&&(N=0),w>=p.length&&(w=p.length-1),b>=p.length&&(b=p.length-1),N>=p[0].length&&(N=p[0].length-1),m>=p[0].length&&(m=p[0].length-1);var g=[];f.getRectMinMax(w,m,b,N,g);var x=g[0],j=g[1];if(!(r.z-y>j||r.z+yv;v++)for(var A=m;N>A;A++)f.getConvexTrianglePillar(v,A,!1),u.pointToWorldFrame(o,i,f.pillarOffset,c),n.distanceTo(c)w||0>m||r>p.length||m>p[0].length)){0>r&&(r=0),0>w&&(w=0),0>b&&(b=0),0>m&&(m=0),r>=p.length&&(r=p.length-1),w>=p.length&&(w=p.length-1),m>=p[0].length&&(m=p[0].length-1),b>=p[0].length&&(b=p[0].length-1);var N=[];f.getRectMinMax(r,b,w,m,N);var g=N[0],x=N[1];if(!(a.z-s>x||a.z+sv;v++)for(var A=b;m>A;A++){var C=j.length;f.getConvexTrianglePillar(v,A,!1),u.pointToWorldFrame(o,i,f.pillarOffset,c),n.distanceTo(c)2)return}}}},{"../collision/AABB":3,"../collision/Ray":9,"../equations/ContactEquation":19,"../equations/FrictionEquation":21,"../math/Quaternion":28,"../math/Transform":29,"../math/Vec3":30,"../shapes/ConvexPolyhedron":38,"../shapes/Shape":43,"../solver/Solver":47,"../utils/Vec3Pool":54}],56:[function(e,f){function n(){u.apply(this),this.dt=-1,this.allowSleep=!1,this.contacts=[],this.frictionEquations=[],this.quatNormalizeSkip=0,this.quatNormalizeFast=!1,this.time=0,this.stepnumber=0,this.default_dt=1/60,this.nextId=0,this.gravity=new d,this.broadphase=new m,this.bodies=[],this.solver=new t,this.constraints=[],this.narrowphase=new l(this),this.collisionMatrix=new p,this.collisionMatrixPrevious=new p,this.materials=[],this.contactmaterials=[],this.contactMaterialTable=new a,this.defaultMaterial=new s("default"),this.defaultContactMaterial=new y(this.defaultMaterial,this.defaultMaterial,{friction:.3,restitution:0}),this.doProfiling=!1,this.profile={solve:0,makeContactConstraints:0,broadphase:0,integrate:0,narrowphase:0},this.subsystems=[],this.addBodyEvent={type:"addBody",body:null},this.removeBodyEvent={type:"removeBody",body:null}}f.exports=n;var o=e("../shapes/Shape"),d=e("../math/Vec3"),i=e("../math/Quaternion"),t=e("../solver/GSSolver"),l=(e("../utils/Vec3Pool"),e("../equations/ContactEquation"),e("../equations/FrictionEquation"),e("./Narrowphase")),u=e("../utils/EventTarget"),p=e("../collision/ArrayCollisionMatrix"),s=e("../material/Material"),y=e("../material/ContactMaterial"),c=e("../objects/Body"),a=e("../utils/TupleDictionary"),r=e("../collision/RaycastResult"),w=e("../collision/AABB"),b=e("../collision/Ray"),m=e("../collision/NaiveBroadphase");n.prototype=new u;var N=(new w,new b);if(n.prototype.getContactMaterial=function(e,f){return this.contactMaterialTable.get(e.id,f.id)},n.prototype.numObjects=function(){return this.bodies.length},n.prototype.collisionMatrixTick=function(){var e=this.collisionMatrixPrevious;this.collisionMatrixPrevious=this.collisionMatrix,this.collisionMatrix=e,this.collisionMatrix.reset()},n.prototype.add=n.prototype.addBody=function(e){-1===this.bodies.indexOf(e)&&(e.index=this.bodies.length,this.bodies.push(e),e.world=this,e.initPosition.copy(e.position),e.initVelocity.copy(e.velocity),e.timeLastSleepy=this.time,e instanceof c&&(e.initAngularVelocity.copy(e.angularVelocity),e.initQuaternion.copy(e.quaternion)),this.collisionMatrix.setNumObjects(this.bodies.length),this.addBodyEvent.body=e,this.dispatchEvent(this.addBodyEvent))},n.prototype.addConstraint=function(e){this.constraints.push(e)},n.prototype.removeConstraint=function(e){var f=this.constraints.indexOf(e);-1!==f&&this.constraints.splice(f,1)},n.prototype.rayTest=function(e,f,n){n instanceof r?this.raycastClosest(e,f,{skipBackfaces:!0},n):this.raycastAll(e,f,{skipBackfaces:!0},n)},n.prototype.raycastAll=function(e,f,n,o){return n.mode=b.ALL,n.from=e,n.to=f,n.callback=o,N.intersectWorld(this,n)},n.prototype.raycastAny=function(e,f,n,o){return n.mode=b.ANY,n.from=e,n.to=f,n.result=o,N.intersectWorld(this,n)},n.prototype.raycastClosest=function(e,f,n,o){return n.mode=b.CLOSEST,n.from=e,n.to=f,n.result=o,N.intersectWorld(this,n)},n.prototype.remove=function(e){e.world=null;var f=this.bodies.length-1,n=this.bodies,o=n.indexOf(e);if(-1!==o){n.splice(o,1);for(var d=0;d!==n.length;d++)n[d].index=d;this.collisionMatrix.setNumObjects(f),this.removeBodyEvent.body=e,this.dispatchEvent(this.removeBodyEvent)}},n.prototype.removeBody=n.prototype.remove,n.prototype.addMaterial=function(e){this.materials.push(e)},n.prototype.addContactMaterial=function(e){this.contactmaterials.push(e),this.contactMaterialTable.set(e.materials[0].id,e.materials[1].id,e)},"undefined"==typeof performance&&(performance={}),!performance.now){var g=Date.now();performance.timing&&performance.timing.navigationStart&&(g=performance.timing.navigationStart),performance.now=function(){return Date.now()-g}}var x=new d;n.prototype.step=function(e,f,n){if(n=n||10,f=f||0,0===f)this.internalStep(e),this.time+=e;else{var o=Math.floor((this.time+f)/e)-Math.floor(this.time/e);o=Math.min(o,n);for(var d=performance.now(),i=0;i!==o&&(this.internalStep(e),!(performance.now()-d>1e3*e));i++);this.time+=f;for(var t=this.time%e,l=t/e,u=x,p=this.bodies,s=0;s!==p.length;s++){var y=p[s];y.type!==c.STATIC&&y.sleepState!==c.SLEEPING?(y.position.vsub(y.previousPosition,u),u.scale(l,u),y.position.vadd(u,y.interpolatedPosition)):(y.interpolatedPosition.copy(y.position),y.interpolatedQuaternion.copy(y.quaternion))}}};var j={type:"postStep"},v={type:"preStep"},A={type:"collide",body:null,contact:null},C=[],O=[],h=[],k=[],q=(new d,new d,new d,new d,new d,new d,new d,new d,new d,new i,new i),z=new i,B=new d;n.prototype.internalStep=function(e){this.dt=e;var f,n=this.contacts,d=h,i=k,t=this.numObjects(),l=this.bodies,u=this.solver,p=this.gravity,s=this.doProfiling,y=this.profile,a=c.DYNAMIC,r=this.constraints,w=O,b=(p.norm(),p.x),m=p.y,N=p.z,g=0;for(s&&(f=performance.now()),g=0;g!==t;g++){var x=l[g];if(x.type&a){var D=x.force,E=x.mass;D.x+=E*b,D.y+=E*m,D.z+=E*N}}for(var g=0,F=this.subsystems.length;g!==F;g++)this.subsystems[g].update();s&&(f=performance.now()),d.length=0,i.length=0,this.broadphase.collisionPairs(this,d,i),s&&(y.broadphase=performance.now()-f);var G=r.length;for(g=0;g!==G;g++){var H=r[g];if(!H.collideConnected)for(var I=d.length-1;I>=0;I-=1)(H.bodyA===d[I]&&H.bodyB===i[I]||H.bodyB===d[I]&&H.bodyA===i[I])&&(d.splice(I,1),i.splice(I,1))}this.collisionMatrixTick(),s&&(f=performance.now());var J=C,K=n.length;for(g=0;g!==K;g++)J.push(n[g]);n.length=0;var L=this.frictionEquations.length;for(g=0;g!==L;g++)w.push(this.frictionEquations[g]);this.frictionEquations.length=0,this.narrowphase.getContacts(d,i,this,n,J,this.frictionEquations,w),s&&(y.narrowphase=performance.now()-f),s&&(f=performance.now());for(var g=0;g=0&&R.material.friction>=0&&(S=x.material.friction*R.material.friction),x.material.restitution>=0&&R.material.restitution>=0&&(H.restitution=x.material.restitution*R.material.restitution)),u.addEquation(H),x.allowSleep&&x.type===c.DYNAMIC&&x.sleepState===c.SLEEPING&&R.sleepState===c.AWAKE&&R.type!==c.STATIC){var T=R.velocity.norm2()+R.angularVelocity.norm2(),U=Math.pow(R.sleepSpeedLimit,2); +T>=2*U&&(x._wakeUpAfterNarrowphase=!0)}if(R.allowSleep&&R.type===c.DYNAMIC&&R.sleepState===c.SLEEPING&&x.sleepState===c.AWAKE&&x.type!==c.STATIC){var V=x.velocity.norm2()+x.angularVelocity.norm2(),W=Math.pow(x.sleepSpeedLimit,2);V>=2*W&&(R._wakeUpAfterNarrowphase=!0)}this.collisionMatrix.set(x,R,!0),this.collisionMatrixPrevious.get(x,R)||(A.body=R,A.contact=H,x.dispatchEvent(A),A.body=x,R.dispatchEvent(A))}for(s&&(y.makeContactConstraints=performance.now()-f,f=performance.now()),g=0;g!==t;g++){var x=l[g];x._wakeUpAfterNarrowphase&&(x.wakeUp(),x._wakeUpAfterNarrowphase=!1)}var G=r.length;for(g=0;g!==G;g++){var H=r[g];H.update();for(var I=0,X=H.equations.length;I!==X;I++){var Y=H.equations[I];u.addEquation(Y)}}u.solve(e,this),s&&(y.solve=performance.now()-f),u.removeAllEquations();var Z=Math.pow;for(g=0;g!==t;g++){var x=l[g];if(x.type&a){var $=Z(1-x.linearDamping,e),_=x.velocity;_.mult($,_);var ef=x.angularVelocity;if(ef){var ff=Z(1-x.angularDamping,e);ef.mult(ff,ef)}}}for(this.dispatchEvent(v),g=0;g!==t;g++){var x=l[g];x.preStep&&x.preStep.call(x)}s&&(f=performance.now());{var nf=q,of=z,df=this.stepnumber,tf=c.DYNAMIC|c.KINEMATIC,lf=df%(this.quatNormalizeSkip+1)===0,uf=this.quatNormalizeFast,pf=.5*e;o.types.PLANE,o.types.CONVEXPOLYHEDRON}for(g=0;g!==t;g++){var sf=l[g],yf=sf.force,cf=sf.torque;if(sf.type&tf&&sf.sleepState!==c.SLEEPING){var af=sf.velocity,rf=sf.angularVelocity,wf=sf.position,bf=sf.quaternion,mf=sf.invMass,Nf=sf.invInertiaWorld;af.x+=yf.x*mf*e,af.y+=yf.y*mf*e,af.z+=yf.z*mf*e,sf.angularVelocity&&(Nf.vmult(cf,B),B.mult(e,B),B.vadd(rf,rf)),wf.x+=af.x*e,wf.y+=af.y*e,wf.z+=af.z*e,sf.angularVelocity&&(nf.set(rf.x,rf.y,rf.z,0),nf.mult(bf,of),bf.x+=pf*of.x,bf.y+=pf*of.y,bf.z+=pf*of.z,bf.w+=pf*of.w,lf&&(uf?bf.normalizeFast():bf.normalize())),sf.aabb&&(sf.aabbNeedsUpdate=!0),sf.updateInertiaWorld&&sf.updateInertiaWorld()}}for(this.clearForces(),this.broadphase.dirty=!0,s&&(y.integrate=performance.now()-f),this.time+=e,this.stepnumber+=1,this.dispatchEvent(j),g=0;g!==t;g++){var x=l[g],gf=x.postStep;gf&&gf.call(x)}if(this.allowSleep)for(g=0;g!==t;g++)l[g].sleepTick(this.time)},n.prototype.clearForces=function(){for(var e=this.bodies,f=e.length,n=0;n!==f;n++){{var o=e[n];o.force,o.torque}o.force.set(0,0,0),o.torque.set(0,0,0)}}},{"../collision/AABB":3,"../collision/ArrayCollisionMatrix":4,"../collision/NaiveBroadphase":7,"../collision/Ray":9,"../collision/RaycastResult":10,"../equations/ContactEquation":19,"../equations/FrictionEquation":21,"../material/ContactMaterial":24,"../material/Material":25,"../math/Quaternion":28,"../math/Vec3":30,"../objects/Body":31,"../shapes/Shape":43,"../solver/GSSolver":46,"../utils/EventTarget":49,"../utils/TupleDictionary":52,"../utils/Vec3Pool":54,"./Narrowphase":55}]},{},[2])(2)}); +}; +gdjs.evtsExt__Physics3dExtension__LoadPhysicsLibrary.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +} + +} + + +{ + + +gdjs.evtsExt__Physics3dExtension__LoadPhysicsLibrary.userFunc0x13f3a20(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +{ + + +let isConditionTrue_0 = false; +{ +} + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__LoadPhysicsLibrary.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Physics3dExtension__LoadPhysicsLibrary.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__Physics3dExtension__LoadPhysicsLibrary.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__onfirstsceneloaded-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__onfirstsceneloaded-func.js new file mode 100644 index 0000000..0e434c4 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__onfirstsceneloaded-func.js @@ -0,0 +1,98 @@ + +if (typeof gdjs.evtsExt__Physics3dExtension__onFirstSceneLoaded !== "undefined") { + gdjs.evtsExt__Physics3dExtension__onFirstSceneLoaded.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Physics3dExtension__onFirstSceneLoaded = {}; + + +gdjs.evtsExt__Physics3dExtension__onFirstSceneLoaded.userFunc0x12c36a8 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +gdjs.__Physics3DExtension = new Map(); +}; +gdjs.evtsExt__Physics3dExtension__onFirstSceneLoaded.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtsExt__Physics3dExtension__LoadPhysicsLibrary.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +gdjs.evtsExt__Physics3dExtension__onFirstSceneLoaded.userFunc0x12c36a8(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__onFirstSceneLoaded.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Physics3dExtension__onFirstSceneLoaded.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__Physics3dExtension__onFirstSceneLoaded.registeredGdjsCallbacks = []; +gdjs.evtsExt__Physics3dExtension__onFirstSceneLoaded.registeredGdjsCallbacks.push((runtimeScene) => { + gdjs.evtsExt__Physics3dExtension__onFirstSceneLoaded.func(runtimeScene, runtimeScene); +}) +gdjs.registerFirstRuntimeSceneLoadedCallback(gdjs.evtsExt__Physics3dExtension__onFirstSceneLoaded.registeredGdjsCallbacks[gdjs.evtsExt__Physics3dExtension__onFirstSceneLoaded.registeredGdjsCallbacks.length - 1]); diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__onscenepostevents-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__onscenepostevents-func.js new file mode 100644 index 0000000..68ac47c --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__onscenepostevents-func.js @@ -0,0 +1,126 @@ + +if (typeof gdjs.evtsExt__Physics3dExtension__onScenePostEvents !== "undefined") { + gdjs.evtsExt__Physics3dExtension__onScenePostEvents.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__Physics3dExtension__onScenePostEvents = {}; + + +gdjs.evtsExt__Physics3dExtension__onScenePostEvents.userFunc0x13f3a20 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__Physics3DExtension.has("World")) { + console.warn("!"); + return; +} + +const World = gdjs.__Physics3DExtension.get("World"); + +const delta = runtimeScene.getVariables().get("__PhysicsEngine3D").getChild("TimeDelta").getAsNumber(); + +World.step(delta); + + +}; +gdjs.evtsExt__Physics3dExtension__onScenePostEvents.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__Physics3dExtension__onScenePostEvents.userFunc0x13f3a20(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +};gdjs.evtsExt__Physics3dExtension__onScenePostEvents.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtsExt__Physics3dExtension__LoadGLTFLoaderLibrary.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__Physics3dExtension__LoadLighting.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +{ +{runtimeScene.getScene().getVariables().get("__PhysicsEngine3D").getChild("TimeDelta").setNumber(gdjs.evtTools.runtimeScene.getElapsedTimeInSeconds(runtimeScene)); +} +{ //Subevents +gdjs.evtsExt__Physics3dExtension__onScenePostEvents.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__onScenePostEvents.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__Physics3dExtension__onScenePostEvents.eventsList1(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__Physics3dExtension__onScenePostEvents.registeredGdjsCallbacks = []; +gdjs.evtsExt__Physics3dExtension__onScenePostEvents.registeredGdjsCallbacks.push((runtimeScene) => { + gdjs.evtsExt__Physics3dExtension__onScenePostEvents.func(runtimeScene, runtimeScene); +}) +gdjs.registerRuntimeScenePostEventsCallback(gdjs.evtsExt__Physics3dExtension__onScenePostEvents.registeredGdjsCallbacks[gdjs.evtsExt__Physics3dExtension__onScenePostEvents.registeredGdjsCallbacks.length - 1]); diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__physicsengine3dboxtile.js b/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__physicsengine3dboxtile.js new file mode 100644 index 0000000..2369b51 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__physicsengine3dboxtile.js @@ -0,0 +1,751 @@ + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile = gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile || {}; + +/** + * Behavior generated from Physics Engine 3D Box Tile + */ +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile = class PhysicsEngine3DBoxTile extends gdjs.RuntimeBehavior { + constructor(instanceContainer, behaviorData, owner) { + super(instanceContainer, behaviorData, owner); + this._runtimeScene = instanceContainer; + + this._onceTriggers = new gdjs.OnceTriggers(); + this._behaviorData = {}; + this._sharedData = gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.getSharedData( + instanceContainer, + behaviorData.name + ); + + this._behaviorData.Shape = behaviorData.Shape !== undefined ? behaviorData.Shape : "Box"; + this._behaviorData.MakeStatic = behaviorData.MakeStatic !== undefined ? behaviorData.MakeStatic : false; + this._behaviorData.Mass = behaviorData.Mass !== undefined ? behaviorData.Mass : Number("1") || 0; + this._behaviorData.BoxProjectionFromTiled = behaviorData.BoxProjectionFromTiled !== undefined ? behaviorData.BoxProjectionFromTiled : ""; + } + + // Hot-reload: + updateFromBehaviorData(oldBehaviorData, newBehaviorData) { + + if (oldBehaviorData.Shape !== newBehaviorData.Shape) + this._behaviorData.Shape = newBehaviorData.Shape; + if (oldBehaviorData.MakeStatic !== newBehaviorData.MakeStatic) + this._behaviorData.MakeStatic = newBehaviorData.MakeStatic; + if (oldBehaviorData.Mass !== newBehaviorData.Mass) + this._behaviorData.Mass = newBehaviorData.Mass; + if (oldBehaviorData.BoxProjectionFromTiled !== newBehaviorData.BoxProjectionFromTiled) + this._behaviorData.BoxProjectionFromTiled = newBehaviorData.BoxProjectionFromTiled; + + return true; + } + + // Properties: + + _getShape() { + return this._behaviorData.Shape !== undefined ? this._behaviorData.Shape : "Box"; + } + _setShape(newValue) { + this._behaviorData.Shape = newValue; + } + _getMakeStatic() { + return this._behaviorData.MakeStatic !== undefined ? this._behaviorData.MakeStatic : false; + } + _setMakeStatic(newValue) { + this._behaviorData.MakeStatic = newValue; + } + _toggleMakeStatic() { + this._setMakeStatic(!this._getMakeStatic()); + } + _getMass() { + return this._behaviorData.Mass !== undefined ? this._behaviorData.Mass : Number("1") || 0; + } + _setMass(newValue) { + this._behaviorData.Mass = newValue; + } + _getBoxProjectionFromTiled() { + return this._behaviorData.BoxProjectionFromTiled !== undefined ? this._behaviorData.BoxProjectionFromTiled : ""; + } + _setBoxProjectionFromTiled(newValue) { + this._behaviorData.BoxProjectionFromTiled = newValue; + } +} + +/** + * Shared data generated from Physics Engine 3D Box Tile + */ +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.SharedData = class PhysicsEngine3DBoxTileSharedData { + constructor(sharedData) { + + this.Gravity = sharedData.Gravity !== undefined ? sharedData.Gravity : Number("9.82") || 0; + } + + // Shared properties: + + _getGravity() { + return this.Gravity !== undefined ? this.Gravity : Number("9.82") || 0; + } + _setGravity(newValue) { + this.Gravity = newValue; + } +} + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.getSharedData = function(instanceContainer, behaviorName) { + if (!instanceContainer._Physics3dExtension_PhysicsEngine3DBoxTileSharedData) { + const initialData = instanceContainer.getInitialSharedDataForBehavior( + behaviorName + ); + instanceContainer._Physics3dExtension_PhysicsEngine3DBoxTileSharedData = new gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.SharedData( + initialData + ); + } + return instanceContainer._Physics3dExtension_PhysicsEngine3DBoxTileSharedData; +} + +// Methods: +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.onCreatedContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.onCreatedContext.GDObjectObjects1= []; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.onCreatedContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.onCreatedContext.userFunc0x8ced00 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +const behaviorName = eventsFunctionContext.getBehaviorName("Behavior"); + +objects[0].getVariables().get("Physics3dBehavior").setString(behaviorName); +}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.onCreatedContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.onCreatedContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.onCreatedContext.GDObjectObjects1); +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.onCreatedContext.userFunc0x8ced00(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.onCreated = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +, "BoxProjectionFromTiled": this._getBoxProjectionFromTiled() +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.onCreatedContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.onCreatedContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.onCreatedContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.doStepPostEventsContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.doStepPostEventsContext.GDObjectObjects1= []; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.doStepPostEventsContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.doStepPostEventsContext.userFunc0x8ce7b8 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; + +const PhysicsEngine3D = objects[0].getBehavior("PhysicsEngine3DBoxTile"); + +if(!PhysicsEngine3D.body) return; + +const scene = gdjs.__WithThreeJS.get("Scene"); +const Object3D = objects[0].getBehavior("BoxProjectionFromTiled"); +const ProjectionScale = Object3D.ProjectionScale(); +const Id = Object3D.Id(); +const cubeMesh = scene.getObjectByName(Id); +const cubeBody = PhysicsEngine3D.body; + + +if(!cubeMesh) return; + +objects[0].setX(cubeBody.position.x/ProjectionScale); +objects[0].setZOrder(cubeBody.position.y/ProjectionScale); +objects[0].setY(cubeBody.position.z/ProjectionScale); + + +// solve this some day +// objects[0].setAngle(cubeBody.rotation.y); + +cubeMesh.quaternion.copy(cubeBody.quaternion); +}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.doStepPostEventsContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.doStepPostEventsContext.GDObjectObjects1); +{gdjs.evtsExt__Physics3dExtension__CreateWorld.func(runtimeScene, (( gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.doStepPostEventsContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.doStepPostEventsContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._sharedData._getGravity()), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = eventsFunctionContext.getOnceTriggers().triggerOnce(23342468); +} +if (isConditionTrue_0) { +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.doStepPostEventsContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.doStepPostEventsContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.doStepPostEventsContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).CreateShape((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.doStepPostEventsContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.doStepPostEventsContext.GDObjectObjects1); +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.doStepPostEventsContext.userFunc0x8ce7b8(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.doStepPostEvents = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +, "BoxProjectionFromTiled": this._getBoxProjectionFromTiled() +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.doStepPostEventsContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.doStepPostEventsContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.doStepPostEventsContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.CreateShapeContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.CreateShapeContext.GDObjectObjects1= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.CreateShapeContext.userFunc0x8cea28 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +if (!gdjs.__Physics3DExtension.has("World")) { + console.warn("!"); + return; +} + +const world = gdjs.__Physics3DExtension.get("World"); +const scene = gdjs.__WithThreeJS.get("Scene"); +const PhysicsEngine3D = objects[0].getBehavior("PhysicsEngine3DBoxTile"); +const Object3D = objects[0].getBehavior("BoxProjectionFromTiled"); +const Id = Object3D.Id(); +const cubeMesh = scene.getObjectByName(Id); +const Width = objects[0].getWidth(); +const Height = objects[0].getHeight(); +const Depth = Object3D.Depth(); +const ProjectionScale = Object3D.ProjectionScale(); + +const cubeShape = new CANNON.Box( + new CANNON.Vec3( + Width * ProjectionScale/2, + Depth * ProjectionScale/2, + Height * ProjectionScale/2 + ) +); + +const cubeBody = new CANNON.Body({ mass: PhysicsEngine3D.Mass() }) +cubeBody.addShape(cubeShape) +cubeBody.position.copy(cubeMesh.position) +world.addBody(cubeBody) + +PhysicsEngine3D.body = cubeBody; +}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.CreateShapeContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.CreateShapeContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.CreateShapeContext.GDObjectObjects1); +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.CreateShapeContext.userFunc0x8cea28(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.CreateShape = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +, "BoxProjectionFromTiled": this._getBoxProjectionFromTiled() +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.CreateShapeContext.GDObjectObjects1.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.CreateShapeContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.MassContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.MassContext.GDObjectObjects1= []; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.MassContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.MassContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.MassContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.MassContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.MassContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getMass()); }}} + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.Mass = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +, "BoxProjectionFromTiled": this._getBoxProjectionFromTiled() +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.MassContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.MassContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.MassContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.SetMassContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.SetMassContext.GDObjectObjects1= []; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.SetMassContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.SetMassContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.SetMassContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.SetMassContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.SetMassContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setMass((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0)); +} +}} + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.SetMass = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +, "BoxProjectionFromTiled": this._getBoxProjectionFromTiled() +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.SetMassContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.SetMassContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.SetMassContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.onDestroyContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.onDestroyContext.GDObjectObjects1= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.onDestroyContext.userFunc0x8d0bd8 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +if (!gdjs.__Physics3DExtension.has("World")) { + console.warn("!"); + return; +} + +const world = gdjs.__Physics3DExtension.get("World"); + +const PhysicsEngine3D = objects[0].getBehavior("PhysicsEngine3DBoxTile"); + +if(!PhysicsEngine3D.body) return; + +world.remove(PhysicsEngine3D.body); +}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.onDestroyContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.onDestroyContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.onDestroyContext.GDObjectObjects1); +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.onDestroyContext.userFunc0x8d0bd8(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.onDestroy = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +, "BoxProjectionFromTiled": this._getBoxProjectionFromTiled() +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.onDestroyContext.GDObjectObjects1.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.onDestroyContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile.prototype.doStepPreEvents = function() { + this._onceTriggers.startNewFrame(); +}; + + +gdjs.registerBehavior("Physics3dExtension::PhysicsEngine3DBoxTile", gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DBoxTile.PhysicsEngine3DBoxTile); diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__physicsengine3dgltfmodel.js b/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__physicsengine3dgltfmodel.js new file mode 100644 index 0000000..e66e886 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__physicsengine3dgltfmodel.js @@ -0,0 +1,1996 @@ + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel = gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel || {}; + +/** + * Behavior generated from Physics Engine 3D GLTF Model + */ +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel = class PhysicsEngine3DGLTFModel extends gdjs.RuntimeBehavior { + constructor(instanceContainer, behaviorData, owner) { + super(instanceContainer, behaviorData, owner); + this._runtimeScene = instanceContainer; + + this._onceTriggers = new gdjs.OnceTriggers(); + this._behaviorData = {}; + this._sharedData = gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.getSharedData( + instanceContainer, + behaviorData.name + ); + + this._behaviorData.FileName = behaviorData.FileName !== undefined ? behaviorData.FileName : ""; + this._behaviorData.MakeStatic = behaviorData.MakeStatic !== undefined ? behaviorData.MakeStatic : false; + this._behaviorData.Mass = behaviorData.Mass !== undefined ? behaviorData.Mass : Number("1") || 0; + } + + // Hot-reload: + updateFromBehaviorData(oldBehaviorData, newBehaviorData) { + + if (oldBehaviorData.FileName !== newBehaviorData.FileName) + this._behaviorData.FileName = newBehaviorData.FileName; + if (oldBehaviorData.MakeStatic !== newBehaviorData.MakeStatic) + this._behaviorData.MakeStatic = newBehaviorData.MakeStatic; + if (oldBehaviorData.Mass !== newBehaviorData.Mass) + this._behaviorData.Mass = newBehaviorData.Mass; + + return true; + } + + // Properties: + + _getFileName() { + return this._behaviorData.FileName !== undefined ? this._behaviorData.FileName : ""; + } + _setFileName(newValue) { + this._behaviorData.FileName = newValue; + } + _getMakeStatic() { + return this._behaviorData.MakeStatic !== undefined ? this._behaviorData.MakeStatic : false; + } + _setMakeStatic(newValue) { + this._behaviorData.MakeStatic = newValue; + } + _toggleMakeStatic() { + this._setMakeStatic(!this._getMakeStatic()); + } + _getMass() { + return this._behaviorData.Mass !== undefined ? this._behaviorData.Mass : Number("1") || 0; + } + _setMass(newValue) { + this._behaviorData.Mass = newValue; + } +} + +/** + * Shared data generated from Physics Engine 3D GLTF Model + */ +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.SharedData = class PhysicsEngine3DGLTFModelSharedData { + constructor(sharedData) { + + this.Gravity = sharedData.Gravity !== undefined ? sharedData.Gravity : Number("9.82") || 0; + } + + // Shared properties: + + _getGravity() { + return this.Gravity !== undefined ? this.Gravity : Number("9.82") || 0; + } + _setGravity(newValue) { + this.Gravity = newValue; + } +} + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.getSharedData = function(instanceContainer, behaviorName) { + if (!instanceContainer._Physics3dExtension_PhysicsEngine3DGLTFModelSharedData) { + const initialData = instanceContainer.getInitialSharedDataForBehavior( + behaviorName + ); + instanceContainer._Physics3dExtension_PhysicsEngine3DGLTFModelSharedData = new gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.SharedData( + initialData + ); + } + return instanceContainer._Physics3dExtension_PhysicsEngine3DGLTFModelSharedData; +} + +// Methods: +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.onCreatedContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.onCreatedContext.GDObjectObjects1= []; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.onCreatedContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.onCreatedContext.userFunc0x8f6658 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +const behaviorName = eventsFunctionContext.getBehaviorName("Behavior"); + +objects[0].getVariables().get("Physics3dBehavior").setString(behaviorName); +}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.onCreatedContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.onCreatedContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.onCreatedContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.onCreatedContext.GDObjectObjects1[i].hide(); +} +}} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.onCreatedContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.onCreatedContext.GDObjectObjects1); +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.onCreatedContext.userFunc0x8f6658(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.onCreated = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.onCreatedContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.onCreatedContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.onCreatedContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.doStepPostEventsContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.doStepPostEventsContext.GDObjectObjects1= []; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.doStepPostEventsContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.doStepPostEventsContext.userFunc0x8f4340 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +const behaviorName = eventsFunctionContext.getBehaviorName("Behavior"); +const PhysicsEngine3D = objects[0].getBehavior(behaviorName); + +if(!PhysicsEngine3D.body) return; +if(!PhysicsEngine3D.model) return; + +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Camera = gdjs.__WithThreeJS.get("Camera"); +const Renderer = gdjs.__WithThreeJS.get("Renderer"); +const World = gdjs.__Physics3DExtension.get("World"); +const ProjectionScale = 0.01; +const mixer = PhysicsEngine3D.mixer; +const model = PhysicsEngine3D.model; +const body = PhysicsEngine3D.body; +const size = PhysicsEngine3D.size; +const box = PhysicsEngine3D.box; +const sphere = PhysicsEngine3D.sphere; +const delta = runtimeScene.getVariables().get("__PhysicsEngine3D").getChild("TimeDelta").getAsNumber(); + +// Update Gdevelop instance +objects[0].setX(body.position.x/ProjectionScale); +objects[0].setZOrder(body.position.y/ProjectionScale); +objects[0].setY(body.position.z/ProjectionScale); + +// Position the sphere to cover the model +sphere.position.copy(body.position); + +// Update model position +model.position.copy(sphere.position); +var sphereSize = new THREE.Box3().setFromObject( sphere ); +model.position.y = sphereSize.min.y; + +// Play animation +mixer.update( delta ); +}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.doStepPostEventsContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.doStepPostEventsContext.GDObjectObjects1); +{gdjs.evtsExt__Physics3dExtension__CreateWorld.func(runtimeScene, (( gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.doStepPostEventsContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.doStepPostEventsContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._sharedData._getGravity()), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.doStepPostEventsContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.doStepPostEventsContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.doStepPostEventsContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).CreateShape((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.doStepPostEventsContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.doStepPostEventsContext.GDObjectObjects1); +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.doStepPostEventsContext.userFunc0x8f4340(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.doStepPostEvents = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.doStepPostEventsContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.doStepPostEventsContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.doStepPostEventsContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.CreateShapeContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.CreateShapeContext.GDObjectObjects1= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.CreateShapeContext.userFunc0x8f4340 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +if (!gdjs.__Physics3DExtension.has("World")) { + console.warn("!"); + return; +} + +if(!THREE.GLTFLoader) return; + +const behaviorName = eventsFunctionContext.getBehaviorName("Behavior"); +const PhysicsEngine3D = objects[0].getBehavior(behaviorName); + +if(PhysicsEngine3D.loaded) return; + +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Camera = gdjs.__WithThreeJS.get("Camera"); +const Renderer = gdjs.__WithThreeJS.get("Renderer"); +const World = gdjs.__Physics3DExtension.get("World"); + +// Load the model +async function loadGLTF(url) { + let loader = new THREE.GLTFLoader(); + let gltf = await new Promise((resolve, reject) => { + loader.load(url, resolve, undefined, reject); + }); + + // adjust colors + gltf.scene.traverse(function(node) { + if (node.isMesh) { + if(node.material.map) { + node.material.map.encoding = THREE.LinearEncoding; + } + + node.flipY = false; + } + }); + + return gltf; +} + +function getSizeOfModel(model) { + const box = new THREE.Box3().setFromObject( model ); + const size = box.getSize(new THREE.Vector3()); + + return size; +} + +async function LoadModel() { + let gltf = await loadGLTF(PhysicsEngine3D.FileName()); + + let model = gltf.scene; + // let size = getSizeOfModel(model); + + Scene.add(model); + + // remove optimization + model.traverse(function(obj){ obj.frustumCulled = false; }); + + // Calculate the size of the model + var box = new THREE.Box3().setFromObject( model ); + var size = box.getSize( new THREE.Vector3() ); + + // // Calculate the radius of the sphere + var radius = ( size.x + size.y + size.z ) / 3; + + // Create a sphere that covers the model + var sphereGeometry = new THREE.SphereGeometry( radius, 32, 32 ); + var sphereMaterial = new THREE.MeshBasicMaterial( { color: 0xffff00 } ); + var sphere = new THREE.Mesh( sphereGeometry, sphereMaterial ); + + // Position the sphere to cover the model + sphere.position.x = ( box.max.x + box.min.x ) / 2; + sphere.position.y = ( box.max.y + box.min.y ) / 2; + sphere.position.z = ( box.max.z + box.min.z ) / 2; + + // Add the sphere to the scene + // Scene.add( sphere ); + + objects[0].setWidth(radius/0.01); + objects[0].setHeight(radius/0.01); + + // Create a Cannon.js body for the sphere + var sphereBody = new CANNON.Body({ + mass: 1, + shape: new CANNON.Sphere(radius), + position: new THREE.Vector3(sphere.position.x, sphere.position.y, sphere.position.z) + }); + sphereBody.linearDamping = 0.9; // slow down + + // Add the sphere body to the Cannon.js world + World.addBody( sphereBody ); + + sphereBody.position.x = objects[0].getCenterXInScene()*0.01; + sphereBody.position.y = objects[0].getZOrder()*0.01; + sphereBody.position.z = objects[0].getCenterYInScene()*0.01; + + PhysicsEngine3D.body = sphereBody; + PhysicsEngine3D.sphere = sphere; + PhysicsEngine3D.box = box; + PhysicsEngine3D.size = size; + PhysicsEngine3D.model = model; + PhysicsEngine3D.animations = gltf.animations; + PhysicsEngine3D.mixer = new THREE.AnimationMixer(model);; +} + +function LoadBody() { + const Width = objects[0].getWidth(); + const Height = objects[0].getHeight(); + const Depth = 64; + const ProjectionScale = 0.01; + const Angle = objects[0].angle; + const X = objects[0].getCenterXInScene(); + const Y = objects[0].getCenterYInScene(); + const Z = objects[0].zOrder; + + const cubeShape = new CANNON.Box( + new CANNON.Vec3( + Width * ProjectionScale/2, + Depth * ProjectionScale/2, + Height * ProjectionScale/2 + ) + ); + + const cubeBody = new CANNON.Body({ mass: PhysicsEngine3D.Mass() }) + cubeBody.addShape(cubeShape) + + cubeBody.position.set(X * ProjectionScale, Z * ProjectionScale, Y * ProjectionScale); + // cubeBody.rotation.set(gdjs.toRad(0), gdjs.toRad(Angle * -1), gdjs.toRad(0)); + + World.addBody(cubeBody) + + PhysicsEngine3D.body = cubeBody; +} + +PhysicsEngine3D.loaded = true; +LoadModel(); +// LoadBody(); +}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.CreateShapeContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.CreateShapeContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.CreateShapeContext.GDObjectObjects1); +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.CreateShapeContext.userFunc0x8f4340(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.CreateShape = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.CreateShapeContext.GDObjectObjects1.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.CreateShapeContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.MassContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.MassContext.GDObjectObjects1= []; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.MassContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.MassContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.MassContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.MassContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.MassContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getMass()); }}} + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.Mass = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.MassContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.MassContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.MassContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetMassContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetMassContext.GDObjectObjects1= []; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetMassContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetMassContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetMassContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetMassContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetMassContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setMass((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0)); +} +}} + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetMass = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetMassContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetMassContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetMassContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.onDestroyContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.onDestroyContext.GDObjectObjects1= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.onDestroyContext.userFunc0x902948 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +if (!gdjs.__Physics3DExtension.has("World")) { + console.warn("!"); + return; +} + +const world = gdjs.__Physics3DExtension.get("World"); +const Scene = gdjs.__WithThreeJS.get("Scene"); + +const behaviorName = eventsFunctionContext.getBehaviorName("Behavior"); + +const PhysicsEngine3D = objects[0].getBehavior(behaviorName); + +if(!PhysicsEngine3D.model) return; + +Scene.remove(PhysicsEngine3D.model); + +if(!PhysicsEngine3D.body) return; + +world.remove(PhysicsEngine3D.body); +}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.onDestroyContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.onDestroyContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.onDestroyContext.GDObjectObjects1); +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.onDestroyContext.userFunc0x902948(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.onDestroy = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.onDestroyContext.GDObjectObjects1.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.onDestroyContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.ApplyImpulseContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.ApplyImpulseContext.GDObjectObjects1= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.ApplyImpulseContext.userFunc0x902948 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +const behaviorName = eventsFunctionContext.getBehaviorName("Behavior"); +const PhysicsEngine3D = objects[0].getBehavior(behaviorName); + +if(!PhysicsEngine3D.body) return; + +const forceX = eventsFunctionContext.getArgument("ForceX"); +const forceY = eventsFunctionContext.getArgument("ForceY"); +const forceZ = eventsFunctionContext.getArgument("ForceZ"); +const body = PhysicsEngine3D.body; +const jumpForce = new CANNON.Vec3(forceX, forceY, forceZ); + +body.applyImpulse(jumpForce, body.position); +}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.ApplyImpulseContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.ApplyImpulseContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.ApplyImpulseContext.GDObjectObjects1); +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.ApplyImpulseContext.userFunc0x902948(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.ApplyImpulse = function(ForceX, ForceY, ForceZ, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ForceX") return ForceX; +if (argName === "ForceY") return ForceY; +if (argName === "ForceZ") return ForceZ; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.ApplyImpulseContext.GDObjectObjects1.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.ApplyImpulseContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionXContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionXContext.GDObjectObjects1= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionXContext.userFunc0x902948 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +const scene = gdjs.__WithThreeJS.get("Scene"); +const behaviorName = eventsFunctionContext.getBehaviorName("Behavior"); +const PhysicsEngine3D = objects[0].getBehavior(behaviorName); +const Id = PhysicsEngine3D.Id(); +const cubeMesh = scene.getObjectByName(Id); + +eventsFunctionContext.returnValue = cubeMesh.position.x; +}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionXContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionXContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionXContext.GDObjectObjects1); +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionXContext.userFunc0x902948(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionX = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionXContext.GDObjectObjects1.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionXContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionZContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionZContext.GDObjectObjects1= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionZContext.userFunc0x902948 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +const scene = gdjs.__WithThreeJS.get("Scene"); +const behaviorName = eventsFunctionContext.getBehaviorName("Behavior"); +const PhysicsEngine3D = objects[0].getBehavior(behaviorName); +const Id = PhysicsEngine3D.Id(); +const cubeMesh = scene.getObjectByName(Id); + +eventsFunctionContext.returnValue = cubeMesh.position.z; +}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionZContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionZContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionZContext.GDObjectObjects1); +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionZContext.userFunc0x902948(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionZ = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionZContext.GDObjectObjects1.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionZContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionYContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionYContext.GDObjectObjects1= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionYContext.userFunc0x902948 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +const scene = gdjs.__WithThreeJS.get("Scene"); +const behaviorName = eventsFunctionContext.getBehaviorName("Behavior"); +const PhysicsEngine3D = objects[0].getBehavior(behaviorName); +const Id = PhysicsEngine3D.Id(); +const cubeMesh = scene.getObjectByName(Id); + +eventsFunctionContext.returnValue = cubeMesh.position.y; +}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionYContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionYContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionYContext.GDObjectObjects1); +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionYContext.userFunc0x902948(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionY = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionYContext.GDObjectObjects1.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.PositionYContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.FileNameContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.FileNameContext.GDObjectObjects1= []; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.FileNameContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.FileNameContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.FileNameContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.FileNameContext.GDObjectObjects1.length === 0 ) ? "" :gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.FileNameContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getFileName()); }}} + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.FileName = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.FileNameContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.FileNameContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.FileNameContext.eventsList0(runtimeScene, eventsFunctionContext); + +return "" + eventsFunctionContext.returnValue; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetFileNameContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetFileNameContext.GDObjectObjects1= []; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetFileNameContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetFileNameContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetFileNameContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetFileNameContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetFileNameContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setFileName((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Value") : "")); +} +}} + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetFileName = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetFileNameContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetFileNameContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetFileNameContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetAnimationContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetAnimationContext.GDObjectObjects1= []; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetAnimationContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetAnimationContext.userFunc0x902948 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +const behaviorName = eventsFunctionContext.getBehaviorName("Behavior"); +const PhysicsEngine3D = objects[0].getBehavior(behaviorName); + +if(!PhysicsEngine3D.mixer) return; + +if(!!PhysicsEngine3D.action) { + PhysicsEngine3D.action.stop(); +} + +const AnimationIndex = eventsFunctionContext.getArgument("AnimationIndex"); + +PhysicsEngine3D.action = PhysicsEngine3D.mixer.clipAction(PhysicsEngine3D.animations[AnimationIndex]); +PhysicsEngine3D.action.play(); + +}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetAnimationContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetAnimationContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetAnimationContext.GDObjectObjects1); +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetAnimationContext.userFunc0x902948(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetAnimation = function(AnimationIndex, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "AnimationIndex") return AnimationIndex; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetAnimationContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetAnimationContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetAnimationContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.LookAtCameraContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.LookAtCameraContext.GDObjectObjects1= []; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.LookAtCameraContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.LookAtCameraContext.userFunc0x902948 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +const behaviorName = eventsFunctionContext.getBehaviorName("Behavior"); +const PhysicsEngine3D = objects[0].getBehavior(behaviorName); + +if(!PhysicsEngine3D.model) return; + +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Camera = gdjs.__WithThreeJS.get("Camera"); +const Renderer = gdjs.__WithThreeJS.get("Renderer"); +const World = gdjs.__Physics3DExtension.get("World"); + +const model = PhysicsEngine3D.model; + +// look at the camera +const target = new THREE.Vector3(); +Camera.getWorldPosition(target); +target.y = 0; +model.lookAt(target); +model.rotateY(Math.PI); +}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.LookAtCameraContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.LookAtCameraContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.LookAtCameraContext.GDObjectObjects1); +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.LookAtCameraContext.userFunc0x902948(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.LookAtCamera = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.LookAtCameraContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.LookAtCameraContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.LookAtCameraContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.RotatePositionContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.RotatePositionContext.GDObjectObjects1= []; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.RotatePositionContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.RotatePositionContext.userFunc0x902948 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +const behaviorName = eventsFunctionContext.getBehaviorName("Behavior"); +const PhysicsEngine3D = objects[0].getBehavior(behaviorName); + +if(!PhysicsEngine3D.model) return; + +const model = PhysicsEngine3D.model; + +const Axis = eventsFunctionContext.getArgument("Axis"); +const Degree = eventsFunctionContext.getArgument("Degree"); + +// Change the rotation of the cube using a quaternion with degrees +const quaternion = new THREE.Quaternion(); + +let direction; + +switch(Axis) { + case "y": direction = new THREE.Vector3(1, 0, 0); break; + case "x": direction = new THREE.Vector3(0, 1, 0); break; + case "z": direction = new THREE.Vector3(0, 0, 1); break; +} + +const angleRadians = THREE.MathUtils.degToRad(Degree); + +quaternion.setFromAxisAngle(direction, angleRadians); +model.quaternion.copy(quaternion); +}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.RotatePositionContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.RotatePositionContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.RotatePositionContext.GDObjectObjects1); +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.RotatePositionContext.userFunc0x902948(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.RotatePosition = function(Axis, Degree, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Axis") return Axis; +if (argName === "Degree") return Degree; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.RotatePositionContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.RotatePositionContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.RotatePositionContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetPositionContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetPositionContext.GDObjectObjects1= []; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetPositionContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetPositionContext.userFunc0x902948 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +const behaviorName = eventsFunctionContext.getBehaviorName("Behavior"); +const PhysicsEngine3D = objects[0].getBehavior(behaviorName); + +if(!PhysicsEngine3D.body) return; + +const body = PhysicsEngine3D.body; +const Value = eventsFunctionContext.getArgument("Value"); +const Axis = eventsFunctionContext.getArgument("Axis"); + +body.position[Axis] = Value*0.01; +}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetPositionContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetPositionContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetPositionContext.GDObjectObjects1); +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetPositionContext.userFunc0x902948(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetPosition = function(Value, Axis, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; +if (argName === "Axis") return Axis; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetPositionContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetPositionContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetPositionContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetVIsibilityContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetVIsibilityContext.GDObjectObjects1= []; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetVIsibilityContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetVIsibilityContext.userFunc0x902948 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +const behaviorName = eventsFunctionContext.getBehaviorName("Behavior"); +const PhysicsEngine3D = objects[0].getBehavior(behaviorName); + +if(!PhysicsEngine3D.model) return; + +const model = PhysicsEngine3D.model; +const Value = eventsFunctionContext.getArgument("Value"); + +model.visible = Value; +}; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetVIsibilityContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetVIsibilityContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetVIsibilityContext.GDObjectObjects1); +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetVIsibilityContext.userFunc0x902948(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetVIsibility = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetVIsibilityContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetVIsibilityContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.SetVIsibilityContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel.prototype.doStepPreEvents = function() { + this._onceTriggers.startNewFrame(); +}; + + +gdjs.registerBehavior("Physics3dExtension::PhysicsEngine3DGLTFModel", gdjs.evtsExt__Physics3dExtension__PhysicsEngine3DGLTFModel.PhysicsEngine3DGLTFModel); diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__physicsengineplayercontroller.js b/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__physicsengineplayercontroller.js new file mode 100644 index 0000000..50ca83f --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__physics3dextension__physicsengineplayercontroller.js @@ -0,0 +1,1313 @@ + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController = gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController || {}; + +/** + * Behavior generated from Physics Engine 3D Player Controller + */ +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController = class PhysicsEnginePlayerController extends gdjs.RuntimeBehavior { + constructor(instanceContainer, behaviorData, owner) { + super(instanceContainer, behaviorData, owner); + this._runtimeScene = instanceContainer; + + this._onceTriggers = new gdjs.OnceTriggers(); + this._behaviorData = {}; + this._sharedData = gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.getSharedData( + instanceContainer, + behaviorData.name + ); + + this._behaviorData.Shape = behaviorData.Shape !== undefined ? behaviorData.Shape : "Box"; + this._behaviorData.MakeStatic = behaviorData.MakeStatic !== undefined ? behaviorData.MakeStatic : false; + this._behaviorData.Mass = behaviorData.Mass !== undefined ? behaviorData.Mass : Number("1") || 0; + this._behaviorData.MovementSpeed = behaviorData.MovementSpeed !== undefined ? behaviorData.MovementSpeed : Number("20") || 0; + this._behaviorData.CanJump = true; + } + + // Hot-reload: + updateFromBehaviorData(oldBehaviorData, newBehaviorData) { + + if (oldBehaviorData.Shape !== newBehaviorData.Shape) + this._behaviorData.Shape = newBehaviorData.Shape; + if (oldBehaviorData.MakeStatic !== newBehaviorData.MakeStatic) + this._behaviorData.MakeStatic = newBehaviorData.MakeStatic; + if (oldBehaviorData.Mass !== newBehaviorData.Mass) + this._behaviorData.Mass = newBehaviorData.Mass; + if (oldBehaviorData.MovementSpeed !== newBehaviorData.MovementSpeed) + this._behaviorData.MovementSpeed = newBehaviorData.MovementSpeed; + if (oldBehaviorData.CanJump !== newBehaviorData.CanJump) + this._behaviorData.CanJump = newBehaviorData.CanJump; + + return true; + } + + // Properties: + + _getShape() { + return this._behaviorData.Shape !== undefined ? this._behaviorData.Shape : "Box"; + } + _setShape(newValue) { + this._behaviorData.Shape = newValue; + } + _getMakeStatic() { + return this._behaviorData.MakeStatic !== undefined ? this._behaviorData.MakeStatic : false; + } + _setMakeStatic(newValue) { + this._behaviorData.MakeStatic = newValue; + } + _toggleMakeStatic() { + this._setMakeStatic(!this._getMakeStatic()); + } + _getMass() { + return this._behaviorData.Mass !== undefined ? this._behaviorData.Mass : Number("1") || 0; + } + _setMass(newValue) { + this._behaviorData.Mass = newValue; + } + _getMovementSpeed() { + return this._behaviorData.MovementSpeed !== undefined ? this._behaviorData.MovementSpeed : Number("20") || 0; + } + _setMovementSpeed(newValue) { + this._behaviorData.MovementSpeed = newValue; + } + _getCanJump() { + return this._behaviorData.CanJump !== undefined ? this._behaviorData.CanJump : true; + } + _setCanJump(newValue) { + this._behaviorData.CanJump = newValue; + } + _toggleCanJump() { + this._setCanJump(!this._getCanJump()); + } +} + +/** + * Shared data generated from Physics Engine 3D Player Controller + */ +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.SharedData = class PhysicsEnginePlayerControllerSharedData { + constructor(sharedData) { + + this.Gravity = sharedData.Gravity !== undefined ? sharedData.Gravity : Number("9.82") || 0; + } + + // Shared properties: + + _getGravity() { + return this.Gravity !== undefined ? this.Gravity : Number("9.82") || 0; + } + _setGravity(newValue) { + this.Gravity = newValue; + } +} + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.getSharedData = function(instanceContainer, behaviorName) { + if (!instanceContainer._Physics3dExtension_PhysicsEnginePlayerControllerSharedData) { + const initialData = instanceContainer.getInitialSharedDataForBehavior( + behaviorName + ); + instanceContainer._Physics3dExtension_PhysicsEnginePlayerControllerSharedData = new gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.SharedData( + initialData + ); + } + return instanceContainer._Physics3dExtension_PhysicsEnginePlayerControllerSharedData; +} + +// Methods: +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.onCreatedContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.onCreatedContext.GDObjectObjects1= []; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.onCreatedContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.onCreatedContext.userFunc0x91f2e0 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +const behaviorName = eventsFunctionContext.getBehaviorName("Behavior"); + +objects[0].getVariables().get("Physics3dBehavior").setString(behaviorName); +}; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.onCreatedContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.onCreatedContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.onCreatedContext.GDObjectObjects1); +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.onCreatedContext.userFunc0x91f2e0(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.onCreated = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.onCreatedContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.onCreatedContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.onCreatedContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.doStepPostEventsContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.doStepPostEventsContext.GDObjectObjects1= []; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.doStepPostEventsContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.doStepPostEventsContext.userFunc0x91f4d0 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; + +const PhysicsEngine3D = objects[0].getBehavior("PhysicsEnginePlayerController"); + +if(!PhysicsEngine3D.body) return; + +const ProjectionScale = 0.01; + +const cubeMesh = PhysicsEngine3D.mesh; +const player = PhysicsEngine3D.body; +const controller = PhysicsEngine3D.controller; +const delta = runtimeScene.getVariables().get("__PhysicsEngine3D").getChild("TimeDelta").getAsNumber(); + +if(!cubeMesh) return; + +controller.update(delta); +cubeMesh.position.copy(player.position); + +objects[0].setX(player.position.x/ProjectionScale); +objects[0].setZOrder(player.position.y/ProjectionScale); +objects[0].setY(player.position.z/ProjectionScale); + +// // decelrate +// player.velocity.x *= 0.9; +// player.velocity.z *= 0.9; +}; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.doStepPostEventsContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.doStepPostEventsContext.GDObjectObjects1); +{gdjs.evtsExt__Physics3dExtension__CreateWorld.func(runtimeScene, (( gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.doStepPostEventsContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.doStepPostEventsContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._sharedData._getGravity()), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.doStepPostEventsContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.doStepPostEventsContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.doStepPostEventsContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).CreateShape((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.doStepPostEventsContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.doStepPostEventsContext.GDObjectObjects1); +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.doStepPostEventsContext.userFunc0x91f4d0(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.doStepPostEvents = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.doStepPostEventsContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.doStepPostEventsContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.doStepPostEventsContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.CreateShapeContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.CreateShapeContext.GDObjectObjects1= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.CreateShapeContext.userFunc0x9227f8 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +if (!gdjs.__Physics3DExtension.has("World")) { + console.warn("!"); + return; +} + +const world = gdjs.__Physics3DExtension.get("World"); +const Camera = gdjs.__WithThreeJS.get("Camera"); +const scene = gdjs.__WithThreeJS.get("Scene"); +const PhysicsEngine3D = objects[0].getBehavior("PhysicsEnginePlayerController"); + +if(PhysicsEngine3D.controller) return; + +// Get object properties +const X = objects[0].getCenterXInScene(); +const Y = objects[0].getCenterYInScene(); +const Z = objects[0].zOrder; +const Width = objects[0].getWidth(); +const Height = objects[0].getHeight(); +const Depth = 64; +const ProjectionScale = 0.01; + + +const normalMaterial = new THREE.MeshNormalMaterial() +// const cubeGeometry = new THREE.BoxGeometry(Width * ProjectionScale, Depth * ProjectionScale, Height * ProjectionScale) +const cubeGeometry = new THREE.SphereGeometry() +const cubeMesh = new THREE.Mesh(cubeGeometry, normalMaterial) +cubeMesh.opacity = 0; + +// Create the player object +const cubeShape = new CANNON.Sphere(1.3); + //new CANNON.Box(new CANNON.Vec3(Width * ProjectionScale/2, Depth * ProjectionScale/2, Height * ProjectionScale/2)); +var player = new CANNON.Body({ mass: PhysicsEngine3D.Mass() }); +player.addShape(cubeShape) +player.position.x = X*ProjectionScale +player.position.y = Z*ProjectionScale +player.position.z = Y*ProjectionScale +world.addBody(player); +player.linearDamping = 0.9; // slow down + +cubeMesh.position.copy(player.position) +scene.add(cubeMesh); + + +const keyboard = {}; + +document.addEventListener("keydown", event => { + keyboard[event.code] = true; +}); + +document.addEventListener("keyup", event => { + keyboard[event.code] = false; +}); + +keyboard.pressed = function(key) { + if(key=="space") + return this["Space"]; + return this["Key" + key.toUpperCase()]; +} + +class PlayerController { + constructor(body, camera) { + this.body = body; + this.camera = camera; + this.movementSpeed = PhysicsEngine3D.MovementSpeed(); + this.jumpForce = new CANNON.Vec3(0, 5, 0); + this.canJump = true; + } + + update(delta) { + // Handle movement input + let inputX = 0, inputZ = 0; + if (keyboard.pressed("w")) inputZ = -1; + if (keyboard.pressed("s")) inputZ = 1; + if (keyboard.pressed("a")) inputX = -1; + if (keyboard.pressed("d")) inputX = 1; + + // Calculate the movement vector + var direction = new THREE.Vector3( inputX * this.movementSpeed * delta, 0, inputZ * this.movementSpeed * delta ); + direction.applyQuaternion( this.camera.quaternion ); + direction.y = 0; + + // Apply the movement vector to the body + this.body.velocity.vadd(direction, this.body.velocity); + } +} + +var controller = new PlayerController(player, Camera); + +var contactNormal = new CANNON.Vec3(); // Normal in the contact, pointing *out* of whatever the player touched +var upAxis = new CANNON.Vec3(0,1,0); + +player.addEventListener("collide",function(e){ + var contact = e.contact; + + // contact.bi and contact.bj are the colliding bodies, and contact.ni is the collision normal. + // We do not yet know which one is which! Let's check. + if(contact.bi.id == player.id) // bi is the player body, flip the contact normal + contact.ni.negate(contactNormal); + else + contactNormal.copy(contact.ni); // bi is something else. Keep the normal as it is + + // If contactNormal.dot(upAxis) is between 0 and 1, we know that the contact normal is somewhat in the up direction. + if(contactNormal.dot(upAxis) > 0.5) // Use a "good" threshold value between 0 and 1 here! + controller.canJump = true; +}); + +PhysicsEngine3D.shape = cubeShape; +PhysicsEngine3D.mesh = cubeMesh; +PhysicsEngine3D.body = player; +PhysicsEngine3D.controller = controller; +}; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.CreateShapeContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.CreateShapeContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.CreateShapeContext.GDObjectObjects1); +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.CreateShapeContext.userFunc0x9227f8(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.CreateShape = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.CreateShapeContext.GDObjectObjects1.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.CreateShapeContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.MassContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.MassContext.GDObjectObjects1= []; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.MassContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.MassContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.MassContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.MassContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.MassContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getMass()); }}} + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.Mass = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.MassContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.MassContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.MassContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.onDestroyContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.onDestroyContext.GDObjectObjects1= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.onDestroyContext.userFunc0x9227f8 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +if (!gdjs.__Physics3DExtension.has("World")) { + console.warn("!"); + return; +} + +const world = gdjs.__Physics3DExtension.get("World"); + +const PhysicsEngine3D = objects[0].getBehavior("PhysicsEnginePlayerController"); + +if(!PhysicsEngine3D.body) return; + +world.remove(PhysicsEngine3D.body); + +const scene = gdjs.__WithThreeJS.get("Scene"); + +// Remove the mesh from the scene +scene.remove(PhysicsEngine3D.mesh); +}; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.onDestroyContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.onDestroyContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.onDestroyContext.GDObjectObjects1); +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.onDestroyContext.userFunc0x9227f8(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.onDestroy = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.onDestroyContext.GDObjectObjects1.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.onDestroyContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.MovementSpeedContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.MovementSpeedContext.GDObjectObjects1= []; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.MovementSpeedContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.MovementSpeedContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.MovementSpeedContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.MovementSpeedContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.MovementSpeedContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getMovementSpeed()); }}} + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.MovementSpeed = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.MovementSpeedContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.MovementSpeedContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.MovementSpeedContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.SetMovementSpeedContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.SetMovementSpeedContext.GDObjectObjects1= []; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.SetMovementSpeedContext.GDObjectObjects2= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.SetMovementSpeedContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.SetMovementSpeedContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.SetMovementSpeedContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.SetMovementSpeedContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setMovementSpeed((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0)); +} +}} + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.SetMovementSpeed = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.SetMovementSpeedContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.SetMovementSpeedContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.SetMovementSpeedContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.ApplyImpulseContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.ApplyImpulseContext.GDObjectObjects1= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.ApplyImpulseContext.userFunc0x9248b8 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +const PhysicsEngine3D = objects[0].getBehavior("PhysicsEnginePlayerController"); + +if(!PhysicsEngine3D.body) return; + +const force = eventsFunctionContext.getArgument("Force"); +const body = PhysicsEngine3D.body; +const jumpForce = new CANNON.Vec3(0, force, 0); + +body.applyImpulse(jumpForce, body.position); +}; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.ApplyImpulseContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.ApplyImpulseContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.ApplyImpulseContext.GDObjectObjects1); +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.ApplyImpulseContext.userFunc0x9248b8(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.ApplyImpulse = function(Force, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Force") return Force; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.ApplyImpulseContext.GDObjectObjects1.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.ApplyImpulseContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.ApplyForceContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.ApplyForceContext.GDObjectObjects1= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.ApplyForceContext.userFunc0x924918 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +const PhysicsEngine3D = objects[0].getBehavior("PhysicsEnginePlayerController"); + +if(!PhysicsEngine3D.body) return; + +const Camera = gdjs.__WithThreeJS.get("Camera"); +const Controller = PhysicsEngine3D.controller; +const Body = Controller.body; +const ForceX = eventsFunctionContext.getArgument("ForceX")*PhysicsEngine3D.MovementSpeed()/10; +const ForceY = eventsFunctionContext.getArgument("ForceY")*PhysicsEngine3D.MovementSpeed()/10; + +// Calculate the movement vector +var direction = new THREE.Vector3( ForceX, 0, ForceY ); +direction.applyQuaternion( Camera.quaternion ); +direction.y = 0; + +// Apply the movement vector to the body +Body.velocity.vadd(direction, Body.velocity); +}; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.ApplyForceContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.ApplyForceContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.ApplyForceContext.GDObjectObjects1); +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.ApplyForceContext.userFunc0x924918(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.ApplyForce = function(ForceX, ForceY, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ForceX") return ForceX; +if (argName === "ForceY") return ForceY; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.ApplyForceContext.GDObjectObjects1.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.ApplyForceContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.CanJumpContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.CanJumpContext.GDObjectObjects1= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.CanJumpContext.userFunc0x924880 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +const PhysicsEngine3D = objects[0].getBehavior("PhysicsEnginePlayerController"); + +if(!PhysicsEngine3D.controller) return; + +eventsFunctionContext.returnValue = PhysicsEngine3D.controller.canJump; +}; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.CanJumpContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.CanJumpContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.CanJumpContext.GDObjectObjects1); +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.CanJumpContext.userFunc0x924880(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.CanJump = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.CanJumpContext.GDObjectObjects1.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.CanJumpContext.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.SetCanJumpContext = {}; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.SetCanJumpContext.GDObjectObjects1= []; + + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.SetCanJumpContext.userFunc0x9248b8 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +const PhysicsEngine3D = objects[0].getBehavior("PhysicsEnginePlayerController"); + +if(!PhysicsEngine3D.controller) return; + +PhysicsEngine3D.controller.canJump = eventsFunctionContext.getArgument("Value"); +}; +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.SetCanJumpContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.SetCanJumpContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.SetCanJumpContext.GDObjectObjects1); +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.SetCanJumpContext.userFunc0x9248b8(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.SetCanJump = function(Value, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.SetCanJumpContext.GDObjectObjects1.length = 0; + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.SetCanJumpContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController.prototype.doStepPreEvents = function() { + this._onceTriggers.startNewFrame(); +}; + + +gdjs.registerBehavior("Physics3dExtension::PhysicsEnginePlayerController", gdjs.evtsExt__Physics3dExtension__PhysicsEnginePlayerController.PhysicsEnginePlayerController); diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__repeateveryxseconds__repeat-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__repeateveryxseconds__repeat-func.js new file mode 100644 index 0000000..3583409 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__repeateveryxseconds__repeat-func.js @@ -0,0 +1,100 @@ + +if (typeof gdjs.evtsExt__RepeatEveryXSeconds__Repeat !== "undefined") { + gdjs.evtsExt__RepeatEveryXSeconds__Repeat.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__RepeatEveryXSeconds__Repeat = {}; + + +gdjs.evtsExt__RepeatEveryXSeconds__Repeat.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = eventsFunctionContext.getOnceTriggers().triggerOnce(23404444); +} +if (isConditionTrue_0) { +{gdjs.evtTools.runtimeScene.resetTimer(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("timerName") : "")); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.runtimeScene.timerElapsedTime(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("time")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("timerName") : "")); +if (isConditionTrue_0) { +{gdjs.evtTools.runtimeScene.resetTimer(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("timerName") : "")); +}{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +}; + +gdjs.evtsExt__RepeatEveryXSeconds__Repeat.func = function(runtimeScene, timerName, time, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "timerName") return timerName; +if (argName === "time") return time; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__RepeatEveryXSeconds__Repeat.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__RepeatEveryXSeconds__Repeat.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__repeateveryxseconds__repeatxtimes-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__repeateveryxseconds__repeatxtimes-func.js new file mode 100644 index 0000000..66da12b --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__repeateveryxseconds__repeatxtimes-func.js @@ -0,0 +1,124 @@ + +if (typeof gdjs.evtsExt__RepeatEveryXSeconds__RepeatXTimes !== "undefined") { + gdjs.evtsExt__RepeatEveryXSeconds__RepeatXTimes.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__RepeatEveryXSeconds__RepeatXTimes = {}; + + +gdjs.evtsExt__RepeatEveryXSeconds__RepeatXTimes.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = eventsFunctionContext.getOnceTriggers().triggerOnce(23407556); +} +if (isConditionTrue_0) { +{gdjs.evtTools.runtimeScene.resetTimer(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("timerName") : "")); +}{runtimeScene.getScene().getVariables().get("__RepeatEveryXSeconds_").getChild("Counter").getChild((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("timerName") : "")).setNumber(0); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.runtimeScene.timerElapsedTime(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("time")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("timerName") : "")); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +{let isConditionTrue_1 = false; +isConditionTrue_0 = false; +{ +{isConditionTrue_1 = ((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("limit")) || 0 : 0) == -(1)); +} +if(isConditionTrue_1) { + isConditionTrue_0 = true; +} +} +{ +isConditionTrue_1 = gdjs.evtTools.variable.getVariableNumber(runtimeScene.getScene().getVariables().get("__RepeatEveryXSeconds_").getChild("Counter").getChild((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("timerName") : ""))) < (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("limit")) || 0 : 0); +if(isConditionTrue_1) { + isConditionTrue_0 = true; +} +} +{ +} +} +} +if (isConditionTrue_0) { +{gdjs.evtTools.runtimeScene.resetTimer(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("timerName") : "")); +}{runtimeScene.getScene().getVariables().get("__RepeatEveryXSeconds_").getChild("Counter").getChild((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("timerName") : "")).add(1); +}{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +}; + +gdjs.evtsExt__RepeatEveryXSeconds__RepeatXTimes.func = function(runtimeScene, timerName, time, limit, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "timerName") return timerName; +if (argName === "time") return time; +if (argName === "limit") return limit; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__RepeatEveryXSeconds__RepeatXTimes.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__RepeatEveryXSeconds__RepeatXTimes.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__shakeobject__shakeobject_positionangle.js b/desktop/apps/dezunkrr/gdjs-evtsext__shakeobject__shakeobject_positionangle.js new file mode 100644 index 0000000..0b0a3bc --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__shakeobject__shakeobject_positionangle.js @@ -0,0 +1,1953 @@ + +gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle = gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle || {}; + +/** + * Behavior generated from Shake object (position, angle) + */ +gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle = class ShakeObject_PositionAngle extends gdjs.RuntimeBehavior { + constructor(instanceContainer, behaviorData, owner) { + super(instanceContainer, behaviorData, owner); + this._runtimeScene = instanceContainer; + + this._onceTriggers = new gdjs.OnceTriggers(); + this._behaviorData = {}; + this._sharedData = gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.getSharedData( + instanceContainer, + behaviorData.name + ); + + } + + // Hot-reload: + updateFromBehaviorData(oldBehaviorData, newBehaviorData) { + + + return true; + } + + // Properties: + +} + +/** + * Shared data generated from Shake object (position, angle) + */ +gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.SharedData = class ShakeObject_PositionAngleSharedData { + constructor(sharedData) { + + } + + // Shared properties: + +} + +gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.getSharedData = function(instanceContainer, behaviorName) { + if (!instanceContainer._ShakeObject_ShakeObject_PositionAngleSharedData) { + const initialData = instanceContainer.getInitialSharedDataForBehavior( + behaviorName + ); + instanceContainer._ShakeObject_ShakeObject_PositionAngleSharedData = new gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.SharedData( + initialData + ); + } + return instanceContainer._ShakeObject_ShakeObject_PositionAngleSharedData; +} + +// Methods: +gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext = {}; +gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects1= []; +gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2= []; +gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects3= []; + + +gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + + +} + + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2); +{for(var i = 0, len = gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2[i].resetTimer("__ShakeObject_DurationTimer"); +} +}} + +} + + +{ + + + +} + + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2); +{for(var i = 0, len = gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2[i].returnVariable(gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2[i].getVariables().get("__ShakeObject_Duration")).setNumber((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Duration")) || 0 : 0)); +} +}{for(var i = 0, len = gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2[i].returnVariable(gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2[i].getVariables().get("__ShakeObject_PowerX")).setNumber((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("PowerX")) || 0 : 0)); +} +}{for(var i = 0, len = gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2[i].returnVariable(gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2[i].getVariables().get("__ShakeObject_PowerY")).setNumber((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("PowerY")) || 0 : 0)); +} +}{for(var i = 0, len = gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2[i].returnVariable(gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2[i].getVariables().get("__ShakeObject_PowerAngle")).setNumber((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("PowerAngle")) || 0 : 0)); +} +}{for(var i = 0, len = gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2[i].returnVariable(gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2[i].getVariables().get("__ShakeObject_TimeBetweenShakes")).setNumber((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("TimeBetweenShakes")) || 0 : 0)); +} +}} + +} + + +{ + + + +} + + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2); +{for(var i = 0, len = gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2[i].setVariableBoolean(gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2[i].getVariables().get("__ShakeObject_ShakeForever"), false); +} +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("ShakeForever") : false); +} +if (isConditionTrue_0) { +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2); +{for(var i = 0, len = gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2[i].setVariableBoolean(gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2[i].getVariables().get("__ShakeObject_ShakeForever"), true); +} +}} + +} + + +{ + + + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__ShakeObject__ShakeObject_PositionAngle.ShakeObject_PositionAngle.prototype.ShakeObject_PositionAngleContext.GDObjectObjects2.length;i + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SpriteMultitouchJoystick__AngleTo4Way = {}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__AngleTo4Way.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtTools.common.mod(Math.round((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Angle")) || 0 : 0) * 4 / 360), 4); }}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__AngleTo4Way.func = function(runtimeScene, Angle, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Angle") return Angle; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__AngleTo4Way.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__SpriteMultitouchJoystick__AngleTo4Way.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__angleto8way-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__angleto8way-func.js new file mode 100644 index 0000000..d247402 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__angleto8way-func.js @@ -0,0 +1,82 @@ + +if (typeof gdjs.evtsExt__SpriteMultitouchJoystick__AngleTo8Way !== "undefined") { + gdjs.evtsExt__SpriteMultitouchJoystick__AngleTo8Way.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SpriteMultitouchJoystick__AngleTo8Way = {}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__AngleTo8Way.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtTools.common.mod(Math.round((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Angle")) || 0 : 0) * 8 / 360), 8); }}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__AngleTo8Way.func = function(runtimeScene, Angle, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Angle") return Angle; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__AngleTo8Way.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__SpriteMultitouchJoystick__AngleTo8Way.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__deadzone-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__deadzone-func.js new file mode 100644 index 0000000..d27db65 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__deadzone-func.js @@ -0,0 +1,83 @@ + +if (typeof gdjs.evtsExt__SpriteMultitouchJoystick__DeadZone !== "undefined") { + gdjs.evtsExt__SpriteMultitouchJoystick__DeadZone.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SpriteMultitouchJoystick__DeadZone = {}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__DeadZone.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtTools.variable.getVariableNumber(runtimeScene.getScene().getVariables().get("__MultitouchJoystick").getChild("Controllers").getChild((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("ControllerIdentifier")) || 0 : 0)).getChild("Joystick").getChild((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("JoystickIdentifier") : "")).getChild("DeadZone")); }}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__DeadZone.func = function(runtimeScene, ControllerIdentifier, JoystickIdentifier, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ControllerIdentifier") return ControllerIdentifier; +if (argName === "JoystickIdentifier") return JoystickIdentifier; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__DeadZone.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__SpriteMultitouchJoystick__DeadZone.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__isanglein4waydirection-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__isanglein4waydirection-func.js new file mode 100644 index 0000000..7974a80 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__isanglein4waydirection-func.js @@ -0,0 +1,141 @@ + +if (typeof gdjs.evtsExt__SpriteMultitouchJoystick__IsAngleIn4WayDirection !== "undefined") { + gdjs.evtsExt__SpriteMultitouchJoystick__IsAngleIn4WayDirection.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SpriteMultitouchJoystick__IsAngleIn4WayDirection = {}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__IsAngleIn4WayDirection.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : "") == "Right"); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__SpriteMultitouchJoystick__AngleTo4Way.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Angle")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) == 0; +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : "") == "Down"); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__SpriteMultitouchJoystick__AngleTo4Way.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Angle")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) == 1; +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : "") == "Left"); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__SpriteMultitouchJoystick__AngleTo4Way.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Angle")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) == 2; +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : "") == "Up"); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__SpriteMultitouchJoystick__AngleTo4Way.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Angle")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) == 3; +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__IsAngleIn4WayDirection.func = function(runtimeScene, Angle, Direction, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Angle") return Angle; +if (argName === "Direction") return Direction; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__IsAngleIn4WayDirection.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__SpriteMultitouchJoystick__IsAngleIn4WayDirection.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__isanglein8waydirection-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__isanglein8waydirection-func.js new file mode 100644 index 0000000..19f3847 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__isanglein8waydirection-func.js @@ -0,0 +1,209 @@ + +if (typeof gdjs.evtsExt__SpriteMultitouchJoystick__IsAngleIn8WayDirection !== "undefined") { + gdjs.evtsExt__SpriteMultitouchJoystick__IsAngleIn8WayDirection.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SpriteMultitouchJoystick__IsAngleIn8WayDirection = {}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__IsAngleIn8WayDirection.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : "") == "Right"); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__SpriteMultitouchJoystick__AngleTo8Way.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Angle")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) == 0; +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : "") == "DownRight"); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__SpriteMultitouchJoystick__AngleTo8Way.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Angle")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) == 1; +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : "") == "Down"); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__SpriteMultitouchJoystick__AngleTo8Way.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Angle")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) == 2; +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : "") == "DownLeft"); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__SpriteMultitouchJoystick__AngleTo8Way.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Angle")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) == 3; +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : "") == "Left"); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__SpriteMultitouchJoystick__AngleTo8Way.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Angle")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) == 4; +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : "") == "UpLeft"); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__SpriteMultitouchJoystick__AngleTo8Way.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Angle")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) == 5; +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : "") == "Up"); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__SpriteMultitouchJoystick__AngleTo8Way.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Angle")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) == 6; +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : "") == "UpRight"); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__SpriteMultitouchJoystick__AngleTo8Way.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Angle")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) == 7; +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__IsAngleIn8WayDirection.func = function(runtimeScene, Angle, Direction, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Angle") return Angle; +if (argName === "Direction") return Direction; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__IsAngleIn8WayDirection.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__SpriteMultitouchJoystick__IsAngleIn8WayDirection.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__isbuttonpressed-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__isbuttonpressed-func.js new file mode 100644 index 0000000..15278ca --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__isbuttonpressed-func.js @@ -0,0 +1,85 @@ + +if (typeof gdjs.evtsExt__SpriteMultitouchJoystick__IsButtonPressed !== "undefined") { + gdjs.evtsExt__SpriteMultitouchJoystick__IsButtonPressed.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SpriteMultitouchJoystick__IsButtonPressed = {}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__IsButtonPressed.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.getVariableString(runtimeScene.getScene().getVariables().get("__MultitouchJoystick").getChild("Controllers").getChild((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("ControllerIdentifier")) || 0 : 0)).getChild("Buttons").getChild((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Button") : "")).getChild("State")) == "Pressed"; +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__IsButtonPressed.func = function(runtimeScene, ControllerIdentifier, Button, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ControllerIdentifier") return ControllerIdentifier; +if (argName === "Button") return Button; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__IsButtonPressed.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__SpriteMultitouchJoystick__IsButtonPressed.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__isbuttonreleased-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__isbuttonreleased-func.js new file mode 100644 index 0000000..a3bc83d --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__isbuttonreleased-func.js @@ -0,0 +1,85 @@ + +if (typeof gdjs.evtsExt__SpriteMultitouchJoystick__IsButtonReleased !== "undefined") { + gdjs.evtsExt__SpriteMultitouchJoystick__IsButtonReleased.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SpriteMultitouchJoystick__IsButtonReleased = {}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__IsButtonReleased.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.getVariableString(runtimeScene.getScene().getVariables().get("__MultitouchJoystick").getChild("Controllers").getChild((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("ControllerIdentifier")) || 0 : 0)).getChild("Buttons").getChild((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Button") : "")).getChild("State")) == "Released"; +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__IsButtonReleased.func = function(runtimeScene, ControllerIdentifier, Button, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ControllerIdentifier") return ControllerIdentifier; +if (argName === "Button") return Button; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__IsButtonReleased.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__SpriteMultitouchJoystick__IsButtonReleased.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__isdirectionpushed4way-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__isdirectionpushed4way-func.js new file mode 100644 index 0000000..04adbc9 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__isdirectionpushed4way-func.js @@ -0,0 +1,97 @@ + +if (typeof gdjs.evtsExt__SpriteMultitouchJoystick__IsDirectionPushed4Way !== "undefined") { + gdjs.evtsExt__SpriteMultitouchJoystick__IsDirectionPushed4Way.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SpriteMultitouchJoystick__IsDirectionPushed4Way = {}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__IsDirectionPushed4Way.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__SpriteMultitouchJoystick__JoystickForce.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("ControllerIdentifier")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("JoystickIdentifier") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) > gdjs.evtsExt__SpriteMultitouchJoystick__DeadZone.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("ControllerIdentifier")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("JoystickIdentifier") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__SpriteMultitouchJoystick__IsAngleIn4WayDirection.func(runtimeScene, gdjs.evtsExt__SpriteMultitouchJoystick__JoystickAngle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("ControllerIdentifier")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("JoystickIdentifier") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__IsDirectionPushed4Way.func = function(runtimeScene, ControllerIdentifier, JoystickIdentifier, Direction, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ControllerIdentifier") return ControllerIdentifier; +if (argName === "JoystickIdentifier") return JoystickIdentifier; +if (argName === "Direction") return Direction; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__IsDirectionPushed4Way.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__SpriteMultitouchJoystick__IsDirectionPushed4Way.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__isdirectionpushed8way-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__isdirectionpushed8way-func.js new file mode 100644 index 0000000..01c380a --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__isdirectionpushed8way-func.js @@ -0,0 +1,97 @@ + +if (typeof gdjs.evtsExt__SpriteMultitouchJoystick__IsDirectionPushed8Way !== "undefined") { + gdjs.evtsExt__SpriteMultitouchJoystick__IsDirectionPushed8Way.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SpriteMultitouchJoystick__IsDirectionPushed8Way = {}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__IsDirectionPushed8Way.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__SpriteMultitouchJoystick__JoystickForce.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("ControllerIdentifier")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("JoystickIdentifier") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) > gdjs.evtsExt__SpriteMultitouchJoystick__DeadZone.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("ControllerIdentifier")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("JoystickIdentifier") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__SpriteMultitouchJoystick__IsAngleIn8WayDirection.func(runtimeScene, gdjs.evtsExt__SpriteMultitouchJoystick__JoystickAngle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("ControllerIdentifier")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("JoystickIdentifier") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__IsDirectionPushed8Way.func = function(runtimeScene, ControllerIdentifier, JoystickIdentifier, Direction, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ControllerIdentifier") return ControllerIdentifier; +if (argName === "JoystickIdentifier") return JoystickIdentifier; +if (argName === "Direction") return Direction; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__IsDirectionPushed8Way.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__SpriteMultitouchJoystick__IsDirectionPushed8Way.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__joystickangle-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__joystickangle-func.js new file mode 100644 index 0000000..5c76df1 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__joystickangle-func.js @@ -0,0 +1,83 @@ + +if (typeof gdjs.evtsExt__SpriteMultitouchJoystick__JoystickAngle !== "undefined") { + gdjs.evtsExt__SpriteMultitouchJoystick__JoystickAngle.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SpriteMultitouchJoystick__JoystickAngle = {}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__JoystickAngle.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtsExt__SpriteMultitouchJoystick__JoystickAngle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("ControllerIdentifier")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("JoystickIdentifier") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); }}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__JoystickAngle.func = function(runtimeScene, ControllerIdentifier, JoystickIdentifier, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ControllerIdentifier") return ControllerIdentifier; +if (argName === "JoystickIdentifier") return JoystickIdentifier; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__JoystickAngle.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__SpriteMultitouchJoystick__JoystickAngle.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__joystickforce-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__joystickforce-func.js new file mode 100644 index 0000000..689ddb9 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__joystickforce-func.js @@ -0,0 +1,83 @@ + +if (typeof gdjs.evtsExt__SpriteMultitouchJoystick__JoystickForce !== "undefined") { + gdjs.evtsExt__SpriteMultitouchJoystick__JoystickForce.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SpriteMultitouchJoystick__JoystickForce = {}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__JoystickForce.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtsExt__SpriteMultitouchJoystick__JoystickForce.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("ControllerIdentifier")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("JoystickIdentifier") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); }}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__JoystickForce.func = function(runtimeScene, ControllerIdentifier, JoystickIdentifier, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ControllerIdentifier") return ControllerIdentifier; +if (argName === "JoystickIdentifier") return JoystickIdentifier; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__JoystickForce.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__SpriteMultitouchJoystick__JoystickForce.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__multitouchbutton.js b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__multitouchbutton.js new file mode 100644 index 0000000..a179165 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__multitouchbutton.js @@ -0,0 +1,621 @@ + +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchButton = gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchButton || {}; + +/** + * Behavior generated from Multitouch button + */ +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchButton.MultitouchButton = class MultitouchButton extends gdjs.RuntimeBehavior { + constructor(instanceContainer, behaviorData, owner) { + super(instanceContainer, behaviorData, owner); + this._runtimeScene = instanceContainer; + + this._onceTriggers = new gdjs.OnceTriggers(); + this._behaviorData = {}; + this._sharedData = gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchButton.MultitouchButton.getSharedData( + instanceContainer, + behaviorData.name + ); + + this._behaviorData.ControllerIdentifier = behaviorData.ControllerIdentifier !== undefined ? behaviorData.ControllerIdentifier : Number("1") || 0; + this._behaviorData.ButtonIdentifier = behaviorData.ButtonIdentifier !== undefined ? behaviorData.ButtonIdentifier : "A"; + this._behaviorData.TouchId = Number("0") || 0; + this._behaviorData.TouchIndex = Number("") || 0; + this._behaviorData.IsReleased = false; + } + + // Hot-reload: + updateFromBehaviorData(oldBehaviorData, newBehaviorData) { + + if (oldBehaviorData.ControllerIdentifier !== newBehaviorData.ControllerIdentifier) + this._behaviorData.ControllerIdentifier = newBehaviorData.ControllerIdentifier; + if (oldBehaviorData.ButtonIdentifier !== newBehaviorData.ButtonIdentifier) + this._behaviorData.ButtonIdentifier = newBehaviorData.ButtonIdentifier; + if (oldBehaviorData.TouchId !== newBehaviorData.TouchId) + this._behaviorData.TouchId = newBehaviorData.TouchId; + if (oldBehaviorData.TouchIndex !== newBehaviorData.TouchIndex) + this._behaviorData.TouchIndex = newBehaviorData.TouchIndex; + if (oldBehaviorData.IsReleased !== newBehaviorData.IsReleased) + this._behaviorData.IsReleased = newBehaviorData.IsReleased; + + return true; + } + + // Properties: + + _getControllerIdentifier() { + return this._behaviorData.ControllerIdentifier !== undefined ? this._behaviorData.ControllerIdentifier : Number("1") || 0; + } + _setControllerIdentifier(newValue) { + this._behaviorData.ControllerIdentifier = newValue; + } + _getButtonIdentifier() { + return this._behaviorData.ButtonIdentifier !== undefined ? this._behaviorData.ButtonIdentifier : "A"; + } + _setButtonIdentifier(newValue) { + this._behaviorData.ButtonIdentifier = newValue; + } + _getTouchId() { + return this._behaviorData.TouchId !== undefined ? this._behaviorData.TouchId : Number("0") || 0; + } + _setTouchId(newValue) { + this._behaviorData.TouchId = newValue; + } + _getTouchIndex() { + return this._behaviorData.TouchIndex !== undefined ? this._behaviorData.TouchIndex : Number("") || 0; + } + _setTouchIndex(newValue) { + this._behaviorData.TouchIndex = newValue; + } + _getIsReleased() { + return this._behaviorData.IsReleased !== undefined ? this._behaviorData.IsReleased : false; + } + _setIsReleased(newValue) { + this._behaviorData.IsReleased = newValue; + } + _toggleIsReleased() { + this._setIsReleased(!this._getIsReleased()); + } +} + +/** + * Shared data generated from Multitouch button + */ +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchButton.MultitouchButton.SharedData = class MultitouchButtonSharedData { + constructor(sharedData) { + + } + + // Shared properties: + +} + +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchButton.MultitouchButton.getSharedData = function(instanceContainer, behaviorName) { + if (!instanceContainer._SpriteMultitouchJoystick_MultitouchButtonSharedData) { + const initialData = instanceContainer.getInitialSharedDataForBehavior( + behaviorName + ); + instanceContainer._SpriteMultitouchJoystick_MultitouchButtonSharedData = new gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchButton.MultitouchButton.SharedData( + initialData + ); + } + return instanceContainer._SpriteMultitouchJoystick_MultitouchButtonSharedData; +} + +// Methods: +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchButton.MultitouchButton.prototype.doStepPreEventsContext = {}; +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchButton.MultitouchButton.prototype.doStepPreEventsContext.GDObjectObjects1= []; +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchButton.MultitouchButton.prototype.doStepPreEventsContext.GDObjectObjects2= []; +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchButton.MultitouchButton.prototype.doStepPreEventsContext.GDObjectObjects3= []; +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchButton.MultitouchButton.prototype.doStepPreEventsContext.GDObjectObjects4= []; + + +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchButton.MultitouchButton.prototype.doStepPreEventsContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchButton.MultitouchButton.prototype.doStepPreEventsContext.GDObjectObjects1, gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchButton.MultitouchButton.prototype.doStepPreEventsContext.GDObjectObjects3); + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchButton.MultitouchButton.prototype.doStepPreEventsContext.GDObjectObjects3.length;i (gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed4WayContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getDeadZoneRadius()) ) { + isConditionTrue_0 = true; + gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed4WayContext.GDObjectObjects1[k] = gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed4WayContext.GDObjectObjects1[i]; + ++k; + } +} +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed4WayContext.GDObjectObjects1.length = k; +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__SpriteMultitouchJoystick__IsAngleIn4WayDirection.func(runtimeScene, (( gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed4WayContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed4WayContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).JoystickAngle((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed4Way = function(Direction, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Direction") return Direction; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed4WayContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed4WayContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed4WayContext.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed8WayContext = {}; +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed8WayContext.GDObjectObjects1= []; +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed8WayContext.GDObjectObjects2= []; + + +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed8WayContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed8WayContext.GDObjectObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed8WayContext.GDObjectObjects1.length;i (gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed8WayContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getDeadZoneRadius()) ) { + isConditionTrue_0 = true; + gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed8WayContext.GDObjectObjects1[k] = gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed8WayContext.GDObjectObjects1[i]; + ++k; + } +} +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed8WayContext.GDObjectObjects1.length = k; +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__SpriteMultitouchJoystick__IsAngleIn8WayDirection.func(runtimeScene, (( gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed8WayContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed8WayContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).JoystickAngle((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed8Way = function(Direction, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Direction") return Direction; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed8WayContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed8WayContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsDirectionPushed8WayContext.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsPressedContext = {}; +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsPressedContext.GDObjectObjects1= []; +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsPressedContext.GDObjectObjects2= []; + + +gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsPressedContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsPressedContext.GDObjectObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__SpriteMultitouchJoystick__MultitouchJoystick.MultitouchJoystick.prototype.IsPressedContext.GDObjectObjects1.length;i + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SpriteMultitouchJoystick__SetButtonState = {}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__SetButtonState.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{runtimeScene.getScene().getVariables().get("__MultitouchJoystick").getChild("Controllers").getChild((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("ControllerIdentifier")) || 0 : 0)).getChild("Buttons").getChild((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Button") : "")).getChild("State").setString((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("ButtonState") : "")); +}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__SetButtonState.func = function(runtimeScene, ControllerIdentifier, Button, ButtonState, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ControllerIdentifier") return ControllerIdentifier; +if (argName === "Button") return Button; +if (argName === "ButtonState") return ButtonState; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__SetButtonState.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__SpriteMultitouchJoystick__SetButtonState.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__setdeadzone-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__setdeadzone-func.js new file mode 100644 index 0000000..f992e83 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__setdeadzone-func.js @@ -0,0 +1,85 @@ + +if (typeof gdjs.evtsExt__SpriteMultitouchJoystick__SetDeadZone !== "undefined") { + gdjs.evtsExt__SpriteMultitouchJoystick__SetDeadZone.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SpriteMultitouchJoystick__SetDeadZone = {}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__SetDeadZone.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{runtimeScene.getScene().getVariables().get("__MultitouchJoystick").getChild("Controllers").getChild((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("ControllerIdentifier")) || 0 : 0)).getChild("Joystick").getChild((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("JoystickIdentifier") : "")).getChild("DeadZone").setNumber((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("DeadZoneRadius")) || 0 : 0)); +}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__SetDeadZone.func = function(runtimeScene, ControllerIdentifier, JoystickIdentifier, DeadZoneRadius, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ControllerIdentifier") return ControllerIdentifier; +if (argName === "JoystickIdentifier") return JoystickIdentifier; +if (argName === "DeadZoneRadius") return DeadZoneRadius; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__SetDeadZone.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__SpriteMultitouchJoystick__SetDeadZone.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__setjoystickangle-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__setjoystickangle-func.js new file mode 100644 index 0000000..ff97001 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__setjoystickangle-func.js @@ -0,0 +1,85 @@ + +if (typeof gdjs.evtsExt__SpriteMultitouchJoystick__SetJoystickAngle !== "undefined") { + gdjs.evtsExt__SpriteMultitouchJoystick__SetJoystickAngle.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SpriteMultitouchJoystick__SetJoystickAngle = {}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__SetJoystickAngle.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{runtimeScene.getScene().getVariables().get("__MultitouchJoystick").getChild("Controllers").getChild((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("ControllerIdentifier")) || 0 : 0)).getChild("Joystick").getChild((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("JoystickIdentifier") : "")).getChild("Angle").setNumber((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0)); +}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__SetJoystickAngle.func = function(runtimeScene, ControllerIdentifier, JoystickIdentifier, Value, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ControllerIdentifier") return ControllerIdentifier; +if (argName === "JoystickIdentifier") return JoystickIdentifier; +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__SetJoystickAngle.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__SpriteMultitouchJoystick__SetJoystickAngle.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__setjoystickforce-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__setjoystickforce-func.js new file mode 100644 index 0000000..a825261 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__setjoystickforce-func.js @@ -0,0 +1,85 @@ + +if (typeof gdjs.evtsExt__SpriteMultitouchJoystick__SetJoystickForce !== "undefined") { + gdjs.evtsExt__SpriteMultitouchJoystick__SetJoystickForce.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SpriteMultitouchJoystick__SetJoystickForce = {}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__SetJoystickForce.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{runtimeScene.getScene().getVariables().get("__MultitouchJoystick").getChild("Controllers").getChild((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("ControllerIdentifier")) || 0 : 0)).getChild("Joystick").getChild((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("JoystickIdentifier") : "")).getChild("Force").setNumber((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Value")) || 0 : 0)); +}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__SetJoystickForce.func = function(runtimeScene, ControllerIdentifier, JoystickIdentifier, Value, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ControllerIdentifier") return ControllerIdentifier; +if (argName === "JoystickIdentifier") return JoystickIdentifier; +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__SetJoystickForce.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__SpriteMultitouchJoystick__SetJoystickForce.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__spritemultitouchjoystick.js b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__spritemultitouchjoystick.js new file mode 100644 index 0000000..c016c28 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__spritemultitouchjoystick.js @@ -0,0 +1,2214 @@ + +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick = gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick || {}; + +/** + * Object generated from Multitouch Joystick + */ +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick = class SpriteMultitouchJoystick extends gdjs.CustomRuntimeObject { + constructor(parentInstanceContainer, objectData) { + super(parentInstanceContainer, objectData); + this._parentInstanceContainer = parentInstanceContainer; + + this._onceTriggers = new gdjs.OnceTriggers(); + this._objectData = {}; + + this._objectData.ControllerIdentifier = objectData.content.ControllerIdentifier !== undefined ? objectData.content.ControllerIdentifier : Number("1") || 0; + this._objectData.JoystickIdentifier = objectData.content.JoystickIdentifier !== undefined ? objectData.content.JoystickIdentifier : "Primary"; + this._objectData.DeadZoneRadius = objectData.content.DeadZoneRadius !== undefined ? objectData.content.DeadZoneRadius : Number("0.4") || 0; + this._objectData.ThumbAnchorOrigin = "Center-center"; + this._objectData.ThumbAnchorTarget = Number("Center-center") || 0; + this._objectData.ThumbIsScaledProportionally = true; + this._objectData.ParentOrigin = "Center-center"; + + // It calls the onCreated super implementation at the end. + this.onCreated(); + } + + // Hot-reload: + updateFromObjectData(oldObjectData, newObjectData) { + super.updateFromObjectData(oldObjectData, newObjectData); + if (oldObjectData.content.ControllerIdentifier !== newObjectData.content.ControllerIdentifier) + this._objectData.ControllerIdentifier = newObjectData.content.ControllerIdentifier; + if (oldObjectData.content.JoystickIdentifier !== newObjectData.content.JoystickIdentifier) + this._objectData.JoystickIdentifier = newObjectData.content.JoystickIdentifier; + if (oldObjectData.content.DeadZoneRadius !== newObjectData.content.DeadZoneRadius) + this._objectData.DeadZoneRadius = newObjectData.content.DeadZoneRadius; + if (oldObjectData.content.ThumbAnchorOrigin !== newObjectData.content.ThumbAnchorOrigin) + this._objectData.ThumbAnchorOrigin = newObjectData.content.ThumbAnchorOrigin; + if (oldObjectData.content.ThumbAnchorTarget !== newObjectData.content.ThumbAnchorTarget) + this._objectData.ThumbAnchorTarget = newObjectData.content.ThumbAnchorTarget; + if (oldObjectData.content.ThumbIsScaledProportionally !== newObjectData.content.ThumbIsScaledProportionally) + this._objectData.ThumbIsScaledProportionally = newObjectData.content.ThumbIsScaledProportionally; + if (oldObjectData.content.ParentOrigin !== newObjectData.content.ParentOrigin) + this._objectData.ParentOrigin = newObjectData.content.ParentOrigin; + + this.onHotReloading(this._parentInstanceContainer); + return true; + } + + // Properties: + + _getControllerIdentifier() { + return this._objectData.ControllerIdentifier !== undefined ? this._objectData.ControllerIdentifier : Number("1") || 0; + } + _setControllerIdentifier(newValue) { + this._objectData.ControllerIdentifier = newValue; + } + _getJoystickIdentifier() { + return this._objectData.JoystickIdentifier !== undefined ? this._objectData.JoystickIdentifier : "Primary"; + } + _setJoystickIdentifier(newValue) { + this._objectData.JoystickIdentifier = newValue; + } + _getDeadZoneRadius() { + return this._objectData.DeadZoneRadius !== undefined ? this._objectData.DeadZoneRadius : Number("0.4") || 0; + } + _setDeadZoneRadius(newValue) { + this._objectData.DeadZoneRadius = newValue; + } + _getThumbAnchorOrigin() { + return this._objectData.ThumbAnchorOrigin !== undefined ? this._objectData.ThumbAnchorOrigin : "Center-center"; + } + _setThumbAnchorOrigin(newValue) { + this._objectData.ThumbAnchorOrigin = newValue; + } + _getThumbAnchorTarget() { + return this._objectData.ThumbAnchorTarget !== undefined ? this._objectData.ThumbAnchorTarget : Number("Center-center") || 0; + } + _setThumbAnchorTarget(newValue) { + this._objectData.ThumbAnchorTarget = newValue; + } + _getThumbIsScaledProportionally() { + return this._objectData.ThumbIsScaledProportionally !== undefined ? this._objectData.ThumbIsScaledProportionally : true; + } + _setThumbIsScaledProportionally(newValue) { + this._objectData.ThumbIsScaledProportionally = newValue; + } + _toggleThumbIsScaledProportionally() { + this._setThumbIsScaledProportionally(!this._getThumbIsScaledProportionally()); + } + _getParentOrigin() { + return this._objectData.ParentOrigin !== undefined ? this._objectData.ParentOrigin : "Center-center"; + } + _setParentOrigin(newValue) { + this._objectData.ParentOrigin = newValue; + } +} + +// Methods: +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext = {}; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDObjectObjects1= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDObjectObjects2= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDThumbObjects1= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDThumbObjects2= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDBorderObjects1= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDBorderObjects2= []; + + +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.mapOfGDgdjs_46evtsExt_95_95SpriteMultitouchJoystick_95_95SpriteMultitouchJoystick_46SpriteMultitouchJoystick_46prototype_46onCreatedContext_46GDBorderObjects1Objects = Hashtable.newFrom({"Border": gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDBorderObjects1}); +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.mapOfGDgdjs_46evtsExt_95_95SpriteMultitouchJoystick_95_95SpriteMultitouchJoystick_46SpriteMultitouchJoystick_46prototype_46onCreatedContext_46GDThumbObjects1Objects = Hashtable.newFrom({"Thumb": gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDThumbObjects1}); +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDObjectObjects1); +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDBorderObjects1.length = 0; + +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDThumbObjects1.length = 0; + +{gdjs.evtTools.object.createObjectOnScene((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : runtimeScene), gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.mapOfGDgdjs_46evtsExt_95_95SpriteMultitouchJoystick_95_95SpriteMultitouchJoystick_46SpriteMultitouchJoystick_46prototype_46onCreatedContext_46GDBorderObjects1Objects, 0, 0, ""); +}{gdjs.evtTools.object.createObjectOnScene((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : runtimeScene), gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.mapOfGDgdjs_46evtsExt_95_95SpriteMultitouchJoystick_95_95SpriteMultitouchJoystick_46SpriteMultitouchJoystick_46prototype_46onCreatedContext_46GDThumbObjects1Objects, 0, 0, ""); +}{for(var i = 0, len = gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDBorderObjects1.length ;i < len;++i) { + gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDBorderObjects1[i].setZOrder(1); +} +}{for(var i = 0, len = gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDThumbObjects1.length ;i < len;++i) { + gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDThumbObjects1[i].setZOrder(2); +} +}{for(var i = 0, len = gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDBorderObjects1.length ;i < len;++i) { + gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDBorderObjects1[i].setCenterPositionInScene(0,0); +} +}{for(var i = 0, len = gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDThumbObjects1.length ;i < len;++i) { + gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDThumbObjects1[i].setCenterPositionInScene(0,0); +} +}{for(var i = 0, len = gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDObjectObjects1[i].UpdateConfiguration((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}{for(var i = 0, len = gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDThumbObjects1.length ;i < len;++i) { + gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDThumbObjects1[i].setIncludedInParentCollisionMask(false); +} +}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreated = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._instanceContainer; +var thisObjectList = [this]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var thisGDThumbObjectsList = [...runtimeScene.getObjects("Thumb")]; +var GDThumbObjects = Hashtable.newFrom({"Thumb": thisGDThumbObjectsList}); +var thisGDBorderObjectsList = [...runtimeScene.getObjects("Border")]; +var GDBorderObjects = Hashtable.newFrom({"Border": thisGDBorderObjectsList}); +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +, "Thumb": GDThumbObjects +, "Border": GDBorderObjects +}, + _objectArraysMap: { +"Object": thisObjectList +, "Thumb": thisGDThumbObjectsList +, "Border": thisGDBorderObjectsList +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDObjectObjects2.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDThumbObjects1.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDThumbObjects2.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDBorderObjects1.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.GDBorderObjects2.length = 0; + +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onCreatedContext.eventsList0(runtimeScene, eventsFunctionContext); +gdjs.CustomRuntimeObject.prototype.onCreated.call(this); + +return; +} +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext = {}; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.GDObjectObjects1= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.GDObjectObjects2= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.GDThumbObjects1= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.GDThumbObjects2= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.GDBorderObjects1= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.GDBorderObjects2= []; + + +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Border"), gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.GDBorderObjects1); +gdjs.copyArray(eventsFunctionContext.getObjects("Thumb"), gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.GDThumbObjects1); +{for(var i = 0, len = gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.GDThumbObjects1.length ;i < len;++i) { + gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.GDThumbObjects1[i].putAroundObject((gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.GDBorderObjects1.length !== 0 ? gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.GDBorderObjects1[0] : null), (( gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.GDBorderObjects1.length === 0 ) ? 0 :gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.GDBorderObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("MultitouchJoystick")).JoystickForce((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))) * (( gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.GDBorderObjects1.length === 0 ) ? 0 :gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.GDBorderObjects1[0].getWidth()) / 2, (( gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.GDBorderObjects1.length === 0 ) ? 0 :gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.GDBorderObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("MultitouchJoystick")).JoystickAngle((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)))); +} +}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEvents = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._instanceContainer; +var thisObjectList = [this]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var thisGDThumbObjectsList = [...runtimeScene.getObjects("Thumb")]; +var GDThumbObjects = Hashtable.newFrom({"Thumb": thisGDThumbObjectsList}); +var thisGDBorderObjectsList = [...runtimeScene.getObjects("Border")]; +var GDBorderObjects = Hashtable.newFrom({"Border": thisGDBorderObjectsList}); +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +, "Thumb": GDThumbObjects +, "Border": GDBorderObjects +}, + _objectArraysMap: { +"Object": thisObjectList +, "Thumb": thisGDThumbObjectsList +, "Border": thisGDBorderObjectsList +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.GDObjectObjects2.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.GDThumbObjects1.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.GDThumbObjects2.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.GDBorderObjects1.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.GDBorderObjects2.length = 0; + +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.doStepPostEventsContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onHotReloadingContext = {}; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onHotReloadingContext.GDObjectObjects1= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onHotReloadingContext.GDObjectObjects2= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onHotReloadingContext.GDThumbObjects1= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onHotReloadingContext.GDThumbObjects2= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onHotReloadingContext.GDBorderObjects1= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onHotReloadingContext.GDBorderObjects2= []; + + +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onHotReloadingContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onHotReloadingContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onHotReloadingContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onHotReloadingContext.GDObjectObjects1[i].UpdateConfiguration((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onHotReloading = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._instanceContainer; +var thisObjectList = [this]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var thisGDThumbObjectsList = [...runtimeScene.getObjects("Thumb")]; +var GDThumbObjects = Hashtable.newFrom({"Thumb": thisGDThumbObjectsList}); +var thisGDBorderObjectsList = [...runtimeScene.getObjects("Border")]; +var GDBorderObjects = Hashtable.newFrom({"Border": thisGDBorderObjectsList}); +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +, "Thumb": GDThumbObjects +, "Border": GDBorderObjects +}, + _objectArraysMap: { +"Object": thisObjectList +, "Thumb": thisGDThumbObjectsList +, "Border": thisGDBorderObjectsList +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onHotReloadingContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onHotReloadingContext.GDObjectObjects2.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onHotReloadingContext.GDThumbObjects1.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onHotReloadingContext.GDThumbObjects2.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onHotReloadingContext.GDBorderObjects1.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onHotReloadingContext.GDBorderObjects2.length = 0; + +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.onHotReloadingContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext = {}; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDObjectObjects1= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDObjectObjects2= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDThumbObjects1= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDThumbObjects2= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDBorderObjects1= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDBorderObjects2= []; + + +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Border"), gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDBorderObjects1); +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDBorderObjects1.length ;i < len;++i) { + gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDBorderObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("MultitouchJoystick")).SetControllerIdentifier((( gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDObjectObjects1[0]._getControllerIdentifier()), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}{for(var i = 0, len = gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDBorderObjects1.length ;i < len;++i) { + gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDBorderObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("MultitouchJoystick")).SetJoystickIdentifier((( gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDObjectObjects1.length === 0 ) ? "" :gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDObjectObjects1[0]._getJoystickIdentifier()), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}{for(var i = 0, len = gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDBorderObjects1.length ;i < len;++i) { + gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDBorderObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("MultitouchJoystick")).SetDeadZoneRadius((( gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDObjectObjects1[0]._getDeadZoneRadius()), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfiguration = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._instanceContainer; +var thisObjectList = [this]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var thisGDThumbObjectsList = [...runtimeScene.getObjects("Thumb")]; +var GDThumbObjects = Hashtable.newFrom({"Thumb": thisGDThumbObjectsList}); +var thisGDBorderObjectsList = [...runtimeScene.getObjects("Border")]; +var GDBorderObjects = Hashtable.newFrom({"Border": thisGDBorderObjectsList}); +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +, "Thumb": GDThumbObjects +, "Border": GDBorderObjects +}, + _objectArraysMap: { +"Object": thisObjectList +, "Thumb": thisGDThumbObjectsList +, "Border": thisGDBorderObjectsList +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDObjectObjects2.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDThumbObjects1.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDThumbObjects2.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDBorderObjects1.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.GDBorderObjects2.length = 0; + +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.UpdateConfigurationContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.ActivateControlContext = {}; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.ActivateControlContext.GDObjectObjects1= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.ActivateControlContext.GDObjectObjects2= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.ActivateControlContext.GDThumbObjects1= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.ActivateControlContext.GDThumbObjects2= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.ActivateControlContext.GDBorderObjects1= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.ActivateControlContext.GDBorderObjects2= []; + + +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.ActivateControlContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = !(typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("ShouldActivate") : false); +} +if (isConditionTrue_0) { +gdjs.copyArray(eventsFunctionContext.getObjects("Border"), gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.ActivateControlContext.GDBorderObjects1); +{for(var i = 0, len = gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.ActivateControlContext.GDBorderObjects1.length ;i < len;++i) { + gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.ActivateControlContext.GDBorderObjects1[i].activateBehavior(eventsFunctionContext.getBehaviorName("MultitouchJoystick"), false); +} +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("ShouldActivate") : false); +} +if (isConditionTrue_0) { +gdjs.copyArray(eventsFunctionContext.getObjects("Border"), gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.ActivateControlContext.GDBorderObjects1); +{for(var i = 0, len = gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.ActivateControlContext.GDBorderObjects1.length ;i < len;++i) { + gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.ActivateControlContext.GDBorderObjects1[i].activateBehavior(eventsFunctionContext.getBehaviorName("MultitouchJoystick"), true); +} +}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.ActivateControl = function(ShouldActivate, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._instanceContainer; +var thisObjectList = [this]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var thisGDThumbObjectsList = [...runtimeScene.getObjects("Thumb")]; +var GDThumbObjects = Hashtable.newFrom({"Thumb": thisGDThumbObjectsList}); +var thisGDBorderObjectsList = [...runtimeScene.getObjects("Border")]; +var GDBorderObjects = Hashtable.newFrom({"Border": thisGDBorderObjectsList}); +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +, "Thumb": GDThumbObjects +, "Border": GDBorderObjects +}, + _objectArraysMap: { +"Object": thisObjectList +, "Thumb": thisGDThumbObjectsList +, "Border": thisGDBorderObjectsList +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ShouldActivate") return ShouldActivate; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.ActivateControlContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.ActivateControlContext.GDObjectObjects2.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.ActivateControlContext.GDThumbObjects1.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.ActivateControlContext.GDThumbObjects2.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.ActivateControlContext.GDBorderObjects1.length = 0; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.ActivateControlContext.GDBorderObjects2.length = 0; + +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.ActivateControlContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.IsPressedContext = {}; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.IsPressedContext.GDObjectObjects1= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.IsPressedContext.GDObjectObjects2= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.IsPressedContext.GDThumbObjects1= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.IsPressedContext.GDThumbObjects2= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.IsPressedContext.GDBorderObjects1= []; +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.IsPressedContext.GDBorderObjects2= []; + + +gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.IsPressedContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Border"), gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.IsPressedContext.GDBorderObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__SpriteMultitouchJoystick__SpriteMultitouchJoystick.SpriteMultitouchJoystick.prototype.IsPressedContext.GDBorderObjects1.length;i + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SpriteMultitouchJoystick__StickAngle = {}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__StickAngle.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtTools.variable.getVariableNumber(runtimeScene.getScene().getVariables().get("__MultitouchJoystick").getChild("Controllers").getChild((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("ControllerIdentifier")) || 0 : 0)).getChild("Joystick").getChild((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("JoystickIdentifier") : "")).getChild("Angle")); }}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__StickAngle.func = function(runtimeScene, ControllerIdentifier, JoystickIdentifier, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ControllerIdentifier") return ControllerIdentifier; +if (argName === "JoystickIdentifier") return JoystickIdentifier; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__StickAngle.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__SpriteMultitouchJoystick__StickAngle.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__stickforce-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__stickforce-func.js new file mode 100644 index 0000000..0a41a26 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__stickforce-func.js @@ -0,0 +1,83 @@ + +if (typeof gdjs.evtsExt__SpriteMultitouchJoystick__StickForce !== "undefined") { + gdjs.evtsExt__SpriteMultitouchJoystick__StickForce.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SpriteMultitouchJoystick__StickForce = {}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__StickForce.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtTools.variable.getVariableNumber(runtimeScene.getScene().getVariables().get("__MultitouchJoystick").getChild("Controllers").getChild((typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("ControllerIdentifier")) || 0 : 0)).getChild("Joystick").getChild((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("JoystickIdentifier") : "")).getChild("Force")); }}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__StickForce.func = function(runtimeScene, ControllerIdentifier, JoystickIdentifier, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ControllerIdentifier") return ControllerIdentifier; +if (argName === "JoystickIdentifier") return JoystickIdentifier; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__StickForce.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__SpriteMultitouchJoystick__StickForce.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__stickforcex-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__stickforcex-func.js new file mode 100644 index 0000000..68fd659 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__stickforcex-func.js @@ -0,0 +1,83 @@ + +if (typeof gdjs.evtsExt__SpriteMultitouchJoystick__StickForceX !== "undefined") { + gdjs.evtsExt__SpriteMultitouchJoystick__StickForceX.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SpriteMultitouchJoystick__StickForceX = {}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__StickForceX.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtsExt__SpriteMultitouchJoystick__JoystickForce.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("ControllerIdentifier")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("JoystickIdentifier") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) * Math.cos(gdjs.toRad(gdjs.evtsExt__SpriteMultitouchJoystick__JoystickAngle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("ControllerIdentifier")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("JoystickIdentifier") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)))); }}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__StickForceX.func = function(runtimeScene, ControllerIdentifier, JoystickIdentifier, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ControllerIdentifier") return ControllerIdentifier; +if (argName === "JoystickIdentifier") return JoystickIdentifier; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__StickForceX.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__SpriteMultitouchJoystick__StickForceX.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__stickforcey-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__stickforcey-func.js new file mode 100644 index 0000000..21a9d07 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__spritemultitouchjoystick__stickforcey-func.js @@ -0,0 +1,83 @@ + +if (typeof gdjs.evtsExt__SpriteMultitouchJoystick__StickForceY !== "undefined") { + gdjs.evtsExt__SpriteMultitouchJoystick__StickForceY.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SpriteMultitouchJoystick__StickForceY = {}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__StickForceY.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtsExt__SpriteMultitouchJoystick__JoystickForce.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("ControllerIdentifier")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("JoystickIdentifier") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) * Math.sin(gdjs.toRad(gdjs.evtsExt__SpriteMultitouchJoystick__JoystickAngle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("ControllerIdentifier")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("JoystickIdentifier") : ""), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)))); }}} + +} + + +}; + +gdjs.evtsExt__SpriteMultitouchJoystick__StickForceY.func = function(runtimeScene, ControllerIdentifier, JoystickIdentifier, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ControllerIdentifier") return ControllerIdentifier; +if (argName === "JoystickIdentifier") return JoystickIdentifier; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SpriteMultitouchJoystick__StickForceY.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__SpriteMultitouchJoystick__StickForceY.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__spritetoggleswitch__buttonfsm.js b/desktop/apps/dezunkrr/gdjs-evtsext__spritetoggleswitch__buttonfsm.js new file mode 100644 index 0000000..6dfc7ce --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__spritetoggleswitch__buttonfsm.js @@ -0,0 +1,1626 @@ + +gdjs.evtsExt__SpriteToggleSwitch__ButtonFSM = gdjs.evtsExt__SpriteToggleSwitch__ButtonFSM || {}; + +/** + * Behavior generated from Button finite state machine + */ +gdjs.evtsExt__SpriteToggleSwitch__ButtonFSM.ButtonFSM = class ButtonFSM extends gdjs.RuntimeBehavior { + constructor(instanceContainer, behaviorData, owner) { + super(instanceContainer, behaviorData, owner); + this._runtimeScene = instanceContainer; + + this._onceTriggers = new gdjs.OnceTriggers(); + this._behaviorData = {}; + this._sharedData = gdjs.evtsExt__SpriteToggleSwitch__ButtonFSM.ButtonFSM.getSharedData( + instanceContainer, + behaviorData.name + ); + + this._behaviorData.ShouldCheckHovering = true; + this._behaviorData.State = "Idle"; + this._behaviorData.TouchId = Number("0") || 0; + this._behaviorData.TouchIsInside = false; + this._behaviorData.MouseIsInside = false; + this._behaviorData.Index = Number("") || 0; + } + + // Hot-reload: + updateFromBehaviorData(oldBehaviorData, newBehaviorData) { + + if (oldBehaviorData.ShouldCheckHovering !== newBehaviorData.ShouldCheckHovering) + this._behaviorData.ShouldCheckHovering = newBehaviorData.ShouldCheckHovering; + if (oldBehaviorData.State !== newBehaviorData.State) + this._behaviorData.State = newBehaviorData.State; + if (oldBehaviorData.TouchId !== newBehaviorData.TouchId) + this._behaviorData.TouchId = newBehaviorData.TouchId; + if (oldBehaviorData.TouchIsInside !== newBehaviorData.TouchIsInside) + this._behaviorData.TouchIsInside = newBehaviorData.TouchIsInside; + if (oldBehaviorData.MouseIsInside !== newBehaviorData.MouseIsInside) + this._behaviorData.MouseIsInside = newBehaviorData.MouseIsInside; + if (oldBehaviorData.Index !== newBehaviorData.Index) + this._behaviorData.Index = newBehaviorData.Index; + + return true; + } + + // Properties: + + _getShouldCheckHovering() { + return this._behaviorData.ShouldCheckHovering !== undefined ? this._behaviorData.ShouldCheckHovering : true; + } + _setShouldCheckHovering(newValue) { + this._behaviorData.ShouldCheckHovering = newValue; + } + _toggleShouldCheckHovering() { + this._setShouldCheckHovering(!this._getShouldCheckHovering()); + } + _getState() { + return this._behaviorData.State !== undefined ? this._behaviorData.State : "Idle"; + } + _setState(newValue) { + this._behaviorData.State = newValue; + } + _getTouchId() { + return this._behaviorData.TouchId !== undefined ? this._behaviorData.TouchId : Number("0") || 0; + } + _setTouchId(newValue) { + this._behaviorData.TouchId = newValue; + } + _getTouchIsInside() { + return this._behaviorData.TouchIsInside !== undefined ? this._behaviorData.TouchIsInside : false; + } + _setTouchIsInside(newValue) { + this._behaviorData.TouchIsInside = newValue; + } + _toggleTouchIsInside() { + this._setTouchIsInside(!this._getTouchIsInside()); + } + _getMouseIsInside() { + return this._behaviorData.MouseIsInside !== undefined ? this._behaviorData.MouseIsInside : false; + } + _setMouseIsInside(newValue) { + this._behaviorData.MouseIsInside = newValue; + } + _toggleMouseIsInside() { + this._setMouseIsInside(!this._getMouseIsInside()); + } + _getIndex() { + return this._behaviorData.Index !== undefined ? this._behaviorData.Index : Number("") || 0; + } + _setIndex(newValue) { + this._behaviorData.Index = newValue; + } +} + +/** + * Shared data generated from Button finite state machine + */ +gdjs.evtsExt__SpriteToggleSwitch__ButtonFSM.ButtonFSM.SharedData = class ButtonFSMSharedData { + constructor(sharedData) { + + } + + // Shared properties: + +} + +gdjs.evtsExt__SpriteToggleSwitch__ButtonFSM.ButtonFSM.getSharedData = function(instanceContainer, behaviorName) { + if (!instanceContainer._SpriteToggleSwitch_ButtonFSMSharedData) { + const initialData = instanceContainer.getInitialSharedDataForBehavior( + behaviorName + ); + instanceContainer._SpriteToggleSwitch_ButtonFSMSharedData = new gdjs.evtsExt__SpriteToggleSwitch__ButtonFSM.ButtonFSM.SharedData( + initialData + ); + } + return instanceContainer._SpriteToggleSwitch_ButtonFSMSharedData; +} + +// Methods: +gdjs.evtsExt__SpriteToggleSwitch__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext = {}; +gdjs.evtsExt__SpriteToggleSwitch__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext.GDObjectObjects4_1final = []; + +gdjs.evtsExt__SpriteToggleSwitch__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext.GDObjectObjects1= []; +gdjs.evtsExt__SpriteToggleSwitch__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext.GDObjectObjects2= []; +gdjs.evtsExt__SpriteToggleSwitch__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext.GDObjectObjects3= []; +gdjs.evtsExt__SpriteToggleSwitch__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext.GDObjectObjects4= []; +gdjs.evtsExt__SpriteToggleSwitch__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext.GDObjectObjects5= []; + + +gdjs.evtsExt__SpriteToggleSwitch__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + + +} + + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__SpriteToggleSwitch__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext.GDObjectObjects3); +{for(var i = 0, len = gdjs.evtsExt__SpriteToggleSwitch__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext.GDObjectObjects3.length ;i < len;++i) { + gdjs.evtsExt__SpriteToggleSwitch__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext.GDObjectObjects3[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._setMouseIsInside(false); +} +}} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__SpriteToggleSwitch__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext.GDObjectObjects3); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__SpriteToggleSwitch__ButtonFSM.ButtonFSM.prototype.doStepPostEventsContext.GDObjectObjects3.length;i + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SwipeGesture__Angle = {}; + + +gdjs.evtsExt__SwipeGesture__Angle.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtTools.variable.getVariableNumber(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("Angle")); }}} + +} + + +}; + +gdjs.evtsExt__SwipeGesture__Angle.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SwipeGesture__Angle.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__SwipeGesture__Angle.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__distance-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__distance-func.js new file mode 100644 index 0000000..e9b5217 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__distance-func.js @@ -0,0 +1,81 @@ + +if (typeof gdjs.evtsExt__SwipeGesture__Distance !== "undefined") { + gdjs.evtsExt__SwipeGesture__Distance.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SwipeGesture__Distance = {}; + + +gdjs.evtsExt__SwipeGesture__Distance.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtTools.variable.getVariableNumber(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("Distance")); }}} + +} + + +}; + +gdjs.evtsExt__SwipeGesture__Distance.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SwipeGesture__Distance.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__SwipeGesture__Distance.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__distancex-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__distancex-func.js new file mode 100644 index 0000000..f8a0ee5 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__distancex-func.js @@ -0,0 +1,81 @@ + +if (typeof gdjs.evtsExt__SwipeGesture__DistanceX !== "undefined") { + gdjs.evtsExt__SwipeGesture__DistanceX.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SwipeGesture__DistanceX = {}; + + +gdjs.evtsExt__SwipeGesture__DistanceX.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtTools.variable.getVariableNumber(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("DistanceX")); }}} + +} + + +}; + +gdjs.evtsExt__SwipeGesture__DistanceX.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SwipeGesture__DistanceX.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__SwipeGesture__DistanceX.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__distancey-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__distancey-func.js new file mode 100644 index 0000000..760b33d --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__distancey-func.js @@ -0,0 +1,81 @@ + +if (typeof gdjs.evtsExt__SwipeGesture__DistanceY !== "undefined") { + gdjs.evtsExt__SwipeGesture__DistanceY.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SwipeGesture__DistanceY = {}; + + +gdjs.evtsExt__SwipeGesture__DistanceY.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtTools.variable.getVariableNumber(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("DistanceY")); }}} + +} + + +}; + +gdjs.evtsExt__SwipeGesture__DistanceY.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SwipeGesture__DistanceY.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__SwipeGesture__DistanceY.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__drawswipe-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__drawswipe-func.js new file mode 100644 index 0000000..8526ee8 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__drawswipe-func.js @@ -0,0 +1,180 @@ + +if (typeof gdjs.evtsExt__SwipeGesture__DrawSwipe !== "undefined") { + gdjs.evtsExt__SwipeGesture__DrawSwipe.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SwipeGesture__DrawSwipe = {}; +gdjs.evtsExt__SwipeGesture__DrawSwipe.GDShapePainterObjectObjects1= []; +gdjs.evtsExt__SwipeGesture__DrawSwipe.GDShapePainterObjectObjects2= []; +gdjs.evtsExt__SwipeGesture__DrawSwipe.GDShapePainterObjectObjects3= []; + + +gdjs.evtsExt__SwipeGesture__DrawSwipe.mapOfEmptyGDShapePainterObjectObjects = Hashtable.newFrom({"ShapePainterObject": []}); +gdjs.evtsExt__SwipeGesture__DrawSwipe.mapOfGDgdjs_46evtsExt_95_95SwipeGesture_95_95DrawSwipe_46GDShapePainterObjectObjects2Objects = Hashtable.newFrom({"ShapePainterObject": gdjs.evtsExt__SwipeGesture__DrawSwipe.GDShapePainterObjectObjects2}); +gdjs.evtsExt__SwipeGesture__DrawSwipe.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.object.getSceneInstancesCount((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : runtimeScene), gdjs.evtsExt__SwipeGesture__DrawSwipe.mapOfEmptyGDShapePainterObjectObjects) == 0; +if (isConditionTrue_0) { +gdjs.evtsExt__SwipeGesture__DrawSwipe.GDShapePainterObjectObjects2.length = 0; + +{gdjs.evtTools.object.createObjectOnScene((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : runtimeScene), gdjs.evtsExt__SwipeGesture__DrawSwipe.mapOfGDgdjs_46evtsExt_95_95SwipeGesture_95_95DrawSwipe_46GDShapePainterObjectObjects2Objects, 0, 0, gdjs.evtTools.variable.getVariableString(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("Layer"))); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("ShapePainterObject"), gdjs.evtsExt__SwipeGesture__DrawSwipe.GDShapePainterObjectObjects2); +{for(var i = 0, len = gdjs.evtsExt__SwipeGesture__DrawSwipe.GDShapePainterObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__SwipeGesture__DrawSwipe.GDShapePainterObjectObjects2[i].setClearBetweenFrames(true); +} +}} + +} + + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("ShapePainterObject"), gdjs.evtsExt__SwipeGesture__DrawSwipe.GDShapePainterObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__SwipeGesture__DrawSwipe.GDShapePainterObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__SwipeGesture__DrawSwipe.GDShapePainterObjectObjects1[i].setCoordinatesRelative(false); +} +}} + +} + + +};gdjs.evtsExt__SwipeGesture__DrawSwipe.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("ShapePainterObject"), gdjs.evtsExt__SwipeGesture__DrawSwipe.GDShapePainterObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__SwipeGesture__DrawSwipe.GDShapePainterObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__SwipeGesture__DrawSwipe.GDShapePainterObjectObjects1[i].drawLineV2(gdjs.evtTools.variable.getVariableNumber(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("StartPointX")), gdjs.evtTools.variable.getVariableNumber(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("StartPointY")), gdjs.evtTools.input.getCursorX(runtimeScene, gdjs.evtTools.variable.getVariableString(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("Layer")), 0), gdjs.evtTools.input.getCursorY(runtimeScene, gdjs.evtTools.variable.getVariableString(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("Layer")), 0), (gdjs.evtsExt__SwipeGesture__DrawSwipe.GDShapePainterObjectObjects1[i].getOutlineSize())); +} +}} + +} + + +};gdjs.evtsExt__SwipeGesture__DrawSwipe.eventsList2 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__SwipeGesture__IsSwipeInProgress.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__SwipeGesture__DrawSwipe.eventsList1(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__SwipeGesture__DrawSwipe.eventsList3 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__SwipeGesture__DrawSwipe.eventsList0(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__SwipeGesture__DrawSwipe.eventsList2(runtimeScene, eventsFunctionContext); +} + + +}; + +gdjs.evtsExt__SwipeGesture__DrawSwipe.func = function(runtimeScene, ShapePainterObject, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +"ShapePainterObject": ShapePainterObject +}, + _objectArraysMap: { +"ShapePainterObject": gdjs.objectsListsToArray(ShapePainterObject) +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + +gdjs.evtsExt__SwipeGesture__DrawSwipe.GDShapePainterObjectObjects1.length = 0; +gdjs.evtsExt__SwipeGesture__DrawSwipe.GDShapePainterObjectObjects2.length = 0; +gdjs.evtsExt__SwipeGesture__DrawSwipe.GDShapePainterObjectObjects3.length = 0; + +gdjs.evtsExt__SwipeGesture__DrawSwipe.eventsList3(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__SwipeGesture__DrawSwipe.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__duration-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__duration-func.js new file mode 100644 index 0000000..67b45b3 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__duration-func.js @@ -0,0 +1,81 @@ + +if (typeof gdjs.evtsExt__SwipeGesture__Duration !== "undefined") { + gdjs.evtsExt__SwipeGesture__Duration.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SwipeGesture__Duration = {}; + + +gdjs.evtsExt__SwipeGesture__Duration.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtTools.runtimeScene.getTimerElapsedTimeInSeconds(runtimeScene, "__SwipeGesture.TouchDuration"); }}} + +} + + +}; + +gdjs.evtsExt__SwipeGesture__Duration.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SwipeGesture__Duration.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__SwipeGesture__Duration.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__enableswipedetection-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__enableswipedetection-func.js new file mode 100644 index 0000000..c028b3e --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__enableswipedetection-func.js @@ -0,0 +1,102 @@ + +if (typeof gdjs.evtsExt__SwipeGesture__EnableSwipeDetection !== "undefined") { + gdjs.evtsExt__SwipeGesture__EnableSwipeDetection.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SwipeGesture__EnableSwipeDetection = {}; + + +gdjs.evtsExt__SwipeGesture__EnableSwipeDetection.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = !(typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("Value") : false); +} +if (isConditionTrue_0) { +{gdjs.evtTools.variable.setVariableBoolean(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("Enabled"), false); +}{gdjs.evtTools.variable.setVariableBoolean(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("SwipeInProgress"), false); +}{gdjs.evtTools.runtimeScene.pauseTimer(runtimeScene, "__SwipeGesture.TouchDuration"); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("Value") : false); +} +if (isConditionTrue_0) { +{gdjs.evtTools.variable.setVariableBoolean(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("Enabled"), true); +}} + +} + + +}; + +gdjs.evtsExt__SwipeGesture__EnableSwipeDetection.func = function(runtimeScene, Value, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SwipeGesture__EnableSwipeDetection.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__SwipeGesture__EnableSwipeDetection.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__endx-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__endx-func.js new file mode 100644 index 0000000..9900275 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__endx-func.js @@ -0,0 +1,81 @@ + +if (typeof gdjs.evtsExt__SwipeGesture__EndX !== "undefined") { + gdjs.evtsExt__SwipeGesture__EndX.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SwipeGesture__EndX = {}; + + +gdjs.evtsExt__SwipeGesture__EndX.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtTools.variable.getVariableNumber(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("EndPointX")); }}} + +} + + +}; + +gdjs.evtsExt__SwipeGesture__EndX.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SwipeGesture__EndX.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__SwipeGesture__EndX.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__endy-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__endy-func.js new file mode 100644 index 0000000..04a2aab --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__endy-func.js @@ -0,0 +1,81 @@ + +if (typeof gdjs.evtsExt__SwipeGesture__EndY !== "undefined") { + gdjs.evtsExt__SwipeGesture__EndY.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SwipeGesture__EndY = {}; + + +gdjs.evtsExt__SwipeGesture__EndY.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtTools.variable.getVariableNumber(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("EndPointY")); }}} + +} + + +}; + +gdjs.evtsExt__SwipeGesture__EndY.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SwipeGesture__EndY.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__SwipeGesture__EndY.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__hasswipejustended-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__hasswipejustended-func.js new file mode 100644 index 0000000..77e45e6 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__hasswipejustended-func.js @@ -0,0 +1,83 @@ + +if (typeof gdjs.evtsExt__SwipeGesture__HasSwipeJustEnded !== "undefined") { + gdjs.evtsExt__SwipeGesture__HasSwipeJustEnded.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SwipeGesture__HasSwipeJustEnded = {}; + + +gdjs.evtsExt__SwipeGesture__HasSwipeJustEnded.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.getVariableBoolean(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("SwipeJustEnded"), true); +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +}; + +gdjs.evtsExt__SwipeGesture__HasSwipeJustEnded.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SwipeGesture__HasSwipeJustEnded.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__SwipeGesture__HasSwipeJustEnded.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__isswipedetectionenabled-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__isswipedetectionenabled-func.js new file mode 100644 index 0000000..9965f5b --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__isswipedetectionenabled-func.js @@ -0,0 +1,83 @@ + +if (typeof gdjs.evtsExt__SwipeGesture__IsSwipeDetectionEnabled !== "undefined") { + gdjs.evtsExt__SwipeGesture__IsSwipeDetectionEnabled.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SwipeGesture__IsSwipeDetectionEnabled = {}; + + +gdjs.evtsExt__SwipeGesture__IsSwipeDetectionEnabled.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.getVariableBoolean(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("Enabled"), true); +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +}; + +gdjs.evtsExt__SwipeGesture__IsSwipeDetectionEnabled.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SwipeGesture__IsSwipeDetectionEnabled.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__SwipeGesture__IsSwipeDetectionEnabled.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__isswipeinprogress-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__isswipeinprogress-func.js new file mode 100644 index 0000000..2e39cc6 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__isswipeinprogress-func.js @@ -0,0 +1,83 @@ + +if (typeof gdjs.evtsExt__SwipeGesture__IsSwipeInProgress !== "undefined") { + gdjs.evtsExt__SwipeGesture__IsSwipeInProgress.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SwipeGesture__IsSwipeInProgress = {}; + + +gdjs.evtsExt__SwipeGesture__IsSwipeInProgress.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.getVariableBoolean(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("SwipeInProgress"), true); +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +}; + +gdjs.evtsExt__SwipeGesture__IsSwipeInProgress.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SwipeGesture__IsSwipeInProgress.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__SwipeGesture__IsSwipeInProgress.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__layer-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__layer-func.js new file mode 100644 index 0000000..8642743 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__layer-func.js @@ -0,0 +1,81 @@ + +if (typeof gdjs.evtsExt__SwipeGesture__Layer !== "undefined") { + gdjs.evtsExt__SwipeGesture__Layer.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SwipeGesture__Layer = {}; + + +gdjs.evtsExt__SwipeGesture__Layer.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtTools.variable.getVariableString(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("Layer")); }}} + +} + + +}; + +gdjs.evtsExt__SwipeGesture__Layer.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SwipeGesture__Layer.eventsList0(runtimeScene, eventsFunctionContext); + +return "" + eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__SwipeGesture__Layer.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__onscenepreevents-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__onscenepreevents-func.js new file mode 100644 index 0000000..1eb5d8f --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__onscenepreevents-func.js @@ -0,0 +1,353 @@ + +if (typeof gdjs.evtsExt__SwipeGesture__onScenePreEvents !== "undefined") { + gdjs.evtsExt__SwipeGesture__onScenePreEvents.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SwipeGesture__onScenePreEvents = {}; + + +gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("EndPointX").setNumber(gdjs.evtTools.input.getCursorX(runtimeScene, gdjs.evtTools.variable.getVariableString(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("Layer")), 0)); +}{runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("EndPointY").setNumber(gdjs.evtTools.input.getCursorY(runtimeScene, gdjs.evtTools.variable.getVariableString(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("Layer")), 0)); +}} + +} + + +};gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtTools.runtimeScene.pauseTimer(runtimeScene, "__SwipeGesture.TouchDuration"); +}{gdjs.evtTools.variable.setVariableBoolean(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("SwipeInProgress"), false); +}{gdjs.evtTools.variable.setVariableBoolean(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("SwipeJustEnded"), true); +}} + +} + + +};gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList2 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList0(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList1(runtimeScene, eventsFunctionContext); +} + + +};gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList3 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__SwipeGesture__IsSwipeInProgress.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.input.isMouseButtonReleased(runtimeScene, "Left"); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList2(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList4 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("EndPointX").setNumber(0); +}{runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("EndPointY").setNumber(0); +}} + +} + + +};gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList5 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("StartPointX").setNumber(gdjs.evtTools.input.getCursorX(runtimeScene, gdjs.evtTools.variable.getVariableString(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("Layer")), 0)); +}{runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("StartPointY").setNumber(gdjs.evtTools.input.getCursorY(runtimeScene, gdjs.evtTools.variable.getVariableString(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("Layer")), 0)); +}} + +} + + +};gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList6 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtTools.runtimeScene.resetTimer(runtimeScene, "__SwipeGesture.TouchDuration"); +}{gdjs.evtTools.runtimeScene.unpauseTimer(runtimeScene, "__SwipeGesture.TouchDuration"); +}{gdjs.evtTools.variable.setVariableBoolean(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("SwipeInProgress"), true); +}} + +} + + +};gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList7 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList4(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList5(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList6(runtimeScene, eventsFunctionContext); +} + + +};gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList8 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__SwipeGesture__IsSwipeDetectionEnabled.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.input.isMouseButtonPressed(runtimeScene, "Left"); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +{isConditionTrue_0 = eventsFunctionContext.getOnceTriggers().triggerOnce(23433500); +} +} +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList7(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList9 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("Distance").setNumber(gdjs.evtTools.common.distanceBetweenPositions(gdjs.evtTools.variable.getVariableNumber(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("StartPointX")), gdjs.evtTools.variable.getVariableNumber(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("StartPointY")), gdjs.evtTools.input.getCursorX(runtimeScene, gdjs.evtTools.variable.getVariableString(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("Layer")), 0), gdjs.evtTools.input.getCursorY(runtimeScene, gdjs.evtTools.variable.getVariableString(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("Layer")), 0))); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +{ +{runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("DistanceX").setNumber(Math.abs(gdjs.evtTools.variable.getVariableNumber(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("StartPointX")) - gdjs.evtTools.input.getCursorX(runtimeScene, gdjs.evtTools.variable.getVariableString(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("Layer")), 0))); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +{ +{runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("DistanceY").setNumber(Math.abs(gdjs.evtTools.variable.getVariableNumber(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("StartPointY")) - gdjs.evtTools.input.getCursorY(runtimeScene, gdjs.evtTools.variable.getVariableString(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("Layer")), 0))); +}} + +} + + +};gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList10 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("Angle").setNumber(gdjs.evtTools.common.angleBetweenPositions(gdjs.evtTools.variable.getVariableNumber(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("StartPointX")), gdjs.evtTools.variable.getVariableNumber(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("StartPointY")), gdjs.evtTools.input.getCursorX(runtimeScene, gdjs.evtTools.variable.getVariableString(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("Layer")), 0), gdjs.evtTools.input.getCursorY(runtimeScene, gdjs.evtTools.variable.getVariableString(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("Layer")), 0))); +}} + +} + + +};gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList11 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList9(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList10(runtimeScene, eventsFunctionContext); +} + + +};gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList12 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__SwipeGesture__IsSwipeInProgress.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList11(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList13 = function(runtimeScene, eventsFunctionContext) { + +{ + + + +} + + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtTools.variable.setVariableBoolean(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("SwipeJustEnded"), false); +}} + +} + + +{ + + +gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList3(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList8(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList12(runtimeScene, eventsFunctionContext); +} + + +}; + +gdjs.evtsExt__SwipeGesture__onScenePreEvents.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SwipeGesture__onScenePreEvents.eventsList13(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__SwipeGesture__onScenePreEvents.registeredGdjsCallbacks = []; +gdjs.evtsExt__SwipeGesture__onScenePreEvents.registeredGdjsCallbacks.push((runtimeScene) => { + gdjs.evtsExt__SwipeGesture__onScenePreEvents.func(runtimeScene, runtimeScene); +}) +gdjs.registerRuntimeScenePreEventsCallback(gdjs.evtsExt__SwipeGesture__onScenePreEvents.registeredGdjsCallbacks[gdjs.evtsExt__SwipeGesture__onScenePreEvents.registeredGdjsCallbacks.length - 1]); diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__setlayer-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__setlayer-func.js new file mode 100644 index 0000000..9a57080 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__setlayer-func.js @@ -0,0 +1,83 @@ + +if (typeof gdjs.evtsExt__SwipeGesture__SetLayer !== "undefined") { + gdjs.evtsExt__SwipeGesture__SetLayer.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SwipeGesture__SetLayer = {}; + + +gdjs.evtsExt__SwipeGesture__SetLayer.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("Layer").setString((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Value") : "")); +}} + +} + + +}; + +gdjs.evtsExt__SwipeGesture__SetLayer.func = function(runtimeScene, Value, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Value") return Value; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SwipeGesture__SetLayer.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__SwipeGesture__SetLayer.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__startx-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__startx-func.js new file mode 100644 index 0000000..23346b9 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__startx-func.js @@ -0,0 +1,81 @@ + +if (typeof gdjs.evtsExt__SwipeGesture__StartX !== "undefined") { + gdjs.evtsExt__SwipeGesture__StartX.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SwipeGesture__StartX = {}; + + +gdjs.evtsExt__SwipeGesture__StartX.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtTools.variable.getVariableNumber(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("StartPointX")); }}} + +} + + +}; + +gdjs.evtsExt__SwipeGesture__StartX.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SwipeGesture__StartX.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__SwipeGesture__StartX.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__starty-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__starty-func.js new file mode 100644 index 0000000..feefa32 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__starty-func.js @@ -0,0 +1,81 @@ + +if (typeof gdjs.evtsExt__SwipeGesture__StartY !== "undefined") { + gdjs.evtsExt__SwipeGesture__StartY.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SwipeGesture__StartY = {}; + + +gdjs.evtsExt__SwipeGesture__StartY.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = gdjs.evtTools.variable.getVariableNumber(runtimeScene.getScene().getVariables().get("__SwipeGesture").getChild("StartPointY")); }}} + +} + + +}; + +gdjs.evtsExt__SwipeGesture__StartY.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SwipeGesture__StartY.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__SwipeGesture__StartY.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__swipedirection_4way-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__swipedirection_4way-func.js new file mode 100644 index 0000000..027159a --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__swipedirection_4way-func.js @@ -0,0 +1,308 @@ + +if (typeof gdjs.evtsExt__SwipeGesture__SwipeDirection_4way !== "undefined") { + gdjs.evtsExt__SwipeGesture__SwipeDirection_4way.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SwipeGesture__SwipeDirection_4way = {}; + + +gdjs.evtsExt__SwipeGesture__SwipeDirection_4way.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) >= -(135)); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +{isConditionTrue_0 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) < -(45)); +} +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_4way.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : "") == "Up"); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__SwipeGesture__SwipeDirection_4way.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_4way.eventsList2 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) >= 45); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +{isConditionTrue_0 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) < 135); +} +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_4way.eventsList3 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : "") == "Down"); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__SwipeGesture__SwipeDirection_4way.eventsList2(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_4way.eventsList4 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{let isConditionTrue_1 = false; +isConditionTrue_0 = false; +{ +{let isConditionTrue_2 = false; +isConditionTrue_2 = false; +{isConditionTrue_2 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) >= -(180)); +} +if (isConditionTrue_2) { +isConditionTrue_2 = false; +{isConditionTrue_2 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) < -(135)); +} +} +isConditionTrue_1 = isConditionTrue_2; +} +if(isConditionTrue_1) { + isConditionTrue_0 = true; +} +} +{ +{let isConditionTrue_2 = false; +isConditionTrue_2 = false; +{isConditionTrue_2 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) >= 135); +} +if (isConditionTrue_2) { +isConditionTrue_2 = false; +{isConditionTrue_2 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) < 180); +} +} +isConditionTrue_1 = isConditionTrue_2; +} +if(isConditionTrue_1) { + isConditionTrue_0 = true; +} +} +{ +} +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_4way.eventsList5 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : "") == "Left"); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__SwipeGesture__SwipeDirection_4way.eventsList4(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_4way.eventsList6 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) >= -(45)); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +{isConditionTrue_0 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) < 45); +} +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_4way.eventsList7 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : "") == "Right"); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__SwipeGesture__SwipeDirection_4way.eventsList6(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_4way.eventsList8 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__SwipeGesture__SwipeDirection_4way.eventsList1(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__SwipeGesture__SwipeDirection_4way.eventsList3(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__SwipeGesture__SwipeDirection_4way.eventsList5(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__SwipeGesture__SwipeDirection_4way.eventsList7(runtimeScene, eventsFunctionContext); +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_4way.eventsList9 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__SwipeGesture__SwipeDirection_4way.eventsList8(runtimeScene, eventsFunctionContext); +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_4way.eventsList10 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__SwipeGesture__Distance.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) > 0; +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__SwipeGesture__SwipeDirection_4way.eventsList9(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__SwipeGesture__SwipeDirection_4way.func = function(runtimeScene, Direction, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Direction") return Direction; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SwipeGesture__SwipeDirection_4way.eventsList10(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__SwipeGesture__SwipeDirection_4way.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__swipedirection_8way-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__swipedirection_8way-func.js new file mode 100644 index 0000000..14659a6 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__swipegesture__swipedirection_8way-func.js @@ -0,0 +1,488 @@ + +if (typeof gdjs.evtsExt__SwipeGesture__SwipeDirection_8way !== "undefined") { + gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__SwipeGesture__SwipeDirection_8way = {}; + + +gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) >= -(112.5)); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +{isConditionTrue_0 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) < -(67.5)); +} +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : "") == "Up"); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList2 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) >= 67.5); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +{isConditionTrue_0 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) < 112.5); +} +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList3 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : "") == "Down"); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList2(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList4 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{let isConditionTrue_1 = false; +isConditionTrue_0 = false; +{ +{let isConditionTrue_2 = false; +isConditionTrue_2 = false; +{isConditionTrue_2 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) >= -(180)); +} +if (isConditionTrue_2) { +isConditionTrue_2 = false; +{isConditionTrue_2 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) < -(157.5)); +} +} +isConditionTrue_1 = isConditionTrue_2; +} +if(isConditionTrue_1) { + isConditionTrue_0 = true; +} +} +{ +{let isConditionTrue_2 = false; +isConditionTrue_2 = false; +{isConditionTrue_2 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) >= 157.5); +} +if (isConditionTrue_2) { +isConditionTrue_2 = false; +{isConditionTrue_2 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) < 180); +} +} +isConditionTrue_1 = isConditionTrue_2; +} +if(isConditionTrue_1) { + isConditionTrue_0 = true; +} +} +{ +} +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList5 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : "") == "Left"); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList4(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList6 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) >= -(22.5)); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +{isConditionTrue_0 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) < 22.5); +} +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList7 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : "") == "Right"); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList6(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList8 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) >= -(67.5)); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +{isConditionTrue_0 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) < -(22.5)); +} +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList9 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : "") == "UpRight"); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList8(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList10 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) >= -(157.5)); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +{isConditionTrue_0 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) < -(112.5)); +} +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList11 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : "") == "UpLeft"); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList10(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList12 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) >= 112.5); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +{isConditionTrue_0 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) < 157.5); +} +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList13 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : "") == "DownLeft"); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList12(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList14 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) >= 22.5); +} +if (isConditionTrue_0) { +isConditionTrue_0 = false; +{isConditionTrue_0 = (gdjs.evtsExt__SwipeGesture__Angle.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) < 67.5); +} +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList15 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Direction") : "") == "DownRight"); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList14(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList16 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList1(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList3(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList5(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList7(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList9(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList11(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList13(runtimeScene, eventsFunctionContext); +} + + +{ + + +gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList15(runtimeScene, eventsFunctionContext); +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList17 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList16(runtimeScene, eventsFunctionContext); +} + + +};gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList18 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtsExt__SwipeGesture__Distance.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) > 0; +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList17(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +}; + +gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.func = function(runtimeScene, Direction, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Direction") return Direction; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.eventsList18(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__SwipeGesture__SwipeDirection_8way.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__tweenzorder__tweenzorder.js b/desktop/apps/dezunkrr/gdjs-evtsext__tweenzorder__tweenzorder.js new file mode 100644 index 0000000..6166e9e --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__tweenzorder__tweenzorder.js @@ -0,0 +1,300 @@ + +gdjs.evtsExt__TweenZOrder__TweenZOrder = gdjs.evtsExt__TweenZOrder__TweenZOrder || {}; + +/** + * Behavior generated from Tween Z-Order + */ +gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder = class TweenZOrder extends gdjs.RuntimeBehavior { + constructor(instanceContainer, behaviorData, owner) { + super(instanceContainer, behaviorData, owner); + this._runtimeScene = instanceContainer; + + this._onceTriggers = new gdjs.OnceTriggers(); + this._behaviorData = {}; + this._sharedData = gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.getSharedData( + instanceContainer, + behaviorData.name + ); + + this._behaviorData.Tween = behaviorData.Tween !== undefined ? behaviorData.Tween : ""; + } + + // Hot-reload: + updateFromBehaviorData(oldBehaviorData, newBehaviorData) { + + if (oldBehaviorData.Tween !== newBehaviorData.Tween) + this._behaviorData.Tween = newBehaviorData.Tween; + + return true; + } + + // Properties: + + _getTween() { + return this._behaviorData.Tween !== undefined ? this._behaviorData.Tween : ""; + } + _setTween(newValue) { + this._behaviorData.Tween = newValue; + } +} + +/** + * Shared data generated from Tween Z-Order + */ +gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.SharedData = class TweenZOrderSharedData { + constructor(sharedData) { + + } + + // Shared properties: + +} + +gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.getSharedData = function(instanceContainer, behaviorName) { + if (!instanceContainer._TweenZOrder_TweenZOrderSharedData) { + const initialData = instanceContainer.getInitialSharedDataForBehavior( + behaviorName + ); + instanceContainer._TweenZOrder_TweenZOrderSharedData = new gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.SharedData( + initialData + ); + } + return instanceContainer._TweenZOrder_TweenZOrderSharedData; +} + +// Methods: +gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.TweenZOrderContext = {}; +gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.TweenZOrderContext.GDObjectObjects1= []; +gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.TweenZOrderContext.GDObjectObjects2= []; + + +gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.TweenZOrderContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.TweenZOrderContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.TweenZOrderContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.TweenZOrderContext.GDObjectObjects1[i].returnVariable(gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.TweenZOrderContext.GDObjectObjects1[i].getVariables().get("__TweenZOrder").getChild("Z")).setNumber((gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.TweenZOrderContext.GDObjectObjects1[i].getZOrder())); +} +}{for(var i = 0, len = gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.TweenZOrderContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.TweenZOrderContext.GDObjectObjects1[i].returnVariable(gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.TweenZOrderContext.GDObjectObjects1[i].getVariables().get("__TweenZOrder").getChild("LastID")).setString((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("TweenIdentifier") : "")); +} +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("Destroy") : false); +} +if (isConditionTrue_0) { +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.TweenZOrderContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.TweenZOrderContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.TweenZOrderContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Tween")).addVariableTween2((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("TweenIdentifier") : ""), gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.TweenZOrderContext.GDObjectObjects1[i].getVariables().get("__TweenZOrder").getChild("Z"), (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("ToZ")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Easing") : ""), (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Ms")) || 0 : 0), true); +} +}} + +} + + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = !(typeof eventsFunctionContext !== 'undefined' ? !!eventsFunctionContext.getArgument("Destroy") : false); +} +if (isConditionTrue_0) { +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.TweenZOrderContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.TweenZOrderContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.TweenZOrderContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Tween")).addVariableTween2((typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("TweenIdentifier") : ""), gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.TweenZOrderContext.GDObjectObjects1[i].getVariables().get("__TweenZOrder").getChild("Z"), (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("ToZ")) || 0 : 0), (typeof eventsFunctionContext !== 'undefined' ? "" + eventsFunctionContext.getArgument("Easing") : ""), (typeof eventsFunctionContext !== 'undefined' ? Number(eventsFunctionContext.getArgument("Ms")) || 0 : 0), false); +} +}} + +} + + +}; + +gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.TweenZOrder = function(TweenIdentifier, ToZ, Easing, Ms, Destroy, parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +, "Tween": this._getTween() +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "TweenIdentifier") return TweenIdentifier; +if (argName === "ToZ") return ToZ; +if (argName === "Easing") return Easing; +if (argName === "Ms") return Ms; +if (argName === "Destroy") return Destroy; + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.TweenZOrderContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.TweenZOrderContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.TweenZOrderContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.doStepPreEventsContext = {}; +gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.doStepPreEventsContext.GDObjectObjects1= []; +gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.doStepPreEventsContext.GDObjectObjects2= []; + + +gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.doStepPreEventsContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.doStepPreEventsContext.GDObjectObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__TweenZOrder__TweenZOrder.TweenZOrder.prototype.doStepPreEventsContext.GDObjectObjects1.length;i + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__UpdateChecker__CreateGlobalReference = {}; + + +gdjs.evtsExt__UpdateChecker__CreateGlobalReference.userFunc0x1992370 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +const reference = eventsFunctionContext.getArgument("reference"); +const source = eventsFunctionContext.getArgument("source"); + +// Override each method +for (let func of Object.getOwnPropertyNames(gdjs.Variable.prototype)) + reference[func] = gdjs.Variable.prototype[func].bind(source); + +}; +gdjs.evtsExt__UpdateChecker__CreateGlobalReference.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__UpdateChecker__CreateGlobalReference.userFunc0x1992370(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__UpdateChecker__CreateGlobalReference.func = function(runtimeScene, reference, source, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "reference") return reference; +if (argName === "source") return source; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__UpdateChecker__CreateGlobalReference.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__UpdateChecker__CreateGlobalReference.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__updatechecker__currentgameid-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__updatechecker__currentgameid-func.js new file mode 100644 index 0000000..62a3d28 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__updatechecker__currentgameid-func.js @@ -0,0 +1,84 @@ + +if (typeof gdjs.evtsExt__UpdateChecker__CurrentGameID !== "undefined") { + gdjs.evtsExt__UpdateChecker__CurrentGameID.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__UpdateChecker__CurrentGameID = {}; + + +gdjs.evtsExt__UpdateChecker__CurrentGameID.userFunc0x1992370 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +eventsFunctionContext.returnValue = runtimeScene.getGame().getGameData().properties.projectUuid; + +}; +gdjs.evtsExt__UpdateChecker__CurrentGameID.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__UpdateChecker__CurrentGameID.userFunc0x1992370(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__UpdateChecker__CurrentGameID.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__UpdateChecker__CurrentGameID.eventsList0(runtimeScene, eventsFunctionContext); + +return "" + eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__UpdateChecker__CurrentGameID.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__updatechecker__currentgameversion-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__updatechecker__currentgameversion-func.js new file mode 100644 index 0000000..6fe99f3 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__updatechecker__currentgameversion-func.js @@ -0,0 +1,84 @@ + +if (typeof gdjs.evtsExt__UpdateChecker__CurrentGameVersion !== "undefined") { + gdjs.evtsExt__UpdateChecker__CurrentGameVersion.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__UpdateChecker__CurrentGameVersion = {}; + + +gdjs.evtsExt__UpdateChecker__CurrentGameVersion.userFunc0x1992370 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +eventsFunctionContext.returnValue = runtimeScene.getGame().getGameData().properties.version; + +}; +gdjs.evtsExt__UpdateChecker__CurrentGameVersion.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__UpdateChecker__CurrentGameVersion.userFunc0x1992370(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__UpdateChecker__CurrentGameVersion.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__UpdateChecker__CurrentGameVersion.eventsList0(runtimeScene, eventsFunctionContext); + +return "" + eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__UpdateChecker__CurrentGameVersion.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__updatechecker__onfirstsceneloaded-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__updatechecker__onfirstsceneloaded-func.js new file mode 100644 index 0000000..9b50926 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__updatechecker__onfirstsceneloaded-func.js @@ -0,0 +1,86 @@ + +if (typeof gdjs.evtsExt__UpdateChecker__onFirstSceneLoaded !== "undefined") { + gdjs.evtsExt__UpdateChecker__onFirstSceneLoaded.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__UpdateChecker__onFirstSceneLoaded = {}; + + +gdjs.evtsExt__UpdateChecker__onFirstSceneLoaded.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtsExt__UpdateChecker__RecheckForUpdates.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +}; + +gdjs.evtsExt__UpdateChecker__onFirstSceneLoaded.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__UpdateChecker__onFirstSceneLoaded.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__UpdateChecker__onFirstSceneLoaded.registeredGdjsCallbacks = []; +gdjs.evtsExt__UpdateChecker__onFirstSceneLoaded.registeredGdjsCallbacks.push((runtimeScene) => { + gdjs.evtsExt__UpdateChecker__onFirstSceneLoaded.func(runtimeScene, runtimeScene); +}) +gdjs.registerFirstRuntimeSceneLoadedCallback(gdjs.evtsExt__UpdateChecker__onFirstSceneLoaded.registeredGdjsCallbacks[gdjs.evtsExt__UpdateChecker__onFirstSceneLoaded.registeredGdjsCallbacks.length - 1]); diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__updatechecker__recheckforupdates-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__updatechecker__recheckforupdates-func.js new file mode 100644 index 0000000..0605274 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__updatechecker__recheckforupdates-func.js @@ -0,0 +1,84 @@ + +if (typeof gdjs.evtsExt__UpdateChecker__RecheckForUpdates !== "undefined") { + gdjs.evtsExt__UpdateChecker__RecheckForUpdates.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__UpdateChecker__RecheckForUpdates = {}; + + +gdjs.evtsExt__UpdateChecker__RecheckForUpdates.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +{gdjs.evtsExt__UpdateChecker__CreateGlobalReference.func(runtimeScene, runtimeScene.getScene().getVariables().get("__UpdateChecker").getChild("LatestVersion"), runtimeScene.getGame().getVariables().get("__UpdateChecker").getChild("LatestVersion"), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtsExt__UpdateChecker__CreateGlobalReference.func(runtimeScene, runtimeScene.getScene().getVariables().get("__UpdateChecker").getChild("Error"), runtimeScene.getGame().getVariables().get("__UpdateChecker").getChild("Error"), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}{gdjs.evtTools.network.sendAsyncRequest("https://updates.arthuro555.com/?game-id=" + gdjs.evtsExt__UpdateChecker__CurrentGameID.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)), "", "GET", "text/plain-text", runtimeScene.getScene().getVariables().get("__UpdateChecker").getChild("LatestVersion"), runtimeScene.getScene().getVariables().get("__UpdateChecker").getChild("Error")); +}} + +} + + +}; + +gdjs.evtsExt__UpdateChecker__RecheckForUpdates.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__UpdateChecker__RecheckForUpdates.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__UpdateChecker__RecheckForUpdates.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__updatechecker__updateavailable-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__updatechecker__updateavailable-func.js new file mode 100644 index 0000000..f9820f6 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__updatechecker__updateavailable-func.js @@ -0,0 +1,87 @@ + +if (typeof gdjs.evtsExt__UpdateChecker__UpdateAvailable !== "undefined") { + gdjs.evtsExt__UpdateChecker__UpdateAvailable.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__UpdateChecker__UpdateAvailable = {}; + + +gdjs.evtsExt__UpdateChecker__UpdateAvailable.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.getVariableString(runtimeScene.getGame().getVariables().get("__UpdateChecker").getChild("LatestVersion")) != gdjs.evtsExt__UpdateChecker__CurrentGameVersion.func(runtimeScene, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.getVariableString(runtimeScene.getGame().getVariables().get("__UpdateChecker").getChild("LatestVersion")) != "0"; +} +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +}; + +gdjs.evtsExt__UpdateChecker__UpdateAvailable.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__UpdateChecker__UpdateAvailable.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__UpdateChecker__UpdateAvailable.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__updatechecker__updatecheckfailed-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__updatechecker__updatecheckfailed-func.js new file mode 100644 index 0000000..b79f07c --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__updatechecker__updatecheckfailed-func.js @@ -0,0 +1,83 @@ + +if (typeof gdjs.evtsExt__UpdateChecker__UpdateCheckFailed !== "undefined") { + gdjs.evtsExt__UpdateChecker__UpdateCheckFailed.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__UpdateChecker__UpdateCheckFailed = {}; + + +gdjs.evtsExt__UpdateChecker__UpdateCheckFailed.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.variable.getVariableString(runtimeScene.getGame().getVariables().get("__UpdateChecker").getChild("Error")) != "0"; +if (isConditionTrue_0) { +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = true; }}} + +} + + +}; + +gdjs.evtsExt__UpdateChecker__UpdateCheckFailed.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__UpdateChecker__UpdateCheckFailed.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__UpdateChecker__UpdateCheckFailed.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__boardprojection.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__boardprojection.js new file mode 100644 index 0000000..41f5608 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__boardprojection.js @@ -0,0 +1,1575 @@ + +gdjs.evtsExt__WithThreeJS__BoardProjection = gdjs.evtsExt__WithThreeJS__BoardProjection || {}; + +/** + * Behavior generated from 3D Board Projection (experimental) + */ +gdjs.evtsExt__WithThreeJS__BoardProjection.BoardProjection = class BoardProjection extends gdjs.RuntimeBehavior { + constructor(instanceContainer, behaviorData, owner) { + super(instanceContainer, behaviorData, owner); + this._runtimeScene = instanceContainer; + + this._onceTriggers = new gdjs.OnceTriggers(); + this._behaviorData = {}; + this._sharedData = gdjs.evtsExt__WithThreeJS__BoardProjection.BoardProjection.getSharedData( + instanceContainer, + behaviorData.name + ); + + this._behaviorData.Id = ""; + this._behaviorData.FirstFrame = true; + this._behaviorData.CurrentTextureId = ""; + this._behaviorData.ProjectionScale = behaviorData.ProjectionScale !== undefined ? behaviorData.ProjectionScale : Number("0.01") || 0; + this._behaviorData.ViewMode = behaviorData.ViewMode !== undefined ? behaviorData.ViewMode : "Top Down"; + this._behaviorData.Hide = behaviorData.Hide !== undefined ? behaviorData.Hide : true; + this._behaviorData.AlphaTest = behaviorData.AlphaTest !== undefined ? behaviorData.AlphaTest : Number("0") || 0; + this._behaviorData.AntiAliasing = behaviorData.AntiAliasing !== undefined ? behaviorData.AntiAliasing : true; + this._behaviorData.AngleAxis = behaviorData.AngleAxis !== undefined ? behaviorData.AngleAxis : "Z Axis"; + this._behaviorData.Orientation = behaviorData.Orientation !== undefined ? behaviorData.Orientation : "Vertical"; + } + + // Hot-reload: + updateFromBehaviorData(oldBehaviorData, newBehaviorData) { + + if (oldBehaviorData.Id !== newBehaviorData.Id) + this._behaviorData.Id = newBehaviorData.Id; + if (oldBehaviorData.FirstFrame !== newBehaviorData.FirstFrame) + this._behaviorData.FirstFrame = newBehaviorData.FirstFrame; + if (oldBehaviorData.CurrentTextureId !== newBehaviorData.CurrentTextureId) + this._behaviorData.CurrentTextureId = newBehaviorData.CurrentTextureId; + if (oldBehaviorData.ProjectionScale !== newBehaviorData.ProjectionScale) + this._behaviorData.ProjectionScale = newBehaviorData.ProjectionScale; + if (oldBehaviorData.ViewMode !== newBehaviorData.ViewMode) + this._behaviorData.ViewMode = newBehaviorData.ViewMode; + if (oldBehaviorData.Hide !== newBehaviorData.Hide) + this._behaviorData.Hide = newBehaviorData.Hide; + if (oldBehaviorData.AlphaTest !== newBehaviorData.AlphaTest) + this._behaviorData.AlphaTest = newBehaviorData.AlphaTest; + if (oldBehaviorData.AntiAliasing !== newBehaviorData.AntiAliasing) + this._behaviorData.AntiAliasing = newBehaviorData.AntiAliasing; + if (oldBehaviorData.AngleAxis !== newBehaviorData.AngleAxis) + this._behaviorData.AngleAxis = newBehaviorData.AngleAxis; + if (oldBehaviorData.Orientation !== newBehaviorData.Orientation) + this._behaviorData.Orientation = newBehaviorData.Orientation; + + return true; + } + + // Properties: + + _getId() { + return this._behaviorData.Id !== undefined ? this._behaviorData.Id : ""; + } + _setId(newValue) { + this._behaviorData.Id = newValue; + } + _getFirstFrame() { + return this._behaviorData.FirstFrame !== undefined ? this._behaviorData.FirstFrame : true; + } + _setFirstFrame(newValue) { + this._behaviorData.FirstFrame = newValue; + } + _toggleFirstFrame() { + this._setFirstFrame(!this._getFirstFrame()); + } + _getCurrentTextureId() { + return this._behaviorData.CurrentTextureId !== undefined ? this._behaviorData.CurrentTextureId : ""; + } + _setCurrentTextureId(newValue) { + this._behaviorData.CurrentTextureId = newValue; + } + _getProjectionScale() { + return this._behaviorData.ProjectionScale !== undefined ? this._behaviorData.ProjectionScale : Number("0.01") || 0; + } + _setProjectionScale(newValue) { + this._behaviorData.ProjectionScale = newValue; + } + _getViewMode() { + return this._behaviorData.ViewMode !== undefined ? this._behaviorData.ViewMode : "Top Down"; + } + _setViewMode(newValue) { + this._behaviorData.ViewMode = newValue; + } + _getHide() { + return this._behaviorData.Hide !== undefined ? this._behaviorData.Hide : true; + } + _setHide(newValue) { + this._behaviorData.Hide = newValue; + } + _toggleHide() { + this._setHide(!this._getHide()); + } + _getAlphaTest() { + return this._behaviorData.AlphaTest !== undefined ? this._behaviorData.AlphaTest : Number("0") || 0; + } + _setAlphaTest(newValue) { + this._behaviorData.AlphaTest = newValue; + } + _getAntiAliasing() { + return this._behaviorData.AntiAliasing !== undefined ? this._behaviorData.AntiAliasing : true; + } + _setAntiAliasing(newValue) { + this._behaviorData.AntiAliasing = newValue; + } + _toggleAntiAliasing() { + this._setAntiAliasing(!this._getAntiAliasing()); + } + _getAngleAxis() { + return this._behaviorData.AngleAxis !== undefined ? this._behaviorData.AngleAxis : "Z Axis"; + } + _setAngleAxis(newValue) { + this._behaviorData.AngleAxis = newValue; + } + _getOrientation() { + return this._behaviorData.Orientation !== undefined ? this._behaviorData.Orientation : "Vertical"; + } + _setOrientation(newValue) { + this._behaviorData.Orientation = newValue; + } +} + +/** + * Shared data generated from 3D Board Projection (experimental) + */ +gdjs.evtsExt__WithThreeJS__BoardProjection.BoardProjection.SharedData = class BoardProjectionSharedData { + constructor(sharedData) { + + } + + // Shared properties: + +} + +gdjs.evtsExt__WithThreeJS__BoardProjection.BoardProjection.getSharedData = function(instanceContainer, behaviorName) { + if (!instanceContainer._WithThreeJS_BoardProjectionSharedData) { + const initialData = instanceContainer.getInitialSharedDataForBehavior( + behaviorName + ); + instanceContainer._WithThreeJS_BoardProjectionSharedData = new gdjs.evtsExt__WithThreeJS__BoardProjection.BoardProjection.SharedData( + initialData + ); + } + return instanceContainer._WithThreeJS_BoardProjectionSharedData; +} + +// Methods: +gdjs.evtsExt__WithThreeJS__BoardProjection.BoardProjection.prototype.doStepPostEventsContext = {}; +gdjs.evtsExt__WithThreeJS__BoardProjection.BoardProjection.prototype.doStepPostEventsContext.GDObjectObjects1= []; +gdjs.evtsExt__WithThreeJS__BoardProjection.BoardProjection.prototype.doStepPostEventsContext.GDObjectObjects2= []; + + +gdjs.evtsExt__WithThreeJS__BoardProjection.BoardProjection.prototype.doStepPostEventsContext.userFunc0xbaefb0 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +if (!gdjs.__WithThreeJS.has("Textures")) { + gdjs.__WithThreeJS.set("Textures", new Map()); +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +let Textures = gdjs.__WithThreeJS.get("Textures"); +// +const Behavior = objects[0].getBehavior("BoardProjection"); +const Id = objects[0].name + objects[0].id; +const ProjectionScale = Behavior.ProjectionScale(); +const ViewMode = Behavior.ViewMode(); +const AlphaTest = Behavior.AlphaTest(); +const Transparent = AlphaTest !== 0; +const AntiAliasing = Behavior.AntiAliasing(); +// +//スプライトのすべてのアニメーション画像を取得 +let AllAnimationSources = []; +for(const V of objects[0]._animations) { + for(const VV of V.directions[0].frames) { + AllAnimationSources.push(VV.texture.baseTexture.resource); + } +} +//その画像がTexturesに登録されているか確認。未登録の場合は作成。(SpriteProjectionと共通の命名規則) +for(const V of AllAnimationSources) { + const TexId = "_" + V.url; + if (!Textures.has(TexId)) { + const T = new THREE.Texture(); + T.image = V.source; + T.wrapS = THREE.MirroredRepeatWrapping; + T.wrapT = THREE.MirroredRepeatWrapping; + if (!AntiAliasing) { + T.magFilter = THREE.NearestFilter;// THREE.LinearFilter + T.minFilter = THREE.NearestFilter;// THREE.LinearMipmapLinearFilter + } + T.needsUpdate = true;//必須 + Textures.set(TexId, T); + //FlipX + const T_FlipX = T.clone(); + T_FlipX.offset.x = 1; + Textures.set(TexId + "_FlipX", T_FlipX); + //FlipY + const T_FlipY = T.clone(); + T_FlipY.offset.y = 1; + Textures.set(TexId + "_FlipY", T_FlipY); + //FlipXY + const T_FlipXY = T.clone(); + T_FlipXY.offset.x = 1; + T_FlipXY.offset.y = 1; + Textures.set(TexId + "_FlipX_FlipY", T_FlipXY); + } +} +// +const TextureId = "_" + objects[0].getRendererObject().texture.baseTexture.resource.url; +Behavior.SetCurrentTextureId(TextureId); +const Texture = Textures.get(TextureId); +const TextureWidth = Texture.image.width; +const TextureHeight = Texture.image.height; +const Material = new THREE.MeshBasicMaterial({map:Texture, side:THREE.DoubleSide, transparent:Transparent, alphaTest:AlphaTest});// blendingとopacityは2D依存 +const Geometry = new THREE.PlaneGeometry(TextureWidth * ProjectionScale, TextureHeight * ProjectionScale, 1, 1); +const Obj = new THREE.Mesh(Geometry, Material); +Obj.name = Id; +Obj.userData.Use3DProjectionBehavior = true; +Behavior.SetId(Id); +Scene.add(Obj); + + +}; +gdjs.evtsExt__WithThreeJS__BoardProjection.BoardProjection.prototype.doStepPostEventsContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(gdjs.evtsExt__WithThreeJS__BoardProjection.BoardProjection.prototype.doStepPostEventsContext.GDObjectObjects1, gdjs.evtsExt__WithThreeJS__BoardProjection.BoardProjection.prototype.doStepPostEventsContext.GDObjectObjects2); + + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__WithThreeJS__BoardProjection.BoardProjection.prototype.doStepPostEventsContext.GDObjectObjects2); +gdjs.evtsExt__WithThreeJS__BoardProjection.BoardProjection.prototype.doStepPostEventsContext.userFunc0xbaefb0(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +{ + +/* Reuse gdjs.evtsExt__WithThreeJS__BoardProjection.BoardProjection.prototype.doStepPostEventsContext.GDObjectObjects1 */ + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__WithThreeJS__BoardProjection.BoardProjection.prototype.doStepPostEventsContext.GDObjectObjects1.length;i= 0; i--){ + Obj.material[i].dispose(); + } +} else { + Obj.material.dispose(); +} +Obj.removeFromParent(); + + +}; +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.onDestroyContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.onDestroyContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.onDestroyContext.GDObjectObjects1); +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.onDestroyContext.userFunc0xc82438(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.onDestroy = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.onDestroyContext.GDObjectObjects1.length = 0; + +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.onDestroyContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.ProjectionScaleContext = {}; +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.ProjectionScaleContext.GDObjectObjects1= []; +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.ProjectionScaleContext.GDObjectObjects2= []; + + +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.ProjectionScaleContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.ProjectionScaleContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.ProjectionScaleContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.ProjectionScaleContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getProjectionScale()); }}} + +} + + +}; + +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.ProjectionScale = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.ProjectionScaleContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.ProjectionScaleContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.ProjectionScaleContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.ViewModeContext = {}; +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.ViewModeContext.GDObjectObjects1= []; +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.ViewModeContext.GDObjectObjects2= []; + + +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.ViewModeContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.ViewModeContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.ViewModeContext.GDObjectObjects1.length === 0 ) ? "" :gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.ViewModeContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getViewMode()); }}} + +} + + +}; + +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.ViewMode = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.ViewModeContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.ViewModeContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.ViewModeContext.eventsList0(runtimeScene, eventsFunctionContext); + +return "" + eventsFunctionContext.returnValue; +} +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.IdContext = {}; +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.IdContext.GDObjectObjects1= []; +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.IdContext.GDObjectObjects2= []; + + +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.IdContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.IdContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.IdContext.GDObjectObjects1.length === 0 ) ? "" :gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.IdContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getId()); }}} + +} + + +}; + +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.Id = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.IdContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.IdContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.IdContext.eventsList0(runtimeScene, eventsFunctionContext); + +return "" + eventsFunctionContext.returnValue; +} +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.AlphaTestContext = {}; +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.AlphaTestContext.GDObjectObjects1= []; +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.AlphaTestContext.GDObjectObjects2= []; + + +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.AlphaTestContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.AlphaTestContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.AlphaTestContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.AlphaTestContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getAlphaTest()); }}} + +} + + +}; + +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.AlphaTest = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.AlphaTestContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.AlphaTestContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.AlphaTestContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.BlendContext = {}; +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.BlendContext.GDObjectObjects1= []; +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.BlendContext.GDObjectObjects2= []; + + +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.BlendContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.BlendContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.BlendContext.GDObjectObjects1.length === 0 ) ? "" :gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.BlendContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getBlend()); }}} + +} + + +}; + +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.Blend = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.BlendContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.BlendContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.BlendContext.eventsList0(runtimeScene, eventsFunctionContext); + +return "" + eventsFunctionContext.returnValue; +} +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.AntiAliasingContext = {}; +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.AntiAliasingContext.GDObjectObjects1= []; +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.AntiAliasingContext.GDObjectObjects2= []; + + +gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.AntiAliasingContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.AntiAliasingContext.GDObjectObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__WithThreeJS__BoxProjectionFromTiled.BoxProjectionFromTiled.prototype.AntiAliasingContext.GDObjectObjects1.length;i + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__CameraAngle = {}; + + +gdjs.evtsExt__WithThreeJS__CameraAngle.userFunc0x13f3a20 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Camera = gdjs.__WithThreeJS.get("Camera"); +const Axis = eventsFunctionContext.getArgument("Axis"); +if (Axis == "X") { + // カメラの視点方向ベクトルと上方向ベクトルを作成 + let LDir = new THREE.Vector3(0, 0, -1); + LDir.applyQuaternion(Camera.quaternion); + const LUpA = new THREE.Vector3(0, 1, 0); + LUpA.applyQuaternion(Camera.quaternion); + // カメラの視点方向ベクトルを向いているM4を作成 + const M4 = new THREE.Matrix4(); + M4.lookAt(new THREE.Vector3(), LDir, new THREE.Vector3(0, 1, 0)); + // M4からQuaを作成し、さらに上方向ベクトルを作成 + const Qua = new THREE.Quaternion(); + Qua.setFromRotationMatrix(M4); + const LUpB = new THREE.Vector3(0, 1, 0); + LUpB.applyQuaternion(Qua); + // 角度 + let LZ = LDir.clone(); + LZ.y = 0;// LZ.projectOnPlane(new THREE.Vector3(0, 1, 0));// y=0のほうが単純 + let Deg = gdjs.toDegrees(LZ.angleTo(LDir)); + // 上方向ベクトルの角度差で+-を判断 + // console.log(gdjs.toDegrees(LUpA.angleTo(LUpB))); + if (LUpA.angleTo(LUpB) >= 1.57) {// Pi / 2 + Deg = 90 + (90 - Deg); + } + // + if (LDir.y >= 0) { + Deg *= -1; + } + eventsFunctionContext.returnValue = Deg; +} else if (Axis == "Y") { + let LDir = new THREE.Vector3(0, 0, -1); + LDir.applyQuaternion(Camera.quaternion); + LDir.y = 0; + LDir.normalize(); + let Deg = gdjs.toDegrees(new THREE.Vector3(0, 0, -1).angleTo(LDir)); + if (LDir.x < 0) { + Deg *= -1; + } + eventsFunctionContext.returnValue = Deg; +} else { + // カメラの視点方向ベクトルと上方向ベクトルを作成 + const LDir = new THREE.Vector3(0, 0, -1); + LDir.applyQuaternion(Camera.quaternion); + const LUpA = new THREE.Vector3(0, 1, 0); + LUpA.applyQuaternion(Camera.quaternion); + // カメラの視点方向ベクトルを向いているM4を作成 + const M4 = new THREE.Matrix4(); + M4.lookAt(new THREE.Vector3(), LDir, new THREE.Vector3(0, 1, 0)); + // M4からQuaを作成し、さらに上方向ベクトルを作成 + const Qua = new THREE.Quaternion(); + Qua.setFromRotationMatrix(M4); + const LUpB = new THREE.Vector3(0, 1, 0); + LUpB.applyQuaternion(Qua); + // 角度 + let Deg = gdjs.toDegrees(LUpA.angleTo(LUpB)); + // 外積と視点の角度差で+-を判断 + const Cross = new THREE.Vector3(); + Cross.crossVectors(LUpA, LUpB); + if (LDir.angleTo(Cross) >= 1.57) {// Pi / 2 + Deg *= -1; + } + // + eventsFunctionContext.returnValue = Deg; +} + + +}; +gdjs.evtsExt__WithThreeJS__CameraAngle.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__CameraAngle.userFunc0x13f3a20(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__CameraAngle.func = function(runtimeScene, Axis, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Axis") return Axis; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__CameraAngle.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__WithThreeJS__CameraAngle.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__cameralookat3dobject-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__cameralookat3dobject-func.js new file mode 100644 index 0000000..457062c --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__cameralookat3dobject-func.js @@ -0,0 +1,100 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__CameraLookAt3DObject !== "undefined") { + gdjs.evtsExt__WithThreeJS__CameraLookAt3DObject.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__CameraLookAt3DObject = {}; + + +gdjs.evtsExt__WithThreeJS__CameraLookAt3DObject.userFunc0xcf4f10 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Camera = gdjs.__WithThreeJS.get("Camera"); +const TargetId = eventsFunctionContext.getArgument("TargetId"); +// +const Obj = Scene.getObjectByName(TargetId); +if (!Obj) { + console.warn("3D Object not found."); + return; +} +// +Camera.lookAt(Obj.position); + + +}; +gdjs.evtsExt__WithThreeJS__CameraLookAt3DObject.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__CameraLookAt3DObject.userFunc0xcf4f10(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__CameraLookAt3DObject.func = function(runtimeScene, TargetId, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "TargetId") return TargetId; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__CameraLookAt3DObject.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__CameraLookAt3DObject.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__cameraposition-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__cameraposition-func.js new file mode 100644 index 0000000..e1b9184 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__cameraposition-func.js @@ -0,0 +1,98 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__CameraPosition !== "undefined") { + gdjs.evtsExt__WithThreeJS__CameraPosition.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__CameraPosition = {}; + + +gdjs.evtsExt__WithThreeJS__CameraPosition.userFunc0xcf4f10 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Camera = gdjs.__WithThreeJS.get("Camera"); +const Axis = eventsFunctionContext.getArgument("Axis"); +if (Axis == "X") { + eventsFunctionContext.returnValue = Camera.position.x; +} else if (Axis == "Y") { + eventsFunctionContext.returnValue = Camera.position.y; +} else { + eventsFunctionContext.returnValue = Camera.position.z; +} + + +}; +gdjs.evtsExt__WithThreeJS__CameraPosition.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__CameraPosition.userFunc0xcf4f10(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__CameraPosition.func = function(runtimeScene, Axis, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Axis") return Axis; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__CameraPosition.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__WithThreeJS__CameraPosition.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__camerarotation-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__camerarotation-func.js new file mode 100644 index 0000000..c3ef0c3 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__camerarotation-func.js @@ -0,0 +1,98 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__CameraRotation !== "undefined") { + gdjs.evtsExt__WithThreeJS__CameraRotation.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__CameraRotation = {}; + + +gdjs.evtsExt__WithThreeJS__CameraRotation.userFunc0xcf4f10 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Camera = gdjs.__WithThreeJS.get("Camera"); +const Axis = eventsFunctionContext.getArgument("Axis"); +if (Axis == "X") { + eventsFunctionContext.returnValue = gdjs.toDegrees(Camera.rotation.x); +} else if (Axis == "Y") { + eventsFunctionContext.returnValue = gdjs.toDegrees(Camera.rotation.y); +} else { + eventsFunctionContext.returnValue = gdjs.toDegrees(Camera.rotation.z); +} + + +}; +gdjs.evtsExt__WithThreeJS__CameraRotation.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__CameraRotation.userFunc0xcf4f10(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__CameraRotation.func = function(runtimeScene, Axis, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Axis") return Axis; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__CameraRotation.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__WithThreeJS__CameraRotation.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__change3dtexture-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__change3dtexture-func.js new file mode 100644 index 0000000..8992ad7 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__change3dtexture-func.js @@ -0,0 +1,117 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__Change3DTexture !== "undefined") { + gdjs.evtsExt__WithThreeJS__Change3DTexture.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__Change3DTexture = {}; + + +gdjs.evtsExt__WithThreeJS__Change3DTexture.userFunc0x13e7f88 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +if (!gdjs.__WithThreeJS.has("Textures")) { + console.warn("!"); + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Textures = gdjs.__WithThreeJS.get("Textures"); +// +const Id = eventsFunctionContext.getArgument("Id"); +const TextureIdList = eventsFunctionContext.getArgument("TextureIdList"); +// +const Obj = Scene.getObjectByName(Id); +if (!Obj) { + console.warn("3D Object not found."); + return; +} +let TextureList = []; +for (const V of TextureIdList.split("\n")) { + if (V != "") { + if (!Textures.has(V)) { + console.warn("3D Texture not found."); + } else { + TextureList.push(Textures.get(V)); + } + } +} +// +gdjs.__WithThreeJS.get("SettingRecursiveTextures")(Obj, TextureList); + + +}; +gdjs.evtsExt__WithThreeJS__Change3DTexture.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__Change3DTexture.userFunc0x13e7f88(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__Change3DTexture.func = function(runtimeScene, Id, TextureIdList, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Id") return Id; +if (argName === "TextureIdList") return TextureIdList; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__Change3DTexture.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__Change3DTexture.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__changedepthwrite-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__changedepthwrite-func.js new file mode 100644 index 0000000..ec9062e --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__changedepthwrite-func.js @@ -0,0 +1,108 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__ChangeDepthWrite !== "undefined") { + gdjs.evtsExt__WithThreeJS__ChangeDepthWrite.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__ChangeDepthWrite = {}; + + +gdjs.evtsExt__WithThreeJS__ChangeDepthWrite.userFunc0x13e7f88 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +// +const Id = eventsFunctionContext.getArgument("Id"); +const Write = eventsFunctionContext.getArgument("Write"); +// +const Obj = Scene.getObjectByName(Id); +if (!Obj) { + console.warn("3D Object not found."); + return; +} +// +if (Array.isArray(Obj.material)) { + for (let i = 0; i < Obj.material.length; i++) { + Obj.material.depthWrite = Write; + } +} else { + Obj.material.depthWrite = Write; +} + + +}; +gdjs.evtsExt__WithThreeJS__ChangeDepthWrite.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__ChangeDepthWrite.userFunc0x13e7f88(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__ChangeDepthWrite.func = function(runtimeScene, Id, Write, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Id") return Id; +if (argName === "Write") return Write; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__ChangeDepthWrite.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__ChangeDepthWrite.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__changeopacity-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__changeopacity-func.js new file mode 100644 index 0000000..a0b7911 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__changeopacity-func.js @@ -0,0 +1,136 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__ChangeOpacity !== "undefined") { + gdjs.evtsExt__WithThreeJS__ChangeOpacity.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__ChangeOpacity = {}; + + +gdjs.evtsExt__WithThreeJS__ChangeOpacity.userFunc0x13e7f88 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +// +const Id = eventsFunctionContext.getArgument("Id"); +const Operator = eventsFunctionContext.getArgument("Operator"); +const Opacity = eventsFunctionContext.getArgument("Opacity"); +// +const Obj = Scene.getObjectByName(Id); +if (!Obj) { + console.warn("3D Object not found."); + return; +} +// +if (Array.isArray(Obj.material)) { + for (let i = 0; i < Obj.material.length; i++) { + // Obj.material[i].transparent = (Obj.material[i].alphaTest !== 0 || Opacity !== 1); + if (!Obj.material[i].transparent) { + Obj.material[i].transparent = true; + Obj.material[i].needsUpdate = true; + } + if (Operator == "=") { + Obj.material[i].opacity = Opacity; + } else if (Operator == "+") { + Obj.material[i].opacity += Opacity; + } else { + Obj.material[i].opacity -= Opacity; + } + if (Obj.material[i].opacity < 0) Obj.material[i].opacity = 0; + if (Obj.material[i].opacity > 1) Obj.material[i].opacity = 1; + } +} else { + // Obj.material.transparent = (Obj.material.alphaTest !== 0 || Opacity !== 1); + if (!Obj.material.transparent) { + Obj.material.transparent = true; + Obj.material.needsUpdate = true; + } + if (Operator == "=") { + Obj.material.opacity = Opacity; + } else if (Operator == "+") { + Obj.material.opacity += Opacity; + } else { + Obj.material.opacity -= Opacity; + } + if (Obj.material.opacity < 0) Obj.material.opacity = 0; + if (Obj.material.opacity > 1) Obj.material.opacity = 1; +} + + +}; +gdjs.evtsExt__WithThreeJS__ChangeOpacity.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__ChangeOpacity.userFunc0x13e7f88(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__ChangeOpacity.func = function(runtimeScene, Id, Operator, Opacity, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Id") return Id; +if (argName === "Operator") return Operator; +if (argName === "Opacity") return Opacity; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__ChangeOpacity.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__ChangeOpacity.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__changescale-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__changescale-func.js new file mode 100644 index 0000000..2e8d836 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__changescale-func.js @@ -0,0 +1,139 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__ChangeScale !== "undefined") { + gdjs.evtsExt__WithThreeJS__ChangeScale.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__ChangeScale = {}; + + +gdjs.evtsExt__WithThreeJS__ChangeScale.userFunc0x13e7f88 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Id = eventsFunctionContext.getArgument("Id"); +const Operator = eventsFunctionContext.getArgument("Operator"); +const X = eventsFunctionContext.getArgument("X"); +const Y = eventsFunctionContext.getArgument("Y"); +const Z = eventsFunctionContext.getArgument("Z"); +// +const Obj = Scene.getObjectByName(Id); +if (!Obj) { + console.warn("3D Object not found."); + return; +} +// +if (Obj.isSprite) { + const Texture = Obj.material.map; + const TextureWidth = Texture.image.width; + const TextureHeight = Texture.image.height; + if (Operator == "=") { + Obj.scale.set(TextureWidth * X, TextureHeight * Y, 1); + } else if (Operator == "+") { + Obj.scale.x += TextureWidth * X; + Obj.scale.y += TextureHeight * Y; + } else if (Operator == "-") { + Obj.scale.x -= TextureWidth * X; + Obj.scale.y -= TextureHeight * Y; + } else { + Obj.scale.x *= TextureWidth * X; + Obj.scale.y *= TextureHeight * Y; + } +} else { + if (Operator == "=") { + Obj.scale.set(X, Y, Z); + } else if (Operator == "+") { + Obj.scale.x += X; + Obj.scale.y += Y; + Obj.scale.z += Z; + } else if (Operator == "-") { + Obj.scale.x -= X; + Obj.scale.y -= Y; + Obj.scale.z -= Z; + } else { + Obj.scale.x *= X; + Obj.scale.y *= Y; + Obj.scale.z *= Z; + } +} + + +}; +gdjs.evtsExt__WithThreeJS__ChangeScale.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__ChangeScale.userFunc0x13e7f88(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__ChangeScale.func = function(runtimeScene, Id, Operator, X, Y, Z, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Id") return Id; +if (argName === "Operator") return Operator; +if (argName === "X") return X; +if (argName === "Y") return Y; +if (argName === "Z") return Z; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__ChangeScale.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__ChangeScale.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__changevisibility-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__changevisibility-func.js new file mode 100644 index 0000000..b4db341 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__changevisibility-func.js @@ -0,0 +1,101 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__ChangeVisibility !== "undefined") { + gdjs.evtsExt__WithThreeJS__ChangeVisibility.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__ChangeVisibility = {}; + + +gdjs.evtsExt__WithThreeJS__ChangeVisibility.userFunc0x13e7f88 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +// +const Id = eventsFunctionContext.getArgument("Id"); +const Visible = eventsFunctionContext.getArgument("Visible"); +// +const Obj = Scene.getObjectByName(Id); +if (!Obj) { + console.warn("3D Object not found."); + return; +} +Obj.visible = Visible; + + +}; +gdjs.evtsExt__WithThreeJS__ChangeVisibility.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__ChangeVisibility.userFunc0x13e7f88(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__ChangeVisibility.func = function(runtimeScene, Id, Visible, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Id") return Id; +if (argName === "Visible") return Visible; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__ChangeVisibility.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__ChangeVisibility.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__checkexistenceof3dobject-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__checkexistenceof3dobject-func.js new file mode 100644 index 0000000..3dc6d66 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__checkexistenceof3dobject-func.js @@ -0,0 +1,98 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__CheckExistenceOf3DObject !== "undefined") { + gdjs.evtsExt__WithThreeJS__CheckExistenceOf3DObject.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__CheckExistenceOf3DObject = {}; + + +gdjs.evtsExt__WithThreeJS__CheckExistenceOf3DObject.userFunc0xb6aef8 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Id = eventsFunctionContext.getArgument("Id"); +// +const Obj = Scene.getObjectByName(Id); +if (Obj) { + eventsFunctionContext.returnValue = true; +} else { + eventsFunctionContext.returnValue = false; +} + + +}; +gdjs.evtsExt__WithThreeJS__CheckExistenceOf3DObject.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__CheckExistenceOf3DObject.userFunc0xb6aef8(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__CheckExistenceOf3DObject.func = function(runtimeScene, Id, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Id") return Id; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__CheckExistenceOf3DObject.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__WithThreeJS__CheckExistenceOf3DObject.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__checkvisibilityof3dobject-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__checkvisibilityof3dobject-func.js new file mode 100644 index 0000000..88a37ac --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__checkvisibilityof3dobject-func.js @@ -0,0 +1,100 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__CheckVisibilityOf3DObject !== "undefined") { + gdjs.evtsExt__WithThreeJS__CheckVisibilityOf3DObject.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__CheckVisibilityOf3DObject = {}; + + +gdjs.evtsExt__WithThreeJS__CheckVisibilityOf3DObject.userFunc0x13e7f88 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Id = eventsFunctionContext.getArgument("Id"); +const Visible = eventsFunctionContext.getArgument("Visible"); +// +const Obj = Scene.getObjectByName(Id); +if (!Obj) { + console.warn("3D Object not found."); + return; +} +eventsFunctionContext.returnValue = Obj.visible === Visible; + + +}; +gdjs.evtsExt__WithThreeJS__CheckVisibilityOf3DObject.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__CheckVisibilityOf3DObject.userFunc0x13e7f88(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__CheckVisibilityOf3DObject.func = function(runtimeScene, Id, Visible, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Id") return Id; +if (argName === "Visible") return Visible; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__CheckVisibilityOf3DObject.eventsList0(runtimeScene, eventsFunctionContext); + +return !!eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__WithThreeJS__CheckVisibilityOf3DObject.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__clear3dscene-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__clear3dscene-func.js new file mode 100644 index 0000000..5d3b6e3 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__clear3dscene-func.js @@ -0,0 +1,122 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__Clear3DScene !== "undefined") { + gdjs.evtsExt__WithThreeJS__Clear3DScene.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__Clear3DScene = {}; + + +gdjs.evtsExt__WithThreeJS__Clear3DScene.userFunc0x7168a0 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Renderer = gdjs.__WithThreeJS.get("Renderer"); +let Scene = gdjs.__WithThreeJS.get("Scene"); +// +const All = runtimeScene.getAdhocListOfAllInstances(); +for (let i = All.length - 1; i >= 0; i--){ + if ( + All[i].hasBehavior("SpriteProjection") + || All[i].hasBehavior("BoardProjection") + || All[i].hasBehavior("PlaneProjectionFromTiled") + || All[i].hasBehavior("BoxProjectionFromTiled") + || All[i].hasBehavior("BoardProjectionLooksAtCamera") + || All[i].hasBehavior("BoxProjectionFromTiledwOffset") + || All[i].hasBehavior("LinkedCameraWithHeadMovement") + || All[i].hasBehavior("LinkedCameraWithVRHead") + ) { + All[i].deleteFromScene(runtimeScene); + } +} +Scene.clear(); + +gdjs.__WithThreeJS.lightLoaded = false; + +// remove all objects from the scene +while (Scene.children.length > 0) { + Scene.remove(Scene.children[0]); +} + +// dispose renderer +Renderer.dispose(); + +// clear reference to the scene +Scene = null; + + + + +}; +gdjs.evtsExt__WithThreeJS__Clear3DScene.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__Clear3DScene.userFunc0x7168a0(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__Clear3DScene.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__Clear3DScene.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__Clear3DScene.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__create3daxeshelper-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__create3daxeshelper-func.js new file mode 100644 index 0000000..28e8001 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__create3daxeshelper-func.js @@ -0,0 +1,102 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__Create3DAxesHelper !== "undefined") { + gdjs.evtsExt__WithThreeJS__Create3DAxesHelper.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__Create3DAxesHelper = {}; + + +gdjs.evtsExt__WithThreeJS__Create3DAxesHelper.userFunc0xbddb20 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +// +const ParentId = eventsFunctionContext.getArgument("ParentId"); +const Size = eventsFunctionContext.getArgument("Size"); +// +const Parent = Scene.getObjectByName(ParentId); +if (!Parent) { + console.warn("Parent 3D Object not found."); + return; +} +// +const AxesHelper = new THREE.AxesHelper(Size); +AxesHelper.name = "AxesHelper"; +Parent.add(AxesHelper); +}; +gdjs.evtsExt__WithThreeJS__Create3DAxesHelper.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__Create3DAxesHelper.userFunc0xbddb20(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__Create3DAxesHelper.func = function(runtimeScene, ParentId, Size, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ParentId") return ParentId; +if (argName === "Size") return Size; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__Create3DAxesHelper.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__Create3DAxesHelper.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__create3dbox-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__create3dbox-func.js new file mode 100644 index 0000000..c4e641d --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__create3dbox-func.js @@ -0,0 +1,161 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__Create3DBox !== "undefined") { + gdjs.evtsExt__WithThreeJS__Create3DBox.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__Create3DBox = {}; + + +gdjs.evtsExt__WithThreeJS__Create3DBox.userFunc0x13b7958 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +if (!gdjs.__WithThreeJS.has("Textures")) { + console.warn("!"); + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Textures = gdjs.__WithThreeJS.get("Textures"); +// +const Id = eventsFunctionContext.getArgument("Id"); +const X = eventsFunctionContext.getArgument("X"); +const Y = eventsFunctionContext.getArgument("Y"); +const Z = eventsFunctionContext.getArgument("Z"); +const AngleX = eventsFunctionContext.getArgument("AngleX"); +const AngleY = eventsFunctionContext.getArgument("AngleY"); +const AngleZ = eventsFunctionContext.getArgument("AngleZ"); +const Width = eventsFunctionContext.getArgument("Width"); +const Height = eventsFunctionContext.getArgument("Height"); +const Depth = eventsFunctionContext.getArgument("Depth"); +const TextureIdList = eventsFunctionContext.getArgument("TextureIdList"); +const AlphaTest = eventsFunctionContext.getArgument("AlphaTest"); +const Opacity = eventsFunctionContext.getArgument("Opacity"); +const Transparent = (AlphaTest !== 0 || Opacity !== 1); +let Blend = THREE.NormalBlending; +if (eventsFunctionContext.getArgument("Blend") == "Additive") { + Blend = THREE.AdditiveBlending; +} else if (eventsFunctionContext.getArgument("Blend") == "Subtractive") { + Blend = THREE.SubtractiveBlending; +} else if (eventsFunctionContext.getArgument("Blend") == "Multiply") { + Blend = THREE.MultiplyBlending; +} +// +let TextureList = []; +for (const V of TextureIdList.split("\n")) { + if (V != "") { + if (!Textures.has(V)) { + console.warn("3D Texture not found."); + } else { + TextureList.push(Textures.get(V)); + } + } +} +// +let Materials; +if (TextureList.length === 1) { + Materials = new THREE.MeshBasicMaterial({map:TextureList[0], transparent:Transparent, alphaTest:AlphaTest, blending:Blend, opacity:Opacity}); +} else if (TextureList.length == 6) { + Materials = []; + for (let i = 0; i < TextureList.length; i++) { + Materials.push(new THREE.MeshBasicMaterial({map:TextureList[i], transparent:Transparent, alphaTest:AlphaTest, blending:Blend, opacity:Opacity}));//side:THREE.FrontSide, transparent:false, alphaTest:0, opacity:1.0 + } +} else { + console.warn("Requires 1 or 6 Texture IDs"); + return; +} +const Geometry = new THREE.BoxGeometry(Width, Height, Depth); +const Box = new THREE.Mesh(Geometry, Materials); +Box.position.set(X, Y, Z); +Box.rotation.set(gdjs.toRad(AngleX), gdjs.toRad(AngleY), gdjs.toRad(AngleZ)); +Box.name = Id; +Scene.add(Box); + + +}; +gdjs.evtsExt__WithThreeJS__Create3DBox.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__Create3DBox.userFunc0x13b7958(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__Create3DBox.func = function(runtimeScene, Id, X, Y, Z, AngleX, AngleY, AngleZ, Width, Height, Depth, TextureIdList, AlphaTest, Opacity, Blend, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Id") return Id; +if (argName === "X") return X; +if (argName === "Y") return Y; +if (argName === "Z") return Z; +if (argName === "AngleX") return AngleX; +if (argName === "AngleY") return AngleY; +if (argName === "AngleZ") return AngleZ; +if (argName === "Width") return Width; +if (argName === "Height") return Height; +if (argName === "Depth") return Depth; +if (argName === "TextureIdList") return TextureIdList; +if (argName === "AlphaTest") return AlphaTest; +if (argName === "Opacity") return Opacity; +if (argName === "Blend") return Blend; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__Create3DBox.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__Create3DBox.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__create3dmodel-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__create3dmodel-func.js new file mode 100644 index 0000000..5a2999a --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__create3dmodel-func.js @@ -0,0 +1,159 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__Create3DModel !== "undefined") { + gdjs.evtsExt__WithThreeJS__Create3DModel.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__Create3DModel = {}; + + +gdjs.evtsExt__WithThreeJS__Create3DModel.userFunc0x13b7958 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +if (!gdjs.__WithThreeJS.has("Textures")) { + console.warn("!"); + return; +} +if (!gdjs.__WithThreeJS.has("Models")) { + console.warn("!"); + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Textures = gdjs.__WithThreeJS.get("Textures"); +const Models = gdjs.__WithThreeJS.get("Models"); +// +const ModelId = eventsFunctionContext.getArgument("ModelId"); +const Id = eventsFunctionContext.getArgument("Id"); +const X = eventsFunctionContext.getArgument("X"); +const Y = eventsFunctionContext.getArgument("Y"); +const Z = eventsFunctionContext.getArgument("Z"); +const AngleX = eventsFunctionContext.getArgument("AngleX"); +const AngleY = eventsFunctionContext.getArgument("AngleY"); +const AngleZ = eventsFunctionContext.getArgument("AngleZ"); +const Scale = eventsFunctionContext.getArgument("Scale"); +const TextureIdList = eventsFunctionContext.getArgument("TextureIdList"); +const AlphaTest = eventsFunctionContext.getArgument("AlphaTest"); +const Opacity = eventsFunctionContext.getArgument("Opacity"); +const Transparent = (AlphaTest !== 0 || Opacity !== 1); +let Blend = THREE.NormalBlending; +if (eventsFunctionContext.getArgument("Blend") == "Additive") { + Blend = THREE.AdditiveBlending; +} else if (eventsFunctionContext.getArgument("Blend") == "Subtractive") { + Blend = THREE.SubtractiveBlending; +} else if (eventsFunctionContext.getArgument("Blend") == "Multiply") { + Blend = THREE.MultiplyBlending; +} +// +let TextureList = []; +for (const V of TextureIdList.split("\n")) { + if (V != "") { + if (!Textures.has(V)) { + console.warn("3D Texture not found."); + } else { + TextureList.push(Textures.get(V)); + } + } +} +// +if (!Models.has(ModelId)) { + console.warn("3D Model not found."); + return; +} +// +const Model = Models.get(ModelId).clone(); +gdjs.__WithThreeJS.get("AllMaterialClone")(Model, Transparent, AlphaTest, Blend, Opacity); +Model.position.set(X, Y, Z); +Model.rotation.set(gdjs.toRad(AngleX), gdjs.toRad(AngleY), gdjs.toRad(AngleZ)); +Model.name = Id; +Model.scale.setScalar(Scale); +gdjs.__WithThreeJS.get("SettingRecursiveTextures")(Model, TextureList); +Scene.add(Model); + + +}; +gdjs.evtsExt__WithThreeJS__Create3DModel.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__Create3DModel.userFunc0x13b7958(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__Create3DModel.func = function(runtimeScene, ModelId, Id, X, Y, Z, AngleX, AngleY, AngleZ, Scale, TextureIdList, AlphaTest, Opacity, Blend, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ModelId") return ModelId; +if (argName === "Id") return Id; +if (argName === "X") return X; +if (argName === "Y") return Y; +if (argName === "Z") return Z; +if (argName === "AngleX") return AngleX; +if (argName === "AngleY") return AngleY; +if (argName === "AngleZ") return AngleZ; +if (argName === "Scale") return Scale; +if (argName === "TextureIdList") return TextureIdList; +if (argName === "AlphaTest") return AlphaTest; +if (argName === "Opacity") return Opacity; +if (argName === "Blend") return Blend; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__Create3DModel.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__Create3DModel.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__create3dplane-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__create3dplane-func.js new file mode 100644 index 0000000..f2cf158 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__create3dplane-func.js @@ -0,0 +1,141 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__Create3DPlane !== "undefined") { + gdjs.evtsExt__WithThreeJS__Create3DPlane.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__Create3DPlane = {}; + + +gdjs.evtsExt__WithThreeJS__Create3DPlane.userFunc0x13b7958 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +if (!gdjs.__WithThreeJS.has("Textures")) { + console.warn("!"); + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Textures = gdjs.__WithThreeJS.get("Textures"); +const TextureId = eventsFunctionContext.getArgument("TextureId"); +if (!Textures.has(TextureId)) { + console.warn("3D Texture not found."); + return; +} +const Id = eventsFunctionContext.getArgument("Id"); +const X = eventsFunctionContext.getArgument("X"); +const Y = eventsFunctionContext.getArgument("Y"); +const Z = eventsFunctionContext.getArgument("Z"); +const AngleX = eventsFunctionContext.getArgument("AngleX"); +const AngleY = eventsFunctionContext.getArgument("AngleY"); +const AngleZ = eventsFunctionContext.getArgument("AngleZ"); +const Width = eventsFunctionContext.getArgument("Width"); +const Height = eventsFunctionContext.getArgument("Height"); +const AlphaTest = eventsFunctionContext.getArgument("AlphaTest"); +const Opacity = eventsFunctionContext.getArgument("Opacity"); +const Transparent = (AlphaTest !== 0 || Opacity !== 1); +let Blend = THREE.NormalBlending; +if (eventsFunctionContext.getArgument("Blend") == "Additive") { + Blend = THREE.AdditiveBlending; +} else if (eventsFunctionContext.getArgument("Blend") == "Subtractive") { + Blend = THREE.SubtractiveBlending; +} else if (eventsFunctionContext.getArgument("Blend") == "Multiply") { + Blend = THREE.MultiplyBlending; +} +// +const Texture = Textures.get(TextureId); +const Material = new THREE.MeshBasicMaterial({map: Texture, side: THREE.DoubleSide, transparent:Transparent, alphaTest:AlphaTest, blending:Blend, opacity:Opacity});//transparent:false, alphaTest:0, opacity:1.0 +const Geometry = new THREE.PlaneGeometry(Width, Height, 1, 1); +const Plane = new THREE.Mesh(Geometry, Material); +Plane.position.set(X, Y, Z); +Plane.rotation.set(gdjs.toRad(AngleX), gdjs.toRad(AngleY), gdjs.toRad(AngleZ)); +Plane.name = Id; +Scene.add(Plane); + + +}; +gdjs.evtsExt__WithThreeJS__Create3DPlane.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__Create3DPlane.userFunc0x13b7958(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__Create3DPlane.func = function(runtimeScene, Id, X, Y, Z, AngleX, AngleY, AngleZ, Width, Height, TextureId, AlphaTest, Opacity, Blend, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Id") return Id; +if (argName === "X") return X; +if (argName === "Y") return Y; +if (argName === "Z") return Z; +if (argName === "AngleX") return AngleX; +if (argName === "AngleY") return AngleY; +if (argName === "AngleZ") return AngleZ; +if (argName === "Width") return Width; +if (argName === "Height") return Height; +if (argName === "TextureId") return TextureId; +if (argName === "AlphaTest") return AlphaTest; +if (argName === "Opacity") return Opacity; +if (argName === "Blend") return Blend; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__Create3DPlane.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__Create3DPlane.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__create3dscene-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__create3dscene-func.js new file mode 100644 index 0000000..0d60473 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__create3dscene-func.js @@ -0,0 +1,209 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__Create3DScene !== "undefined") { + gdjs.evtsExt__WithThreeJS__Create3DScene.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__Create3DScene = {}; + + +gdjs.evtsExt__WithThreeJS__Create3DScene.userFunc0x7168a0 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +// console.log("Three.js create scene"); +// GDの背景を黒くした上で透明にする +runtimeScene.setBackgroundColor(0,0,0); +runtimeScene.getRenderer().getPIXIRenderer().backgroundAlpha = 0; +// +// if (gdjs.__WithThreeJS.has("Renderer")) { +// console.warn("!"); +// return; +// } +// +const Canvas2D = document.getElementsByTagName("canvas")[0]; +const Rect = Canvas2D.getBoundingClientRect(); +let Scene; +if (gdjs.__WithThreeJS.has("Scene")) { + Scene = gdjs.__WithThreeJS.get("Scene"); +} else { + Scene = new THREE.Scene(); +} +Scene.name ="Scene"; +// +const Fov = eventsFunctionContext.getArgument("Fov") || 50; +const BG_RGB = eventsFunctionContext.getArgument("BackGroundColor") || "0;0;0"; +const BG_Img = eventsFunctionContext.getArgument("BackGroundImage") || ""; +const FogColor = eventsFunctionContext.getArgument("FogColor") || ""; +const FogNear = eventsFunctionContext.getArgument("FogNear") || 1; +const FogFar = eventsFunctionContext.getArgument("FogFar") || 1000; +// +if (Scene.background) { + if (Scene.background.isTexture) { + Scene.background.dispose(); + Scene.background = null; + } +} +// +if (BG_Img !== "") { + const Resource = runtimeScene.getGame().getImageManager().getPIXITexture(BG_Img).baseTexture.resource; + const ResourceWidth = Resource.width; + const ResourceHeight = Resource.height; + const BGTexture = new THREE.Texture(); + BGTexture.image = Resource.source; + if (ResourceWidth == ResourceHeight * 2) { + BGTexture.mapping = THREE.EquirectangularReflectionMapping; + } + BGTexture.needsUpdate = true;//必須 + Scene.background = BGTexture; +} else { + const RGB = BG_RGB.split(";"); + Scene.background = new THREE.Color(`rgb(${RGB[0]}, ${RGB[1]}, ${RGB[2]})`); +} +// +if (FogColor === "") { + Scene.fog = null; +} else { + const RGB = FogColor.split(";"); + Scene.fog = new THREE.Fog(`rgb(${RGB[0]}, ${RGB[1]}, ${RGB[2]})`, FogNear, FogFar); + // Scene.fog = new THREE.FogExp2("rgb(0,0,0)", 0.005); +} +gdjs.__WithThreeJS.set("Scene", Scene); +// +let Camera; +if (gdjs.__WithThreeJS.has("Camera")) { + Camera = gdjs.__WithThreeJS.get("Camera"); +} else { + Camera = new THREE.PerspectiveCamera(); +} +Camera.name ="Camera"; +Camera.fov = Fov; +// Camera.aspect = window.innerWidth / window.innerHeight; +Camera.aspect = Rect.width / Rect.height; +Camera.near = 0.1; +Camera.far = 1000; +Camera.position.set(0, 0, 0); +Camera.rotation.set(0, 0, 0); +Camera.updateProjectionMatrix();//必須 +gdjs.__WithThreeJS.set("Camera", Camera); +// +let Renderer; +if (gdjs.__WithThreeJS.has("Renderer")) { + Renderer = gdjs.__WithThreeJS.get("Renderer"); +} else { + Renderer = new THREE.WebGLRenderer(); + document.body.appendChild( Renderer.domElement ); +} +Renderer.setPixelRatio(window.devicePixelRatio); +// Renderer.setSize( window.innerWidth, window.innerHeight ); +Renderer.setSize(Rect.width, Rect.height); +Renderer.domElement.style.position = "absolute"; +Renderer.domElement.style.zIndex = -99; +Renderer.domElement.style.left = Rect.left + "px"; +Renderer.domElement.style.top = Rect.top + "px"; +gdjs.__WithThreeJS.set("Renderer", Renderer); + +// Resize +window.addEventListener('resize', () => { + // const width = window.innerWidth; + // const height = window.innerHeight; + // Renderer.setPixelRatio(window.devicePixelRatio); + // Renderer.setSize(width, height); + // Camera.aspect = width / height; + // Camera.updateProjectionMatrix(); + + const Rect = Canvas2D.getBoundingClientRect(); + + // レンダラーのサイズを調整する + Renderer.setPixelRatio(window.devicePixelRatio); + Renderer.setSize(Rect.width, Rect.height); + + // カメラのアスペクト比を正す + Camera.aspect = Rect.width / Rect.height; + Camera.updateProjectionMatrix(); + + // CSS + Renderer.domElement.style.position = "absolute"; + Renderer.domElement.style.zIndex = -99; + Renderer.domElement.style.left = Rect.left + "px"; + Renderer.domElement.style.top = Rect.top + "px"; + +}); + + + +}; +gdjs.evtsExt__WithThreeJS__Create3DScene.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__Create3DScene.userFunc0x7168a0(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__Create3DScene.func = function(runtimeScene, Fov, BackGroundColor, BackGroundImage, FogColor, FogNear, FogFar, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Fov") return Fov; +if (argName === "BackGroundColor") return BackGroundColor; +if (argName === "BackGroundImage") return BackGroundImage; +if (argName === "FogColor") return FogColor; +if (argName === "FogNear") return FogNear; +if (argName === "FogFar") return FogFar; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__Create3DScene.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__Create3DScene.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__create3dsprite-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__create3dsprite-func.js new file mode 100644 index 0000000..be5916a --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__create3dsprite-func.js @@ -0,0 +1,134 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__Create3DSprite !== "undefined") { + gdjs.evtsExt__WithThreeJS__Create3DSprite.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__Create3DSprite = {}; + + +gdjs.evtsExt__WithThreeJS__Create3DSprite.userFunc0x15341d0 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +if (!gdjs.__WithThreeJS.has("Textures")) { + console.warn("!"); + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Textures = gdjs.__WithThreeJS.get("Textures"); +const TextureId = eventsFunctionContext.getArgument("TextureId"); +if (!Textures.has(TextureId)) { + console.warn("3D Texture not found."); + return; +} +const Id = eventsFunctionContext.getArgument("Id"); +const X = eventsFunctionContext.getArgument("X"); +const Y = eventsFunctionContext.getArgument("Y"); +const Z = eventsFunctionContext.getArgument("Z"); +const Scale = eventsFunctionContext.getArgument("Scale"); +const AlphaTest = eventsFunctionContext.getArgument("AlphaTest"); +const Opacity = eventsFunctionContext.getArgument("Opacity"); +const Transparent = (AlphaTest !== 0 || Opacity !== 1); +let Blend = THREE.NormalBlending; +if (eventsFunctionContext.getArgument("Blend") == "Additive") { + Blend = THREE.AdditiveBlending; +} else if (eventsFunctionContext.getArgument("Blend") == "Subtractive") { + Blend = THREE.SubtractiveBlending; +} else if (eventsFunctionContext.getArgument("Blend") == "Multiply") { + Blend = THREE.MultiplyBlending; +} +// +const Texture = Textures.get(TextureId); +const TextureWidth = Texture.image.width; +const TextureHeight = Texture.image.height; +const Material = new THREE.SpriteMaterial({map:Texture, transparent:Transparent, alphaTest:AlphaTest, blending:Blend, opacity:Opacity}); +const Sprite = new THREE.Sprite(Material); +Sprite.position.set(X, Y, Z); +Sprite.scale.set(TextureWidth * Scale, TextureHeight * Scale, 1); +Sprite.name = Id; +Scene.add(Sprite); + + +}; +gdjs.evtsExt__WithThreeJS__Create3DSprite.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__Create3DSprite.userFunc0x15341d0(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__Create3DSprite.func = function(runtimeScene, Id, X, Y, Z, Scale, TextureId, AlphaTest, Opacity, Blend, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Id") return Id; +if (argName === "X") return X; +if (argName === "Y") return Y; +if (argName === "Z") return Z; +if (argName === "Scale") return Scale; +if (argName === "TextureId") return TextureId; +if (argName === "AlphaTest") return AlphaTest; +if (argName === "Opacity") return Opacity; +if (argName === "Blend") return Blend; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__Create3DSprite.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__Create3DSprite.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__distancefrom3dcamerato3dobject-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__distancefrom3dcamerato3dobject-func.js new file mode 100644 index 0000000..8a829a0 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__distancefrom3dcamerato3dobject-func.js @@ -0,0 +1,104 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__DistanceFrom3DCameraTo3DObject !== "undefined") { + gdjs.evtsExt__WithThreeJS__DistanceFrom3DCameraTo3DObject.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__DistanceFrom3DCameraTo3DObject = {}; + + +gdjs.evtsExt__WithThreeJS__DistanceFrom3DCameraTo3DObject.userFunc0x1391a10 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Camera = gdjs.__WithThreeJS.get("Camera"); +const Id = eventsFunctionContext.getArgument("Id"); +// +const Obj = Scene.getObjectByName(Id); +if (!Obj) { + console.warn("3D Object not found."); + return; +} +// +const WPos1 = new THREE.Vector3(); +const WPos2 = new THREE.Vector3(); +Camera.getWorldPosition(WPos1); +Obj.getWorldPosition(WPos2); +eventsFunctionContext.returnValue = WPos1.distanceTo(WPos2); + + +}; +gdjs.evtsExt__WithThreeJS__DistanceFrom3DCameraTo3DObject.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__DistanceFrom3DCameraTo3DObject.userFunc0x1391a10(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__DistanceFrom3DCameraTo3DObject.func = function(runtimeScene, Id, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Id") return Id; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__DistanceFrom3DCameraTo3DObject.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__WithThreeJS__DistanceFrom3DCameraTo3DObject.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__distancefrom3dobjectto3dobject-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__distancefrom3dobjectto3dobject-func.js new file mode 100644 index 0000000..1d53e50 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__distancefrom3dobjectto3dobject-func.js @@ -0,0 +1,109 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__DistanceFrom3DObjectTo3DObject !== "undefined") { + gdjs.evtsExt__WithThreeJS__DistanceFrom3DObjectTo3DObject.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__DistanceFrom3DObjectTo3DObject = {}; + + +gdjs.evtsExt__WithThreeJS__DistanceFrom3DObjectTo3DObject.userFunc0x13e7f88 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Id1 = eventsFunctionContext.getArgument("Id1"); +const Id2 = eventsFunctionContext.getArgument("Id2"); +// +const Obj1 = Scene.getObjectByName(Id1); +const Obj2 = Scene.getObjectByName(Id2); +if (!Obj1) { + console.warn("3D Object not found."); + return; +} +if (!Obj2) { + console.warn("3D Object not found."); + return; +} +// +const WPos1 = new THREE.Vector3(); +const WPos2 = new THREE.Vector3(); +Obj1.getWorldPosition(WPos1); +Obj2.getWorldPosition(WPos2); +eventsFunctionContext.returnValue = WPos1.distanceTo(WPos2); + +}; +gdjs.evtsExt__WithThreeJS__DistanceFrom3DObjectTo3DObject.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__DistanceFrom3DObjectTo3DObject.userFunc0x13e7f88(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__DistanceFrom3DObjectTo3DObject.func = function(runtimeScene, Id1, Id2, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Id1") return Id1; +if (argName === "Id2") return Id2; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__DistanceFrom3DObjectTo3DObject.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__WithThreeJS__DistanceFrom3DObjectTo3DObject.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__linkedcamera.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__linkedcamera.js new file mode 100644 index 0000000..6a28253 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__linkedcamera.js @@ -0,0 +1,905 @@ + +gdjs.evtsExt__WithThreeJS__LinkedCamera = gdjs.evtsExt__WithThreeJS__LinkedCamera || {}; + +/** + * Behavior generated from Linked 3D Camera + */ +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera = class LinkedCamera extends gdjs.RuntimeBehavior { + constructor(instanceContainer, behaviorData, owner) { + super(instanceContainer, behaviorData, owner); + this._runtimeScene = instanceContainer; + + this._onceTriggers = new gdjs.OnceTriggers(); + this._behaviorData = {}; + this._sharedData = gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.getSharedData( + instanceContainer, + behaviorData.name + ); + + this._behaviorData.ProjectionScale = behaviorData.ProjectionScale !== undefined ? behaviorData.ProjectionScale : Number("0.01") || 0; + this._behaviorData.LinkAngle = behaviorData.LinkAngle !== undefined ? behaviorData.LinkAngle : true; + this._behaviorData.ViewMode = behaviorData.ViewMode !== undefined ? behaviorData.ViewMode : "Top Down"; + this._behaviorData.Hide = behaviorData.Hide !== undefined ? behaviorData.Hide : true; + } + + // Hot-reload: + updateFromBehaviorData(oldBehaviorData, newBehaviorData) { + + if (oldBehaviorData.ProjectionScale !== newBehaviorData.ProjectionScale) + this._behaviorData.ProjectionScale = newBehaviorData.ProjectionScale; + if (oldBehaviorData.LinkAngle !== newBehaviorData.LinkAngle) + this._behaviorData.LinkAngle = newBehaviorData.LinkAngle; + if (oldBehaviorData.ViewMode !== newBehaviorData.ViewMode) + this._behaviorData.ViewMode = newBehaviorData.ViewMode; + if (oldBehaviorData.Hide !== newBehaviorData.Hide) + this._behaviorData.Hide = newBehaviorData.Hide; + + return true; + } + + // Properties: + + _getProjectionScale() { + return this._behaviorData.ProjectionScale !== undefined ? this._behaviorData.ProjectionScale : Number("0.01") || 0; + } + _setProjectionScale(newValue) { + this._behaviorData.ProjectionScale = newValue; + } + _getLinkAngle() { + return this._behaviorData.LinkAngle !== undefined ? this._behaviorData.LinkAngle : true; + } + _setLinkAngle(newValue) { + this._behaviorData.LinkAngle = newValue; + } + _toggleLinkAngle() { + this._setLinkAngle(!this._getLinkAngle()); + } + _getViewMode() { + return this._behaviorData.ViewMode !== undefined ? this._behaviorData.ViewMode : "Top Down"; + } + _setViewMode(newValue) { + this._behaviorData.ViewMode = newValue; + } + _getHide() { + return this._behaviorData.Hide !== undefined ? this._behaviorData.Hide : true; + } + _setHide(newValue) { + this._behaviorData.Hide = newValue; + } + _toggleHide() { + this._setHide(!this._getHide()); + } +} + +/** + * Shared data generated from Linked 3D Camera + */ +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.SharedData = class LinkedCameraSharedData { + constructor(sharedData) { + + } + + // Shared properties: + +} + +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.getSharedData = function(instanceContainer, behaviorName) { + if (!instanceContainer._WithThreeJS_LinkedCameraSharedData) { + const initialData = instanceContainer.getInitialSharedDataForBehavior( + behaviorName + ); + instanceContainer._WithThreeJS_LinkedCameraSharedData = new gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.SharedData( + initialData + ); + } + return instanceContainer._WithThreeJS_LinkedCameraSharedData; +} + +// Methods: +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.doStepPostEventsContext = {}; +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.doStepPostEventsContext.GDObjectObjects1= []; + + +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.doStepPostEventsContext.userFunc0x1291e18 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Camera = gdjs.__WithThreeJS.get("Camera"); +const Behavior = objects[0].getBehavior("LinkedCamera"); +const ProjectionScale = Behavior.ProjectionScale(); +const LinkAngle = Behavior.LinkAngle(); +const ViewMode = Behavior.ViewMode(); +const Hide = Behavior.Hide(); +const X = objects[0].x; +const Y = objects[0].y; +const Z = objects[0].zOrder; +// +if (ViewMode == "Top Down") { + Camera.position.set(X * ProjectionScale, Z * ProjectionScale, Y * ProjectionScale); +} else { + Camera.position.set(X * ProjectionScale, -Y * ProjectionScale, Z * ProjectionScale); +} +// +if (LinkAngle) { + const Angle = objects[0].angle; + const XAngle = objects[0].getVariables().get("XAngle").getAsNumber(); + if (ViewMode == "Top Down") { + + // x y z w + // Camera.rotation.set(gdjs.toRad(0), gdjs.toRad(Angle * -1 - 90), gdjs.toRad(0)); + + // Includes Vertical rotation + Camera.rotation.set(gdjs.toRad(XAngle), gdjs.toRad(Angle * -1 - 90), gdjs.toRad(0), "YXZ"); + + } else { + Camera.rotation.set(gdjs.toRad(-Angle), gdjs.toRad(-90), gdjs.toRad(0), "YXZ"); + } +} +// +objects[0].hide(Hide); + + +}; +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.doStepPostEventsContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.doStepPostEventsContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.doStepPostEventsContext.GDObjectObjects1); +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.doStepPostEventsContext.userFunc0x1291e18(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.doStepPostEvents = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.doStepPostEventsContext.GDObjectObjects1.length = 0; + +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.doStepPostEventsContext.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.ProjectionScaleContext = {}; +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.ProjectionScaleContext.GDObjectObjects1= []; +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.ProjectionScaleContext.GDObjectObjects2= []; + + +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.ProjectionScaleContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.ProjectionScaleContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.ProjectionScaleContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.ProjectionScaleContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getProjectionScale()); }}} + +} + + +}; + +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.ProjectionScale = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.ProjectionScaleContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.ProjectionScaleContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.ProjectionScaleContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.ViewModeContext = {}; +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.ViewModeContext.GDObjectObjects1= []; +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.ViewModeContext.GDObjectObjects2= []; + + +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.ViewModeContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.ViewModeContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.ViewModeContext.GDObjectObjects1.length === 0 ) ? "" :gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.ViewModeContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getViewMode()); }}} + +} + + +}; + +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.ViewMode = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.ViewModeContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.ViewModeContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.ViewModeContext.eventsList0(runtimeScene, eventsFunctionContext); + +return "" + eventsFunctionContext.returnValue; +} +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.LinkAngleContext = {}; +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.LinkAngleContext.GDObjectObjects1= []; +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.LinkAngleContext.GDObjectObjects2= []; + + +gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.LinkAngleContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.LinkAngleContext.GDObjectObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__WithThreeJS__LinkedCamera.LinkedCamera.prototype.LinkAngleContext.GDObjectObjects1.length;i= 90); +} +if (isConditionTrue_0) { +{gdjs.evtsExt__WithThreeJS__Rotate3DCameraLikeHead.func(runtimeScene, "+", 1000 * gdjs.evtTools.runtimeScene.getElapsedTimeInSeconds(runtimeScene), 0, 0, (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +}} + +} + + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.doStepPostEventsContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.doStepPostEventsContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.doStepPostEventsContext.GDObjectObjects1[i].setAngle(gdjs.evtsExt__WithThreeJS__CameraAngle.func(runtimeScene, "Y", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) - 90); +} +}} + +} + + +};gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.doStepPostEventsContext.eventsList4 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +isConditionTrue_0 = gdjs.evtTools.systemInfo.hasTouchScreen(runtimeScene); +if (isConditionTrue_0) { +isConditionTrue_0 = false; +{isConditionTrue_0 = eventsFunctionContext.getOnceTriggers().triggerOnce(23249204); +} +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.doStepPostEventsContext.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.doStepPostEventsContext.GDObjectObjects1); + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.doStepPostEventsContext.GDObjectObjects1); +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.doStepPostEventsContext.userFunc0x863618(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +{ + + +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.doStepPostEventsContext.eventsList3(runtimeScene, eventsFunctionContext); +} + + +}; + +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.doStepPostEvents = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.doStepPostEventsContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.doStepPostEventsContext.GDObjectObjects2.length = 0; +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.doStepPostEventsContext.GDObjectObjects3.length = 0; +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.doStepPostEventsContext.GDObjectObjects4.length = 0; + +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.doStepPostEventsContext.eventsList4(runtimeScene, eventsFunctionContext); + +return; +} +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.ProjectionScaleContext = {}; +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.ProjectionScaleContext.GDObjectObjects1= []; +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.ProjectionScaleContext.GDObjectObjects2= []; + + +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.ProjectionScaleContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.ProjectionScaleContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.ProjectionScaleContext.GDObjectObjects1.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.ProjectionScaleContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getProjectionScale()); }}} + +} + + +}; + +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.ProjectionScale = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.ProjectionScaleContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.ProjectionScaleContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.ProjectionScaleContext.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.ViewModeContext = {}; +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.ViewModeContext.GDObjectObjects1= []; +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.ViewModeContext.GDObjectObjects2= []; + + +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.ViewModeContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.ViewModeContext.GDObjectObjects1); +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = (( gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.ViewModeContext.GDObjectObjects1.length === 0 ) ? "" :gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.ViewModeContext.GDObjectObjects1[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior"))._getViewMode()); }}} + +} + + +}; + +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.ViewMode = function(parentEventsFunctionContext) { + +var that = this; +var runtimeScene = this._runtimeScene; +var thisObjectList = [this.owner]; +var Object = Hashtable.newFrom({Object: thisObjectList}); +var Behavior = this.name; +var eventsFunctionContext = { + _objectsMap: { +"Object": Object +}, + _objectArraysMap: { +"Object": thisObjectList +}, + _behaviorNamesMap: { +"Behavior": Behavior +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return that._onceTriggers; } +}; + +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.ViewModeContext.GDObjectObjects1.length = 0; +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.ViewModeContext.GDObjectObjects2.length = 0; + +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.ViewModeContext.eventsList0(runtimeScene, eventsFunctionContext); + +return "" + eventsFunctionContext.returnValue; +} +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.LinkAngleContext = {}; +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.LinkAngleContext.GDObjectObjects1= []; +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.LinkAngleContext.GDObjectObjects2= []; + + +gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.LinkAngleContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.LinkAngleContext.GDObjectObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__WithThreeJS__LinkedCameraWithHeadMovement.LinkedCameraWithHeadMovement.prototype.LinkAngleContext.GDObjectObjects1.length;i + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__Load3DModelFromOBJ = {}; + + +gdjs.evtsExt__WithThreeJS__Load3DModelFromOBJ.userFunc0x12b6c40 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +if (!gdjs.__WithThreeJS.has("Models")) { + gdjs.__WithThreeJS.set("Models", new Map()); +} +let Models = gdjs.__WithThreeJS.get("Models"); +const OBJ = eventsFunctionContext.getArgument("OBJ"); +const ModelId = eventsFunctionContext.getArgument("ModelId"); +// +const OBJLoader = new THREE.OBJLoader(); +const Model = OBJLoader.parse(OBJ); +Models.set(ModelId, Model); + +}; +gdjs.evtsExt__WithThreeJS__Load3DModelFromOBJ.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__Load3DModelFromOBJ.userFunc0x12b6c40(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__Load3DModelFromOBJ.func = function(runtimeScene, OBJ, ModelId, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "OBJ") return OBJ; +if (argName === "ModelId") return ModelId; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__Load3DModelFromOBJ.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__Load3DModelFromOBJ.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__load3dtexture-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__load3dtexture-func.js new file mode 100644 index 0000000..5ad0f3f --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__load3dtexture-func.js @@ -0,0 +1,115 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__Load3DTexture !== "undefined") { + gdjs.evtsExt__WithThreeJS__Load3DTexture.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__Load3DTexture = {}; + + +gdjs.evtsExt__WithThreeJS__Load3DTexture.userFunc0x7168a0 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +if (!gdjs.__WithThreeJS.has("Textures")) { + gdjs.__WithThreeJS.set("Textures", new Map()); +} +let Textures = gdjs.__WithThreeJS.get("Textures"); +const ResourceName = eventsFunctionContext.getArgument("ResourceName"); +const TextureId = eventsFunctionContext.getArgument("TextureId"); +const RepeatU = eventsFunctionContext.getArgument("RepeatU"); +const RepeatV = eventsFunctionContext.getArgument("RepeatV"); +// +const GetResourceFileName = gdjs.__WithThreeJS.get("GetResourceFileName"); +const ResourceFileName = GetResourceFileName(ResourceName, "image"); +if (ResourceFileName) { + const Loader = new THREE.TextureLoader(); + Loader.load(GetResourceFileName(ResourceName, "image"), + (T) => { + T.wrapS = THREE.RepeatWrapping; + T.wrapT = THREE.RepeatWrapping; + T.repeat.set(RepeatU, RepeatV); + Textures.set(TextureId, T); + }, + undefined, + (E) => {} + ); +} + +}; +gdjs.evtsExt__WithThreeJS__Load3DTexture.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__Load3DTexture.userFunc0x7168a0(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__Load3DTexture.func = function(runtimeScene, ResourceName, TextureId, RepeatU, RepeatV, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ResourceName") return ResourceName; +if (argName === "TextureId") return TextureId; +if (argName === "RepeatU") return RepeatU; +if (argName === "RepeatV") return RepeatV; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__Load3DTexture.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__Load3DTexture.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__load3dtexturev2-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__load3dtexturev2-func.js new file mode 100644 index 0000000..14668f0 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__load3dtexturev2-func.js @@ -0,0 +1,116 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__Load3DTextureV2 !== "undefined") { + gdjs.evtsExt__WithThreeJS__Load3DTextureV2.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__Load3DTextureV2 = {}; + + +gdjs.evtsExt__WithThreeJS__Load3DTextureV2.userFunc0x12c36a8 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +if (!gdjs.__WithThreeJS.has("Textures")) { + gdjs.__WithThreeJS.set("Textures", new Map()); +} +let Textures = gdjs.__WithThreeJS.get("Textures"); +const ResourceName = eventsFunctionContext.getArgument("ResourceName"); +const TextureId = eventsFunctionContext.getArgument("TextureId"); +const RepeatU = eventsFunctionContext.getArgument("RepeatU"); +const RepeatV = eventsFunctionContext.getArgument("RepeatV"); +const AntiAliasing = eventsFunctionContext.getArgument("AntiAliasing"); +// +if (!Textures.has(TextureId)) { + const T = new THREE.Texture(); + T.image = runtimeScene.getGame().getImageManager().getPIXITexture(ResourceName).baseTexture.resource.source; + T.wrapS = THREE.RepeatWrapping; + T.wrapT = THREE.RepeatWrapping; + T.repeat.set(RepeatU, RepeatV); + if (!AntiAliasing) { + T.magFilter = THREE.NearestFilter;// THREE.LinearFilter + T.minFilter = THREE.NearestFilter;// THREE.LinearMipmapLinearFilter + } + T.needsUpdate = true;//必須 + Textures.set(TextureId, T); +} + + +}; +gdjs.evtsExt__WithThreeJS__Load3DTextureV2.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__Load3DTextureV2.userFunc0x12c36a8(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__Load3DTextureV2.func = function(runtimeScene, ResourceName, TextureId, RepeatU, RepeatV, AntiAliasing, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ResourceName") return ResourceName; +if (argName === "TextureId") return TextureId; +if (argName === "RepeatU") return RepeatU; +if (argName === "RepeatV") return RepeatV; +if (argName === "AntiAliasing") return AntiAliasing; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__Load3DTextureV2.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__Load3DTextureV2.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__move3dcamera-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__move3dcamera-func.js new file mode 100644 index 0000000..3c402e9 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__move3dcamera-func.js @@ -0,0 +1,109 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__Move3DCamera !== "undefined") { + gdjs.evtsExt__WithThreeJS__Move3DCamera.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__Move3DCamera = {}; + + +gdjs.evtsExt__WithThreeJS__Move3DCamera.userFunc0x13b7958 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Camera = gdjs.__WithThreeJS.get("Camera"); +const Operator = eventsFunctionContext.getArgument("Operator"); +const X = eventsFunctionContext.getArgument("X"); +const Y = eventsFunctionContext.getArgument("Y"); +const Z = eventsFunctionContext.getArgument("Z"); +// +if (Operator == "=") { + Camera.position.set(X, Y, Z); +} else if (Operator == "+") { + Camera.translateX(X); + Camera.translateY(Y); + Camera.translateZ(Z); +} else { + Camera.translateX(-X); + Camera.translateY(-Y); + Camera.translateZ(-Z); +} + + +}; +gdjs.evtsExt__WithThreeJS__Move3DCamera.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__Move3DCamera.userFunc0x13b7958(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__Move3DCamera.func = function(runtimeScene, Operator, X, Y, Z, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Operator") return Operator; +if (argName === "X") return X; +if (argName === "Y") return Y; +if (argName === "Z") return Z; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__Move3DCamera.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__Move3DCamera.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__move3dobject-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__move3dobject-func.js new file mode 100644 index 0000000..fd17498 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__move3dobject-func.js @@ -0,0 +1,117 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__Move3DObject !== "undefined") { + gdjs.evtsExt__WithThreeJS__Move3DObject.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__Move3DObject = {}; + + +gdjs.evtsExt__WithThreeJS__Move3DObject.userFunc0x1385690 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Id = eventsFunctionContext.getArgument("Id"); +const Operator = eventsFunctionContext.getArgument("Operator"); +const X = eventsFunctionContext.getArgument("X"); +const Y = eventsFunctionContext.getArgument("Y"); +const Z = eventsFunctionContext.getArgument("Z"); +// +const Obj = Scene.getObjectByName(Id); +if (!Obj) { + console.warn("3D Object not found."); + return; +} +// +if (Operator == "=") { + Obj.position.set(X, Y, Z); +} else if (Operator == "+") { + Obj.translateX(X); + Obj.translateY(Y); + Obj.translateZ(Z); +} else { + Obj.translateX(-X); + Obj.translateY(-Y); + Obj.translateZ(-Z); +} + + +}; +gdjs.evtsExt__WithThreeJS__Move3DObject.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__Move3DObject.userFunc0x1385690(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__Move3DObject.func = function(runtimeScene, Id, Operator, X, Y, Z, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Id") return Id; +if (argName === "Operator") return Operator; +if (argName === "X") return X; +if (argName === "Y") return Y; +if (argName === "Z") return Z; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__Move3DObject.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__Move3DObject.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__objectopacity-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__objectopacity-func.js new file mode 100644 index 0000000..e1a31d3 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__objectopacity-func.js @@ -0,0 +1,103 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__ObjectOpacity !== "undefined") { + gdjs.evtsExt__WithThreeJS__ObjectOpacity.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__ObjectOpacity = {}; + + +gdjs.evtsExt__WithThreeJS__ObjectOpacity.userFunc0x13e7f88 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Id = eventsFunctionContext.getArgument("Id"); +// +const Obj = Scene.getObjectByName(Id); +if (!Obj) { + console.warn("3D Object not found."); + return; +} +// +if (Array.isArray(Obj.material)) { + eventsFunctionContext.returnValue = Obj.material[0].opacity; +} else { + eventsFunctionContext.returnValue = Obj.material.opacity; +} + + +}; +gdjs.evtsExt__WithThreeJS__ObjectOpacity.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__ObjectOpacity.userFunc0x13e7f88(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__ObjectOpacity.func = function(runtimeScene, Id, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Id") return Id; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__ObjectOpacity.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__WithThreeJS__ObjectOpacity.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__objectposition-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__objectposition-func.js new file mode 100644 index 0000000..6212032 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__objectposition-func.js @@ -0,0 +1,107 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__ObjectPosition !== "undefined") { + gdjs.evtsExt__WithThreeJS__ObjectPosition.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__ObjectPosition = {}; + + +gdjs.evtsExt__WithThreeJS__ObjectPosition.userFunc0x13e7f88 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Id = eventsFunctionContext.getArgument("Id"); +const Axis = eventsFunctionContext.getArgument("Axis"); +// +const Obj = Scene.getObjectByName(Id); +if (!Obj) { + console.warn("3D Object not found."); + return; +} +// +if (Axis == "X") { + eventsFunctionContext.returnValue = Obj.position.x; +} else if (Axis == "Y") { + eventsFunctionContext.returnValue = Obj.position.y; +} else { + eventsFunctionContext.returnValue = Obj.position.z; +} + + +}; +gdjs.evtsExt__WithThreeJS__ObjectPosition.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__ObjectPosition.userFunc0x13e7f88(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__ObjectPosition.func = function(runtimeScene, Id, Axis, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Id") return Id; +if (argName === "Axis") return Axis; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__ObjectPosition.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__WithThreeJS__ObjectPosition.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__objectrotation-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__objectrotation-func.js new file mode 100644 index 0000000..e206b6d --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__objectrotation-func.js @@ -0,0 +1,107 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__ObjectRotation !== "undefined") { + gdjs.evtsExt__WithThreeJS__ObjectRotation.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__ObjectRotation = {}; + + +gdjs.evtsExt__WithThreeJS__ObjectRotation.userFunc0x13e7f88 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Id = eventsFunctionContext.getArgument("Id"); +const Axis = eventsFunctionContext.getArgument("Axis"); +// +const Obj = Scene.getObjectByName(Id); +if (!Obj) { + console.warn("3D Object not found."); + return; +} +// +if (Axis == "X") { + eventsFunctionContext.returnValue = gdjs.toDegrees(Obj.rotation.x); +} else if (Axis == "Y") { + eventsFunctionContext.returnValue = gdjs.toDegrees(Obj.rotation.y); +} else { + eventsFunctionContext.returnValue = gdjs.toDegrees(Obj.rotation.z); +} + + +}; +gdjs.evtsExt__WithThreeJS__ObjectRotation.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__ObjectRotation.userFunc0x13e7f88(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__ObjectRotation.func = function(runtimeScene, Id, Axis, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Id") return Id; +if (argName === "Axis") return Axis; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__ObjectRotation.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__WithThreeJS__ObjectRotation.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__objectscale-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__objectscale-func.js new file mode 100644 index 0000000..930fcf9 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__objectscale-func.js @@ -0,0 +1,120 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__ObjectScale !== "undefined") { + gdjs.evtsExt__WithThreeJS__ObjectScale.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__ObjectScale = {}; + + +gdjs.evtsExt__WithThreeJS__ObjectScale.userFunc0x13e7f88 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Id = eventsFunctionContext.getArgument("Id"); +const Axis = eventsFunctionContext.getArgument("Axis"); +// +const Obj = Scene.getObjectByName(Id); +if (!Obj) { + console.warn("3D Object not found."); + return; +} +// +if (Obj.isSprite) { + const Texture = Obj.material.map; + const TextureWidth = Texture.image.width; + const TextureHeight = Texture.image.height; + if (Axis == "Scale X Axis") { + eventsFunctionContext.returnValue = Obj.scale.x / TextureWidth; + } else if (Axis == "Scale Y Axis") { + eventsFunctionContext.returnValue = Obj.scale.y / TextureHeight; + } else { + eventsFunctionContext.returnValue = 1; + } +} else { + if (Axis == "Scale X Axis") { + eventsFunctionContext.returnValue = Obj.scale.x; + } else if (Axis == "Scale Y Axis") { + eventsFunctionContext.returnValue = Obj.scale.y; + } else { + eventsFunctionContext.returnValue = Obj.scale.z; + } +} + + +}; +gdjs.evtsExt__WithThreeJS__ObjectScale.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__ObjectScale.userFunc0x13e7f88(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__ObjectScale.func = function(runtimeScene, Id, Axis, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Id") return Id; +if (argName === "Axis") return Axis; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__ObjectScale.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__WithThreeJS__ObjectScale.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__onfirstsceneloaded-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__onfirstsceneloaded-func.js new file mode 100644 index 0000000..bc515be --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__onfirstsceneloaded-func.js @@ -0,0 +1,1042 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__onFirstSceneLoaded !== "undefined") { + gdjs.evtsExt__WithThreeJS__onFirstSceneLoaded.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__onFirstSceneLoaded = {}; + + +gdjs.evtsExt__WithThreeJS__onFirstSceneLoaded.userFunc0x136c0d8 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +console.log("Three.js r146"); +/** + * @license + * Copyright 2010-2022 Three.js Authors + * SPDX-License-Identifier: MIT + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).THREE={})}(this,(function(t){"use strict";const e="146",i=100,n=300,r=301,s=302,a=303,o=304,l=306,c=1e3,h=1001,u=1002,d=1003,p=1004,m=1005,f=1006,g=1007,v=1008,x=1009,_=1012,y=1014,M=1015,b=1016,S=1020,w=1023,T=1026,A=1027,E=33776,C=33777,L=33778,R=33779,P=35840,D=35841,I=35842,N=35843,O=37492,z=37496,U=37808,B=37809,F=37810,k=37811,G=37812,V=37813,H=37814,W=37815,j=37816,q=37817,X=37818,Y=37819,Z=37820,J=37821,K=36492,$=2300,Q=2301,tt=2302,et=2400,it=2401,nt=2402,rt=2500,st=2501,at=3e3,ot=3001,lt="srgb",ct="srgb-linear",ht=7680,ut=35044,dt="300 es",pt=1035;class mt{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)}hasEventListener(t,e){if(void 0===this._listeners)return!1;const i=this._listeners;return void 0!==i[t]&&-1!==i[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const i=this._listeners[t];if(void 0!==i){const t=i.indexOf(e);-1!==t&&i.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const i=e.slice(0);for(let e=0,n=i.length;e>8&255]+ft[t>>16&255]+ft[t>>24&255]+"-"+ft[255&e]+ft[e>>8&255]+"-"+ft[e>>16&15|64]+ft[e>>24&255]+"-"+ft[63&i|128]+ft[i>>8&255]+"-"+ft[i>>16&255]+ft[i>>24&255]+ft[255&n]+ft[n>>8&255]+ft[n>>16&255]+ft[n>>24&255]).toLowerCase()}function yt(t,e,i){return Math.max(e,Math.min(i,t))}function Mt(t,e){return(t%e+e)%e}function bt(t,e,i){return(1-i)*t+i*e}function St(t){return 0==(t&t-1)&&0!==t}function wt(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function Tt(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function At(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Et(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}var Ct=Object.freeze({__proto__:null,DEG2RAD:vt,RAD2DEG:xt,generateUUID:_t,clamp:yt,euclideanModulo:Mt,mapLinear:function(t,e,i,n,r){return n+(t-e)*(r-n)/(i-e)},inverseLerp:function(t,e,i){return t!==e?(i-t)/(e-t):0},lerp:bt,damp:function(t,e,i,n){return bt(t,e,1-Math.exp(-i*n))},pingpong:function(t,e=1){return e-Math.abs(Mt(t,2*e)-e)},smoothstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)},smootherstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(gt=t);let e=gt+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296},degToRad:function(t){return t*vt},radToDeg:function(t){return t*xt},isPowerOfTwo:St,ceilPowerOfTwo:wt,floorPowerOfTwo:Tt,setQuaternionFromProperEuler:function(t,e,i,n,r){const s=Math.cos,a=Math.sin,o=s(i/2),l=a(i/2),c=s((e+n)/2),h=a((e+n)/2),u=s((e-n)/2),d=a((e-n)/2),p=s((n-e)/2),m=a((n-e)/2);switch(r){case"XYX":t.set(o*h,l*u,l*d,o*c);break;case"YZY":t.set(l*d,o*h,l*u,o*c);break;case"ZXZ":t.set(l*u,l*d,o*h,o*c);break;case"XZX":t.set(o*h,l*m,l*p,o*c);break;case"YXY":t.set(l*p,o*h,l*m,o*c);break;case"ZYZ":t.set(l*m,l*p,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize:Et,denormalize:At});class Lt{constructor(t=0,e=0){Lt.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,i=this.y,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const i=Math.cos(e),n=Math.sin(e),r=this.x-t.x,s=this.y-t.y;return this.x=r*i-s*n+t.x,this.y=r*n+s*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Rt{constructor(){Rt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(t,e,i,n,r,s,a,o,l){const c=this.elements;return c[0]=t,c[1]=n,c[2]=a,c[3]=e,c[4]=r,c[5]=o,c[6]=i,c[7]=s,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,n=e.elements,r=this.elements,s=i[0],a=i[3],o=i[6],l=i[1],c=i[4],h=i[7],u=i[2],d=i[5],p=i[8],m=n[0],f=n[3],g=n[6],v=n[1],x=n[4],_=n[7],y=n[2],M=n[5],b=n[8];return r[0]=s*m+a*v+o*y,r[3]=s*f+a*x+o*M,r[6]=s*g+a*_+o*b,r[1]=l*m+c*v+h*y,r[4]=l*f+c*x+h*M,r[7]=l*g+c*_+h*b,r[2]=u*m+d*v+p*y,r[5]=u*f+d*x+p*M,r[8]=u*g+d*_+p*b,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8];return e*s*c-e*a*l-i*r*c+i*a*o+n*r*l-n*s*o}invert(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8],h=c*s-a*l,u=a*o-c*r,d=l*r-s*o,p=e*h+i*u+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const m=1/p;return t[0]=h*m,t[1]=(n*l-c*i)*m,t[2]=(a*i-n*s)*m,t[3]=u*m,t[4]=(c*e-n*o)*m,t[5]=(n*r-a*e)*m,t[6]=d*m,t[7]=(i*o-l*e)*m,t[8]=(s*e-i*r)*m,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,i,n,r,s,a){const o=Math.cos(r),l=Math.sin(r);return this.set(i*o,i*l,-i*(o*s+l*a)+s+t,-n*l,n*o,-n*(-l*s+o*a)+a+e,0,0,1),this}scale(t,e){const i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=e,i[4]*=e,i[7]*=e,this}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.elements,r=n[0],s=n[3],a=n[6],o=n[1],l=n[4],c=n[7];return n[0]=e*r+i*o,n[3]=e*s+i*l,n[6]=e*a+i*c,n[1]=-i*r+e*o,n[4]=-i*s+e*l,n[7]=-i*a+e*c,this}translate(t,e){const i=this.elements;return i[0]+=t*i[2],i[3]+=t*i[5],i[6]+=t*i[8],i[1]+=e*i[2],i[4]+=e*i[5],i[7]+=e*i[8],this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<9;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}function Pt(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const Dt={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function It(t,e){return new Dt[t](e)}function Nt(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function Ot(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function zt(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const Ut={[lt]:{[ct]:Ot},[ct]:{[lt]:zt}},Bt={legacyMode:!0,get workingColorSpace(){return ct},set workingColorSpace(t){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(t,e,i){if(this.legacyMode||e===i||!e||!i)return t;if(Ut[e]&&void 0!==Ut[e][i]){const n=Ut[e][i];return t.r=n(t.r),t.g=n(t.g),t.b=n(t.b),t}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)}},Ft={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},kt={r:0,g:0,b:0},Gt={h:0,s:0,l:0},Vt={h:0,s:0,l:0};function Ht(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}function Wt(t,e){return e.r=t.r,e.g=t.g,e.b=t.b,e}class jt{constructor(t,e,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,void 0===e&&void 0===i?this.set(t):this.setRGB(t,e,i)}set(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e="srgb"){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,Bt.toWorkingColorSpace(this,e),this}setRGB(t,e,i,n="srgb-linear"){return this.r=t,this.g=e,this.b=i,Bt.toWorkingColorSpace(this,n),this}setHSL(t,e,i,n="srgb-linear"){if(t=Mt(t,1),e=yt(e,0,1),i=yt(i,0,1),0===e)this.r=this.g=this.b=i;else{const n=i<=.5?i*(1+e):i+e-i*e,r=2*i-n;this.r=Ht(r,n,t+1/3),this.g=Ht(r,n,t),this.b=Ht(r,n,t-1/3)}return Bt.toWorkingColorSpace(this,n),this}setStyle(t,e="srgb"){function i(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let t;const r=n[1],s=n[2];switch(r){case"rgb":case"rgba":if(t=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,Bt.toWorkingColorSpace(this,e),i(t[4]),this;if(t=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,Bt.toWorkingColorSpace(this,e),i(t[4]),this;break;case"hsl":case"hsla":if(t=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)){const n=parseFloat(t[1])/360,r=parseFloat(t[2])/100,s=parseFloat(t[3])/100;return i(t[4]),this.setHSL(n,r,s,e)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(t)){const t=n[1],i=t.length;if(3===i)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,Bt.toWorkingColorSpace(this,e),this;if(6===i)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,Bt.toWorkingColorSpace(this,e),this}return t&&t.length>0?this.setColorName(t,e):this}setColorName(t,e="srgb"){const i=Ft[t.toLowerCase()];return void 0!==i?this.setHex(i,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Ot(t.r),this.g=Ot(t.g),this.b=Ot(t.b),this}copyLinearToSRGB(t){return this.r=zt(t.r),this.g=zt(t.g),this.b=zt(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t="srgb"){return Bt.fromWorkingColorSpace(Wt(this,kt),t),yt(255*kt.r,0,255)<<16^yt(255*kt.g,0,255)<<8^yt(255*kt.b,0,255)<<0}getHexString(t="srgb"){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e="srgb-linear"){Bt.fromWorkingColorSpace(Wt(this,kt),e);const i=kt.r,n=kt.g,r=kt.b,s=Math.max(i,n,r),a=Math.min(i,n,r);let o,l;const c=(a+s)/2;if(a===s)o=0,l=0;else{const t=s-a;switch(l=c<=.5?t/(s+a):t/(2-s-a),s){case i:o=(n-r)/t+(n2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=Nt("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const n=i.getImageData(0,0,t.width,t.height),r=n.data;for(let t=0;t1)switch(this.wrapS){case c:t.x=t.x-Math.floor(t.x);break;case h:t.x=t.x<0?0:1;break;case u:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case c:t.y=t.y-Math.floor(t.y);break;case h:t.y=t.y<0?0:1;break;case u:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}}Kt.DEFAULT_IMAGE=null,Kt.DEFAULT_MAPPING=n;class $t{constructor(t=0,e=0,i=0,n=1){$t.prototype.isVector4=!0,this.x=t,this.y=e,this.z=i,this.w=n}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,i=this.y,n=this.z,r=this.w,s=t.elements;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12]*r,this.y=s[1]*e+s[5]*i+s[9]*n+s[13]*r,this.z=s[2]*e+s[6]*i+s[10]*n+s[14]*r,this.w=s[3]*e+s[7]*i+s[11]*n+s[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,i,n,r;const s=.01,a=.1,o=t.elements,l=o[0],c=o[4],h=o[8],u=o[1],d=o[5],p=o[9],m=o[2],f=o[6],g=o[10];if(Math.abs(c-u)o&&t>v?tv?o=0?1:-1,n=1-e*e;if(n>Number.EPSILON){const r=Math.sqrt(n),s=Math.atan2(r,e*i);t=Math.sin(t*s)/r,a=Math.sin(a*s)/r}const r=a*i;if(o=o*t+u*r,l=l*t+d*r,c=c*t+p*r,h=h*t+m*r,t===1-a){const t=1/Math.sqrt(o*o+l*l+c*c+h*h);o*=t,l*=t,c*=t,h*=t}}t[e]=o,t[e+1]=l,t[e+2]=c,t[e+3]=h}static multiplyQuaternionsFlat(t,e,i,n,r,s){const a=i[n],o=i[n+1],l=i[n+2],c=i[n+3],h=r[s],u=r[s+1],d=r[s+2],p=r[s+3];return t[e]=a*p+c*h+o*d-l*u,t[e+1]=o*p+c*u+l*h-a*d,t[e+2]=l*p+c*d+a*u-o*h,t[e+3]=c*p-a*h-o*u-l*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){const i=t._x,n=t._y,r=t._z,s=t._order,a=Math.cos,o=Math.sin,l=a(i/2),c=a(n/2),h=a(r/2),u=o(i/2),d=o(n/2),p=o(r/2);switch(s){case"XYZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"YXZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"ZXY":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"ZYX":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"YZX":this._x=u*c*h+l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h-u*d*p;break;case"XZY":this._x=u*c*h-l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const i=e/2,n=Math.sin(i);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],n=e[4],r=e[8],s=e[1],a=e[5],o=e[9],l=e[2],c=e[6],h=e[10],u=i+a+h;if(u>0){const t=.5/Math.sqrt(u+1);this._w=.25/t,this._x=(c-o)*t,this._y=(r-l)*t,this._z=(s-n)*t}else if(i>a&&i>h){const t=2*Math.sqrt(1+i-a-h);this._w=(c-o)/t,this._x=.25*t,this._y=(n+s)/t,this._z=(r+l)/t}else if(a>h){const t=2*Math.sqrt(1+a-i-h);this._w=(r-l)/t,this._x=(n+s)/t,this._y=.25*t,this._z=(o+c)/t}else{const t=2*Math.sqrt(1+h-i-a);this._w=(s-n)/t,this._x=(r+l)/t,this._y=(o+c)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return iMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(yt(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(0===i)return this;const n=Math.min(1,e/i);return this.slerp(t,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const i=t._x,n=t._y,r=t._z,s=t._w,a=e._x,o=e._y,l=e._z,c=e._w;return this._x=i*c+s*a+n*l-r*o,this._y=n*c+s*o+r*a-i*l,this._z=r*c+s*l+i*o-n*a,this._w=s*c-i*a-n*o-r*l,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const i=this._x,n=this._y,r=this._z,s=this._w;let a=s*t._w+i*t._x+n*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=s,this._x=i,this._y=n,this._z=r,this;const o=1-a*a;if(o<=Number.EPSILON){const t=1-e;return this._w=t*s+e*this._w,this._x=t*i+e*this._x,this._y=t*n+e*this._y,this._z=t*r+e*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(o),c=Math.atan2(l,a),h=Math.sin((1-e)*c)/l,u=Math.sin(e*c)/l;return this._w=s*h+this._w*u,this._x=i*h+this._x*u,this._y=n*h+this._y*u,this._z=r*h+this._z*u,this._onChangeCallback(),this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){const t=Math.random(),e=Math.sqrt(1-t),i=Math.sqrt(t),n=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(e*Math.cos(n),i*Math.sin(r),i*Math.cos(r),e*Math.sin(n))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ne{constructor(t=0,e=0,i=0){ne.prototype.isVector3=!0,this.x=t,this.y=e,this.z=i}set(t,e,i){return void 0===i&&(i=this.z),this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(se.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(se.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*n,this.y=r[1]*e+r[4]*i+r[7]*n,this.z=r[2]*e+r[5]*i+r[8]*n,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,n=this.z,r=t.elements,s=1/(r[3]*e+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*n+r[12])*s,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*s,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*s,this}applyQuaternion(t){const e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,a=t.z,o=t.w,l=o*e+s*n-a*i,c=o*i+a*e-r*n,h=o*n+r*i-s*e,u=-r*e-s*i-a*n;return this.x=l*o+u*-r+c*-a-h*-s,this.y=c*o+u*-s+h*-r-l*-a,this.z=h*o+u*-a+l*-s-c*-r,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*n,this.y=r[1]*e+r[5]*i+r[9]*n,this.z=r[2]*e+r[6]*i+r[10]*n,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const i=t.x,n=t.y,r=t.z,s=e.x,a=e.y,o=e.z;return this.x=n*o-r*a,this.y=r*s-i*o,this.z=i*a-n*s,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return re.copy(this).projectOnVector(t),this.sub(re)}reflect(t){return this.sub(re.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(yt(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,n=this.z-t.z;return e*e+i*i+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){const n=Math.sin(e)*t;return this.x=n*Math.sin(i),this.y=Math.cos(e)*t,this.z=n*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=n,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=2*(Math.random()-.5),e=Math.random()*Math.PI*2,i=Math.sqrt(1-t**2);return this.x=i*Math.cos(e),this.y=i*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const re=new ne,se=new ie;class ae{constructor(t=new ne(1/0,1/0,1/0),e=new ne(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){let e=1/0,i=1/0,n=1/0,r=-1/0,s=-1/0,a=-1/0;for(let o=0,l=t.length;or&&(r=l),c>s&&(s=c),h>a&&(a=h)}return this.min.set(e,i,n),this.max.set(r,s,a),this}setFromBufferAttribute(t){let e=1/0,i=1/0,n=1/0,r=-1/0,s=-1/0,a=-1/0;for(let o=0,l=t.count;or&&(r=l),c>s&&(s=c),h>a&&(a=h)}return this.min.set(e,i,n),this.max.set(r,s,a),this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,le),le.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(ge),ve.subVectors(this.max,ge),he.subVectors(t.a,ge),ue.subVectors(t.b,ge),de.subVectors(t.c,ge),pe.subVectors(ue,he),me.subVectors(de,ue),fe.subVectors(he,de);let e=[0,-pe.z,pe.y,0,-me.z,me.y,0,-fe.z,fe.y,pe.z,0,-pe.x,me.z,0,-me.x,fe.z,0,-fe.x,-pe.y,pe.x,0,-me.y,me.x,0,-fe.y,fe.x,0];return!!ye(e,he,ue,de,ve)&&(e=[1,0,0,0,1,0,0,0,1],!!ye(e,he,ue,de,ve)&&(xe.crossVectors(pe,me),e=[xe.x,xe.y,xe.z],ye(e,he,ue,de,ve)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return le.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return this.getCenter(t.center),t.radius=.5*this.getSize(le).length(),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(oe[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),oe[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),oe[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),oe[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),oe[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),oe[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),oe[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),oe[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(oe)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const oe=[new ne,new ne,new ne,new ne,new ne,new ne,new ne,new ne],le=new ne,ce=new ae,he=new ne,ue=new ne,de=new ne,pe=new ne,me=new ne,fe=new ne,ge=new ne,ve=new ne,xe=new ne,_e=new ne;function ye(t,e,i,n,r){for(let s=0,a=t.length-3;s<=a;s+=3){_e.fromArray(t,s);const a=r.x*Math.abs(_e.x)+r.y*Math.abs(_e.y)+r.z*Math.abs(_e.z),o=e.dot(_e),l=i.dot(_e),c=n.dot(_e);if(Math.max(-Math.max(o,l,c),Math.min(o,l,c))>a)return!1}return!0}const Me=new ae,be=new ne,Se=new ne;class we{constructor(t=new ne,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const i=this.center;void 0!==e?i.copy(e):Me.setFromPoints(t).getCenter(i);let n=0;for(let e=0,r=t.length;ethis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;be.subVectors(t,this.center);const e=be.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),i=.5*(t-this.radius);this.center.addScaledVector(be,i/t),this.radius+=i}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(Se.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(be.copy(t.center).add(Se)),this.expandByPoint(be.copy(t.center).sub(Se))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Te=new ne,Ae=new ne,Ee=new ne,Ce=new ne,Le=new ne,Re=new ne,Pe=new ne;class De{constructor(t=new ne,e=new ne(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.direction).multiplyScalar(t).add(this.origin)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Te)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(i).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=Te.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Te.copy(this.direction).multiplyScalar(e).add(this.origin),Te.distanceToSquared(t))}distanceSqToSegment(t,e,i,n){Ae.copy(t).add(e).multiplyScalar(.5),Ee.copy(e).sub(t).normalize(),Ce.copy(this.origin).sub(Ae);const r=.5*t.distanceTo(e),s=-this.direction.dot(Ee),a=Ce.dot(this.direction),o=-Ce.dot(Ee),l=Ce.lengthSq(),c=Math.abs(1-s*s);let h,u,d,p;if(c>0)if(h=s*o-a,u=s*a-o,p=r*c,h>=0)if(u>=-p)if(u<=p){const t=1/c;h*=t,u*=t,d=h*(h+s*u+2*a)+u*(s*h+u+2*o)+l}else u=r,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;else u=-r,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;else u<=-p?(h=Math.max(0,-(-s*r+a)),u=h>0?-r:Math.min(Math.max(-r,-o),r),d=-h*h+u*(u+2*o)+l):u<=p?(h=0,u=Math.min(Math.max(-r,-o),r),d=u*(u+2*o)+l):(h=Math.max(0,-(s*r+a)),u=h>0?r:Math.min(Math.max(-r,-o),r),d=-h*h+u*(u+2*o)+l);else u=s>0?-r:r,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;return i&&i.copy(this.direction).multiplyScalar(h).add(this.origin),n&&n.copy(Ee).multiplyScalar(u).add(Ae),d}intersectSphere(t,e){Te.subVectors(t.center,this.origin);const i=Te.dot(this.direction),n=Te.dot(Te)-i*i,r=t.radius*t.radius;if(n>r)return null;const s=Math.sqrt(r-n),a=i-s,o=i+s;return a<0&&o<0?null:a<0?this.at(o,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){const i=this.distanceToPlane(t);return null===i?null:this.at(i,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let i,n,r,s,a,o;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(i=(t.min.x-u.x)*l,n=(t.max.x-u.x)*l):(i=(t.max.x-u.x)*l,n=(t.min.x-u.x)*l),c>=0?(r=(t.min.y-u.y)*c,s=(t.max.y-u.y)*c):(r=(t.max.y-u.y)*c,s=(t.min.y-u.y)*c),i>s||r>n?null:((r>i||isNaN(i))&&(i=r),(s=0?(a=(t.min.z-u.z)*h,o=(t.max.z-u.z)*h):(a=(t.max.z-u.z)*h,o=(t.min.z-u.z)*h),i>o||a>n?null:((a>i||i!=i)&&(i=a),(o=0?i:n,e)))}intersectsBox(t){return null!==this.intersectBox(t,Te)}intersectTriangle(t,e,i,n,r){Le.subVectors(e,t),Re.subVectors(i,t),Pe.crossVectors(Le,Re);let s,a=this.direction.dot(Pe);if(a>0){if(n)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}Ce.subVectors(this.origin,t);const o=s*this.direction.dot(Re.crossVectors(Ce,Re));if(o<0)return null;const l=s*this.direction.dot(Le.cross(Ce));if(l<0)return null;if(o+l>a)return null;const c=-s*Ce.dot(Pe);return c<0?null:this.at(c/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class Ie{constructor(){Ie.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(t,e,i,n,r,s,a,o,l,c,h,u,d,p,m,f){const g=this.elements;return g[0]=t,g[4]=e,g[8]=i,g[12]=n,g[1]=r,g[5]=s,g[9]=a,g[13]=o,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=m,g[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Ie).fromArray(this.elements)}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,i=t.elements,n=1/Ne.setFromMatrixColumn(t,0).length(),r=1/Ne.setFromMatrixColumn(t,1).length(),s=1/Ne.setFromMatrixColumn(t,2).length();return e[0]=i[0]*n,e[1]=i[1]*n,e[2]=i[2]*n,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*s,e[9]=i[9]*s,e[10]=i[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,i=t.x,n=t.y,r=t.z,s=Math.cos(i),a=Math.sin(i),o=Math.cos(n),l=Math.sin(n),c=Math.cos(r),h=Math.sin(r);if("XYZ"===t.order){const t=s*c,i=s*h,n=a*c,r=a*h;e[0]=o*c,e[4]=-o*h,e[8]=l,e[1]=i+n*l,e[5]=t-r*l,e[9]=-a*o,e[2]=r-t*l,e[6]=n+i*l,e[10]=s*o}else if("YXZ"===t.order){const t=o*c,i=o*h,n=l*c,r=l*h;e[0]=t+r*a,e[4]=n*a-i,e[8]=s*l,e[1]=s*h,e[5]=s*c,e[9]=-a,e[2]=i*a-n,e[6]=r+t*a,e[10]=s*o}else if("ZXY"===t.order){const t=o*c,i=o*h,n=l*c,r=l*h;e[0]=t-r*a,e[4]=-s*h,e[8]=n+i*a,e[1]=i+n*a,e[5]=s*c,e[9]=r-t*a,e[2]=-s*l,e[6]=a,e[10]=s*o}else if("ZYX"===t.order){const t=s*c,i=s*h,n=a*c,r=a*h;e[0]=o*c,e[4]=n*l-i,e[8]=t*l+r,e[1]=o*h,e[5]=r*l+t,e[9]=i*l-n,e[2]=-l,e[6]=a*o,e[10]=s*o}else if("YZX"===t.order){const t=s*o,i=s*l,n=a*o,r=a*l;e[0]=o*c,e[4]=r-t*h,e[8]=n*h+i,e[1]=h,e[5]=s*c,e[9]=-a*c,e[2]=-l*c,e[6]=i*h+n,e[10]=t-r*h}else if("XZY"===t.order){const t=s*o,i=s*l,n=a*o,r=a*l;e[0]=o*c,e[4]=-h,e[8]=l*c,e[1]=t*h+r,e[5]=s*c,e[9]=i*h-n,e[2]=n*h-i,e[6]=a*c,e[10]=r*h+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(ze,t,Ue)}lookAt(t,e,i){const n=this.elements;return ke.subVectors(t,e),0===ke.lengthSq()&&(ke.z=1),ke.normalize(),Be.crossVectors(i,ke),0===Be.lengthSq()&&(1===Math.abs(i.z)?ke.x+=1e-4:ke.z+=1e-4,ke.normalize(),Be.crossVectors(i,ke)),Be.normalize(),Fe.crossVectors(ke,Be),n[0]=Be.x,n[4]=Fe.x,n[8]=ke.x,n[1]=Be.y,n[5]=Fe.y,n[9]=ke.y,n[2]=Be.z,n[6]=Fe.z,n[10]=ke.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,n=e.elements,r=this.elements,s=i[0],a=i[4],o=i[8],l=i[12],c=i[1],h=i[5],u=i[9],d=i[13],p=i[2],m=i[6],f=i[10],g=i[14],v=i[3],x=i[7],_=i[11],y=i[15],M=n[0],b=n[4],S=n[8],w=n[12],T=n[1],A=n[5],E=n[9],C=n[13],L=n[2],R=n[6],P=n[10],D=n[14],I=n[3],N=n[7],O=n[11],z=n[15];return r[0]=s*M+a*T+o*L+l*I,r[4]=s*b+a*A+o*R+l*N,r[8]=s*S+a*E+o*P+l*O,r[12]=s*w+a*C+o*D+l*z,r[1]=c*M+h*T+u*L+d*I,r[5]=c*b+h*A+u*R+d*N,r[9]=c*S+h*E+u*P+d*O,r[13]=c*w+h*C+u*D+d*z,r[2]=p*M+m*T+f*L+g*I,r[6]=p*b+m*A+f*R+g*N,r[10]=p*S+m*E+f*P+g*O,r[14]=p*w+m*C+f*D+g*z,r[3]=v*M+x*T+_*L+y*I,r[7]=v*b+x*A+_*R+y*N,r[11]=v*S+x*E+_*P+y*O,r[15]=v*w+x*C+_*D+y*z,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[4],n=t[8],r=t[12],s=t[1],a=t[5],o=t[9],l=t[13],c=t[2],h=t[6],u=t[10],d=t[14];return t[3]*(+r*o*h-n*l*h-r*a*u+i*l*u+n*a*d-i*o*d)+t[7]*(+e*o*d-e*l*u+r*s*u-n*s*d+n*l*c-r*o*c)+t[11]*(+e*l*h-e*a*d-r*s*h+i*s*d+r*a*c-i*l*c)+t[15]*(-n*a*c-e*o*h+e*a*u+n*s*h-i*s*u+i*o*c)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,i){const n=this.elements;return t.isVector3?(n[12]=t.x,n[13]=t.y,n[14]=t.z):(n[12]=t,n[13]=e,n[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8],h=t[9],u=t[10],d=t[11],p=t[12],m=t[13],f=t[14],g=t[15],v=h*f*l-m*u*l+m*o*d-a*f*d-h*o*g+a*u*g,x=p*u*l-c*f*l-p*o*d+s*f*d+c*o*g-s*u*g,_=c*m*l-p*h*l+p*a*d-s*m*d-c*a*g+s*h*g,y=p*h*o-c*m*o-p*a*u+s*m*u+c*a*f-s*h*f,M=e*v+i*x+n*_+r*y;if(0===M)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const b=1/M;return t[0]=v*b,t[1]=(m*u*r-h*f*r-m*n*d+i*f*d+h*n*g-i*u*g)*b,t[2]=(a*f*r-m*o*r+m*n*l-i*f*l-a*n*g+i*o*g)*b,t[3]=(h*o*r-a*u*r-h*n*l+i*u*l+a*n*d-i*o*d)*b,t[4]=x*b,t[5]=(c*f*r-p*u*r+p*n*d-e*f*d-c*n*g+e*u*g)*b,t[6]=(p*o*r-s*f*r-p*n*l+e*f*l+s*n*g-e*o*g)*b,t[7]=(s*u*r-c*o*r+c*n*l-e*u*l-s*n*d+e*o*d)*b,t[8]=_*b,t[9]=(p*h*r-c*m*r-p*i*d+e*m*d+c*i*g-e*h*g)*b,t[10]=(s*m*r-p*a*r+p*i*l-e*m*l-s*i*g+e*a*g)*b,t[11]=(c*a*r-s*h*r-c*i*l+e*h*l+s*i*d-e*a*d)*b,t[12]=y*b,t[13]=(c*m*n-p*h*n+p*i*u-e*m*u-c*i*f+e*h*f)*b,t[14]=(p*a*n-s*m*n-p*i*o+e*m*o+s*i*f-e*a*f)*b,t[15]=(s*h*n-c*a*n+c*i*o-e*h*o-s*i*u+e*a*u)*b,this}scale(t){const e=this.elements,i=t.x,n=t.y,r=t.z;return e[0]*=i,e[4]*=n,e[8]*=r,e[1]*=i,e[5]*=n,e[9]*=r,e[2]*=i,e[6]*=n,e[10]*=r,e[3]*=i,e[7]*=n,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,n))}makeTranslation(t,e,i){return this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const i=Math.cos(e),n=Math.sin(e),r=1-i,s=t.x,a=t.y,o=t.z,l=r*s,c=r*a;return this.set(l*s+i,l*a-n*o,l*o+n*a,0,l*a+n*o,c*a+i,c*o-n*s,0,l*o-n*a,c*o+n*s,r*o*o+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,n,r,s){return this.set(1,i,r,0,t,1,s,0,e,n,1,0,0,0,0,1),this}compose(t,e,i){const n=this.elements,r=e._x,s=e._y,a=e._z,o=e._w,l=r+r,c=s+s,h=a+a,u=r*l,d=r*c,p=r*h,m=s*c,f=s*h,g=a*h,v=o*l,x=o*c,_=o*h,y=i.x,M=i.y,b=i.z;return n[0]=(1-(m+g))*y,n[1]=(d+_)*y,n[2]=(p-x)*y,n[3]=0,n[4]=(d-_)*M,n[5]=(1-(u+g))*M,n[6]=(f+v)*M,n[7]=0,n[8]=(p+x)*b,n[9]=(f-v)*b,n[10]=(1-(u+m))*b,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this}decompose(t,e,i){const n=this.elements;let r=Ne.set(n[0],n[1],n[2]).length();const s=Ne.set(n[4],n[5],n[6]).length(),a=Ne.set(n[8],n[9],n[10]).length();this.determinant()<0&&(r=-r),t.x=n[12],t.y=n[13],t.z=n[14],Oe.copy(this);const o=1/r,l=1/s,c=1/a;return Oe.elements[0]*=o,Oe.elements[1]*=o,Oe.elements[2]*=o,Oe.elements[4]*=l,Oe.elements[5]*=l,Oe.elements[6]*=l,Oe.elements[8]*=c,Oe.elements[9]*=c,Oe.elements[10]*=c,e.setFromRotationMatrix(Oe),i.x=r,i.y=s,i.z=a,this}makePerspective(t,e,i,n,r,s){const a=this.elements,o=2*r/(e-t),l=2*r/(i-n),c=(e+t)/(e-t),h=(i+n)/(i-n),u=-(s+r)/(s-r),d=-2*s*r/(s-r);return a[0]=o,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=l,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=u,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(t,e,i,n,r,s){const a=this.elements,o=1/(e-t),l=1/(i-n),c=1/(s-r),h=(e+t)*o,u=(i+n)*l,d=(s+r)*c;return a[0]=2*o,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-u,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<16;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}const Ne=new ne,Oe=new Ie,ze=new ne(0,0,0),Ue=new ne(1,1,1),Be=new ne,Fe=new ne,ke=new ne,Ge=new Ie,Ve=new ie;class He{constructor(t=0,e=0,i=0,n=He.DefaultOrder){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=n}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,n=this._order){return this._x=t,this._y=e,this._z=i,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){const n=t.elements,r=n[0],s=n[4],a=n[8],o=n[1],l=n[5],c=n[9],h=n[2],u=n[6],d=n[10];switch(e){case"XYZ":this._y=Math.asin(yt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-s,r)):(this._x=Math.atan2(u,l),this._z=0);break;case"YXZ":this._x=Math.asin(-yt(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-h,r),this._z=0);break;case"ZXY":this._x=Math.asin(yt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-yt(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(u,d),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(yt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-h,r)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-yt(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(u,l),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-c,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===i&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return Ge.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Ge,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return Ve.setFromEuler(this),this.setFromQuaternion(Ve,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}toVector3(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")}}He.DefaultOrder="XYZ",He.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class We{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let t=0;t1){for(let t=0;t0){n.children=[];for(let e=0;e0){n.animations=[];for(let e=0;e0&&(i.geometries=e),n.length>0&&(i.materials=n),r.length>0&&(i.textures=r),a.length>0&&(i.images=a),o.length>0&&(i.shapes=o),l.length>0&&(i.skeletons=l),c.length>0&&(i.animations=c),h.length>0&&(i.nodes=h)}return i.object=n,i;function s(t){const e=[];for(const i in t){const n=t[i];delete n.metadata,e.push(n)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e0?n.multiplyScalar(1/Math.sqrt(r)):n.set(0,0,0)}static getBarycoord(t,e,i,n,r){si.subVectors(n,e),ai.subVectors(i,e),oi.subVectors(t,e);const s=si.dot(si),a=si.dot(ai),o=si.dot(oi),l=ai.dot(ai),c=ai.dot(oi),h=s*l-a*a;if(0===h)return r.set(-2,-1,-1);const u=1/h,d=(l*o-a*c)*u,p=(s*c-a*o)*u;return r.set(1-d-p,p,d)}static containsPoint(t,e,i,n){return this.getBarycoord(t,e,i,n,li),li.x>=0&&li.y>=0&&li.x+li.y<=1}static getUV(t,e,i,n,r,s,a,o){return this.getBarycoord(t,e,i,n,li),o.set(0,0),o.addScaledVector(r,li.x),o.addScaledVector(s,li.y),o.addScaledVector(a,li.z),o}static isFrontFacing(t,e,i,n){return si.subVectors(i,e),ai.subVectors(t,e),si.cross(ai).dot(n)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,n){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[n]),this}setFromAttributeAndIndices(t,e,i,n){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,n),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return si.subVectors(this.c,this.b),ai.subVectors(this.a,this.b),.5*si.cross(ai).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return fi.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return fi.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,i,n,r){return fi.getUV(t,this.a,this.b,this.c,e,i,n,r)}containsPoint(t){return fi.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return fi.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const i=this.a,n=this.b,r=this.c;let s,a;ci.subVectors(n,i),hi.subVectors(r,i),di.subVectors(t,i);const o=ci.dot(di),l=hi.dot(di);if(o<=0&&l<=0)return e.copy(i);pi.subVectors(t,n);const c=ci.dot(pi),h=hi.dot(pi);if(c>=0&&h<=c)return e.copy(n);const u=o*h-c*l;if(u<=0&&o>=0&&c<=0)return s=o/(o-c),e.copy(i).addScaledVector(ci,s);mi.subVectors(t,r);const d=ci.dot(mi),p=hi.dot(mi);if(p>=0&&d<=p)return e.copy(r);const m=d*l-o*p;if(m<=0&&l>=0&&p<=0)return a=l/(l-p),e.copy(i).addScaledVector(hi,a);const f=c*p-d*h;if(f<=0&&h-c>=0&&d-p>=0)return ui.subVectors(r,n),a=(h-c)/(h-c+(d-p)),e.copy(n).addScaledVector(ui,a);const g=1/(f+m+u);return s=m*g,a=u*g,e.copy(i).addScaledVector(ci,s).addScaledVector(hi,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let gi=0;class vi extends mt{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:gi++}),this.uuid=_t(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=i,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ht,this.stencilZFail=ht,this.stencilZPass=ht,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const i=t[e];if(void 0===i){console.warn("THREE.Material: '"+e+"' parameter is undefined.");continue}const n=this[e];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[e]=i:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function n(t){const e=[];for(const i in t){const n=t[i];delete n.metadata,e.push(n)}return e}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(i.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(i.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),0!==this.side&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(i.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=this.flatShading),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),e){const e=n(t.textures),r=n(t.images);e.length>0&&(i.textures=e),r.length>0&&(i.images=r)}return i}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let i=null;if(null!==e){const t=e.length;i=new Array(t);for(let n=0;n!==t;++n)i[n]=e[n].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}class xi extends vi{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new jt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const _i=new ne,yi=new Lt;class Mi{constructor(t,e,i){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===i,this.usage=ut,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this}copyAt(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let n=0,r=this.itemSize;n0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const i=this.attributes;for(const e in i){const n=i[e];t.data.attributes[e]=n.toJSON(t.data)}const n={};let r=!1;for(const e in this.morphAttributes){const i=this.morphAttributes[e],s=[];for(let e=0,n=i.length;e0&&(n[e]=s,r=!0)}r&&(t.data.morphAttributes=n,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return null!==a&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const i=t.index;null!==i&&this.setIndex(i.clone(e));const n=t.attributes;for(const t in n){const i=n[t];this.setAttribute(t,i.clone(e))}const r=t.morphAttributes;for(const t in r){const i=[],n=r[t];for(let t=0,r=n.length;t0){const i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;ti.far?null:{distance:c,point:Zi.clone(),object:t}}(t,e,i,n,zi,Ui,Bi,Yi);if(p){o&&(ji.fromBufferAttribute(o,c),qi.fromBufferAttribute(o,h),Xi.fromBufferAttribute(o,u),p.uv=fi.getUV(Yi,zi,Ui,Bi,ji,qi,Xi,new Lt)),l&&(ji.fromBufferAttribute(l,c),qi.fromBufferAttribute(l,h),Xi.fromBufferAttribute(l,u),p.uv2=fi.getUV(Yi,zi,Ui,Bi,ji,qi,Xi,new Lt));const t={a:c,b:h,c:u,normal:new ne,materialIndex:0};fi.getNormal(zi,Ui,Bi,t.normal),p.face=t}return p}class $i extends Di{constructor(t=1,e=1,i=1,n=1,r=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:n,heightSegments:r,depthSegments:s};const a=this;n=Math.floor(n),r=Math.floor(r),s=Math.floor(s);const o=[],l=[],c=[],h=[];let u=0,d=0;function p(t,e,i,n,r,s,p,m,f,g,v){const x=s/f,_=p/g,y=s/2,M=p/2,b=m/2,S=f+1,w=g+1;let T=0,A=0;const E=new ne;for(let s=0;s0?1:-1,c.push(E.x,E.y,E.z),h.push(o/f),h.push(1-s/g),T+=1}}for(let t=0;t0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;const i={};for(const t in this.extensions)!0===this.extensions[t]&&(i[t]=!0);return Object.keys(i).length>0&&(e.extensions=i),e}}class rn extends ri{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Ie,this.projectionMatrix=new Ie,this.projectionMatrixInverse=new Ie}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}class sn extends rn{constructor(t=50,e=1,i=.1,n=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*xt*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*vt*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*xt*Math.atan(Math.tan(.5*vt*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(t,e,i,n,r,s){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*vt*this.fov)/this.zoom,i=2*e,n=this.aspect*i,r=-.5*n;const s=this.view;if(null!==this.view&&this.view.enabled){const t=s.fullWidth,a=s.fullHeight;r+=s.offsetX*n/t,e-=s.offsetY*i/a,n*=s.width/t,i*=s.height/a}const a=this.filmOffset;0!==a&&(r+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,e,e-i,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const an=90;class on extends ri{constructor(t,e,i){super(),this.type="CubeCamera",this.renderTarget=i;const n=new sn(an,1,t,e);n.layers=this.layers,n.up.set(0,-1,0),n.lookAt(new ne(1,0,0)),this.add(n);const r=new sn(an,1,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new ne(-1,0,0)),this.add(r);const s=new sn(an,1,t,e);s.layers=this.layers,s.up.set(0,0,1),s.lookAt(new ne(0,1,0)),this.add(s);const a=new sn(an,1,t,e);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new ne(0,-1,0)),this.add(a);const o=new sn(an,1,t,e);o.layers=this.layers,o.up.set(0,-1,0),o.lookAt(new ne(0,0,1)),this.add(o);const l=new sn(an,1,t,e);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new ne(0,0,-1)),this.add(l)}update(t,e){null===this.parent&&this.updateMatrixWorld();const i=this.renderTarget,[n,r,s,a,o,l]=this.children,c=t.getRenderTarget(),h=t.toneMapping,u=t.xr.enabled;t.toneMapping=0,t.xr.enabled=!1;const d=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0),t.render(e,n),t.setRenderTarget(i,1),t.render(e,r),t.setRenderTarget(i,2),t.render(e,s),t.setRenderTarget(i,3),t.render(e,a),t.setRenderTarget(i,4),t.render(e,o),i.texture.generateMipmaps=d,t.setRenderTarget(i,5),t.render(e,l),t.setRenderTarget(c),t.toneMapping=h,t.xr.enabled=u,i.texture.needsPMREMUpdate=!0}}class ln extends Kt{constructor(t,e,i,n,s,a,o,l,c,h){super(t=void 0!==t?t:[],e=void 0!==e?e:r,i,n,s,a,o,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class cn extends Qt{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const i={width:t,height:t,depth:1},n=[i,i,i,i,i,i];this.texture=new ln(n,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:f}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.encoding=e.encoding,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},n=new $i(5,5,5),r=new nn({name:"CubemapFromEquirect",uniforms:Qi(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=e;const s=new Ji(n,r),a=e.minFilter;e.minFilter===v&&(e.minFilter=f);return new on(1,10,this).update(t,s),e.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(t,e,i,n){const r=t.getRenderTarget();for(let r=0;r<6;r++)t.setRenderTarget(this,r),t.clear(e,i,n);t.setRenderTarget(r)}}const hn=new ne,un=new ne,dn=new Rt;class pn{constructor(t=new ne(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,i,n){return this.normal.set(t,e,i),this.constant=n,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,i){const n=hn.subVectors(i,e).cross(un.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)}intersectLine(t,e){const i=t.delta(hn),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const r=-(t.start.dot(this.normal)+this.constant)/n;return r<0||r>1?null:e.copy(i).multiplyScalar(r).add(t.start)}intersectsLine(t){const e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const i=e||dn.getNormalMatrix(t),n=this.coplanarPoint(hn).applyMatrix4(t),r=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const mn=new we,fn=new ne;class gn{constructor(t=new pn,e=new pn,i=new pn,n=new pn,r=new pn,s=new pn){this.planes=[t,e,i,n,r,s]}set(t,e,i,n,r,s){const a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(i),a[3].copy(n),a[4].copy(r),a[5].copy(s),this}copy(t){const e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t){const e=this.planes,i=t.elements,n=i[0],r=i[1],s=i[2],a=i[3],o=i[4],l=i[5],c=i[6],h=i[7],u=i[8],d=i[9],p=i[10],m=i[11],f=i[12],g=i[13],v=i[14],x=i[15];return e[0].setComponents(a-n,h-o,m-u,x-f).normalize(),e[1].setComponents(a+n,h+o,m+u,x+f).normalize(),e[2].setComponents(a+r,h+l,m+d,x+g).normalize(),e[3].setComponents(a-r,h-l,m-d,x-g).normalize(),e[4].setComponents(a-s,h-c,m-p,x-v).normalize(),e[5].setComponents(a+s,h+c,m+p,x+v).normalize(),this}intersectsObject(t){const e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),mn.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(mn)}intersectsSprite(t){return mn.center.set(0,0,0),mn.radius=.7071067811865476,mn.applyMatrix4(t.matrixWorld),this.intersectsSphere(mn)}intersectsSphere(t){const e=this.planes,i=t.center,n=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(i)0?t.max.x:t.min.x,fn.y=n.normal.y>0?t.max.y:t.min.y,fn.z=n.normal.z>0?t.max.z:t.min.z,n.distanceToPoint(fn)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function vn(){let t=null,e=!1,i=null,n=null;function r(e,s){i(e,s),n=t.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==i&&(n=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(t){i=t},setContext:function(e){t=e}}}function xn(t,e){const i=e.isWebGL2,n=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),n.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const i=n.get(e);i&&(t.deleteBuffer(i.buffer),n.delete(e))},update:function(e,r){if(e.isGLBufferAttribute){const t=n.get(e);return void((!t||t.version 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660,\t0.0556434,\n\t\t-1.5371385,\t1.8760108, -0.2040259,\n\t\t-0.4985314,\t0.0415560,\t1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\t return vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat R21 = R12;\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos.xyz );\n\t\tvec3 vSigmaY = dFdy( surf_pos.xyz );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert\n#define Material_LightProbeLOD( material )\t(0)",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3(\t\t0, 1,\t\t0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX_Iridescence( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness );\n\t#else\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t\tf.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t\tf.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if defined( USE_SHADOWMAP ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_COORDS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tuniform int boneTextureSize;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\ty = dy * ( y + 0.5 );\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\treturn bone;\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3(\t1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108,\t1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605,\t1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef texture2DLodEXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tgl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );\n\t#endif\n\t#include \n\t#include \n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"},Mn={common:{diffuse:{value:new jt(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Rt},uv2Transform:{value:new Rt},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Lt(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new jt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new jt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Rt}},sprite:{diffuse:{value:new jt(16777215)},opacity:{value:1},center:{value:new Lt(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Rt}}},bn={basic:{uniforms:tn([Mn.common,Mn.specularmap,Mn.envmap,Mn.aomap,Mn.lightmap,Mn.fog]),vertexShader:yn.meshbasic_vert,fragmentShader:yn.meshbasic_frag},lambert:{uniforms:tn([Mn.common,Mn.specularmap,Mn.envmap,Mn.aomap,Mn.lightmap,Mn.emissivemap,Mn.bumpmap,Mn.normalmap,Mn.displacementmap,Mn.fog,Mn.lights,{emissive:{value:new jt(0)}}]),vertexShader:yn.meshlambert_vert,fragmentShader:yn.meshlambert_frag},phong:{uniforms:tn([Mn.common,Mn.specularmap,Mn.envmap,Mn.aomap,Mn.lightmap,Mn.emissivemap,Mn.bumpmap,Mn.normalmap,Mn.displacementmap,Mn.fog,Mn.lights,{emissive:{value:new jt(0)},specular:{value:new jt(1118481)},shininess:{value:30}}]),vertexShader:yn.meshphong_vert,fragmentShader:yn.meshphong_frag},standard:{uniforms:tn([Mn.common,Mn.envmap,Mn.aomap,Mn.lightmap,Mn.emissivemap,Mn.bumpmap,Mn.normalmap,Mn.displacementmap,Mn.roughnessmap,Mn.metalnessmap,Mn.fog,Mn.lights,{emissive:{value:new jt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:yn.meshphysical_vert,fragmentShader:yn.meshphysical_frag},toon:{uniforms:tn([Mn.common,Mn.aomap,Mn.lightmap,Mn.emissivemap,Mn.bumpmap,Mn.normalmap,Mn.displacementmap,Mn.gradientmap,Mn.fog,Mn.lights,{emissive:{value:new jt(0)}}]),vertexShader:yn.meshtoon_vert,fragmentShader:yn.meshtoon_frag},matcap:{uniforms:tn([Mn.common,Mn.bumpmap,Mn.normalmap,Mn.displacementmap,Mn.fog,{matcap:{value:null}}]),vertexShader:yn.meshmatcap_vert,fragmentShader:yn.meshmatcap_frag},points:{uniforms:tn([Mn.points,Mn.fog]),vertexShader:yn.points_vert,fragmentShader:yn.points_frag},dashed:{uniforms:tn([Mn.common,Mn.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:yn.linedashed_vert,fragmentShader:yn.linedashed_frag},depth:{uniforms:tn([Mn.common,Mn.displacementmap]),vertexShader:yn.depth_vert,fragmentShader:yn.depth_frag},normal:{uniforms:tn([Mn.common,Mn.bumpmap,Mn.normalmap,Mn.displacementmap,{opacity:{value:1}}]),vertexShader:yn.meshnormal_vert,fragmentShader:yn.meshnormal_frag},sprite:{uniforms:tn([Mn.sprite,Mn.fog]),vertexShader:yn.sprite_vert,fragmentShader:yn.sprite_frag},background:{uniforms:{uvTransform:{value:new Rt},t2D:{value:null}},vertexShader:yn.background_vert,fragmentShader:yn.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0}},vertexShader:yn.backgroundCube_vert,fragmentShader:yn.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:yn.cube_vert,fragmentShader:yn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:yn.equirect_vert,fragmentShader:yn.equirect_frag},distanceRGBA:{uniforms:tn([Mn.common,Mn.displacementmap,{referencePosition:{value:new ne},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:yn.distanceRGBA_vert,fragmentShader:yn.distanceRGBA_frag},shadow:{uniforms:tn([Mn.lights,Mn.fog,{color:{value:new jt(0)},opacity:{value:1}}]),vertexShader:yn.shadow_vert,fragmentShader:yn.shadow_frag}};function Sn(t,e,i,n,r,s,a){const o=new jt(0);let c,h,u=!0===s?0:1,d=null,p=0,m=null;function f(t,e){n.buffers.color.setClear(t.r,t.g,t.b,e,a)}return{getClearColor:function(){return o},setClearColor:function(t,e=1){o.set(t),u=e,f(o,u)},getClearAlpha:function(){return u},setClearAlpha:function(t){u=t,f(o,u)},render:function(n,s){let a=!1,g=!0===s.isScene?s.background:null;if(g&&g.isTexture){g=(s.backgroundBlurriness>0?i:e).get(g)}const v=t.xr,x=v.getSession&&v.getSession();x&&"additive"===x.environmentBlendMode&&(g=null),null===g?f(o,u):g&&g.isColor&&(f(g,1),a=!0),(t.autoClear||a)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),g&&(g.isCubeTexture||g.mapping===l)?(void 0===h&&(h=new Ji(new $i(1,1,1),new nn({name:"BackgroundCubeMaterial",uniforms:Qi(bn.backgroundCube.uniforms),vertexShader:bn.backgroundCube.vertexShader,fragmentShader:bn.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(t,e,i){this.matrixWorld.copyPosition(i.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(h)),h.material.uniforms.envMap.value=g,h.material.uniforms.flipEnvMap.value=g.isCubeTexture&&!1===g.isRenderTargetTexture?-1:1,h.material.uniforms.backgroundBlurriness.value=s.backgroundBlurriness,d===g&&p===g.version&&m===t.toneMapping||(h.material.needsUpdate=!0,d=g,p=g.version,m=t.toneMapping),h.layers.enableAll(),n.unshift(h,h.geometry,h.material,0,0,null)):g&&g.isTexture&&(void 0===c&&(c=new Ji(new _n(2,2),new nn({name:"BackgroundMaterial",uniforms:Qi(bn.background.uniforms),vertexShader:bn.background.vertexShader,fragmentShader:bn.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=g,!0===g.matrixAutoUpdate&&g.updateMatrix(),c.material.uniforms.uvTransform.value.copy(g.matrix),d===g&&p===g.version&&m===t.toneMapping||(c.material.needsUpdate=!0,d=g,p=g.version,m=t.toneMapping),c.layers.enableAll(),n.unshift(c,c.geometry,c.material,0,0,null))}}}function wn(t,e,i,n){const r=t.getParameter(34921),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),a=n.isWebGL2||null!==s,o={},l=p(null);let c=l,h=!1;function u(e){return n.isWebGL2?t.bindVertexArray(e):s.bindVertexArrayOES(e)}function d(e){return n.isWebGL2?t.deleteVertexArray(e):s.deleteVertexArrayOES(e)}function p(t){const e=[],i=[],n=[];for(let t=0;t=0){const i=r[e];let n=s[e];if(void 0===n&&("instanceMatrix"===e&&t.instanceMatrix&&(n=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(n=t.instanceColor)),void 0===i)return!0;if(i.attribute!==n)return!0;if(n&&i.data!==n.data)return!0;a++}}return c.attributesNum!==a||c.index!==n}(r,_,d,y),M&&function(t,e,i,n){const r={},s=e.attributes;let a=0;const o=i.getAttributes();for(const e in o){if(o[e].location>=0){let i=s[e];void 0===i&&("instanceMatrix"===e&&t.instanceMatrix&&(i=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(i=t.instanceColor));const n={};n.attribute=i,i&&i.data&&(n.data=i.data),r[e]=n,a++}}c.attributes=r,c.attributesNum=a,c.index=n}(r,_,d,y)}else{const t=!0===l.wireframe;c.geometry===_.id&&c.program===d.id&&c.wireframe===t||(c.geometry=_.id,c.program=d.id,c.wireframe=t,M=!0)}null!==y&&i.update(y,34963),(M||h)&&(h=!1,function(r,s,a,o){if(!1===n.isWebGL2&&(r.isInstancedMesh||o.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;m();const l=o.attributes,c=a.getAttributes(),h=s.defaultAttributeValues;for(const e in c){const n=c[e];if(n.location>=0){let s=l[e];if(void 0===s&&("instanceMatrix"===e&&r.instanceMatrix&&(s=r.instanceMatrix),"instanceColor"===e&&r.instanceColor&&(s=r.instanceColor)),void 0!==s){const e=s.normalized,a=s.itemSize,l=i.get(s);if(void 0===l)continue;const c=l.buffer,h=l.type,u=l.bytesPerElement;if(s.isInterleavedBufferAttribute){const i=s.data,l=i.stride,d=s.offset;if(i.isInstancedInterleavedBuffer){for(let t=0;t0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const s="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext;let a=void 0!==i.precision?i.precision:"highp";const o=r(a);o!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",o,"instead."),a=o);const l=s||e.has("WEBGL_draw_buffers"),c=!0===i.logarithmicDepthBuffer,h=t.getParameter(34930),u=t.getParameter(35660),d=t.getParameter(3379),p=t.getParameter(34076),m=t.getParameter(34921),f=t.getParameter(36347),g=t.getParameter(36348),v=t.getParameter(36349),x=u>0,_=s||e.has("OES_texture_float");return{isWebGL2:s,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==n)return n;if(!0===e.has("EXT_texture_filter_anisotropic")){const i=e.get("EXT_texture_filter_anisotropic");n=t.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n},getMaxPrecision:r,precision:a,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:f,maxVaryings:g,maxFragmentUniforms:v,vertexTextures:x,floatFragmentTextures:_,floatVertexTextures:x&&_,maxSamples:s?t.getParameter(36183):0}}function En(t){const e=this;let i=null,n=0,r=!1,s=!1;const a=new pn,o=new Rt,l={value:null,needsUpdate:!1};function c(){l.value!==i&&(l.value=i,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function h(t,i,n,r){const s=null!==t?t.length:0;let c=null;if(0!==s){if(c=l.value,!0!==r||null===c){const e=n+4*s,r=i.matrixWorldInverse;o.getNormalMatrix(r),(null===c||c.length0){const a=new cn(s.height/2);return a.fromEquirectangularTexture(t,r),e.set(r,a),r.addEventListener("dispose",n),i(a.texture,r.mapping)}return null}}}return r},dispose:function(){e=new WeakMap}}}bn.physical={uniforms:tn([bn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Lt(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new jt(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Lt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new jt(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new jt(1,1,1)},specularColorMap:{value:null}}]),vertexShader:yn.meshphysical_vert,fragmentShader:yn.meshphysical_frag};class Ln extends rn{constructor(t=-1,e=1,i=1,n=-1,r=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=n,this.near=r,this.far=s,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,i,n,r,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2;let r=i-t,s=i+t,a=n+e,o=n-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,s=r+t*this.view.width,a-=e*this.view.offsetY,o=a-e*this.view.height}this.projectionMatrix.makeOrthographic(r,s,a,o,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}const Rn=[.125,.215,.35,.446,.526,.582],Pn=20,Dn=new Ln,In=new jt;let Nn=null;const On=(1+Math.sqrt(5))/2,zn=1/On,Un=[new ne(1,1,1),new ne(-1,1,1),new ne(1,1,-1),new ne(-1,1,-1),new ne(0,On,zn),new ne(0,On,-zn),new ne(zn,0,On),new ne(-zn,0,On),new ne(On,zn,0),new ne(-On,zn,0)];class Bn{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,i=.1,n=100){Nn=this._renderer.getRenderTarget(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(t,i,n,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=Vn(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=Gn(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let t=0;tt-4?o=Rn[a-t+4-1]:0===a&&(o=0),n.push(o);const l=1/(s-2),c=-l,h=1+l,u=[c,c,h,c,h,h,c,c,h,h,c,h],d=6,p=6,m=3,f=2,g=1,v=new Float32Array(m*p*d),x=new Float32Array(f*p*d),_=new Float32Array(g*p*d);for(let t=0;t2?0:-1,n=[e,i,0,e+2/3,i,0,e+2/3,i+1,0,e,i,0,e+2/3,i+1,0,e,i+1,0];v.set(n,m*p*t),x.set(u,f*p*t);const r=[t,t,t,t,t,t];_.set(r,g*p*t)}const y=new Di;y.setAttribute("position",new Mi(v,m)),y.setAttribute("uv",new Mi(x,f)),y.setAttribute("faceIndex",new Mi(_,g)),e.push(y),r>4&&r--}return{lodPlanes:e,sizeLods:i,sigmas:n}}(n)),this._blurMaterial=function(t,e,i){const n=new Float32Array(Pn),r=new ne(0,1,0);return new nn({name:"SphericalGaussianBlur",defines:{n:Pn,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/i,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:Hn(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include \n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}(n,t,e)}return n}_compileMaterial(t){const e=new Ji(this._lodPlanes[0],t);this._renderer.compile(e,Dn)}_sceneToCubeUV(t,e,i,n){const r=new sn(90,1,e,i),s=[1,-1,1,1,1,1],a=[1,1,1,-1,-1,-1],o=this._renderer,l=o.autoClear,c=o.toneMapping;o.getClearColor(In),o.toneMapping=0,o.autoClear=!1;const h=new xi({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1}),u=new Ji(new $i,h);let d=!1;const p=t.background;p?p.isColor&&(h.color.copy(p),t.background=null,d=!0):(h.color.copy(In),d=!0);for(let e=0;e<6;e++){const i=e%3;0===i?(r.up.set(0,s[e],0),r.lookAt(a[e],0,0)):1===i?(r.up.set(0,0,s[e]),r.lookAt(0,a[e],0)):(r.up.set(0,s[e],0),r.lookAt(0,0,a[e]));const l=this._cubeSize;kn(n,i*l,e>2?l:0,l,l),o.setRenderTarget(n),d&&o.render(u,r),o.render(t,r)}u.geometry.dispose(),u.material.dispose(),o.toneMapping=c,o.autoClear=l,t.background=p}_textureToCubeUV(t,e){const i=this._renderer,n=t.mapping===r||t.mapping===s;n?(null===this._cubemapMaterial&&(this._cubemapMaterial=Vn()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=Gn());const a=n?this._cubemapMaterial:this._equirectMaterial,o=new Ji(this._lodPlanes[0],a);a.uniforms.envMap.value=t;const l=this._cubeSize;kn(e,0,0,3*l,2*l),i.setRenderTarget(e),i.render(o,Dn)}_applyPMREM(t){const e=this._renderer,i=e.autoClear;e.autoClear=!1;for(let e=1;ePn&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to 20`);const f=[];let g=0;for(let t=0;tv-4?n-v+4:0),4*(this._cubeSize-x),3*x,2*x),o.setRenderTarget(e),o.render(c,Dn)}}function Fn(t,e,i){const n=new Qt(t,e,i);return n.texture.mapping=l,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function kn(t,e,i,n,r){t.viewport.set(e,i,n,r),t.scissor.set(e,i,n,r)}function Gn(){return new nn({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Hn(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function Vn(){return new nn({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Hn(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function Hn(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function Wn(t){let e=new WeakMap,i=null;function n(t){const i=t.target;i.removeEventListener("dispose",n);const r=e.get(i);void 0!==r&&(e.delete(i),r.dispose())}return{get:function(l){if(l&&l.isTexture){const c=l.mapping,h=c===a||c===o,u=c===r||c===s;if(h||u){if(l.isRenderTargetTexture&&!0===l.needsPMREMUpdate){l.needsPMREMUpdate=!1;let n=e.get(l);return null===i&&(i=new Bn(t)),n=h?i.fromEquirectangular(l,n):i.fromCubemap(l,n),e.set(l,n),n.texture}if(e.has(l))return e.get(l).texture;{const r=l.image;if(h&&r&&r.height>0||u&&r&&function(t){let e=0;const i=6;for(let n=0;ne.maxTextureSize&&(E=Math.ceil(A/e.maxTextureSize),A=e.maxTextureSize);const C=new Float32Array(A*E*4*m),L=new te(C,A,E,m);L.type=M,L.needsUpdate=!0;const R=4*T;for(let D=0;D0)return t;const r=e*i;let s=nr[r];if(void 0===s&&(s=new Float32Array(r),nr[r]=s),0!==e){n.toArray(s,0);for(let n=1,r=0;n!==e;++n)r+=i,t[n].toArray(s,r)}return s}function cr(t,e){if(t.length!==e.length)return!1;for(let i=0,n=t.length;i":" "} ${r}: ${i[t]}`)}return n.join("\n")}(t.getShaderSource(e),n)}return r}function as(t,e){const i=function(t){switch(t){case at:return["Linear","( value )"];case ot:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",t),["Linear","( value )"]}}(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+i[0]+i[1]+"; }"}function os(t,e){let i;switch(e){case 1:i="Linear";break;case 2:i="Reinhard";break;case 3:i="OptimizedCineon";break;case 4:i="ACESFilmic";break;case 5:i="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),i="Linear"}return"vec3 "+t+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function ls(t){return""!==t}function cs(t,e){const i=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,i).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function hs(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const us=/^[ \t]*#include +<([\w\d./]+)>/gm;function ds(t){return t.replace(us,ps)}function ps(t,e){const i=yn[e];if(void 0===i)throw new Error("Can not resolve #include <"+e+">");return ds(i)}const ms=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function fs(t){return t.replace(ms,gs)}function gs(t,e,i,n){let r="";for(let t=parseInt(e);t0&&(_+="\n"),y=[g,v].filter(ls).join("\n"),y.length>0&&(y+="\n")):(_=[vs(i),"#define SHADER_NAME "+i.shaderName,v,i.instancing?"#define USE_INSTANCING":"",i.instancingColor?"#define USE_INSTANCING_COLOR":"",i.supportsVertexTextures?"#define VERTEX_TEXTURES":"",i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+p:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.displacementMap&&i.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",i.specularColorMap?"#define USE_SPECULARCOLORMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.sheenColorMap?"#define USE_SHEENCOLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&!1===i.flatShading?"#define USE_MORPHNORMALS":"",i.morphColors&&i.isWebGL2?"#define USE_MORPHCOLORS":"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+i.morphTextureStride:"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_COUNT "+i.morphTargetsCount:"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+u:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(ls).join("\n"),y=[g,vs(i),"#define SHADER_NAME "+i.shaderName,v,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+d:"",i.envMap?"#define "+p:"",i.envMap?"#define "+m:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoat?"#define USE_CLEARCOAT":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.iridescence?"#define USE_IRIDESCENCE":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",i.specularColorMap?"#define USE_SPECULARCOLORMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaTest?"#define USE_ALPHATEST":"",i.sheen?"#define USE_SHEEN":"",i.sheenColorMap?"#define USE_SHEENCOLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors||i.instancingColor?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+u:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==i.toneMapping?"#define TONE_MAPPING":"",0!==i.toneMapping?yn.tonemapping_pars_fragment:"",0!==i.toneMapping?os("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.opaque?"#define OPAQUE":"",yn.encodings_pars_fragment,as("linearToOutputTexel",i.outputEncoding),i.useDepthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(ls).join("\n")),c=ds(c),c=cs(c,i),c=hs(c,i),h=ds(h),h=cs(h,i),h=hs(h,i),c=fs(c),h=fs(h),i.isWebGL2&&!0!==i.isRawShaderMaterial&&(M="#version 300 es\n",_=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+_,y=["#define varying in",i.glslVersion===dt?"":"layout(location = 0) out highp vec4 pc_fragColor;",i.glslVersion===dt?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+y);const b=M+y+h,S=ns(a,35633,M+_+c),w=ns(a,35632,b);if(a.attachShader(x,S),a.attachShader(x,w),void 0!==i.index0AttributeName?a.bindAttribLocation(x,0,i.index0AttributeName):!0===i.morphTargets&&a.bindAttribLocation(x,0,"position"),a.linkProgram(x),t.debug.checkShaderErrors){const t=a.getProgramInfoLog(x).trim(),e=a.getShaderInfoLog(S).trim(),i=a.getShaderInfoLog(w).trim();let n=!0,r=!0;if(!1===a.getProgramParameter(x,35714)){n=!1;const e=ss(a,S,"vertex"),i=ss(a,w,"fragment");console.error("THREE.WebGLProgram: Shader Error "+a.getError()+" - VALIDATE_STATUS "+a.getProgramParameter(x,35715)+"\n\nProgram Info Log: "+t+"\n"+e+"\n"+i)}else""!==t?console.warn("THREE.WebGLProgram: Program Info Log:",t):""!==e&&""!==i||(r=!1);r&&(this.diagnostics={runnable:n,programLog:t,vertexShader:{log:e,prefix:_},fragmentShader:{log:i,prefix:y}})}let T,A;return a.deleteShader(S),a.deleteShader(w),this.getUniforms=function(){return void 0===T&&(T=new is(a,x)),T},this.getAttributes=function(){return void 0===A&&(A=function(t,e){const i={},n=t.getProgramParameter(e,35721);for(let r=0;r0,I=s.clearcoat>0,N=s.iridescence>0;return{isWebGL2:u,shaderID:S,shaderName:s.type,vertexShader:A,fragmentShader:E,defines:s.defines,customVertexShaderID:C,customFragmentShaderID:L,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:m,instancing:!0===v.isInstancedMesh,instancingColor:!0===v.isInstancedMesh&&null!==v.instanceColor,supportsVertexTextures:p,outputEncoding:null===P?t.outputEncoding:!0===P.isXRRenderTarget?P.texture.encoding:at,map:!!s.map,matcap:!!s.matcap,envMap:!!M,envMapMode:M&&M.mapping,envMapCubeUVHeight:b,lightMap:!!s.lightMap,aoMap:!!s.aoMap,emissiveMap:!!s.emissiveMap,bumpMap:!!s.bumpMap,normalMap:!!s.normalMap,objectSpaceNormalMap:1===s.normalMapType,tangentSpaceNormalMap:0===s.normalMapType,decodeVideoTexture:!!s.map&&!0===s.map.isVideoTexture&&s.map.encoding===ot,clearcoat:I,clearcoatMap:I&&!!s.clearcoatMap,clearcoatRoughnessMap:I&&!!s.clearcoatRoughnessMap,clearcoatNormalMap:I&&!!s.clearcoatNormalMap,iridescence:N,iridescenceMap:N&&!!s.iridescenceMap,iridescenceThicknessMap:N&&!!s.iridescenceThicknessMap,displacementMap:!!s.displacementMap,roughnessMap:!!s.roughnessMap,metalnessMap:!!s.metalnessMap,specularMap:!!s.specularMap,specularIntensityMap:!!s.specularIntensityMap,specularColorMap:!!s.specularColorMap,opaque:!1===s.transparent&&1===s.blending,alphaMap:!!s.alphaMap,alphaTest:D,gradientMap:!!s.gradientMap,sheen:s.sheen>0,sheenColorMap:!!s.sheenColorMap,sheenRoughnessMap:!!s.sheenRoughnessMap,transmission:s.transmission>0,transmissionMap:!!s.transmissionMap,thicknessMap:!!s.thicknessMap,combine:s.combine,vertexTangents:!!s.normalMap&&!!_.attributes.tangent,vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!_.attributes.color&&4===_.attributes.color.itemSize,vertexUvs:!!(s.map||s.bumpMap||s.normalMap||s.specularMap||s.alphaMap||s.emissiveMap||s.roughnessMap||s.metalnessMap||s.clearcoatMap||s.clearcoatRoughnessMap||s.clearcoatNormalMap||s.iridescenceMap||s.iridescenceThicknessMap||s.displacementMap||s.transmissionMap||s.thicknessMap||s.specularIntensityMap||s.specularColorMap||s.sheenColorMap||s.sheenRoughnessMap),uvsVertexOnly:!(s.map||s.bumpMap||s.normalMap||s.specularMap||s.alphaMap||s.emissiveMap||s.roughnessMap||s.metalnessMap||s.clearcoatNormalMap||s.iridescenceMap||s.iridescenceThicknessMap||s.transmission>0||s.transmissionMap||s.thicknessMap||s.specularIntensityMap||s.specularColorMap||s.sheen>0||s.sheenColorMap||s.sheenRoughnessMap||!s.displacementMap),fog:!!x,useFog:!0===s.fog,fogExp2:x&&x.isFogExp2,flatShading:!!s.flatShading,sizeAttenuation:s.sizeAttenuation,logarithmicDepthBuffer:d,skinning:!0===v.isSkinnedMesh,morphTargets:void 0!==_.morphAttributes.position,morphNormals:void 0!==_.morphAttributes.normal,morphColors:void 0!==_.morphAttributes.color,morphTargetsCount:T,morphTextureStride:R,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:s.dithering,shadowMapEnabled:t.shadowMap.enabled&&h.length>0,shadowMapType:t.shadowMap.type,toneMapping:s.toneMapped?t.toneMapping:0,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:s.premultipliedAlpha,doubleSided:2===s.side,flipSided:1===s.side,useDepthPacking:!!s.depthPacking,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionDerivatives:s.extensions&&s.extensions.derivatives,extensionFragDepth:s.extensions&&s.extensions.fragDepth,extensionDrawBuffers:s.extensions&&s.extensions.drawBuffers,extensionShaderTextureLOD:s.extensions&&s.extensions.shaderTextureLOD,rendererExtensionFragDepth:u||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||n.has("EXT_shader_texture_lod"),customProgramCacheKey:s.customProgramCacheKey()}},getProgramCacheKey:function(e){const i=[];if(e.shaderID?i.push(e.shaderID):(i.push(e.customVertexShaderID),i.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)i.push(t),i.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(!function(t,e){t.push(e.precision),t.push(e.outputEncoding),t.push(e.envMapMode),t.push(e.envMapCubeUVHeight),t.push(e.combine),t.push(e.vertexUvs),t.push(e.fogExp2),t.push(e.sizeAttenuation),t.push(e.morphTargetsCount),t.push(e.morphAttributeCount),t.push(e.numDirLights),t.push(e.numPointLights),t.push(e.numSpotLights),t.push(e.numSpotLightMaps),t.push(e.numHemiLights),t.push(e.numRectAreaLights),t.push(e.numDirLightShadows),t.push(e.numPointLightShadows),t.push(e.numSpotLightShadows),t.push(e.numSpotLightShadowsWithMaps),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection),t.push(e.depthPacking)}(i,e),function(t,e){o.disableAll(),e.isWebGL2&&o.enable(0);e.supportsVertexTextures&&o.enable(1);e.instancing&&o.enable(2);e.instancingColor&&o.enable(3);e.map&&o.enable(4);e.matcap&&o.enable(5);e.envMap&&o.enable(6);e.lightMap&&o.enable(7);e.aoMap&&o.enable(8);e.emissiveMap&&o.enable(9);e.bumpMap&&o.enable(10);e.normalMap&&o.enable(11);e.objectSpaceNormalMap&&o.enable(12);e.tangentSpaceNormalMap&&o.enable(13);e.clearcoat&&o.enable(14);e.clearcoatMap&&o.enable(15);e.clearcoatRoughnessMap&&o.enable(16);e.clearcoatNormalMap&&o.enable(17);e.iridescence&&o.enable(18);e.iridescenceMap&&o.enable(19);e.iridescenceThicknessMap&&o.enable(20);e.displacementMap&&o.enable(21);e.specularMap&&o.enable(22);e.roughnessMap&&o.enable(23);e.metalnessMap&&o.enable(24);e.gradientMap&&o.enable(25);e.alphaMap&&o.enable(26);e.alphaTest&&o.enable(27);e.vertexColors&&o.enable(28);e.vertexAlphas&&o.enable(29);e.vertexUvs&&o.enable(30);e.vertexTangents&&o.enable(31);e.uvsVertexOnly&&o.enable(32);t.push(o.mask),o.disableAll(),e.fog&&o.enable(0);e.useFog&&o.enable(1);e.flatShading&&o.enable(2);e.logarithmicDepthBuffer&&o.enable(3);e.skinning&&o.enable(4);e.morphTargets&&o.enable(5);e.morphNormals&&o.enable(6);e.morphColors&&o.enable(7);e.premultipliedAlpha&&o.enable(8);e.shadowMapEnabled&&o.enable(9);e.physicallyCorrectLights&&o.enable(10);e.doubleSided&&o.enable(11);e.flipSided&&o.enable(12);e.useDepthPacking&&o.enable(13);e.dithering&&o.enable(14);e.specularIntensityMap&&o.enable(15);e.specularColorMap&&o.enable(16);e.transmission&&o.enable(17);e.transmissionMap&&o.enable(18);e.thicknessMap&&o.enable(19);e.sheen&&o.enable(20);e.sheenColorMap&&o.enable(21);e.sheenRoughnessMap&&o.enable(22);e.decodeVideoTexture&&o.enable(23);e.opaque&&o.enable(24);t.push(o.mask)}(i,e),i.push(t.outputEncoding)),i.push(e.customProgramCacheKey),i.join()},getUniforms:function(t){const e=f[t.type];let i;if(e){const t=bn[e];i=en.clone(t.uniforms)}else i=t.uniforms;return i},acquireProgram:function(e,i){let n;for(let t=0,e=h.length;t0?n.push(h):!0===a.transparent?r.push(h):i.push(h)},unshift:function(t,e,a,o,l,c){const h=s(t,e,a,o,l,c);a.transmission>0?n.unshift(h):!0===a.transparent?r.unshift(h):i.unshift(h)},finish:function(){for(let i=e,n=t.length;i1&&i.sort(t||ws),n.length>1&&n.sort(e||Ts),r.length>1&&r.sort(e||Ts)}}}function Es(){let t=new WeakMap;return{get:function(e,i){const n=t.get(e);let r;return void 0===n?(r=new As,t.set(e,[r])):i>=n.length?(r=new As,n.push(r)):r=n[i],r},dispose:function(){t=new WeakMap}}}function Cs(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let i;switch(e.type){case"DirectionalLight":i={direction:new ne,color:new jt};break;case"SpotLight":i={position:new ne,direction:new ne,color:new jt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new ne,color:new jt,distance:0,decay:0};break;case"HemisphereLight":i={direction:new ne,skyColor:new jt,groundColor:new jt};break;case"RectAreaLight":i={color:new jt,position:new ne,halfWidth:new ne,halfHeight:new ne}}return t[e.id]=i,i}}}let Ls=0;function Rs(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function Ps(t,e){const i=new Cs,n=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let i;switch(e.type){case"DirectionalLight":case"SpotLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Lt};break;case"PointLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Lt,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=i,i}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let t=0;t<9;t++)r.probe.push(new ne);const s=new ne,a=new Ie,o=new Ie;return{setup:function(s,a){let o=0,l=0,c=0;for(let t=0;t<9;t++)r.probe[t].set(0,0,0);let h=0,u=0,d=0,p=0,m=0,f=0,g=0,v=0,x=0,_=0;s.sort(Rs);const y=!0!==a?Math.PI:1;for(let t=0,e=s.length;t0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(r.rectAreaLTC1=Mn.LTC_FLOAT_1,r.rectAreaLTC2=Mn.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(r.rectAreaLTC1=Mn.LTC_HALF_1,r.rectAreaLTC2=Mn.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=o,r.ambient[1]=l,r.ambient[2]=c;const M=r.hash;M.directionalLength===h&&M.pointLength===u&&M.spotLength===d&&M.rectAreaLength===p&&M.hemiLength===m&&M.numDirectionalShadows===f&&M.numPointShadows===g&&M.numSpotShadows===v&&M.numSpotMaps===x||(r.directional.length=h,r.spot.length=d,r.rectArea.length=p,r.point.length=u,r.hemi.length=m,r.directionalShadow.length=f,r.directionalShadowMap.length=f,r.pointShadow.length=g,r.pointShadowMap.length=g,r.spotShadow.length=v,r.spotShadowMap.length=v,r.directionalShadowMatrix.length=f,r.pointShadowMatrix.length=g,r.spotLightMatrix.length=v+x-_,r.spotLightMap.length=x,r.numSpotLightShadowsWithMaps=_,M.directionalLength=h,M.pointLength=u,M.spotLength=d,M.rectAreaLength=p,M.hemiLength=m,M.numDirectionalShadows=f,M.numPointShadows=g,M.numSpotShadows=v,M.numSpotMaps=x,r.version=Ls++)},setupView:function(t,e){let i=0,n=0,l=0,c=0,h=0;const u=e.matrixWorldInverse;for(let e=0,d=t.length;e=s.length?(a=new Ds(t,e),s.push(a)):a=s[r],a},dispose:function(){i=new WeakMap}}}class Ns extends vi{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class Os extends vi{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new ne,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}function zs(t,e,i){let n=new gn;const r=new Lt,s=new Lt,a=new $t,o=new Ns({depthPacking:3201}),l=new Os,c={},h=i.maxTextureSize,u={0:1,1:0,2:2},p=new nn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Lt},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),m=p.clone();m.defines.HORIZONTAL_PASS=1;const f=new Di;f.setAttribute("position",new Mi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const g=new Ji(f,p),v=this;function x(i,n){const s=e.update(g);p.defines.VSM_SAMPLES!==i.blurSamples&&(p.defines.VSM_SAMPLES=i.blurSamples,m.defines.VSM_SAMPLES=i.blurSamples,p.needsUpdate=!0,m.needsUpdate=!0),null===i.mapPass&&(i.mapPass=new Qt(r.x,r.y)),p.uniforms.shadow_pass.value=i.map.texture,p.uniforms.resolution.value=i.mapSize,p.uniforms.radius.value=i.radius,t.setRenderTarget(i.mapPass),t.clear(),t.renderBufferDirect(n,null,s,p,g,null),m.uniforms.shadow_pass.value=i.mapPass.texture,m.uniforms.resolution.value=i.mapSize,m.uniforms.radius.value=i.radius,t.setRenderTarget(i.map),t.clear(),t.renderBufferDirect(n,null,s,m,g,null)}function _(e,i,n,r,s,a){let h=null;const d=!0===n.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(h=void 0!==d?d:!0===n.isPointLight?l:o,t.localClippingEnabled&&!0===i.clipShadows&&Array.isArray(i.clippingPlanes)&&0!==i.clippingPlanes.length||i.displacementMap&&0!==i.displacementScale||i.alphaMap&&i.alphaTest>0){const t=h.uuid,e=i.uuid;let n=c[t];void 0===n&&(n={},c[t]=n);let r=n[e];void 0===r&&(r=h.clone(),n[e]=r),h=r}return h.visible=i.visible,h.wireframe=i.wireframe,h.side=3===a?null!==i.shadowSide?i.shadowSide:i.side:null!==i.shadowSide?i.shadowSide:u[i.side],h.alphaMap=i.alphaMap,h.alphaTest=i.alphaTest,h.clipShadows=i.clipShadows,h.clippingPlanes=i.clippingPlanes,h.clipIntersection=i.clipIntersection,h.displacementMap=i.displacementMap,h.displacementScale=i.displacementScale,h.displacementBias=i.displacementBias,h.wireframeLinewidth=i.wireframeLinewidth,h.linewidth=i.linewidth,!0===n.isPointLight&&!0===h.isMeshDistanceMaterial&&(h.referencePosition.setFromMatrixPosition(n.matrixWorld),h.nearDistance=r,h.farDistance=s),h}function y(i,r,s,a,o){if(!1===i.visible)return;if(i.layers.test(r.layers)&&(i.isMesh||i.isLine||i.isPoints)&&(i.castShadow||i.receiveShadow&&3===o)&&(!i.frustumCulled||n.intersectsObject(i))){i.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,i.matrixWorld);const n=e.update(i),r=i.material;if(Array.isArray(r)){const e=n.groups;for(let l=0,c=e.length;lh||r.y>h)&&(r.x>h&&(s.x=Math.floor(h/m.x),r.x=s.x*m.x,u.mapSize.x=s.x),r.y>h&&(s.y=Math.floor(h/m.y),r.y=s.y*m.y,u.mapSize.y=s.y)),null===u.map){const t=3!==this.type?{minFilter:d,magFilter:d}:{};u.map=new Qt(r.x,r.y,t),u.map.texture.name=c.name+".shadowMap",u.camera.updateProjectionMatrix()}t.setRenderTarget(u.map),t.clear();const f=u.getViewportCount();for(let t=0;t=1):-1!==D.indexOf("OpenGL ES")&&(P=parseFloat(/^OpenGL ES (\d)/.exec(D)[1]),R=P>=2);let I=null,N={};const O=t.getParameter(3088),z=t.getParameter(2978),U=(new $t).fromArray(O),B=(new $t).fromArray(z);function F(e,i,n){const r=new Uint8Array(4),s=t.createTexture();t.bindTexture(e,s),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(let e=0;en||t.height>n)&&(r=n/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const n=e?Tt:Math.floor,s=n(r*t.width),a=n(r*t.height);void 0===I&&(I=z(s,a));const o=i?z(s,a):I;o.width=s,o.height=a;return o.getContext("2d").drawImage(t,0,0,s,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+s+"x"+a+")."),o}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function B(t){return St(t.width)&&St(t.height)}function F(t,e){return t.generateMipmaps&&e&&t.minFilter!==d&&t.minFilter!==f}function k(e){t.generateMipmap(e)}function G(i,n,r,s,a=!1){if(!1===o)return n;if(null!==i){if(void 0!==t[i])return t[i];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+i+"'")}let l=n;return 6403===n&&(5126===r&&(l=33326),5131===r&&(l=33325),5121===r&&(l=33321)),33319===n&&(5126===r&&(l=33328),5131===r&&(l=33327),5121===r&&(l=33323)),6408===n&&(5126===r&&(l=34836),5131===r&&(l=34842),5121===r&&(l=s===ot&&!1===a?35907:32856),32819===r&&(l=32854),32820===r&&(l=32855)),33325!==l&&33326!==l&&33327!==l&&33328!==l&&34842!==l&&34836!==l||e.get("EXT_color_buffer_float"),l}function V(t,e,i){return!0===F(t,i)||t.isFramebufferTexture&&t.minFilter!==d&&t.minFilter!==f?Math.log2(Math.max(e.width,e.height))+1:void 0!==t.mipmaps&&t.mipmaps.length>0?t.mipmaps.length:t.isCompressedTexture&&Array.isArray(t.image)?e.mipmaps.length:1}function H(t){return t===d||t===p||t===m?9728:9729}function W(t){const e=t.target;e.removeEventListener("dispose",W),function(t){const e=n.get(t);if(void 0===e.__webglInit)return;const i=t.source,r=N.get(i);if(r){const n=r[e.__cacheKey];n.usedTimes--,0===n.usedTimes&&q(t),0===Object.keys(r).length&&N.delete(i)}n.remove(t)}(e),e.isVideoTexture&&D.delete(e)}function j(e){const i=e.target;i.removeEventListener("dispose",j),function(e){const i=e.texture,r=n.get(e),s=n.get(i);void 0!==s.__webglTexture&&(t.deleteTexture(s.__webglTexture),a.memory.textures--);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++)t.deleteFramebuffer(r.__webglFramebuffer[e]),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer[e]);else{if(t.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&t.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer)for(let e=0;e0&&r.__version!==t.version){const i=t.image;if(null===i)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==i.complete)return void Q(r,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}i.bindTexture(3553,r.__webglTexture,33984+e)}const Z={[c]:10497,[h]:33071,[u]:33648},J={[d]:9728,[p]:9984,[m]:9986,[f]:9729,[g]:9985,[v]:9987};function K(i,s,a){if(a?(t.texParameteri(i,10242,Z[s.wrapS]),t.texParameteri(i,10243,Z[s.wrapT]),32879!==i&&35866!==i||t.texParameteri(i,32882,Z[s.wrapR]),t.texParameteri(i,10240,J[s.magFilter]),t.texParameteri(i,10241,J[s.minFilter])):(t.texParameteri(i,10242,33071),t.texParameteri(i,10243,33071),32879!==i&&35866!==i||t.texParameteri(i,32882,33071),s.wrapS===h&&s.wrapT===h||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(i,10240,H(s.magFilter)),t.texParameteri(i,10241,H(s.minFilter)),s.minFilter!==d&&s.minFilter!==f&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===e.has("EXT_texture_filter_anisotropic")){const a=e.get("EXT_texture_filter_anisotropic");if(s.type===M&&!1===e.has("OES_texture_float_linear"))return;if(!1===o&&s.type===b&&!1===e.has("OES_texture_half_float_linear"))return;(s.anisotropy>1||n.get(s).__currentAnisotropy)&&(t.texParameterf(i,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,r.getMaxAnisotropy())),n.get(s).__currentAnisotropy=s.anisotropy)}}function $(e,i){let n=!1;void 0===e.__webglInit&&(e.__webglInit=!0,i.addEventListener("dispose",W));const r=i.source;let s=N.get(r);void 0===s&&(s={},N.set(r,s));const o=function(t){const e=[];return e.push(t.wrapS),e.push(t.wrapT),e.push(t.wrapR||0),e.push(t.magFilter),e.push(t.minFilter),e.push(t.anisotropy),e.push(t.internalFormat),e.push(t.format),e.push(t.type),e.push(t.generateMipmaps),e.push(t.premultiplyAlpha),e.push(t.flipY),e.push(t.unpackAlignment),e.push(t.encoding),e.join()}(i);if(o!==e.__cacheKey){void 0===s[o]&&(s[o]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,n=!0),s[o].usedTimes++;const r=s[e.__cacheKey];void 0!==r&&(s[e.__cacheKey].usedTimes--,0===r.usedTimes&&q(i)),e.__cacheKey=o,e.__webglTexture=s[o].texture}return n}function Q(e,r,a){let l=3553;(r.isDataArrayTexture||r.isCompressedArrayTexture)&&(l=35866),r.isData3DTexture&&(l=32879);const c=$(e,r),u=r.source;i.bindTexture(l,e.__webglTexture,33984+a);const p=n.get(u);if(u.version!==p.__version||!0===c){i.activeTexture(33984+a),t.pixelStorei(37440,r.flipY),t.pixelStorei(37441,r.premultiplyAlpha),t.pixelStorei(3317,r.unpackAlignment),t.pixelStorei(37443,0);const e=function(t){return!o&&(t.wrapS!==h||t.wrapT!==h||t.minFilter!==d&&t.minFilter!==f)}(r)&&!1===B(r.image);let n=U(r.image,e,!1,C);n=st(r,n);const m=B(n)||o,g=s.convert(r.format,r.encoding);let v,x=s.convert(r.type),b=G(r.internalFormat,g,x,r.encoding,r.isVideoTexture);K(l,r,m);const E=r.mipmaps,L=o&&!0!==r.isVideoTexture,R=void 0===p.__version||!0===c,P=V(r,n,m);if(r.isDepthTexture)b=6402,o?b=r.type===M?36012:r.type===y?33190:r.type===S?35056:33189:r.type===M&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),r.format===T&&6402===b&&r.type!==_&&r.type!==y&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=y,x=s.convert(r.type)),r.format===A&&6402===b&&(b=34041,r.type!==S&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=S,x=s.convert(r.type))),R&&(L?i.texStorage2D(3553,1,b,n.width,n.height):i.texImage2D(3553,0,b,n.width,n.height,0,g,x,null));else if(r.isDataTexture)if(E.length>0&&m){L&&R&&i.texStorage2D(3553,P,b,E[0].width,E[0].height);for(let t=0,e=E.length;t>=1,e>>=1}}else if(E.length>0&&m){L&&R&&i.texStorage2D(3553,P,b,E[0].width,E[0].height);for(let t=0,e=E.length;t=34069&&l<=34074)&&t.framebufferTexture2D(36160,o,l,n.get(a).__webglTexture,0),i.bindFramebuffer(36160,null)}function et(e,i,n){if(t.bindRenderbuffer(36161,e),i.depthBuffer&&!i.stencilBuffer){let r=33189;if(n||rt(i)){const e=i.depthTexture;e&&e.isDepthTexture&&(e.type===M?r=36012:e.type===y&&(r=33190));const n=nt(i);rt(i)?R.renderbufferStorageMultisampleEXT(36161,n,r,i.width,i.height):t.renderbufferStorageMultisample(36161,n,r,i.width,i.height)}else t.renderbufferStorage(36161,r,i.width,i.height);t.framebufferRenderbuffer(36160,36096,36161,e)}else if(i.depthBuffer&&i.stencilBuffer){const r=nt(i);n&&!1===rt(i)?t.renderbufferStorageMultisample(36161,r,35056,i.width,i.height):rt(i)?R.renderbufferStorageMultisampleEXT(36161,r,35056,i.width,i.height):t.renderbufferStorage(36161,34041,i.width,i.height),t.framebufferRenderbuffer(36160,33306,36161,e)}else{const e=!0===i.isWebGLMultipleRenderTargets?i.texture:[i.texture];for(let r=0;r0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==i.__useRenderToTexture}function st(t,i){const n=t.encoding,r=t.format,s=t.type;return!0===t.isCompressedTexture||!0===t.isVideoTexture||t.format===pt||n!==at&&(n===ot?!1===o?!0===e.has("EXT_sRGB")&&r===w?(t.format=pt,t.minFilter=f,t.generateMipmaps=!1):i=Xt.sRGBToLinear(i):r===w&&s===x||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",n)),i}this.allocateTextureUnit=function(){const t=X;return t>=l&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l),X+=1,t},this.resetTextureUnits=function(){X=0},this.setTexture2D=Y,this.setTexture2DArray=function(t,e){const r=n.get(t);t.version>0&&r.__version!==t.version?Q(r,t,e):i.bindTexture(35866,r.__webglTexture,33984+e)},this.setTexture3D=function(t,e){const r=n.get(t);t.version>0&&r.__version!==t.version?Q(r,t,e):i.bindTexture(32879,r.__webglTexture,33984+e)},this.setTextureCube=function(e,r){const a=n.get(e);e.version>0&&a.__version!==e.version?function(e,r,a){if(6!==r.image.length)return;const l=$(e,r),c=r.source;i.bindTexture(34067,e.__webglTexture,33984+a);const h=n.get(c);if(c.version!==h.__version||!0===l){i.activeTexture(33984+a),t.pixelStorei(37440,r.flipY),t.pixelStorei(37441,r.premultiplyAlpha),t.pixelStorei(3317,r.unpackAlignment),t.pixelStorei(37443,0);const e=r.isCompressedTexture||r.image[0].isCompressedTexture,n=r.image[0]&&r.image[0].isDataTexture,u=[];for(let t=0;t<6;t++)u[t]=e||n?n?r.image[t].image:r.image[t]:U(r.image[t],!1,!0,E),u[t]=st(r,u[t]);const d=u[0],p=B(d)||o,m=s.convert(r.format,r.encoding),f=s.convert(r.type),g=G(r.internalFormat,m,f,r.encoding),v=o&&!0!==r.isVideoTexture,x=void 0===h.__version||!0===l;let _,y=V(r,d,p);if(K(34067,r,p),e){v&&x&&i.texStorage2D(34067,y,g,d.width,d.height);for(let t=0;t<6;t++){_=u[t].mipmaps;for(let e=0;e<_.length;e++){const n=_[e];r.format!==w?null!==m?v?i.compressedTexSubImage2D(34069+t,e,0,0,n.width,n.height,m,n.data):i.compressedTexImage2D(34069+t,e,g,n.width,n.height,0,n.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):v?i.texSubImage2D(34069+t,e,0,0,n.width,n.height,m,f,n.data):i.texImage2D(34069+t,e,g,n.width,n.height,0,m,f,n.data)}}}else{_=r.mipmaps,v&&x&&(_.length>0&&y++,i.texStorage2D(34067,y,g,u[0].width,u[0].height));for(let t=0;t<6;t++)if(n){v?i.texSubImage2D(34069+t,0,0,0,u[t].width,u[t].height,m,f,u[t].data):i.texImage2D(34069+t,0,g,u[t].width,u[t].height,0,m,f,u[t].data);for(let e=0;e<_.length;e++){const n=_[e].image[t].image;v?i.texSubImage2D(34069+t,e+1,0,0,n.width,n.height,m,f,n.data):i.texImage2D(34069+t,e+1,g,n.width,n.height,0,m,f,n.data)}}else{v?i.texSubImage2D(34069+t,0,0,0,m,f,u[t]):i.texImage2D(34069+t,0,g,m,f,u[t]);for(let e=0;e<_.length;e++){const n=_[e];v?i.texSubImage2D(34069+t,e+1,0,0,m,f,n.image[t]):i.texImage2D(34069+t,e+1,g,m,f,n.image[t])}}}F(r,p)&&k(34067),h.__version=c.version,r.onUpdate&&r.onUpdate(r)}e.__version=r.version}(a,e,r):i.bindTexture(34067,a.__webglTexture,33984+r)},this.rebindTextures=function(t,e,i){const r=n.get(t);void 0!==e&&tt(r.__webglFramebuffer,t,t.texture,36064,3553),void 0!==i&&it(t)},this.setupRenderTarget=function(e){const l=e.texture,c=n.get(e),h=n.get(l);e.addEventListener("dispose",j),!0!==e.isWebGLMultipleRenderTargets&&(void 0===h.__webglTexture&&(h.__webglTexture=t.createTexture()),h.__version=l.version,a.memory.textures++);const u=!0===e.isWebGLCubeRenderTarget,d=!0===e.isWebGLMultipleRenderTargets,p=B(e)||o;if(u){c.__webglFramebuffer=[];for(let e=0;e<6;e++)c.__webglFramebuffer[e]=t.createFramebuffer()}else{if(c.__webglFramebuffer=t.createFramebuffer(),d)if(r.drawBuffers){const i=e.texture;for(let e=0,r=i.length;e0&&!1===rt(e)){const n=d?l:[l];c.__webglMultisampledFramebuffer=t.createFramebuffer(),c.__webglColorRenderbuffer=[],i.bindFramebuffer(36160,c.__webglMultisampledFramebuffer);for(let i=0;i0&&!1===rt(e)){const r=e.isWebGLMultipleRenderTargets?e.texture:[e.texture],s=e.width,a=e.height;let o=16384;const l=[],c=e.stencilBuffer?33306:36096,h=n.get(e),u=!0===e.isWebGLMultipleRenderTargets;if(u)for(let e=0;eo+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&a<=o-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==o&&t.gripSpace&&(r=e.getPose(t.gripSpace,i),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1));null!==a&&(n=e.getPose(t.targetRaySpace,i),null===n&&null!==r&&(n=r),null!==n&&(a.matrix.fromArray(n.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),n.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(n.linearVelocity)):a.hasLinearVelocity=!1,n.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(n.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Vs)))}return null!==a&&(a.visible=null!==n),null!==o&&(o.visible=null!==r),null!==l&&(l.visible=null!==s),this}}class Ws extends Kt{constructor(t,e,i,n,r,s,a,o,l,c){if((c=void 0!==c?c:T)!==T&&c!==A)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&c===T&&(i=y),void 0===i&&c===A&&(i=S),super(null,n,r,s,a,o,c,i,l),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=void 0!==a?a:d,this.minFilter=void 0!==o?o:d,this.flipY=!1,this.generateMipmaps=!1}}class js extends mt{constructor(t,e){super();const i=this;let n=null,r=1,s=null,a="local-floor",o=null,l=null,c=null,h=null,u=null,d=null;const p=e.getContextAttributes();let m=null,f=null;const g=[],v=[],_=new sn;_.layers.enable(1),_.viewport=new $t;const M=new sn;M.layers.enable(2),M.viewport=new $t;const b=[_,M],E=new ks;E.layers.enable(1),E.layers.enable(2);let C=null,L=null;function R(t){const e=v.indexOf(t.inputSource);if(-1===e)return;const i=g[e];void 0!==i&&i.dispatchEvent({type:t.type,data:t.inputSource})}function P(){n.removeEventListener("select",R),n.removeEventListener("selectstart",R),n.removeEventListener("selectend",R),n.removeEventListener("squeeze",R),n.removeEventListener("squeezestart",R),n.removeEventListener("squeezeend",R),n.removeEventListener("end",P),n.removeEventListener("inputsourceschange",D);for(let t=0;t=0&&(v[n]=null,g[n].dispatchEvent({type:"disconnected",data:i}))}for(let e=0;e=v.length){v.push(i),n=t;break}if(null===v[t]){v[t]=i,n=t;break}}if(-1===n)break}const r=g[n];r&&r.dispatchEvent({type:"connected",data:i})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=g[t];return void 0===e&&(e=new Hs,g[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=g[t];return void 0===e&&(e=new Hs,g[t]=e),e.getGripSpace()},this.getHand=function(t){let e=g[t];return void 0===e&&(e=new Hs,g[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){r=t,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){a=t,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return o||s},this.setReferenceSpace=function(t){o=t},this.getBaseLayer=function(){return null!==h?h:u},this.getBinding=function(){return c},this.getFrame=function(){return d},this.getSession=function(){return n},this.setSession=async function(l){if(n=l,null!==n){if(m=t.getRenderTarget(),n.addEventListener("select",R),n.addEventListener("selectstart",R),n.addEventListener("selectend",R),n.addEventListener("squeeze",R),n.addEventListener("squeezestart",R),n.addEventListener("squeezeend",R),n.addEventListener("end",P),n.addEventListener("inputsourceschange",D),!0!==p.xrCompatible&&await e.makeXRCompatible(),void 0===n.renderState.layers||!1===t.capabilities.isWebGL2){const i={antialias:void 0!==n.renderState.layers||p.antialias,alpha:p.alpha,depth:p.depth,stencil:p.stencil,framebufferScaleFactor:r};u=new XRWebGLLayer(n,e,i),n.updateRenderState({baseLayer:u}),f=new Qt(u.framebufferWidth,u.framebufferHeight,{format:w,type:x,encoding:t.outputEncoding,stencilBuffer:p.stencil})}else{let i=null,s=null,a=null;p.depth&&(a=p.stencil?35056:33190,i=p.stencil?A:T,s=p.stencil?S:y);const o={colorFormat:32856,depthFormat:a,scaleFactor:r};c=new XRWebGLBinding(n,e),h=c.createProjectionLayer(o),n.updateRenderState({layers:[h]}),f=new Qt(h.textureWidth,h.textureHeight,{format:w,type:x,depthTexture:new Ws(h.textureWidth,h.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,i),stencilBuffer:p.stencil,encoding:t.outputEncoding,samples:p.antialias?4:0});t.properties.get(f).__ignoreDepthValues=h.ignoreDepthValues}f.isXRRenderTarget=!0,this.setFoveation(1),o=null,s=await n.requestReferenceSpace(a),U.setContext(n),U.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};const I=new ne,N=new ne;function O(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.updateCamera=function(t){if(null===n)return;E.near=M.near=_.near=t.near,E.far=M.far=_.far=t.far,C===E.near&&L===E.far||(n.updateRenderState({depthNear:E.near,depthFar:E.far}),C=E.near,L=E.far);const e=t.parent,i=E.cameras;O(E,e);for(let t=0;t0&&(i.alphaTest.value=n.alphaTest);const r=e.get(n).envMap;if(r&&(i.envMap.value=r,i.flipEnvMap.value=r.isCubeTexture&&!1===r.isRenderTargetTexture?-1:1,i.reflectivity.value=n.reflectivity,i.ior.value=n.ior,i.refractionRatio.value=n.refractionRatio),n.lightMap){i.lightMap.value=n.lightMap;const e=!0!==t.physicallyCorrectLights?Math.PI:1;i.lightMapIntensity.value=n.lightMapIntensity*e}let s,a;n.aoMap&&(i.aoMap.value=n.aoMap,i.aoMapIntensity.value=n.aoMapIntensity),n.map?s=n.map:n.specularMap?s=n.specularMap:n.displacementMap?s=n.displacementMap:n.normalMap?s=n.normalMap:n.bumpMap?s=n.bumpMap:n.roughnessMap?s=n.roughnessMap:n.metalnessMap?s=n.metalnessMap:n.alphaMap?s=n.alphaMap:n.emissiveMap?s=n.emissiveMap:n.clearcoatMap?s=n.clearcoatMap:n.clearcoatNormalMap?s=n.clearcoatNormalMap:n.clearcoatRoughnessMap?s=n.clearcoatRoughnessMap:n.iridescenceMap?s=n.iridescenceMap:n.iridescenceThicknessMap?s=n.iridescenceThicknessMap:n.specularIntensityMap?s=n.specularIntensityMap:n.specularColorMap?s=n.specularColorMap:n.transmissionMap?s=n.transmissionMap:n.thicknessMap?s=n.thicknessMap:n.sheenColorMap?s=n.sheenColorMap:n.sheenRoughnessMap&&(s=n.sheenRoughnessMap),void 0!==s&&(s.isWebGLRenderTarget&&(s=s.texture),!0===s.matrixAutoUpdate&&s.updateMatrix(),i.uvTransform.value.copy(s.matrix)),n.aoMap?a=n.aoMap:n.lightMap&&(a=n.lightMap),void 0!==a&&(a.isWebGLRenderTarget&&(a=a.texture),!0===a.matrixAutoUpdate&&a.updateMatrix(),i.uv2Transform.value.copy(a.matrix))}return{refreshFogUniforms:function(t,e){t.fogColor.value.copy(e.color),e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)},refreshMaterialUniforms:function(t,n,r,s,a){n.isMeshBasicMaterial||n.isMeshLambertMaterial?i(t,n):n.isMeshToonMaterial?(i(t,n),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(t,n)):n.isMeshPhongMaterial?(i(t,n),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4)}(t,n)):n.isMeshStandardMaterial?(i(t,n),function(t,i){t.roughness.value=i.roughness,t.metalness.value=i.metalness,i.roughnessMap&&(t.roughnessMap.value=i.roughnessMap);i.metalnessMap&&(t.metalnessMap.value=i.metalnessMap);e.get(i).envMap&&(t.envMapIntensity.value=i.envMapIntensity)}(t,n),n.isMeshPhysicalMaterial&&function(t,e,i){t.ior.value=e.ior,e.sheen>0&&(t.sheenColor.value.copy(e.sheenColor).multiplyScalar(e.sheen),t.sheenRoughness.value=e.sheenRoughness,e.sheenColorMap&&(t.sheenColorMap.value=e.sheenColorMap),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap));e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap),e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,1===e.side&&t.clearcoatNormalScale.value.negate()));e.iridescence>0&&(t.iridescence.value=e.iridescence,t.iridescenceIOR.value=e.iridescenceIOR,t.iridescenceThicknessMinimum.value=e.iridescenceThicknessRange[0],t.iridescenceThicknessMaximum.value=e.iridescenceThicknessRange[1],e.iridescenceMap&&(t.iridescenceMap.value=e.iridescenceMap),e.iridescenceThicknessMap&&(t.iridescenceThicknessMap.value=e.iridescenceThicknessMap));e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=i.texture,t.transmissionSamplerSize.value.set(i.width,i.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor));t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap);e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap)}(t,n,a)):n.isMeshMatcapMaterial?(i(t,n),function(t,e){e.matcap&&(t.matcap.value=e.matcap)}(t,n)):n.isMeshDepthMaterial?i(t,n):n.isMeshDistanceMaterial?(i(t,n),function(t,e){t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(t,n)):n.isMeshNormalMaterial?i(t,n):n.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}(t,n),n.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,n)):n.isPointsMaterial?function(t,e,i,n){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*i,t.scale.value=.5*n,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);e.alphaTest>0&&(t.alphaTest.value=e.alphaTest);let r;e.map?r=e.map:e.alphaMap&&(r=e.alphaMap);void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uvTransform.value.copy(r.matrix))}(t,n,r,s):n.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);e.alphaTest>0&&(t.alphaTest.value=e.alphaTest);let i;e.map?i=e.map:e.alphaMap&&(i=e.alphaMap);void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix))}(t,n):n.isShadowMaterial?(t.color.value.copy(n.color),t.opacity.value=n.opacity):n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)}}}function Xs(t,e,i,n){let r={},s={},a=[];const o=i.isWebGL2?t.getParameter(35375):0;function l(t,e,i){const n=t.value;if(void 0===i[e])return i[e]="number"==typeof n?n:n.clone(),!0;if("number"==typeof n){if(i[e]!==n)return i[e]=n,!0}else{const t=i[e];if(!1===t.equals(n))return t.copy(n),!0}return!1}function c(t){const e=t.value,i={boundary:0,storage:0};return"number"==typeof e?(i.boundary=4,i.storage=4):e.isVector2?(i.boundary=8,i.storage=8):e.isVector3||e.isColor?(i.boundary=16,i.storage=12):e.isVector4?(i.boundary=16,i.storage=16):e.isMatrix3?(i.boundary=48,i.storage=48):e.isMatrix4?(i.boundary=64,i.storage=64):e.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",e),i}function h(e){const i=e.target;i.removeEventListener("dispose",h);const n=a.indexOf(i.__bindingPointIndex);a.splice(n,1),t.deleteBuffer(r[i.id]),delete r[i.id],delete s[i.id]}return{bind:function(t,e){const i=e.program;n.uniformBlockBinding(t,i)},update:function(i,u){let d=r[i.id];void 0===d&&(!function(t){const e=t.uniforms;let i=0;const n=16;let r=0;for(let t=0,s=e.length;t0){r=i%n;const t=n-r;0!==r&&t-a.boundary<0&&(i+=n-r,s.__offset=i)}i+=a.storage}r=i%n,r>0&&(i+=n-r);t.__size=i,t.__cache={}}(i),d=function(e){const i=function(){for(let t=0;t0&&function(t,e,i){const n=Y.isWebGL2;null===G&&(G=new Qt(1,1,{generateMipmaps:!0,type:X.has("EXT_color_buffer_half_float")?b:x,minFilter:v,samples:n&&!0===s?4:0}));f.getDrawingBufferSize(H),n?G.setSize(H.x,H.y):G.setSize(Tt(H.x),Tt(H.y));const r=f.getRenderTarget();f.setRenderTarget(G),f.clear();const a=f.toneMapping;f.toneMapping=0,Ot(t,e,i),f.toneMapping=a,$.updateMultisampleRenderTarget(G),$.updateRenderTargetMipmap(G),f.setRenderTarget(r)}(r,e,i),n&&Z.viewport(E.copy(n)),r.length>0&&Ot(r,e,i),a.length>0&&Ot(a,e,i),o.length>0&&Ot(o,e,i),Z.buffers.depth.setTest(!0),Z.buffers.depth.setMask(!0),Z.buffers.color.setMask(!0),Z.setPolygonOffset(!1)}function Ot(t,e,i){const n=!0===e.isScene?e.overrideMaterial:null;for(let r=0,s=t.length;r0?m[m.length-1]:null,p.pop(),u=p.length>0?p[p.length-1]:null},this.getActiveCubeFace=function(){return _},this.getActiveMipmapLevel=function(){return y},this.getRenderTarget=function(){return S},this.setRenderTargetTextures=function(t,e,i){K.get(t.texture).__webglTexture=e,K.get(t.depthTexture).__webglTexture=i;const n=K.get(t);n.__hasExternalTextures=!0,n.__hasExternalTextures&&(n.__autoAllocateDepthBuffer=void 0===i,n.__autoAllocateDepthBuffer||!0===X.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),n.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(t,e){const i=K.get(t);i.__webglFramebuffer=e,i.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,i=0){S=t,_=e,y=i;let n=!0,r=null,s=!1,a=!1;if(t){const i=K.get(t);void 0!==i.__useDefaultFramebuffer?(Z.bindFramebuffer(36160,null),n=!1):void 0===i.__webglFramebuffer?$.setupRenderTarget(t):i.__hasExternalTextures&&$.rebindTextures(t,K.get(t.texture).__webglTexture,K.get(t.depthTexture).__webglTexture);const o=t.texture;(o.isData3DTexture||o.isDataArrayTexture||o.isCompressedArrayTexture)&&(a=!0);const l=K.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=l[e],s=!0):r=Y.isWebGL2&&t.samples>0&&!1===$.useMultisampledRTT(t)?K.get(t).__webglMultisampledFramebuffer:l,E.copy(t.viewport),C.copy(t.scissor),L=t.scissorTest}else E.copy(O).multiplyScalar(D).floor(),C.copy(z).multiplyScalar(D).floor(),L=U;if(Z.bindFramebuffer(36160,r)&&Y.drawBuffers&&n&&Z.drawBuffers(t,r),Z.viewport(E),Z.scissor(C),Z.setScissorTest(L),s){const n=K.get(t.texture);xt.framebufferTexture2D(36160,36064,34069+e,n.__webglTexture,i)}else if(a){const n=K.get(t.texture),r=e||0;xt.framebufferTextureLayer(36160,36064,n.__webglTexture,i||0,r)}T=-1},this.readRenderTargetPixels=function(t,e,i,n,r,s,a){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let o=K.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(o=o[a]),o){Z.bindFramebuffer(36160,o);try{const a=t.texture,o=a.format,l=a.type;if(o!==w&&ft.convert(o)!==xt.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===b&&(X.has("EXT_color_buffer_half_float")||Y.isWebGL2&&X.has("EXT_color_buffer_float"));if(!(l===x||ft.convert(l)===xt.getParameter(35738)||l===M&&(Y.isWebGL2||X.has("OES_texture_float")||X.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");e>=0&&e<=t.width-n&&i>=0&&i<=t.height-r&&xt.readPixels(e,i,n,r,ft.convert(o),ft.convert(l),s)}finally{const t=null!==S?K.get(S).__webglFramebuffer:null;Z.bindFramebuffer(36160,t)}}},this.copyFramebufferToTexture=function(t,e,i=0){const n=Math.pow(2,-i),r=Math.floor(e.image.width*n),s=Math.floor(e.image.height*n);$.setTexture2D(e,0),xt.copyTexSubImage2D(3553,i,0,0,t.x,t.y,r,s),Z.unbindTexture()},this.copyTextureToTexture=function(t,e,i,n=0){const r=e.image.width,s=e.image.height,a=ft.convert(i.format),o=ft.convert(i.type);$.setTexture2D(i,0),xt.pixelStorei(37440,i.flipY),xt.pixelStorei(37441,i.premultiplyAlpha),xt.pixelStorei(3317,i.unpackAlignment),e.isDataTexture?xt.texSubImage2D(3553,n,t.x,t.y,r,s,a,o,e.image.data):e.isCompressedTexture?xt.compressedTexSubImage2D(3553,n,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,a,e.mipmaps[0].data):xt.texSubImage2D(3553,n,t.x,t.y,a,o,e.image),0===n&&i.generateMipmaps&&xt.generateMipmap(3553),Z.unbindTexture()},this.copyTextureToTexture3D=function(t,e,i,n,r=0){if(f.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const s=t.max.x-t.min.x+1,a=t.max.y-t.min.y+1,o=t.max.z-t.min.z+1,l=ft.convert(n.format),c=ft.convert(n.type);let h;if(n.isData3DTexture)$.setTexture3D(n,0),h=32879;else{if(!n.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");$.setTexture2DArray(n,0),h=35866}xt.pixelStorei(37440,n.flipY),xt.pixelStorei(37441,n.premultiplyAlpha),xt.pixelStorei(3317,n.unpackAlignment);const u=xt.getParameter(3314),d=xt.getParameter(32878),p=xt.getParameter(3316),m=xt.getParameter(3315),g=xt.getParameter(32877),v=i.isCompressedTexture?i.mipmaps[0]:i.image;xt.pixelStorei(3314,v.width),xt.pixelStorei(32878,v.height),xt.pixelStorei(3316,t.min.x),xt.pixelStorei(3315,t.min.y),xt.pixelStorei(32877,t.min.z),i.isDataTexture||i.isData3DTexture?xt.texSubImage3D(h,r,e.x,e.y,e.z,s,a,o,l,c,v.data):i.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),xt.compressedTexSubImage3D(h,r,e.x,e.y,e.z,s,a,o,l,v.data)):xt.texSubImage3D(h,r,e.x,e.y,e.z,s,a,o,l,c,v),xt.pixelStorei(3314,u),xt.pixelStorei(32878,d),xt.pixelStorei(3316,p),xt.pixelStorei(3315,m),xt.pixelStorei(32877,g),0===r&&n.generateMipmaps&&xt.generateMipmap(h),Z.unbindTexture()},this.initTexture=function(t){t.isCubeTexture?$.setTextureCube(t,0):t.isData3DTexture?$.setTexture3D(t,0):t.isDataArrayTexture||t.isCompressedArrayTexture?$.setTexture2DArray(t,0):$.setTexture2D(t,0),Z.unbindTexture()},this.resetState=function(){_=0,y=0,S=null,Z.reset(),gt.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class Zs extends Ys{}Zs.prototype.isWebGL1Renderer=!0;class Js{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new jt(t),this.density=e}clone(){return new Js(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class Ks{constructor(t,e=1,i=1e3){this.isFog=!0,this.name="",this.color=new jt(t),this.near=e,this.far=i}clone(){return new Ks(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class $s extends ri{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.backgroundBlurriness=this.backgroundBlurriness),e}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(t){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=t}}class Qs{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=ut,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=_t()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,i){t*=this.stride,i*=e.stride;for(let n=0,r=this.stride;nt.far||e.push({distance:o,point:ra.clone(),uv:fi.getUV(ra,ha,ua,da,pa,ma,fa,new Lt),face:null,object:this})}copy(t,e){return super.copy(t,e),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}function va(t,e,i,n,r,s){oa.subVectors(t,i).addScalar(.5).multiply(n),void 0!==r?(la.x=s*oa.x-r*oa.y,la.y=r*oa.x+s*oa.y):la.copy(oa),t.copy(e),t.x+=la.x,t.y+=la.y,t.applyMatrix4(ca)}const xa=new ne,_a=new ne;class ya extends ri{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const e=t.levels;for(let t=0,i=e.length;t0){let i,n;for(i=1,n=e.length;i0){xa.setFromMatrixPosition(this.matrixWorld);const i=t.ray.origin.distanceTo(xa);this.getObjectForDistance(i).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){xa.setFromMatrixPosition(t.matrixWorld),_a.setFromMatrixPosition(this.matrixWorld);const i=xa.distanceTo(_a)/t.zoom;let n,r;for(e[0].object.visible=!0,n=1,r=e.length;n=e[n].distance;n++)e[n-1].object.visible=!1,e[n].object.visible=!0;for(this._currentLevel=n-1;no)continue;u.applyMatrix4(this.matrixWorld);const s=t.ray.origin.distanceTo(u);st.far||e.push({distance:s,point:h.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}else{for(let i=Math.max(0,s.start),n=Math.min(m.count,s.start+s.count)-1;io)continue;u.applyMatrix4(this.matrixWorld);const n=t.ray.origin.distanceTo(u);nt.far||e.push({distance:n,point:h.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;t0){const i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;tr.far)return;s.push({distance:l,distanceToRay:Math.sqrt(o),point:i,index:e,face:null,object:a})}}class no extends Kt{constructor(t,e,i,n,r,s,a,o,l,c,h,u){super(null,s,a,o,l,c,n,r,h,u),this.isCompressedTexture=!0,this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}class ro{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const i=this.getUtoTmapping(t);return this.getPoint(i,e)}getPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}getSpacedPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let i,n=this.getPoint(0),r=0;e.push(0);for(let s=1;s<=t;s++)i=this.getPoint(s/t),r+=i.distanceTo(n),e.push(r),n=i;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const i=this.getLengths();let n=0;const r=i.length;let s;s=e||t*i[r-1];let a,o=0,l=r-1;for(;o<=l;)if(n=Math.floor(o+(l-o)/2),a=i[n]-s,a<0)o=n+1;else{if(!(a>0)){l=n;break}l=n-1}if(n=l,i[n]===s)return n/(r-1);const c=i[n];return(n+(s-c)/(i[n+1]-c))/(r-1)}getTangent(t,e){const i=1e-4;let n=t-i,r=t+i;n<0&&(n=0),r>1&&(r=1);const s=this.getPoint(n),a=this.getPoint(r),o=e||(s.isVector2?new Lt:new ne);return o.copy(a).sub(s).normalize(),o}getTangentAt(t,e){const i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t,e){const i=new ne,n=[],r=[],s=[],a=new ne,o=new Ie;for(let e=0;e<=t;e++){const i=e/t;n[e]=this.getTangentAt(i,new ne)}r[0]=new ne,s[0]=new ne;let l=Number.MAX_VALUE;const c=Math.abs(n[0].x),h=Math.abs(n[0].y),u=Math.abs(n[0].z);c<=l&&(l=c,i.set(1,0,0)),h<=l&&(l=h,i.set(0,1,0)),u<=l&&i.set(0,0,1),a.crossVectors(n[0],i).normalize(),r[0].crossVectors(n[0],a),s[0].crossVectors(n[0],r[0]);for(let e=1;e<=t;e++){if(r[e]=r[e-1].clone(),s[e]=s[e-1].clone(),a.crossVectors(n[e-1],n[e]),a.length()>Number.EPSILON){a.normalize();const t=Math.acos(yt(n[e-1].dot(n[e]),-1,1));r[e].applyMatrix4(o.makeRotationAxis(a,t))}s[e].crossVectors(n[e],r[e])}if(!0===e){let e=Math.acos(yt(r[0].dot(r[t]),-1,1));e/=t,n[0].dot(a.crossVectors(r[0],r[t]))>0&&(e=-e);for(let i=1;i<=t;i++)r[i].applyMatrix4(o.makeRotationAxis(n[i],e*i)),s[i].crossVectors(n[i],r[i])}return{tangents:n,normals:r,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class so extends ro{constructor(t=0,e=0,i=1,n=1,r=0,s=2*Math.PI,a=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=n,this.aStartAngle=r,this.aEndAngle=s,this.aClockwise=a,this.aRotation=o}getPoint(t,e){const i=e||new Lt,n=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const s=Math.abs(r)n;)r-=n;r0?0:(Math.floor(Math.abs(l)/r)+1)*r:0===c&&l===r-1&&(l=r-2,c=1),this.closed||l>0?a=n[(l-1)%r]:(lo.subVectors(n[0],n[1]).add(n[0]),a=lo);const h=n[l%r],u=n[(l+1)%r];if(this.closed||l+2n.length-2?n.length-1:s+1],h=n[s>n.length-3?n.length-1:s+2];return i.set(mo(a,o.x,l.x,c.x,h.x),mo(a,o.y,l.y,c.y,h.y)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e=i){const t=n[r]-i,s=this.curves[r],a=s.getLength(),o=0===a?0:1-t/a;return s.getPointAt(o,e)}r++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let i=0,n=this.curves.length;i1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,i=t.curves.length;e0){const t=l.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class Eo extends Di{constructor(t=[new Lt(0,-.5),new Lt(.5,0),new Lt(0,.5)],e=12,i=0,n=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:n},e=Math.floor(e),n=yt(n,0,2*Math.PI);const r=[],s=[],a=[],o=[],l=[],c=1/e,h=new ne,u=new Lt,d=new ne,p=new ne,m=new ne;let f=0,g=0;for(let e=0;e<=t.length-1;e++)switch(e){case 0:f=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-f,d.z=0*g,m.copy(d),d.normalize(),o.push(d.x,d.y,d.z);break;case t.length-1:o.push(m.x,m.y,m.z);break;default:f=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-f,d.z=0*g,p.copy(d),d.x+=m.x,d.y+=m.y,d.z+=m.z,d.normalize(),o.push(d.x,d.y,d.z),m.copy(p)}for(let r=0;r<=e;r++){const d=i+r*c*n,p=Math.sin(d),m=Math.cos(d);for(let i=0;i<=t.length-1;i++){h.x=t[i].x*p,h.y=t[i].y,h.z=t[i].x*m,s.push(h.x,h.y,h.z),u.x=r/e,u.y=i/(t.length-1),a.push(u.x,u.y);const n=o[3*i+0]*p,c=o[3*i+1],d=o[3*i+0]*m;l.push(n,c,d)}}for(let i=0;i0&&v(!0),e>0&&v(!1)),this.setIndex(c),this.setAttribute("position",new wi(h,3)),this.setAttribute("normal",new wi(u,3)),this.setAttribute("uv",new wi(d,2))}static fromJSON(t){return new Ro(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class Po extends Ro{constructor(t=1,e=1,i=8,n=1,r=!1,s=0,a=2*Math.PI){super(0,t,e,i,n,r,s,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:s,thetaLength:a}}static fromJSON(t){return new Po(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class Do extends Di{constructor(t=[],e=[],i=1,n=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:i,detail:n};const r=[],s=[];function a(t,e,i,n){const r=n+1,s=[];for(let n=0;n<=r;n++){s[n]=[];const a=t.clone().lerp(i,n/r),o=e.clone().lerp(i,n/r),l=r-n;for(let t=0;t<=l;t++)s[n][t]=0===t&&n===r?a:a.clone().lerp(o,t/l)}for(let t=0;t.9&&a<.1&&(e<.2&&(s[t+0]+=1),i<.2&&(s[t+2]+=1),n<.2&&(s[t+4]+=1))}}()}(),this.setAttribute("position",new wi(r,3)),this.setAttribute("normal",new wi(r.slice(),3)),this.setAttribute("uv",new wi(s,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}static fromJSON(t){return new Do(t.vertices,t.indices,t.radius,t.details)}}class Io extends Do{constructor(t=1,e=0){const i=(1+Math.sqrt(5))/2,n=1/i;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-i,0,-n,i,0,n,-i,0,n,i,-n,-i,0,-n,i,0,n,-i,0,n,i,0,-i,0,-n,i,0,-n,-i,0,n,i,0,n],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new Io(t.radius,t.detail)}}const No=new ne,Oo=new ne,zo=new ne,Uo=new fi;class Bo extends Di{constructor(t=null,e=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:t,thresholdAngle:e},null!==t){const i=4,n=Math.pow(10,i),r=Math.cos(vt*e),s=t.getIndex(),a=t.getAttribute("position"),o=s?s.count:a.count,l=[0,0,0],c=["a","b","c"],h=new Array(3),u={},d=[];for(let t=0;t80*i){o=c=t[0],l=h=t[1];for(let e=i;ec&&(c=u),d>h&&(h=d);p=Math.max(c-o,h-l),p=0!==p?32767/p:0}return Ho(s,a,i,o,l,p,0),a};function Go(t,e,i,n,r){let s,a;if(r===function(t,e,i,n){let r=0;for(let s=e,a=i-n;s0)for(s=e;s=e;s-=n)a=ll(s,t[s],t[s+1],a);return a&&il(a,a.next)&&(cl(a),a=a.next),a}function Vo(t,e){if(!t)return t;e||(e=t);let i,n=t;do{if(i=!1,n.steiner||!il(n,n.next)&&0!==el(n.prev,n,n.next))n=n.next;else{if(cl(n),n=e=n.prev,n===n.next)break;i=!0}}while(i||n!==e);return e}function Ho(t,e,i,n,r,s,a){if(!t)return;!a&&s&&function(t,e,i,n){let r=t;do{0===r.z&&(r.z=Ko(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){let e,i,n,r,s,a,o,l,c=1;do{for(i=t,t=null,s=null,a=0;i;){for(a++,n=i,o=0,e=0;e0||l>0&&n;)0!==o&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,o--):(r=n,n=n.nextZ,l--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=n}s.nextZ=null,c*=2}while(a>1)}(r)}(t,n,r,s);let o,l,c=t;for(;t.prev!==t.next;)if(o=t.prev,l=t.next,s?jo(t,n,r,s):Wo(t))e.push(o.i/i|0),e.push(t.i/i|0),e.push(l.i/i|0),cl(t),t=l.next,c=l.next;else if((t=l)===c){a?1===a?Ho(t=qo(Vo(t),e,i),e,i,n,r,s,2):2===a&&Xo(t,e,i,n,r,s):Ho(Vo(t),e,i,n,r,s,1);break}}function Wo(t){const e=t.prev,i=t,n=t.next;if(el(e,i,n)>=0)return!1;const r=e.x,s=i.x,a=n.x,o=e.y,l=i.y,c=n.y,h=rs?r>a?r:a:s>a?s:a,p=o>l?o>c?o:c:l>c?l:c;let m=n.next;for(;m!==e;){if(m.x>=h&&m.x<=d&&m.y>=u&&m.y<=p&&Qo(r,o,s,l,a,c,m.x,m.y)&&el(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function jo(t,e,i,n){const r=t.prev,s=t,a=t.next;if(el(r,s,a)>=0)return!1;const o=r.x,l=s.x,c=a.x,h=r.y,u=s.y,d=a.y,p=ol?o>c?o:c:l>c?l:c,g=h>u?h>d?h:d:u>d?u:d,v=Ko(p,m,e,i,n),x=Ko(f,g,e,i,n);let _=t.prevZ,y=t.nextZ;for(;_&&_.z>=v&&y&&y.z<=x;){if(_.x>=p&&_.x<=f&&_.y>=m&&_.y<=g&&_!==r&&_!==a&&Qo(o,h,l,u,c,d,_.x,_.y)&&el(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,y.x>=p&&y.x<=f&&y.y>=m&&y.y<=g&&y!==r&&y!==a&&Qo(o,h,l,u,c,d,y.x,y.y)&&el(y.prev,y,y.next)>=0)return!1;y=y.nextZ}for(;_&&_.z>=v;){if(_.x>=p&&_.x<=f&&_.y>=m&&_.y<=g&&_!==r&&_!==a&&Qo(o,h,l,u,c,d,_.x,_.y)&&el(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;y&&y.z<=x;){if(y.x>=p&&y.x<=f&&y.y>=m&&y.y<=g&&y!==r&&y!==a&&Qo(o,h,l,u,c,d,y.x,y.y)&&el(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function qo(t,e,i){let n=t;do{const r=n.prev,s=n.next.next;!il(r,s)&&nl(r,n,n.next,s)&&al(r,s)&&al(s,r)&&(e.push(r.i/i|0),e.push(n.i/i|0),e.push(s.i/i|0),cl(n),cl(n.next),n=t=s),n=n.next}while(n!==t);return Vo(n)}function Xo(t,e,i,n,r,s){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.i!==t.i&&tl(a,t)){let o=ol(a,t);return a=Vo(a,a.next),o=Vo(o,o.next),Ho(a,e,i,n,r,s,0),void Ho(o,e,i,n,r,s,0)}t=t.next}a=a.next}while(a!==t)}function Yo(t,e){return t.x-e.x}function Zo(t,e){const i=function(t,e){let i,n=e,r=-1/0;const s=t.x,a=t.y;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){const t=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=s&&t>r&&(r=t,i=n.x=n.x&&n.x>=l&&s!==n.x&&Qo(ai.x||n.x===i.x&&Jo(i,n)))&&(i=n,u=h)),n=n.next}while(n!==o);return i}(t,e);if(!i)return e;const n=ol(i,t);return Vo(n,n.next),Vo(i,i.next)}function Jo(t,e){return el(t.prev,t,e.prev)<0&&el(e.next,t,t.next)<0}function Ko(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function $o(t){let e=t,i=t;do{(e.x=(t-a)*(s-o)&&(t-a)*(n-o)>=(i-a)*(e-o)&&(i-a)*(s-o)>=(r-a)*(n-o)}function tl(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&nl(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(al(t,e)&&al(e,t)&&function(t,e){let i=t,n=!1;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(el(t.prev,t,e.prev)||el(t,e.prev,e))||il(t,e)&&el(t.prev,t,t.next)>0&&el(e.prev,e,e.next)>0)}function el(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function il(t,e){return t.x===e.x&&t.y===e.y}function nl(t,e,i,n){const r=sl(el(t,e,i)),s=sl(el(t,e,n)),a=sl(el(i,n,t)),o=sl(el(i,n,e));return r!==s&&a!==o||(!(0!==r||!rl(t,i,e))||(!(0!==s||!rl(t,n,e))||(!(0!==a||!rl(i,t,n))||!(0!==o||!rl(i,e,n)))))}function rl(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function sl(t){return t>0?1:t<0?-1:0}function al(t,e){return el(t.prev,t,t.next)<0?el(t,e,t.next)>=0&&el(t,t.prev,e)>=0:el(t,e,t.prev)<0||el(t,t.next,e)<0}function ol(t,e){const i=new hl(t.i,t.x,t.y),n=new hl(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function ll(t,e,i,n){const r=new hl(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function cl(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function hl(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class ul{static area(t){const e=t.length;let i=0;for(let n=e-1,r=0;r2&&t[e-1].equals(t[0])&&t.pop()}function pl(t,e){for(let i=0;iNumber.EPSILON){const u=Math.sqrt(h),d=Math.sqrt(l*l+c*c),p=e.x-o/u,m=e.y+a/u,f=((i.x-c/d-p)*c-(i.y+l/d-m)*l)/(a*c-o*l);n=p+a*f-t.x,r=m+o*f-t.y;const g=n*n+r*r;if(g<=2)return new Lt(n,r);s=Math.sqrt(g/2)}else{let t=!1;a>Number.EPSILON?l>Number.EPSILON&&(t=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(t=!0):Math.sign(o)===Math.sign(c)&&(t=!0),t?(n=-o,r=a,s=Math.sqrt(h)):(n=a,r=o,s=Math.sqrt(h/2))}return new Lt(n/s,r/s)}const P=[];for(let t=0,e=A.length,i=e-1,n=t+1;t=0;t--){const e=t/p,i=h*Math.cos(e*Math.PI/2),n=u*Math.sin(e*Math.PI/2)+d;for(let t=0,e=A.length;t=0;){const n=i;let r=i-1;r<0&&(r=t.length-1);for(let t=0,i=o+2*p;t0)&&d.push(e,r,l),(t!==i-1||o0!=t>0&&this.version++,this._sheen=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class Dl extends vi{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new jt(16777215),this.specular=new jt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new jt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Lt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Il extends vi{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new jt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new jt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Lt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}class Nl extends vi{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Lt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}class Ol extends vi{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new jt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new jt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Lt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class zl extends vi{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new jt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Lt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Ul extends Fa{constructor(t){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}function Bl(t,e,i){return kl(t)?new t.constructor(t.subarray(e,void 0!==i?i:t.length)):t.slice(e,i)}function Fl(t,e,i){return!t||!i&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)}function kl(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Gl(t){const e=t.length,i=new Array(e);for(let t=0;t!==e;++t)i[t]=t;return i.sort((function(e,i){return t[e]-t[i]})),i}function Vl(t,e,i){const n=t.length,r=new t.constructor(n);for(let s=0,a=0;a!==n;++s){const n=i[s]*e;for(let i=0;i!==e;++i)r[a++]=t[n+i]}return r}function Hl(t,e,i,n){let r=1,s=t[0];for(;void 0!==s&&void 0===s[n];)s=t[r++];if(void 0===s)return;let a=s[n];if(void 0!==a)if(Array.isArray(a))do{a=s[n],void 0!==a&&(e.push(s.time),i.push.apply(i,a)),s=t[r++]}while(void 0!==s);else if(void 0!==a.toArray)do{a=s[n],void 0!==a&&(e.push(s.time),a.toArray(i,i.length)),s=t[r++]}while(void 0!==s);else do{a=s[n],void 0!==a&&(e.push(s.time),i.push(a)),s=t[r++]}while(void 0!==s)}var Wl=Object.freeze({__proto__:null,arraySlice:Bl,convertArray:Fl,isTypedArray:kl,getKeyframeOrder:Gl,sortedArray:Vl,flattenJSON:Hl,subclip:function(t,e,i,n,r=30){const s=t.clone();s.name=e;const a=[];for(let t=0;t=n)){l.push(e.times[t]);for(let i=0;is.tracks[t].times[0]&&(o=s.tracks[t].times[0]);for(let t=0;t=n.times[u]){const t=u*l+o,e=t+l-o;d=Bl(n.values,t,e)}else{const t=n.createInterpolant(),e=o,i=l-o;t.evaluate(s),d=Bl(t.resultBuffer,e,i)}if("quaternion"===r){(new ie).fromArray(d).normalize().conjugate().toArray(d)}const p=a.times.length;for(let t=0;t=r)break t;{const a=e[1];t=r)break e}s=i,i=0}}for(;i>>1;te;)--s;if(++s,0!==r||s!==n){r>=s&&(s=Math.max(s,1),r=s-1);const t=this.getValueSize();this.times=Bl(i,r,s),this.values=Bl(this.values,r*t,s*t)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const i=this.times,n=this.values,r=i.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let e=0;e!==r;e++){const n=i[e];if("number"==typeof n&&isNaN(n)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,n),t=!1;break}if(null!==s&&s>n){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,n,s),t=!1;break}s=n}if(void 0!==n&&kl(n))for(let e=0,i=n.length;e!==i;++e){const i=n[e];if(isNaN(i)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,i),t=!1;break}}return t}optimize(){const t=Bl(this.times),e=Bl(this.values),i=this.getValueSize(),n=this.getInterpolation()===tt,r=t.length-1;let s=1;for(let a=1;a0){t[s]=t[r];for(let t=r*i,n=s*i,a=0;a!==i;++a)e[n+a]=e[t+a];++s}return s!==t.length?(this.times=Bl(t,0,s),this.values=Bl(e,0,s*i)):(this.times=t,this.values=e),this}clone(){const t=Bl(this.times,0),e=Bl(this.values,0),i=new(0,this.constructor)(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}Zl.prototype.TimeBufferType=Float32Array,Zl.prototype.ValueBufferType=Float32Array,Zl.prototype.DefaultInterpolation=Q;class Jl extends Zl{}Jl.prototype.ValueTypeName="bool",Jl.prototype.ValueBufferType=Array,Jl.prototype.DefaultInterpolation=$,Jl.prototype.InterpolantFactoryMethodLinear=void 0,Jl.prototype.InterpolantFactoryMethodSmooth=void 0;class Kl extends Zl{}Kl.prototype.ValueTypeName="color";class $l extends Zl{}$l.prototype.ValueTypeName="number";class Ql extends jl{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t,e,i,n){const r=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=(i-e)/(n-e);let l=t*a;for(let t=l+a;l!==t;l+=4)ie.slerpFlat(r,0,s,l-a,s,l,o);return r}}class tc extends Zl{InterpolantFactoryMethodLinear(t){return new Ql(this.times,this.values,this.getValueSize(),t)}}tc.prototype.ValueTypeName="quaternion",tc.prototype.DefaultInterpolation=Q,tc.prototype.InterpolantFactoryMethodSmooth=void 0;class ec extends Zl{}ec.prototype.ValueTypeName="string",ec.prototype.ValueBufferType=Array,ec.prototype.DefaultInterpolation=$,ec.prototype.InterpolantFactoryMethodLinear=void 0,ec.prototype.InterpolantFactoryMethodSmooth=void 0;class ic extends Zl{}ic.prototype.ValueTypeName="vector";class nc{constructor(t,e=-1,i,n=2500){this.name=t,this.tracks=i,this.duration=e,this.blendMode=n,this.uuid=_t(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],i=t.tracks,n=1/(t.fps||1);for(let t=0,r=i.length;t!==r;++t)e.push(rc(i[t]).scale(n));const r=new this(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r}static toJSON(t){const e=[],i=t.tracks,n={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,n=i.length;t!==n;++t)e.push(Zl.toJSON(i[t]));return n}static CreateFromMorphTargetSequence(t,e,i,n){const r=e.length,s=[];for(let t=0;t1){const t=s[1];let e=n[t];e||(n[t]=e=[]),e.push(i)}}const s=[];for(const t in n)s.push(this.CreateFromMorphTargetSequence(t,n[t],e,i));return s}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(t,e,i,n,r){if(0!==i.length){const s=[],a=[];Hl(i,s,a,n),0!==s.length&&r.push(new t(e,s,a))}},n=[],r=t.name||"default",s=t.fps||30,a=t.blendMode;let o=t.length||-1;const l=t.hierarchy||[];for(let t=0;t{e&&e(r),this.manager.itemEnd(t)}),0),r;if(void 0!==cc[t])return void cc[t].push({onLoad:e,onProgress:i,onError:n});cc[t]=[],cc[t].push({onLoad:e,onProgress:i,onError:n});const s=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,o=this.responseType;fetch(s).then((e=>{if(200===e.status||0===e.status){if(0===e.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;const i=cc[t],n=e.body.getReader(),r=e.headers.get("Content-Length"),s=r?parseInt(r):0,a=0!==s;let o=0;const l=new ReadableStream({start(t){!function e(){n.read().then((({done:n,value:r})=>{if(n)t.close();else{o+=r.byteLength;const n=new ProgressEvent("progress",{lengthComputable:a,loaded:o,total:s});for(let t=0,e=i.length;t{switch(o){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then((t=>(new DOMParser).parseFromString(t,a)));case"json":return t.json();default:if(void 0===a)return t.text();{const e=/charset="?([^;"\s]*)"?/i.exec(a),i=e&&e[1]?e[1].toLowerCase():void 0,n=new TextDecoder(i);return t.arrayBuffer().then((t=>n.decode(t)))}}})).then((e=>{sc.add(t,e);const i=cc[t];delete cc[t];for(let t=0,n=i.length;t{const i=cc[t];if(void 0===i)throw this.manager.itemError(t),e;delete cc[t];for(let t=0,n=i.length;t{this.manager.itemEnd(t)})),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class dc extends lc{constructor(t){super(t)}load(t,e,i,n){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,s=sc.get(t);if(void 0!==s)return r.manager.itemStart(t),setTimeout((function(){e&&e(s),r.manager.itemEnd(t)}),0),s;const a=Nt("img");function o(){c(),sc.add(t,this),e&&e(this),r.manager.itemEnd(t)}function l(e){c(),n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)}function c(){a.removeEventListener("load",o,!1),a.removeEventListener("error",l,!1)}return a.addEventListener("load",o,!1),a.addEventListener("error",l,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(t),a.src=t,a}}class pc extends ri{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new jt(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}class mc extends pc{constructor(t,e,i){super(t,i),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(ri.DefaultUp),this.updateMatrix(),this.groundColor=new jt(e)}copy(t,e){return super.copy(t,e),this.groundColor.copy(t.groundColor),this}}const fc=new Ie,gc=new ne,vc=new ne;class xc{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Lt(512,512),this.map=null,this.mapPass=null,this.matrix=new Ie,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new gn,this._frameExtents=new Lt(1,1),this._viewportCount=1,this._viewports=[new $t(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,i=this.matrix;gc.setFromMatrixPosition(t.matrixWorld),e.position.copy(gc),vc.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(vc),e.updateMatrixWorld(),fc.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(fc),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(fc)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const t={};return 0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class _c extends xc{constructor(){super(new sn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(t){const e=this.camera,i=2*xt*t.angle*this.focus,n=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;i===e.fov&&n===e.aspect&&r===e.far||(e.fov=i,e.aspect=n,e.far=r,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}}class yc extends pc{constructor(t,e,i=0,n=Math.PI/3,r=0,s=1){super(t,e),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(ri.DefaultUp),this.updateMatrix(),this.target=new ri,this.distance=i,this.angle=n,this.penumbra=r,this.decay=s,this.map=null,this.shadow=new _c}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}const Mc=new Ie,bc=new ne,Sc=new ne;class wc extends xc{constructor(){super(new sn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Lt(4,2),this._viewportCount=6,this._viewports=[new $t(2,1,1,1),new $t(0,1,1,1),new $t(3,1,1,1),new $t(1,1,1,1),new $t(3,0,1,1),new $t(1,0,1,1)],this._cubeDirections=[new ne(1,0,0),new ne(-1,0,0),new ne(0,0,1),new ne(0,0,-1),new ne(0,1,0),new ne(0,-1,0)],this._cubeUps=[new ne(0,1,0),new ne(0,1,0),new ne(0,1,0),new ne(0,1,0),new ne(0,0,1),new ne(0,0,-1)]}updateMatrices(t,e=0){const i=this.camera,n=this.matrix,r=t.distance||i.far;r!==i.far&&(i.far=r,i.updateProjectionMatrix()),bc.setFromMatrixPosition(t.matrixWorld),i.position.copy(bc),Sc.copy(i.position),Sc.add(this._cubeDirections[e]),i.up.copy(this._cubeUps[e]),i.lookAt(Sc),i.updateMatrixWorld(),n.makeTranslation(-bc.x,-bc.y,-bc.z),Mc.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Mc)}}class Tc extends pc{constructor(t,e,i=0,n=1){super(t,e),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=n,this.shadow=new wc}get power(){return 4*this.intensity*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}class Ac extends xc{constructor(){super(new Ln(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Ec extends pc{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(ri.DefaultUp),this.updateMatrix(),this.target=new ri,this.shadow=new Ac}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}class Cc extends pc{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}}class Lc extends pc{constructor(t,e,i=10,n=10){super(t,e),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=i,this.height=n}get power(){return this.intensity*this.width*this.height*Math.PI}set power(t){this.intensity=t/(this.width*this.height*Math.PI)}copy(t){return super.copy(t),this.width=t.width,this.height=t.height,this}toJSON(t){const e=super.toJSON(t);return e.object.width=this.width,e.object.height=this.height,e}}class Rc{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new ne)}set(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}zero(){for(let t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this}getAt(t,e){const i=t.x,n=t.y,r=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.282095),e.addScaledVector(s[1],.488603*n),e.addScaledVector(s[2],.488603*r),e.addScaledVector(s[3],.488603*i),e.addScaledVector(s[4],i*n*1.092548),e.addScaledVector(s[5],n*r*1.092548),e.addScaledVector(s[6],.315392*(3*r*r-1)),e.addScaledVector(s[7],i*r*1.092548),e.addScaledVector(s[8],.546274*(i*i-n*n)),e}getIrradianceAt(t,e){const i=t.x,n=t.y,r=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.886227),e.addScaledVector(s[1],1.023328*n),e.addScaledVector(s[2],1.023328*r),e.addScaledVector(s[3],1.023328*i),e.addScaledVector(s[4],.858086*i*n),e.addScaledVector(s[5],.858086*n*r),e.addScaledVector(s[6],.743125*r*r-.247708),e.addScaledVector(s[7],.858086*i*r),e.addScaledVector(s[8],.429043*(i*i-n*n)),e}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,e){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(t.coefficients[i],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let i=0;i<9;i++)this.coefficients[i].lerp(t.coefficients[i],e);return this}equals(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}copy(t){return this.set(t.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(t,e=0){const i=this.coefficients;for(let n=0;n<9;n++)i[n].fromArray(t,e+3*n);return this}toArray(t=[],e=0){const i=this.coefficients;for(let n=0;n<9;n++)i[n].toArray(t,e+3*n);return t}static getBasisAt(t,e){const i=t.x,n=t.y,r=t.z;e[0]=.282095,e[1]=.488603*n,e[2]=.488603*r,e[3]=.488603*i,e[4]=1.092548*i*n,e[5]=1.092548*n*r,e[6]=.315392*(3*r*r-1),e[7]=1.092548*i*r,e[8]=.546274*(i*i-n*n)}}class Pc extends pc{constructor(t=new Rc,e=1){super(void 0,e),this.isLightProbe=!0,this.sh=t}copy(t){return super.copy(t),this.sh.copy(t.sh),this}fromJSON(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this}toJSON(t){const e=super.toJSON(t);return e.object.sh=this.sh.toArray(),e}}class Dc extends lc{constructor(t){super(t),this.textures={}}load(t,e,i,n){const r=this,s=new uc(r.manager);s.setPath(r.path),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(t,(function(i){try{e(r.parse(JSON.parse(i)))}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}}),i,n)}parse(t){const e=this.textures;function i(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}const n=Dc.createMaterialFromType(t.type);if(void 0!==t.uuid&&(n.uuid=t.uuid),void 0!==t.name&&(n.name=t.name),void 0!==t.color&&void 0!==n.color&&n.color.setHex(t.color),void 0!==t.roughness&&(n.roughness=t.roughness),void 0!==t.metalness&&(n.metalness=t.metalness),void 0!==t.sheen&&(n.sheen=t.sheen),void 0!==t.sheenColor&&(n.sheenColor=(new jt).setHex(t.sheenColor)),void 0!==t.sheenRoughness&&(n.sheenRoughness=t.sheenRoughness),void 0!==t.emissive&&void 0!==n.emissive&&n.emissive.setHex(t.emissive),void 0!==t.specular&&void 0!==n.specular&&n.specular.setHex(t.specular),void 0!==t.specularIntensity&&(n.specularIntensity=t.specularIntensity),void 0!==t.specularColor&&void 0!==n.specularColor&&n.specularColor.setHex(t.specularColor),void 0!==t.shininess&&(n.shininess=t.shininess),void 0!==t.clearcoat&&(n.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(n.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.iridescence&&(n.iridescence=t.iridescence),void 0!==t.iridescenceIOR&&(n.iridescenceIOR=t.iridescenceIOR),void 0!==t.iridescenceThicknessRange&&(n.iridescenceThicknessRange=t.iridescenceThicknessRange),void 0!==t.transmission&&(n.transmission=t.transmission),void 0!==t.thickness&&(n.thickness=t.thickness),void 0!==t.attenuationDistance&&(n.attenuationDistance=t.attenuationDistance),void 0!==t.attenuationColor&&void 0!==n.attenuationColor&&n.attenuationColor.setHex(t.attenuationColor),void 0!==t.fog&&(n.fog=t.fog),void 0!==t.flatShading&&(n.flatShading=t.flatShading),void 0!==t.blending&&(n.blending=t.blending),void 0!==t.combine&&(n.combine=t.combine),void 0!==t.side&&(n.side=t.side),void 0!==t.shadowSide&&(n.shadowSide=t.shadowSide),void 0!==t.opacity&&(n.opacity=t.opacity),void 0!==t.transparent&&(n.transparent=t.transparent),void 0!==t.alphaTest&&(n.alphaTest=t.alphaTest),void 0!==t.depthTest&&(n.depthTest=t.depthTest),void 0!==t.depthWrite&&(n.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(n.colorWrite=t.colorWrite),void 0!==t.stencilWrite&&(n.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(n.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(n.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(n.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(n.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(n.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(n.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(n.stencilZPass=t.stencilZPass),void 0!==t.wireframe&&(n.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(n.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(n.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(n.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(n.rotation=t.rotation),1!==t.linewidth&&(n.linewidth=t.linewidth),void 0!==t.dashSize&&(n.dashSize=t.dashSize),void 0!==t.gapSize&&(n.gapSize=t.gapSize),void 0!==t.scale&&(n.scale=t.scale),void 0!==t.polygonOffset&&(n.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(n.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(n.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.dithering&&(n.dithering=t.dithering),void 0!==t.alphaToCoverage&&(n.alphaToCoverage=t.alphaToCoverage),void 0!==t.premultipliedAlpha&&(n.premultipliedAlpha=t.premultipliedAlpha),void 0!==t.visible&&(n.visible=t.visible),void 0!==t.toneMapped&&(n.toneMapped=t.toneMapped),void 0!==t.userData&&(n.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?n.vertexColors=t.vertexColors>0:n.vertexColors=t.vertexColors),void 0!==t.uniforms)for(const e in t.uniforms){const r=t.uniforms[e];switch(n.uniforms[e]={},r.type){case"t":n.uniforms[e].value=i(r.value);break;case"c":n.uniforms[e].value=(new jt).setHex(r.value);break;case"v2":n.uniforms[e].value=(new Lt).fromArray(r.value);break;case"v3":n.uniforms[e].value=(new ne).fromArray(r.value);break;case"v4":n.uniforms[e].value=(new $t).fromArray(r.value);break;case"m3":n.uniforms[e].value=(new Rt).fromArray(r.value);break;case"m4":n.uniforms[e].value=(new Ie).fromArray(r.value);break;default:n.uniforms[e].value=r.value}}if(void 0!==t.defines&&(n.defines=t.defines),void 0!==t.vertexShader&&(n.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(n.fragmentShader=t.fragmentShader),void 0!==t.glslVersion&&(n.glslVersion=t.glslVersion),void 0!==t.extensions)for(const e in t.extensions)n.extensions[e]=t.extensions[e];if(void 0!==t.size&&(n.size=t.size),void 0!==t.sizeAttenuation&&(n.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(n.map=i(t.map)),void 0!==t.matcap&&(n.matcap=i(t.matcap)),void 0!==t.alphaMap&&(n.alphaMap=i(t.alphaMap)),void 0!==t.bumpMap&&(n.bumpMap=i(t.bumpMap)),void 0!==t.bumpScale&&(n.bumpScale=t.bumpScale),void 0!==t.normalMap&&(n.normalMap=i(t.normalMap)),void 0!==t.normalMapType&&(n.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),n.normalScale=(new Lt).fromArray(e)}return void 0!==t.displacementMap&&(n.displacementMap=i(t.displacementMap)),void 0!==t.displacementScale&&(n.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(n.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(n.roughnessMap=i(t.roughnessMap)),void 0!==t.metalnessMap&&(n.metalnessMap=i(t.metalnessMap)),void 0!==t.emissiveMap&&(n.emissiveMap=i(t.emissiveMap)),void 0!==t.emissiveIntensity&&(n.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(n.specularMap=i(t.specularMap)),void 0!==t.specularIntensityMap&&(n.specularIntensityMap=i(t.specularIntensityMap)),void 0!==t.specularColorMap&&(n.specularColorMap=i(t.specularColorMap)),void 0!==t.envMap&&(n.envMap=i(t.envMap)),void 0!==t.envMapIntensity&&(n.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(n.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(n.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(n.lightMap=i(t.lightMap)),void 0!==t.lightMapIntensity&&(n.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(n.aoMap=i(t.aoMap)),void 0!==t.aoMapIntensity&&(n.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(n.gradientMap=i(t.gradientMap)),void 0!==t.clearcoatMap&&(n.clearcoatMap=i(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(n.clearcoatRoughnessMap=i(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(n.clearcoatNormalMap=i(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(n.clearcoatNormalScale=(new Lt).fromArray(t.clearcoatNormalScale)),void 0!==t.iridescenceMap&&(n.iridescenceMap=i(t.iridescenceMap)),void 0!==t.iridescenceThicknessMap&&(n.iridescenceThicknessMap=i(t.iridescenceThicknessMap)),void 0!==t.transmissionMap&&(n.transmissionMap=i(t.transmissionMap)),void 0!==t.thicknessMap&&(n.thicknessMap=i(t.thicknessMap)),void 0!==t.sheenColorMap&&(n.sheenColorMap=i(t.sheenColorMap)),void 0!==t.sheenRoughnessMap&&(n.sheenRoughnessMap=i(t.sheenRoughnessMap)),n}setTextures(t){return this.textures=t,this}static createMaterialFromType(t){return new{ShadowMaterial:Cl,SpriteMaterial:ia,RawShaderMaterial:Ll,ShaderMaterial:nn,PointsMaterial:Ja,MeshPhysicalMaterial:Pl,MeshStandardMaterial:Rl,MeshPhongMaterial:Dl,MeshToonMaterial:Il,MeshNormalMaterial:Nl,MeshLambertMaterial:Ol,MeshDepthMaterial:Ns,MeshDistanceMaterial:Os,MeshBasicMaterial:xi,MeshMatcapMaterial:zl,LineDashedMaterial:Ul,LineBasicMaterial:Fa,Material:vi}[t]}}class Ic{static decodeText(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let i=0,n=t.length;i0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(i,n,this._addIndex*e,1,e);for(let t=e,r=e+e;t!==r;++t)if(i[t]!==i[t+e]){a.setValue(i,n);break}}saveOriginalState(){const t=this.binding,e=this.buffer,i=this.valueSize,n=i*this._origIndex;t.getValue(e,n);for(let t=i,r=n;t!==r;++t)e[t]=e[n+t%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let i=t;i=.5)for(let n=0;n!==r;++n)t[e+n]=t[i+n]}_slerp(t,e,i,n){ie.slerpFlat(t,e,t,e,t,i,n)}_slerpAdditive(t,e,i,n,r){const s=this._workIndex*r;ie.multiplyQuaternionsFlat(t,s,t,e,t,i),ie.slerpFlat(t,e,t,e,t,s,n)}_lerp(t,e,i,n,r){const s=1-n;for(let a=0;a!==r;++a){const r=e+a;t[r]=t[r]*s+t[i+a]*n}}_lerpAdditive(t,e,i,n,r){for(let s=0;s!==r;++s){const r=e+s;t[r]=t[r]+t[i+s]*n}}}const ih="\\[\\]\\.:\\/",nh=new RegExp("[\\[\\]\\.:\\/]","g"),rh="[^\\[\\]\\.:\\/]",sh="[^"+ih.replace("\\.","")+"]",ah=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",rh)+/(WCOD+)?/.source.replace("WCOD",sh)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",rh)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",rh)+"$"),oh=["material","materials","bones","map"];class lh{constructor(t,e,i){this.path=e,this.parsedPath=i||lh.parseTrackName(e),this.node=lh.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,i){return t&&t.isAnimationObjectGroup?new lh.Composite(t,e,i):new lh(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(nh,"")}static parseTrackName(t){const e=ah.exec(t);if(null===e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){const t=i.nodeName.substring(n+1);-1!==oh.indexOf(t)&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=t)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const i=t.skeleton.getBoneByName(e);if(void 0!==i)return i}if(t.children){const i=function(t){for(let n=0;n0){const t=this._interpolants,e=this._propertyBindings;if(this.blendMode===st)for(let i=0,n=t.length;i!==n;++i)t[i].evaluate(s),e[i].accumulateAdditive(a);else for(let i=0,r=t.length;i!==r;++i)t[i].evaluate(s),e[i].accumulate(n,a)}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const i=this._weightInterpolant;if(null!==i){const n=i.evaluate(t)[0];e*=n,t>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const i=this._timeScaleInterpolant;if(null!==i){e*=i.evaluate(t)[0],t>i.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,i=this.loop;let n=this.time+t,r=this._loopCount;const s=2202===i;if(0===t)return-1===r?n:s&&1==(1&r)?e-n:n;if(2200===i){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(n>=e)n=e;else{if(!(n<0)){this.time=n;break t}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),n>=e||n<0){const i=Math.floor(n/e);n-=e*i,r+=Math.abs(i);const a=this.repetitions-r;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=t>0?e:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===a){const e=t<0;this._setEndings(e,!e,s)}else this._setEndings(!1,!1,s);this._loopCount=r,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this.time=n;if(s&&1==(1&r))return e-n}return n}_setEndings(t,e,i){const n=this._interpolantSettings;i?(n.endingStart=it,n.endingEnd=it):(n.endingStart=t?this.zeroSlopeAtStart?it:et:nt,n.endingEnd=e?this.zeroSlopeAtEnd?it:et:nt)}_scheduleFading(t,e,i){const n=this._mixer,r=n.time;let s=this._weightInterpolant;null===s&&(s=n._lendControlInterpolant(),this._weightInterpolant=s);const a=s.parameterPositions,o=s.sampleValues;return a[0]=r,o[0]=e,a[1]=r+t,o[1]=i,this}}const hh=new Float32Array(1);class uh{constructor(t){this.value=t}clone(){return new uh(void 0===this.value.clone?this.value:this.value.clone())}}let dh=0;function ph(t,e){return t.distance-e.distance}function mh(t,e,i,n){if(t.layers.test(e.layers)&&t.raycast(e,i),!0===n){const n=t.children;for(let t=0,r=n.length;t>-e-14,n[256|t]=1024>>-e-14|32768,r[t]=-e-1,r[256|t]=-e-1):e<=15?(n[t]=e+15<<10,n[256|t]=e+15<<10|32768,r[t]=13,r[256|t]=13):e<128?(n[t]=31744,n[256|t]=64512,r[t]=24,r[256|t]=24):(n[t]=31744,n[256|t]=64512,r[t]=13,r[256|t]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let t=1;t<1024;++t){let e=t<<13,i=0;for(;0==(8388608&e);)e<<=1,i-=8388608;e&=-8388609,i+=947912704,s[t]=e|i}for(let t=1024;t<2048;++t)s[t]=939524096+(t-1024<<13);for(let t=1;t<31;++t)a[t]=t<<23;a[31]=1199570944,a[32]=2147483648;for(let t=33;t<63;++t)a[t]=2147483648+(t-32<<23);a[63]=3347054592;for(let t=1;t<64;++t)32!==t&&(o[t]=1024);return{floatView:e,uint32View:i,baseTable:n,shiftTable:r,mantissaTable:s,exponentTable:a,offsetTable:o}}var Bh=Object.freeze({__proto__:null,toHalfFloat:function(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=yt(t,-65504,65504),zh.floatView[0]=t;const e=zh.uint32View[0],i=e>>23&511;return zh.baseTable[i]+((8388607&e)>>zh.shiftTable[i])},fromHalfFloat:function(t){const e=t>>10;return zh.uint32View[0]=zh.mantissaTable[zh.offsetTable[e]+(1023&t)]+zh.exponentTable[e],zh.floatView[0]}});"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:e}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=e),t.ACESFilmicToneMapping=4,t.AddEquation=i,t.AddOperation=2,t.AdditiveAnimationBlendMode=st,t.AdditiveBlending=2,t.AlphaFormat=1021,t.AlwaysDepth=1,t.AlwaysStencilFunc=519,t.AmbientLight=Cc,t.AmbientLightProbe=class extends Pc{constructor(t,e=1){super(void 0,e),this.isAmbientLightProbe=!0;const i=(new jt).set(t);this.sh.coefficients[0].set(i.r,i.g,i.b).multiplyScalar(2*Math.sqrt(Math.PI))}},t.AnimationClip=nc,t.AnimationLoader=class extends lc{constructor(t){super(t)}load(t,e,i,n){const r=this,s=new uc(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,(function(i){try{e(r.parse(JSON.parse(i)))}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}}),i,n)}parse(t){const e=[];for(let i=0;i=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;const e=this._actions,i=this._nActiveActions,n=this.time+=t,r=Math.sign(t),s=this._accuIndex^=1;for(let a=0;a!==i;++a){e[a]._update(n,t,r,s)}const a=this._bindings,o=this._nActiveBindings;for(let t=0;t!==o;++t)a[t].apply(s);return this}setTime(t){this.time=0;for(let t=0;t=r){const s=r++,c=t[s];e[c.uuid]=l,t[l]=c,e[o]=s,t[s]=a;for(let t=0,e=n;t!==e;++t){const e=i[t],n=e[s],r=e[l];e[l]=n,e[s]=r}}}this.nCachedObjects_=r}uncache(){const t=this._objects,e=this._indicesByUUID,i=this._bindings,n=i.length;let r=this.nCachedObjects_,s=t.length;for(let a=0,o=arguments.length;a!==o;++a){const o=arguments[a].uuid,l=e[o];if(void 0!==l)if(delete e[o],l0&&(e[a.uuid]=l),t[l]=a,t.pop();for(let t=0,e=n;t!==e;++t){const e=i[t];e[l]=e[r],e.pop()}}}this.nCachedObjects_=r}subscribe_(t,e){const i=this._bindingsIndicesByPath;let n=i[t];const r=this._bindings;if(void 0!==n)return r[n];const s=this._paths,a=this._parsedPaths,o=this._objects,l=o.length,c=this.nCachedObjects_,h=new Array(l);n=r.length,i[t]=n,s.push(t),a.push(e),r.push(h);for(let i=c,n=o.length;i!==n;++i){const n=o[i];h[i]=new lh(n,t,e)}return h}unsubscribe_(t){const e=this._bindingsIndicesByPath,i=e[t];if(void 0!==i){const n=this._paths,r=this._parsedPaths,s=this._bindings,a=s.length-1,o=s[a];e[t[a]]=i,s[i]=o,s.pop(),r[i]=r[a],r.pop(),n[i]=n[a],n.pop()}}},t.AnimationUtils=Wl,t.ArcCurve=ao,t.ArrayCamera=ks,t.ArrowHelper=class extends ri{constructor(t=new ne(0,0,1),e=new ne(0,0,0),i=1,n=16776960,r=.2*i,s=.2*r){super(),this.type="ArrowHelper",void 0===Nh&&(Nh=new Di,Nh.setAttribute("position",new wi([0,0,0,0,1,0],3)),Oh=new Ro(0,.5,1,5,1),Oh.translate(0,-.5,0)),this.position.copy(e),this.line=new ja(Nh,new Fa({color:n,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Ji(Oh,new xi({color:n,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(i,r,s)}setDirection(t){if(t.y>.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{Ih.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(Ih,e)}}setLength(t,e=.2*t,i=.2*e){this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(i,e,i),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}},t.Audio=Jc,t.AudioAnalyser=class{constructor(t,e=2048){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=e,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let t=0;const e=this.getFrequencyData();for(let i=0;ithis.max.x||t.ythis.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return fh.copy(t).clamp(this.min,this.max).sub(t).length()}intersect(t){return this.min.max(t.min),this.max.min(t.max),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},t.Box3=ae,t.Box3Helper=class extends Ya{constructor(t,e=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new Di;n.setIndex(new Mi(i,1)),n.setAttribute("position",new wi([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(n,new Fa({color:e,toneMapped:!1})),this.box=t,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(t){const e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(t))}dispose(){this.geometry.dispose(),this.material.dispose()}},t.BoxBufferGeometry=class extends $i{constructor(t,e,i,n,r,s){console.warn("THREE.BoxBufferGeometry has been renamed to THREE.BoxGeometry."),super(t,e,i,n,r,s)}},t.BoxGeometry=$i,t.BoxHelper=class extends Ya{constructor(t,e=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new Float32Array(24),r=new Di;r.setIndex(new Mi(i,1)),r.setAttribute("position",new Mi(n,3)),super(r,new Fa({color:e,toneMapped:!1})),this.object=t,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Dh.setFromObject(this.object),Dh.isEmpty())return;const e=Dh.min,i=Dh.max,n=this.geometry.attributes.position,r=n.array;r[0]=i.x,r[1]=i.y,r[2]=i.z,r[3]=e.x,r[4]=i.y,r[5]=i.z,r[6]=e.x,r[7]=e.y,r[8]=i.z,r[9]=i.x,r[10]=e.y,r[11]=i.z,r[12]=i.x,r[13]=i.y,r[14]=e.z,r[15]=e.x,r[16]=i.y,r[17]=e.z,r[18]=e.x,r[19]=e.y,r[20]=e.z,r[21]=i.x,r[22]=e.y,r[23]=e.z,n.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(t){return this.object=t,this.update(),this}copy(t,e){return super.copy(t,e),this.object=t.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}},t.BufferAttribute=Mi,t.BufferGeometry=Di,t.BufferGeometryLoader=Oc,t.ByteType=1010,t.Cache=sc,t.Camera=rn,t.CameraHelper=class extends Ya{constructor(t){const e=new Di,i=new Fa({color:16777215,vertexColors:!0,toneMapped:!1}),n=[],r=[],s={};function a(t,e){o(t),o(e)}function o(t){n.push(0,0,0),r.push(0,0,0),void 0===s[t]&&(s[t]=[]),s[t].push(n.length/3-1)}a("n1","n2"),a("n2","n4"),a("n4","n3"),a("n3","n1"),a("f1","f2"),a("f2","f4"),a("f4","f3"),a("f3","f1"),a("n1","f1"),a("n2","f2"),a("n3","f3"),a("n4","f4"),a("p","n1"),a("p","n2"),a("p","n3"),a("p","n4"),a("u1","u2"),a("u2","u3"),a("u3","u1"),a("c","t"),a("p","c"),a("cn1","cn2"),a("cn3","cn4"),a("cf1","cf2"),a("cf3","cf4"),e.setAttribute("position",new wi(n,3)),e.setAttribute("color",new wi(r,3)),super(e,i),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update();const l=new jt(16755200),c=new jt(16711680),h=new jt(43775),u=new jt(16777215),d=new jt(3355443);this.setColors(l,c,h,u,d)}setColors(t,e,i,n,r){const s=this.geometry.getAttribute("color");s.setXYZ(0,t.r,t.g,t.b),s.setXYZ(1,t.r,t.g,t.b),s.setXYZ(2,t.r,t.g,t.b),s.setXYZ(3,t.r,t.g,t.b),s.setXYZ(4,t.r,t.g,t.b),s.setXYZ(5,t.r,t.g,t.b),s.setXYZ(6,t.r,t.g,t.b),s.setXYZ(7,t.r,t.g,t.b),s.setXYZ(8,t.r,t.g,t.b),s.setXYZ(9,t.r,t.g,t.b),s.setXYZ(10,t.r,t.g,t.b),s.setXYZ(11,t.r,t.g,t.b),s.setXYZ(12,t.r,t.g,t.b),s.setXYZ(13,t.r,t.g,t.b),s.setXYZ(14,t.r,t.g,t.b),s.setXYZ(15,t.r,t.g,t.b),s.setXYZ(16,t.r,t.g,t.b),s.setXYZ(17,t.r,t.g,t.b),s.setXYZ(18,t.r,t.g,t.b),s.setXYZ(19,t.r,t.g,t.b),s.setXYZ(20,t.r,t.g,t.b),s.setXYZ(21,t.r,t.g,t.b),s.setXYZ(22,t.r,t.g,t.b),s.setXYZ(23,t.r,t.g,t.b),s.setXYZ(24,e.r,e.g,e.b),s.setXYZ(25,e.r,e.g,e.b),s.setXYZ(26,e.r,e.g,e.b),s.setXYZ(27,e.r,e.g,e.b),s.setXYZ(28,e.r,e.g,e.b),s.setXYZ(29,e.r,e.g,e.b),s.setXYZ(30,e.r,e.g,e.b),s.setXYZ(31,e.r,e.g,e.b),s.setXYZ(32,i.r,i.g,i.b),s.setXYZ(33,i.r,i.g,i.b),s.setXYZ(34,i.r,i.g,i.b),s.setXYZ(35,i.r,i.g,i.b),s.setXYZ(36,i.r,i.g,i.b),s.setXYZ(37,i.r,i.g,i.b),s.setXYZ(38,n.r,n.g,n.b),s.setXYZ(39,n.r,n.g,n.b),s.setXYZ(40,r.r,r.g,r.b),s.setXYZ(41,r.r,r.g,r.b),s.setXYZ(42,r.r,r.g,r.b),s.setXYZ(43,r.r,r.g,r.b),s.setXYZ(44,r.r,r.g,r.b),s.setXYZ(45,r.r,r.g,r.b),s.setXYZ(46,r.r,r.g,r.b),s.setXYZ(47,r.r,r.g,r.b),s.setXYZ(48,r.r,r.g,r.b),s.setXYZ(49,r.r,r.g,r.b),s.needsUpdate=!0}update(){const t=this.geometry,e=this.pointMap;Rh.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Ph("c",e,t,Rh,0,0,-1),Ph("t",e,t,Rh,0,0,1),Ph("n1",e,t,Rh,-1,-1,-1),Ph("n2",e,t,Rh,1,-1,-1),Ph("n3",e,t,Rh,-1,1,-1),Ph("n4",e,t,Rh,1,1,-1),Ph("f1",e,t,Rh,-1,-1,1),Ph("f2",e,t,Rh,1,-1,1),Ph("f3",e,t,Rh,-1,1,1),Ph("f4",e,t,Rh,1,1,1),Ph("u1",e,t,Rh,.7,1.1,-1),Ph("u2",e,t,Rh,-.7,1.1,-1),Ph("u3",e,t,Rh,0,2,-1),Ph("cf1",e,t,Rh,-1,0,1),Ph("cf2",e,t,Rh,1,0,1),Ph("cf3",e,t,Rh,0,-1,1),Ph("cf4",e,t,Rh,0,1,1),Ph("cn1",e,t,Rh,-1,0,-1),Ph("cn2",e,t,Rh,1,0,-1),Ph("cn3",e,t,Rh,0,-1,-1),Ph("cn4",e,t,Rh,0,1,-1),t.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}},t.CanvasTexture=class extends Kt{constructor(t,e,i,n,r,s,a,o,l){super(t,e,i,n,r,s,a,o,l),this.isCanvasTexture=!0,this.needsUpdate=!0}},t.CapsuleBufferGeometry=class extends Co{constructor(t,e,i,n){console.warn("THREE.CapsuleBufferGeometry has been renamed to THREE.CapsuleGeometry."),super(t,e,i,n)}},t.CapsuleGeometry=Co,t.CatmullRomCurve3=po,t.CineonToneMapping=3,t.CircleBufferGeometry=class extends Lo{constructor(t,e,i,n){console.warn("THREE.CircleBufferGeometry has been renamed to THREE.CircleGeometry."),super(t,e,i,n)}},t.CircleGeometry=Lo,t.ClampToEdgeWrapping=h,t.Clock=Wc,t.Color=jt,t.ColorKeyframeTrack=Kl,t.ColorManagement=Bt,t.CompressedArrayTexture=class extends no{constructor(t,e,i,n,r,s){super(t,e,i,r,s),this.isCompressedArrayTexture=!0,this.image.depth=n,this.wrapR=h}},t.CompressedTexture=no,t.CompressedTextureLoader=class extends lc{constructor(t){super(t)}load(t,e,i,n){const r=this,s=[],a=new no,o=new uc(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(r.withCredentials);let l=0;function c(c){o.load(t[c],(function(t){const i=r.parse(t,!0);s[c]={width:i.width,height:i.height,format:i.format,mipmaps:i.mipmaps},l+=1,6===l&&(1===i.mipmapCount&&(a.minFilter=f),a.image=s,a.format=i.format,a.needsUpdate=!0,e&&e(a))}),i,n)}if(Array.isArray(t))for(let e=0,i=t.length;e0){const i=new ac(e);r=new dc(i),r.setCrossOrigin(this.crossOrigin);for(let e=0,i=t.length;e0){n=new dc(this.manager),n.setCrossOrigin(this.crossOrigin);for(let e=0,n=t.length;e1)for(let i=0;iNumber.EPSILON){if(l<0&&(i=e[s],o=-o,a=e[r],l=-l),t.ya.y)continue;if(t.y===i.y){if(t.x===i.x)return!0}else{const e=l*(t.x-i.x)-o*(t.y-i.y);if(0===e)return!0;if(e<0)continue;n=!n}}else{if(t.y!==i.y)continue;if(a.x<=t.x&&t.x<=i.x||i.x<=t.x&&t.x<=a.x)return!0}}return n}const i=ul.isClockWise,n=this.subPaths;if(0===n.length)return[];let r,s,a;const o=[];if(1===n.length)return s=n[0],a=new Fo,a.curves=s.curves,o.push(a),o;let l=!i(n[0].getPoints());l=t?!l:l;const c=[],h=[];let u,d,p=[],m=0;h[m]=void 0,p[m]=[];for(let e=0,a=n.length;e1){let t=!1,i=0;for(let t=0,e=h.length;t0&&!1===t&&(p=c)}for(let t=0,e=h.length;t=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}},t.WebGL1Renderer=Zs,t.WebGL3DRenderTarget=class extends Qt{constructor(t=1,e=1,i=1){super(t,e),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new ee(null,t,e,i),this.texture.isRenderTargetTexture=!0}},t.WebGLArrayRenderTarget=class extends Qt{constructor(t=1,e=1,i=1){super(t,e),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new te(null,t,e,i),this.texture.isRenderTargetTexture=!0}},t.WebGLCubeRenderTarget=cn,t.WebGLMultipleRenderTargets=class extends Qt{constructor(t=1,e=1,i=1,n={}){super(t,e,n),this.isWebGLMultipleRenderTargets=!0;const r=this.texture;this.texture=[];for(let t=0;t 0 ? libraries[ libraries.length - 1 ] : '', + smooth: previous !== undefined ? previous.smooth : this.smooth, + groupStart: previous !== undefined ? previous.groupEnd : 0, + groupEnd: - 1, + groupCount: - 1, + inherited: false, + clone: function ( index ) { + + const cloned = { + index: typeof index === 'number' ? index : this.index, + name: this.name, + mtllib: this.mtllib, + smooth: this.smooth, + groupStart: 0, + groupEnd: - 1, + groupCount: - 1, + inherited: false + }; + cloned.clone = this.clone.bind( cloned ); + return cloned; + + } + }; + this.materials.push( material ); + return material; + + }, + currentMaterial: function () { + + if ( this.materials.length > 0 ) { + + return this.materials[ this.materials.length - 1 ]; + + } + + return undefined; + + }, + _finalize: function ( end ) { + + const lastMultiMaterial = this.currentMaterial(); + + if ( lastMultiMaterial && lastMultiMaterial.groupEnd === - 1 ) { + + lastMultiMaterial.groupEnd = this.geometry.vertices.length / 3; + lastMultiMaterial.groupCount = lastMultiMaterial.groupEnd - lastMultiMaterial.groupStart; + lastMultiMaterial.inherited = false; + + } // Ignore objects tail materials if no face declarations followed them before a new o/g started. + + + if ( end && this.materials.length > 1 ) { + + for ( let mi = this.materials.length - 1; mi >= 0; mi -- ) { + + if ( this.materials[ mi ].groupCount <= 0 ) { + + this.materials.splice( mi, 1 ); + + } + + } + + } // Guarantee at least one empty material, this makes the creation later more straight forward. + + + if ( end && this.materials.length === 0 ) { + + this.materials.push( { + name: '', + smooth: this.smooth + } ); + + } + + return lastMultiMaterial; + + } + }; // Inherit previous objects material. + // Spec tells us that a declared material must be set to all objects until a new material is declared. + // If a usemtl declaration is encountered while this new object is being parsed, it will + // overwrite the inherited material. Exception being that there was already face declarations + // to the inherited material, then it will be preserved for proper MultiMaterial continuation. + + if ( previousMaterial && previousMaterial.name && typeof previousMaterial.clone === 'function' ) { + + const declared = previousMaterial.clone( 0 ); + declared.inherited = true; + this.object.materials.push( declared ); + + } + + this.objects.push( this.object ); + + }, + finalize: function () { + + if ( this.object && typeof this.object._finalize === 'function' ) { + + this.object._finalize( true ); + + } + + }, + parseVertexIndex: function ( value, len ) { + + const index = parseInt( value, 10 ); + return ( index >= 0 ? index - 1 : index + len / 3 ) * 3; + + }, + parseNormalIndex: function ( value, len ) { + + const index = parseInt( value, 10 ); + return ( index >= 0 ? index - 1 : index + len / 3 ) * 3; + + }, + parseUVIndex: function ( value, len ) { + + const index = parseInt( value, 10 ); + return ( index >= 0 ? index - 1 : index + len / 2 ) * 2; + + }, + addVertex: function ( a, b, c ) { + + const src = this.vertices; + const dst = this.object.geometry.vertices; + dst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] ); + dst.push( src[ b + 0 ], src[ b + 1 ], src[ b + 2 ] ); + dst.push( src[ c + 0 ], src[ c + 1 ], src[ c + 2 ] ); + + }, + addVertexPoint: function ( a ) { + + const src = this.vertices; + const dst = this.object.geometry.vertices; + dst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] ); + + }, + addVertexLine: function ( a ) { + + const src = this.vertices; + const dst = this.object.geometry.vertices; + dst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] ); + + }, + addNormal: function ( a, b, c ) { + + const src = this.normals; + const dst = this.object.geometry.normals; + dst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] ); + dst.push( src[ b + 0 ], src[ b + 1 ], src[ b + 2 ] ); + dst.push( src[ c + 0 ], src[ c + 1 ], src[ c + 2 ] ); + + }, + addFaceNormal: function ( a, b, c ) { + + const src = this.vertices; + const dst = this.object.geometry.normals; + + _vA.fromArray( src, a ); + + _vB.fromArray( src, b ); + + _vC.fromArray( src, c ); + + _cb.subVectors( _vC, _vB ); + + _ab.subVectors( _vA, _vB ); + + _cb.cross( _ab ); + + _cb.normalize(); + + dst.push( _cb.x, _cb.y, _cb.z ); + dst.push( _cb.x, _cb.y, _cb.z ); + dst.push( _cb.x, _cb.y, _cb.z ); + + }, + addColor: function ( a, b, c ) { + + const src = this.colors; + const dst = this.object.geometry.colors; + if ( src[ a ] !== undefined ) dst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] ); + if ( src[ b ] !== undefined ) dst.push( src[ b + 0 ], src[ b + 1 ], src[ b + 2 ] ); + if ( src[ c ] !== undefined ) dst.push( src[ c + 0 ], src[ c + 1 ], src[ c + 2 ] ); + + }, + addUV: function ( a, b, c ) { + + const src = this.uvs; + const dst = this.object.geometry.uvs; + dst.push( src[ a + 0 ], src[ a + 1 ] ); + dst.push( src[ b + 0 ], src[ b + 1 ] ); + dst.push( src[ c + 0 ], src[ c + 1 ] ); + + }, + addDefaultUV: function () { + + const dst = this.object.geometry.uvs; + dst.push( 0, 0 ); + dst.push( 0, 0 ); + dst.push( 0, 0 ); + + }, + addUVLine: function ( a ) { + + const src = this.uvs; + const dst = this.object.geometry.uvs; + dst.push( src[ a + 0 ], src[ a + 1 ] ); + + }, + addFace: function ( a, b, c, ua, ub, uc, na, nb, nc ) { + + const vLen = this.vertices.length; + let ia = this.parseVertexIndex( a, vLen ); + let ib = this.parseVertexIndex( b, vLen ); + let ic = this.parseVertexIndex( c, vLen ); + this.addVertex( ia, ib, ic ); + this.addColor( ia, ib, ic ); // normals + + if ( na !== undefined && na !== '' ) { + + const nLen = this.normals.length; + ia = this.parseNormalIndex( na, nLen ); + ib = this.parseNormalIndex( nb, nLen ); + ic = this.parseNormalIndex( nc, nLen ); + this.addNormal( ia, ib, ic ); + + } else { + + this.addFaceNormal( ia, ib, ic ); + + } // uvs + + + if ( ua !== undefined && ua !== '' ) { + + const uvLen = this.uvs.length; + ia = this.parseUVIndex( ua, uvLen ); + ib = this.parseUVIndex( ub, uvLen ); + ic = this.parseUVIndex( uc, uvLen ); + this.addUV( ia, ib, ic ); + this.object.geometry.hasUVIndices = true; + + } else { + + // add placeholder values (for inconsistent face definitions) + this.addDefaultUV(); + + } + + }, + addPointGeometry: function ( vertices ) { + + this.object.geometry.type = 'Points'; + const vLen = this.vertices.length; + + for ( let vi = 0, l = vertices.length; vi < l; vi ++ ) { + + const index = this.parseVertexIndex( vertices[ vi ], vLen ); + this.addVertexPoint( index ); + this.addColor( index ); + + } + + }, + addLineGeometry: function ( vertices, uvs ) { + + this.object.geometry.type = 'Line'; + const vLen = this.vertices.length; + const uvLen = this.uvs.length; + + for ( let vi = 0, l = vertices.length; vi < l; vi ++ ) { + + this.addVertexLine( this.parseVertexIndex( vertices[ vi ], vLen ) ); + + } + + for ( let uvi = 0, l = uvs.length; uvi < l; uvi ++ ) { + + this.addUVLine( this.parseUVIndex( uvs[ uvi ], uvLen ) ); + + } + + } + }; + state.startObject( '', false ); + return state; + + } // + + + class OBJLoader extends THREE.Loader { + + constructor( manager ) { + + super( manager ); + this.materials = null; + + } + + load( url, onLoad, onProgress, onError ) { + + const scope = this; + const loader = new THREE.FileLoader( this.manager ); + loader.setPath( this.path ); + loader.setRequestHeader( this.requestHeader ); + loader.setWithCredentials( this.withCredentials ); + loader.load( url, function ( text ) { + + try { + + onLoad( scope.parse( text ) ); + + } catch ( e ) { + + if ( onError ) { + + onError( e ); + + } else { + + console.error( e ); + + } + + scope.manager.itemError( url ); + + } + + }, onProgress, onError ); + + } + + setMaterials( materials ) { + + this.materials = materials; + return this; + + } + + parse( text ) { + + const state = new ParserState(); + + if ( text.indexOf( '\r\n' ) !== - 1 ) { + + // This is faster than String.split with regex that splits on both + text = text.replace( /\r\n/g, '\n' ); + + } + + if ( text.indexOf( '\\\n' ) !== - 1 ) { + + // join lines separated by a line continuation character (\) + text = text.replace( /\\\n/g, '' ); + + } + + const lines = text.split( '\n' ); + let result = []; + + for ( let i = 0, l = lines.length; i < l; i ++ ) { + + const line = lines[ i ].trimStart(); + if ( line.length === 0 ) continue; + const lineFirstChar = line.charAt( 0 ); // @todo invoke passed in handler if any + + if ( lineFirstChar === '#' ) continue; + + if ( lineFirstChar === 'v' ) { + + const data = line.split( _face_vertex_data_separator_pattern ); + + switch ( data[ 0 ] ) { + + case 'v': + state.vertices.push( parseFloat( data[ 1 ] ), parseFloat( data[ 2 ] ), parseFloat( data[ 3 ] ) ); + + if ( data.length >= 7 ) { + + _color.setRGB( parseFloat( data[ 4 ] ), parseFloat( data[ 5 ] ), parseFloat( data[ 6 ] ) ).convertSRGBToLinear(); + + state.colors.push( _color.r, _color.g, _color.b ); + + } else { + + // if no colors are defined, add placeholders so color and vertex indices match + state.colors.push( undefined, undefined, undefined ); + + } + + break; + + case 'vn': + state.normals.push( parseFloat( data[ 1 ] ), parseFloat( data[ 2 ] ), parseFloat( data[ 3 ] ) ); + break; + + case 'vt': + state.uvs.push( parseFloat( data[ 1 ] ), parseFloat( data[ 2 ] ) ); + break; + + } + + } else if ( lineFirstChar === 'f' ) { + + const lineData = line.slice( 1 ).trim(); + const vertexData = lineData.split( _face_vertex_data_separator_pattern ); + const faceVertices = []; // Parse the face vertex data into an easy to work with format + + for ( let j = 0, jl = vertexData.length; j < jl; j ++ ) { + + const vertex = vertexData[ j ]; + + if ( vertex.length > 0 ) { + + const vertexParts = vertex.split( '/' ); + faceVertices.push( vertexParts ); + + } + + } // Draw an edge between the first vertex and all subsequent vertices to form an n-gon + + + const v1 = faceVertices[ 0 ]; + + for ( let j = 1, jl = faceVertices.length - 1; j < jl; j ++ ) { + + const v2 = faceVertices[ j ]; + const v3 = faceVertices[ j + 1 ]; + state.addFace( v1[ 0 ], v2[ 0 ], v3[ 0 ], v1[ 1 ], v2[ 1 ], v3[ 1 ], v1[ 2 ], v2[ 2 ], v3[ 2 ] ); + + } + + } else if ( lineFirstChar === 'l' ) { + + const lineParts = line.substring( 1 ).trim().split( ' ' ); + let lineVertices = []; + const lineUVs = []; + + if ( line.indexOf( '/' ) === - 1 ) { + + lineVertices = lineParts; + + } else { + + for ( let li = 0, llen = lineParts.length; li < llen; li ++ ) { + + const parts = lineParts[ li ].split( '/' ); + if ( parts[ 0 ] !== '' ) lineVertices.push( parts[ 0 ] ); + if ( parts[ 1 ] !== '' ) lineUVs.push( parts[ 1 ] ); + + } + + } + + state.addLineGeometry( lineVertices, lineUVs ); + + } else if ( lineFirstChar === 'p' ) { + + const lineData = line.slice( 1 ).trim(); + const pointData = lineData.split( ' ' ); + state.addPointGeometry( pointData ); + + } else if ( ( result = _object_pattern.exec( line ) ) !== null ) { + + // o object_name + // or + // g group_name + // WORKAROUND: https://bugs.chromium.org/p/v8/issues/detail?id=2869 + // let name = result[ 0 ].slice( 1 ).trim(); + const name = ( ' ' + result[ 0 ].slice( 1 ).trim() ).slice( 1 ); + state.startObject( name ); + + } else if ( _material_use_pattern.test( line ) ) { + + // material + state.object.startMaterial( line.substring( 7 ).trim(), state.materialLibraries ); + + } else if ( _material_library_pattern.test( line ) ) { + + // mtl file + state.materialLibraries.push( line.substring( 7 ).trim() ); + + } else if ( _map_use_pattern.test( line ) ) { + + // the line is parsed but ignored since the loader assumes textures are defined MTL files + // (according to https://www.okino.com/conv/imp_wave.htm, 'usemap' is the old-style Wavefront texture reference method) + console.warn( 'THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.' ); + + } else if ( lineFirstChar === 's' ) { + + result = line.split( ' ' ); // smooth shading + // @todo Handle files that have varying smooth values for a set of faces inside one geometry, + // but does not define a usemtl for each face set. + // This should be detected and a dummy material created (later MultiMaterial and geometry groups). + // This requires some care to not create extra material on each smooth value for "normal" obj files. + // where explicit usemtl defines geometry groups. + // Example asset: examples/models/obj/cerberus/Cerberus.obj + + /* + * http://paulbourke.net/dataformats/obj/ + * + * From chapter "Grouping" Syntax explanation "s group_number": + * "group_number is the smoothing group number. To turn off smoothing groups, use a value of 0 or off. + * Polygonal elements use group numbers to put elements in different smoothing groups. For free-form + * surfaces, smoothing groups are either turned on or off; there is no difference between values greater + * than 0." + */ + + if ( result.length > 1 ) { + + const value = result[ 1 ].trim().toLowerCase(); + state.object.smooth = value !== '0' && value !== 'off'; + + } else { + + // ZBrush can produce "s" lines #11707 + state.object.smooth = true; + + } + + const material = state.object.currentMaterial(); + if ( material ) material.smooth = state.object.smooth; + + } else { + + // Handle null terminated files without exception + if ( line === '\0' ) continue; + console.warn( 'THREE.OBJLoader: Unexpected line: "' + line + '"' ); + + } + + } + + state.finalize(); + const container = new THREE.Group(); + container.materialLibraries = [].concat( state.materialLibraries ); + const hasPrimitives = ! ( state.objects.length === 1 && state.objects[ 0 ].geometry.vertices.length === 0 ); + + if ( hasPrimitives === true ) { + + for ( let i = 0, l = state.objects.length; i < l; i ++ ) { + + const object = state.objects[ i ]; + const geometry = object.geometry; + const materials = object.materials; + const isLine = geometry.type === 'Line'; + const isPoints = geometry.type === 'Points'; + let hasVertexColors = false; // Skip o/g line declarations that did not follow with any faces + + if ( geometry.vertices.length === 0 ) continue; + const buffergeometry = new THREE.BufferGeometry(); + buffergeometry.setAttribute( 'position', new THREE.Float32BufferAttribute( geometry.vertices, 3 ) ); + + if ( geometry.normals.length > 0 ) { + + buffergeometry.setAttribute( 'normal', new THREE.Float32BufferAttribute( geometry.normals, 3 ) ); + + } + + if ( geometry.colors.length > 0 ) { + + hasVertexColors = true; + buffergeometry.setAttribute( 'color', new THREE.Float32BufferAttribute( geometry.colors, 3 ) ); + + } + + if ( geometry.hasUVIndices === true ) { + + buffergeometry.setAttribute( 'uv', new THREE.Float32BufferAttribute( geometry.uvs, 2 ) ); + + } // Create materials + + + const createdMaterials = []; + + for ( let mi = 0, miLen = materials.length; mi < miLen; mi ++ ) { + + const sourceMaterial = materials[ mi ]; + const materialHash = sourceMaterial.name + '_' + sourceMaterial.smooth + '_' + hasVertexColors; + let material = state.materials[ materialHash ]; + + if ( this.materials !== null ) { + + material = this.materials.create( sourceMaterial.name ); // mtl etc. loaders probably can't create line materials correctly, copy properties to a line material. + + if ( isLine && material && ! ( material instanceof THREE.LineBasicMaterial ) ) { + + const materialLine = new THREE.LineBasicMaterial(); + THREE.Material.prototype.copy.call( materialLine, material ); + materialLine.color.copy( material.color ); + material = materialLine; + + } else if ( isPoints && material && ! ( material instanceof THREE.PointsMaterial ) ) { + + const materialPoints = new THREE.PointsMaterial( { + size: 10, + sizeAttenuation: false + } ); + THREE.Material.prototype.copy.call( materialPoints, material ); + materialPoints.color.copy( material.color ); + materialPoints.map = material.map; + material = materialPoints; + + } + + } + + if ( material === undefined ) { + + if ( isLine ) { + + material = new THREE.LineBasicMaterial(); + + } else if ( isPoints ) { + + material = new THREE.PointsMaterial( { + size: 1, + sizeAttenuation: false + } ); + + } else { + + // material = new THREE.MeshPhongMaterial(); + material = new THREE.MeshBasicMaterial();// Custom + + + } + + material.name = sourceMaterial.name; + // material.flatShading = sourceMaterial.smooth ? false : true;// Custom + material.vertexColors = hasVertexColors; + state.materials[ materialHash ] = material; + + } + + createdMaterials.push( material ); + + } // Create mesh + + + let mesh; + + if ( createdMaterials.length > 1 ) { + + for ( let mi = 0, miLen = materials.length; mi < miLen; mi ++ ) { + + const sourceMaterial = materials[ mi ]; + buffergeometry.addGroup( sourceMaterial.groupStart, sourceMaterial.groupCount, mi ); + + } + + if ( isLine ) { + + mesh = new THREE.LineSegments( buffergeometry, createdMaterials ); + + } else if ( isPoints ) { + + mesh = new THREE.Points( buffergeometry, createdMaterials ); + + } else { + + mesh = new THREE.Mesh( buffergeometry, createdMaterials ); + + } + + } else { + + if ( isLine ) { + + mesh = new THREE.LineSegments( buffergeometry, createdMaterials[ 0 ] ); + + } else if ( isPoints ) { + + mesh = new THREE.Points( buffergeometry, createdMaterials[ 0 ] ); + + } else { + + mesh = new THREE.Mesh( buffergeometry, createdMaterials[ 0 ] ); + + } + + } + + mesh.name = object.name; + container.add( mesh ); + + } + + } else { + + // if there is only the default parser state object with no geometry data, interpret data as point cloud + if ( state.vertices.length > 0 ) { + + const material = new THREE.PointsMaterial( { + size: 1, + sizeAttenuation: false + } ); + const buffergeometry = new THREE.BufferGeometry(); + buffergeometry.setAttribute( 'position', new THREE.Float32BufferAttribute( state.vertices, 3 ) ); + + if ( state.colors.length > 0 && state.colors[ 0 ] !== undefined ) { + + buffergeometry.setAttribute( 'color', new THREE.Float32BufferAttribute( state.colors, 3 ) ); + material.vertexColors = true; + + } + + const points = new THREE.Points( buffergeometry, material ); + container.add( points ); + + } + + } + + return container; + + } + + } + + THREE.OBJLoader = OBJLoader; + +} )(); + +}; +gdjs.evtsExt__WithThreeJS__onFirstSceneLoaded.userFunc0x12d19a8 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +gdjs.__WithThreeJS = new Map(); +gdjs.__WithThreeJS.set("Blend2Dto3D", [THREE.NormalBlending, THREE.AdditiveBlending, THREE.MultiplyBlending, THREE.NormalBlending, THREE.SubtractiveBlending]);// PixiJSのSUBTRACTは28 +// +gdjs.__WithThreeJS.set("GetResourceFileName", function(ResourceName, Kind) { + for (const V of gdjs.projectData.resources.resources) { + if (V.name === ResourceName && V.kind === Kind) { + return V.file; + } + } +}); +// +gdjs.__WithThreeJS.set("SettingRecursiveTextures", function(Obj, Textures) { + let TxNum = Textures.length; + if (Obj.isMesh || Obj.isGroup) { + if (Obj.material) { + if (Array.isArray(Obj.material)) { + for (let i = 0; i < Obj.material.length; i++) { + if (i < TxNum) { + Obj.material[i].map = Textures[i]; + } + } + } else { + Obj.material.map = Textures[0]; + } + } + // + for (let i = 0; i < Obj.children.length; i++) { + gdjs.__WithThreeJS.get("SettingRecursiveTextures")(Obj.children[i], Textures); + } + } +}); +// +gdjs.__WithThreeJS.set("GetModelInfo", function(Obj, T, Lv) { + const Indent = " ".repeat(Lv * 2); + T += Indent + "---\n"; + T += Indent + "Name: " + Obj.name + "\n"; + if (Obj.material) { + if (Array.isArray(Obj.material)) { + for (let i = 0; i < Obj.material.length; i++) { + T += Indent + "Material " + (i + 1) + ": " + Obj.material[i].name + "\n"; + } + } else { + T += Indent + "Material 1: " + Obj.material.name + "\n"; + } + } + // + for (let i = 0; i < Obj.children.length; i++) { + T = gdjs.__WithThreeJS.get("GetModelInfo")(Obj.children[i], T, Lv + 1); + } + return T; +}); +// +gdjs.__WithThreeJS.set("AllMaterialClone", function(Obj, Transparent, AlphaTest, Blend, Opacity) { + if (Obj.material) { + if (Array.isArray(Obj.material)) { + for (let i = 0; i < Obj.material.length; i++) { + const CloneMaterial = Obj.material[i].clone(); + Obj.material[i] = CloneMaterial; + Obj.material[i].transparent = Transparent; + Obj.material[i].alphaTest = AlphaTest; + Obj.material[i].blending = Blend; + Obj.material[i].opacity = Opacity; + } + } else { + const CloneMaterial = Obj.material.clone(); + Obj.material = CloneMaterial; + Obj.material.transparent = Transparent; + Obj.material.alphaTest = AlphaTest; + Obj.material.blending = Blend; + Obj.material.opacity = Opacity; + } + } + // + for (let i = 0; i < Obj.children.length; i++) { + gdjs.__WithThreeJS.get("AllMaterialClone")(Obj.children[i], Transparent, AlphaTest, Blend, Opacity); + } +}); +// +gdjs.__WithThreeJS.set("GetAllObjectsName", function(Obj, T, Lv) { + const Indent = " ".repeat(Lv * 2); + T += Indent + "ID: " + Obj.name + "\n"; + // + for (let i = 0; i < Obj.children.length; i++) { + T = gdjs.__WithThreeJS.get("GetAllObjectsName")(Obj.children[i], T, Lv + 1); + } + return T; +}); +// +gdjs.__WithThreeJS.set("AllMaterialDispose", function(Obj) { + if (Obj.material) { + if (Array.isArray(Obj.material)) { + for (let i = Obj.material.length - 1; i >= 0; i--){ + Obj.material[i].dispose(); + } + } else { + Obj.material.dispose(); + } + } + // + for (let i = 0; i < Obj.children.length; i++) { + gdjs.__WithThreeJS.get("AllMaterialDispose")(Obj.children[i]); + } +}); + + +}; +gdjs.evtsExt__WithThreeJS__onFirstSceneLoaded.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + + +} + + +{ + + +gdjs.evtsExt__WithThreeJS__onFirstSceneLoaded.userFunc0x136c0d8(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +{ + + + +} + + +{ + + +gdjs.evtsExt__WithThreeJS__onFirstSceneLoaded.userFunc0x136cb30(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +{ + + +gdjs.evtsExt__WithThreeJS__onFirstSceneLoaded.userFunc0x12d19a8(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__onFirstSceneLoaded.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__onFirstSceneLoaded.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__onFirstSceneLoaded.registeredGdjsCallbacks = []; +gdjs.evtsExt__WithThreeJS__onFirstSceneLoaded.registeredGdjsCallbacks.push((runtimeScene) => { + gdjs.evtsExt__WithThreeJS__onFirstSceneLoaded.func(runtimeScene, runtimeScene); +}) +gdjs.registerFirstRuntimeSceneLoadedCallback(gdjs.evtsExt__WithThreeJS__onFirstSceneLoaded.registeredGdjsCallbacks[gdjs.evtsExt__WithThreeJS__onFirstSceneLoaded.registeredGdjsCallbacks.length - 1]); diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__onscenepostevents-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__onscenepostevents-func.js new file mode 100644 index 0000000..692b0d4 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__onscenepostevents-func.js @@ -0,0 +1,119 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__onScenePostEvents !== "undefined") { + gdjs.evtsExt__WithThreeJS__onScenePostEvents.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__onScenePostEvents = {}; + + +gdjs.evtsExt__WithThreeJS__onScenePostEvents.userFunc0x7168a0 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +// console.log("Three.js post events"); +if (!gdjs.__WithThreeJS.has("Renderer")) { + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Camera = gdjs.__WithThreeJS.get("Camera"); +const Renderer = gdjs.__WithThreeJS.get("Renderer"); + +// optimization +const enableOptimization = false; + +if(enableOptimization) { + var frustum = new THREE.Frustum(); + var cameraViewProjectionMatrix = new THREE.Matrix4(); + + cameraViewProjectionMatrix.multiplyMatrices( Camera.projectionMatrix, Camera.matrixWorldInverse ); + frustum.setFromProjectionMatrix(cameraViewProjectionMatrix); + + let counte=0; + Scene.children.forEach(obj => { + obj.visible = false; + if(frustum.intersectsObject(obj)) { + counte++; + obj.visible = true; + } + }) + runtimeScene.getVariables().get('ObjectCount').setNumber(counte); +} + + + +// render(); +Renderer.render( Scene, Camera ); +}; +gdjs.evtsExt__WithThreeJS__onScenePostEvents.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__onScenePostEvents.userFunc0x7168a0(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__onScenePostEvents.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__onScenePostEvents.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__onScenePostEvents.registeredGdjsCallbacks = []; +gdjs.evtsExt__WithThreeJS__onScenePostEvents.registeredGdjsCallbacks.push((runtimeScene) => { + gdjs.evtsExt__WithThreeJS__onScenePostEvents.func(runtimeScene, runtimeScene); +}) +gdjs.registerRuntimeScenePostEventsCallback(gdjs.evtsExt__WithThreeJS__onScenePostEvents.registeredGdjsCallbacks[gdjs.evtsExt__WithThreeJS__onScenePostEvents.registeredGdjsCallbacks.length - 1]); diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__outputallidstoconsole-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__outputallidstoconsole-func.js new file mode 100644 index 0000000..480207b --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__outputallidstoconsole-func.js @@ -0,0 +1,116 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__OutputAllIdsToConsole !== "undefined") { + gdjs.evtsExt__WithThreeJS__OutputAllIdsToConsole.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__OutputAllIdsToConsole = {}; + + +gdjs.evtsExt__WithThreeJS__OutputAllIdsToConsole.userFunc0x1385690 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Type = eventsFunctionContext.getArgument("Type"); +let Res = ""; +// +if (Type == "3D Object") { + Res = gdjs.__WithThreeJS.get("GetAllObjectsName")(Scene, Res, 0); +} else if (Type == "3D Texture") { + if (!gdjs.__WithThreeJS.has("Textures")) { + console.warn("3D Texture not found."); + return; + } + const Textures = gdjs.__WithThreeJS.get("Textures"); + for (let K of Textures.keys()) { + Res += "ID: " + K + "\n"; + } +} else if (Type == "3D Model") { + if (!gdjs.__WithThreeJS.has("Models")) { + console.warn("3D Model not found."); + return; + } + const Models = gdjs.__WithThreeJS.get("Models"); + for (let K of Models.keys()) { + Res += "ID: " + K + "\n"; + } +} +// +console.log(Res); + + +}; +gdjs.evtsExt__WithThreeJS__OutputAllIdsToConsole.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__OutputAllIdsToConsole.userFunc0x1385690(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__OutputAllIdsToConsole.func = function(runtimeScene, Type, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Type") return Type; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__OutputAllIdsToConsole.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__OutputAllIdsToConsole.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__outputmodelinformationtoconsole-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__outputmodelinformationtoconsole-func.js new file mode 100644 index 0000000..932c9a9 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__outputmodelinformationtoconsole-func.js @@ -0,0 +1,102 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__OutputModelInformationToConsole !== "undefined") { + gdjs.evtsExt__WithThreeJS__OutputModelInformationToConsole.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__OutputModelInformationToConsole = {}; + + +gdjs.evtsExt__WithThreeJS__OutputModelInformationToConsole.userFunc0x1385690 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +if (!gdjs.__WithThreeJS.has("Models")) { + console.warn("!"); + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Models = gdjs.__WithThreeJS.get("Models"); +// +const ModelId = eventsFunctionContext.getArgument("ModelId"); +// +if (!Models.has(ModelId)) { + console.warn("3D Model not found."); + return; +} +// +console.log(gdjs.__WithThreeJS.get("GetModelInfo")(Models.get(ModelId), "", 0)); +}; +gdjs.evtsExt__WithThreeJS__OutputModelInformationToConsole.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__OutputModelInformationToConsole.userFunc0x1385690(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__OutputModelInformationToConsole.func = function(runtimeScene, ModelId, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ModelId") return ModelId; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__OutputModelInformationToConsole.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__OutputModelInformationToConsole.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__planeprojectionfromtiled.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__planeprojectionfromtiled.js new file mode 100644 index 0000000..764dae1 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__planeprojectionfromtiled.js @@ -0,0 +1,1537 @@ + +gdjs.evtsExt__WithThreeJS__PlaneProjectionFromTiled = gdjs.evtsExt__WithThreeJS__PlaneProjectionFromTiled || {}; + +/** + * Behavior generated from 3D Plane Projection from Tiled Sprite + */ +gdjs.evtsExt__WithThreeJS__PlaneProjectionFromTiled.PlaneProjectionFromTiled = class PlaneProjectionFromTiled extends gdjs.RuntimeBehavior { + constructor(instanceContainer, behaviorData, owner) { + super(instanceContainer, behaviorData, owner); + this._runtimeScene = instanceContainer; + + this._onceTriggers = new gdjs.OnceTriggers(); + this._behaviorData = {}; + this._sharedData = gdjs.evtsExt__WithThreeJS__PlaneProjectionFromTiled.PlaneProjectionFromTiled.getSharedData( + instanceContainer, + behaviorData.name + ); + + this._behaviorData.Id = ""; + this._behaviorData.FirstFrame = true; + this._behaviorData.ProjectionScale = behaviorData.ProjectionScale !== undefined ? behaviorData.ProjectionScale : Number("0.01") || 0; + this._behaviorData.ViewMode = behaviorData.ViewMode !== undefined ? behaviorData.ViewMode : "Top Down"; + this._behaviorData.Hide = behaviorData.Hide !== undefined ? behaviorData.Hide : true; + this._behaviorData.AlphaTest = behaviorData.AlphaTest !== undefined ? behaviorData.AlphaTest : Number("0") || 0; + this._behaviorData.AntiAliasing = behaviorData.AntiAliasing !== undefined ? behaviorData.AntiAliasing : true; + this._behaviorData.Blend = behaviorData.Blend !== undefined ? behaviorData.Blend : "Normal"; + this._behaviorData.TextureId = ""; + this._behaviorData.OffsetV = Number("") || 0; + } + + // Hot-reload: + updateFromBehaviorData(oldBehaviorData, newBehaviorData) { + + if (oldBehaviorData.Id !== newBehaviorData.Id) + this._behaviorData.Id = newBehaviorData.Id; + if (oldBehaviorData.FirstFrame !== newBehaviorData.FirstFrame) + this._behaviorData.FirstFrame = newBehaviorData.FirstFrame; + if (oldBehaviorData.ProjectionScale !== newBehaviorData.ProjectionScale) + this._behaviorData.ProjectionScale = newBehaviorData.ProjectionScale; + if (oldBehaviorData.ViewMode !== newBehaviorData.ViewMode) + this._behaviorData.ViewMode = newBehaviorData.ViewMode; + if (oldBehaviorData.Hide !== newBehaviorData.Hide) + this._behaviorData.Hide = newBehaviorData.Hide; + if (oldBehaviorData.AlphaTest !== newBehaviorData.AlphaTest) + this._behaviorData.AlphaTest = newBehaviorData.AlphaTest; + if (oldBehaviorData.AntiAliasing !== newBehaviorData.AntiAliasing) + this._behaviorData.AntiAliasing = newBehaviorData.AntiAliasing; + if (oldBehaviorData.Blend !== newBehaviorData.Blend) + this._behaviorData.Blend = newBehaviorData.Blend; + if (oldBehaviorData.TextureId !== newBehaviorData.TextureId) + this._behaviorData.TextureId = newBehaviorData.TextureId; + if (oldBehaviorData.OffsetV !== newBehaviorData.OffsetV) + this._behaviorData.OffsetV = newBehaviorData.OffsetV; + + return true; + } + + // Properties: + + _getId() { + return this._behaviorData.Id !== undefined ? this._behaviorData.Id : ""; + } + _setId(newValue) { + this._behaviorData.Id = newValue; + } + _getFirstFrame() { + return this._behaviorData.FirstFrame !== undefined ? this._behaviorData.FirstFrame : true; + } + _setFirstFrame(newValue) { + this._behaviorData.FirstFrame = newValue; + } + _toggleFirstFrame() { + this._setFirstFrame(!this._getFirstFrame()); + } + _getProjectionScale() { + return this._behaviorData.ProjectionScale !== undefined ? this._behaviorData.ProjectionScale : Number("0.01") || 0; + } + _setProjectionScale(newValue) { + this._behaviorData.ProjectionScale = newValue; + } + _getViewMode() { + return this._behaviorData.ViewMode !== undefined ? this._behaviorData.ViewMode : "Top Down"; + } + _setViewMode(newValue) { + this._behaviorData.ViewMode = newValue; + } + _getHide() { + return this._behaviorData.Hide !== undefined ? this._behaviorData.Hide : true; + } + _setHide(newValue) { + this._behaviorData.Hide = newValue; + } + _toggleHide() { + this._setHide(!this._getHide()); + } + _getAlphaTest() { + return this._behaviorData.AlphaTest !== undefined ? this._behaviorData.AlphaTest : Number("0") || 0; + } + _setAlphaTest(newValue) { + this._behaviorData.AlphaTest = newValue; + } + _getAntiAliasing() { + return this._behaviorData.AntiAliasing !== undefined ? this._behaviorData.AntiAliasing : true; + } + _setAntiAliasing(newValue) { + this._behaviorData.AntiAliasing = newValue; + } + _toggleAntiAliasing() { + this._setAntiAliasing(!this._getAntiAliasing()); + } + _getBlend() { + return this._behaviorData.Blend !== undefined ? this._behaviorData.Blend : "Normal"; + } + _setBlend(newValue) { + this._behaviorData.Blend = newValue; + } + _getTextureId() { + return this._behaviorData.TextureId !== undefined ? this._behaviorData.TextureId : ""; + } + _setTextureId(newValue) { + this._behaviorData.TextureId = newValue; + } + _getOffsetV() { + return this._behaviorData.OffsetV !== undefined ? this._behaviorData.OffsetV : Number("") || 0; + } + _setOffsetV(newValue) { + this._behaviorData.OffsetV = newValue; + } +} + +/** + * Shared data generated from 3D Plane Projection from Tiled Sprite + */ +gdjs.evtsExt__WithThreeJS__PlaneProjectionFromTiled.PlaneProjectionFromTiled.SharedData = class PlaneProjectionFromTiledSharedData { + constructor(sharedData) { + + } + + // Shared properties: + +} + +gdjs.evtsExt__WithThreeJS__PlaneProjectionFromTiled.PlaneProjectionFromTiled.getSharedData = function(instanceContainer, behaviorName) { + if (!instanceContainer._WithThreeJS_PlaneProjectionFromTiledSharedData) { + const initialData = instanceContainer.getInitialSharedDataForBehavior( + behaviorName + ); + instanceContainer._WithThreeJS_PlaneProjectionFromTiledSharedData = new gdjs.evtsExt__WithThreeJS__PlaneProjectionFromTiled.PlaneProjectionFromTiled.SharedData( + initialData + ); + } + return instanceContainer._WithThreeJS_PlaneProjectionFromTiledSharedData; +} + +// Methods: +gdjs.evtsExt__WithThreeJS__PlaneProjectionFromTiled.PlaneProjectionFromTiled.prototype.doStepPostEventsContext = {}; +gdjs.evtsExt__WithThreeJS__PlaneProjectionFromTiled.PlaneProjectionFromTiled.prototype.doStepPostEventsContext.GDObjectObjects1= []; +gdjs.evtsExt__WithThreeJS__PlaneProjectionFromTiled.PlaneProjectionFromTiled.prototype.doStepPostEventsContext.GDObjectObjects2= []; + + +gdjs.evtsExt__WithThreeJS__PlaneProjectionFromTiled.PlaneProjectionFromTiled.prototype.doStepPostEventsContext.userFunc0x14f6380 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +if (!gdjs.__WithThreeJS.has("Textures")) { + gdjs.__WithThreeJS.set("Textures", new Map()); +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +let Textures = gdjs.__WithThreeJS.get("Textures"); +// +const Behavior = objects[0].getBehavior("PlaneProjectionFromTiled"); +const Id = objects[0].name + objects[0].id; +// const X = objects[0].getCenterXInScene(); +// const Y = objects[0].getCenterYInScene(); +// const Z = objects[0].zOrder; +const Width = objects[0].getWidth(); +const Height = objects[0].getHeight(); +const ProjectionScale = Behavior.ProjectionScale(); +// const ViewMode = Behavior.ViewMode(); +const AlphaTest = Behavior.AlphaTest(); +const Transparent = AlphaTest !== 0; +const AntiAliasing = Behavior.AntiAliasing(); +let Blend = THREE.NormalBlending; +if (Behavior.Blend() == "Additive") { + Blend = THREE.AdditiveBlending; +} else if (Behavior.Blend() == "Subtractive") { + Blend = THREE.SubtractiveBlending; +} else if (Behavior.Blend() == "Multiply") { + Blend = THREE.MultiplyBlending; +} +// const Opacity = 1.0; +// +//タイルの画像を取得 +const Resource = objects[0].getRendererObject().texture.baseTexture.resource; +const TextureWidth = Resource.width; +const TextureHeight = Resource.height; +// +// インスタンスごとのマテリアルとテクスチャ生成 +// Plane は FrontRear のみ +//リピート数 +const RepeatU = Width / TextureWidth; +const RepeatV = Height / TextureHeight; +const TextureId = "_" + Id + "_" + Resource.url; +Behavior.SetTextureId(TextureId); +Behavior.SetOffsetV(1 - (RepeatV % 1)); +// +const Texture = new THREE.Texture(); +Texture.image = Resource.source; +Texture.wrapS = THREE.RepeatWrapping; +Texture.wrapT = THREE.RepeatWrapping; +if (!AntiAliasing) { + Texture.magFilter = THREE.NearestFilter;// THREE.LinearFilter + Texture.minFilter = THREE.NearestFilter;// THREE.LinearMipmapLinearFilter +} +Texture.repeat.set(RepeatU, RepeatV); +Texture.needsUpdate = true;//必須 +Textures.set(TextureId, Texture); +// +const Material = new THREE.MeshBasicMaterial({map: Texture, side: THREE.DoubleSide, transparent:Transparent, alphaTest:AlphaTest, blending:Blend}); +const Geometry = new THREE.PlaneGeometry(Width * ProjectionScale, Height * ProjectionScale, 1, 1); +const Obj = new THREE.Mesh(Geometry, Material); +Obj.name = Id; +Obj.userData.Use3DProjectionBehavior = true; +Behavior.SetId(Id); +Scene.add(Obj); + + +}; +gdjs.evtsExt__WithThreeJS__PlaneProjectionFromTiled.PlaneProjectionFromTiled.prototype.doStepPostEventsContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(gdjs.evtsExt__WithThreeJS__PlaneProjectionFromTiled.PlaneProjectionFromTiled.prototype.doStepPostEventsContext.GDObjectObjects1, gdjs.evtsExt__WithThreeJS__PlaneProjectionFromTiled.PlaneProjectionFromTiled.prototype.doStepPostEventsContext.GDObjectObjects2); + + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__WithThreeJS__PlaneProjectionFromTiled.PlaneProjectionFromTiled.prototype.doStepPostEventsContext.GDObjectObjects2); +gdjs.evtsExt__WithThreeJS__PlaneProjectionFromTiled.PlaneProjectionFromTiled.prototype.doStepPostEventsContext.userFunc0x14f6380(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +{ + +/* Reuse gdjs.evtsExt__WithThreeJS__PlaneProjectionFromTiled.PlaneProjectionFromTiled.prototype.doStepPostEventsContext.GDObjectObjects1 */ + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__WithThreeJS__PlaneProjectionFromTiled.PlaneProjectionFromTiled.prototype.doStepPostEventsContext.GDObjectObjects1.length;i + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__Raycast = {}; + + +gdjs.evtsExt__WithThreeJS__Raycast.userFunc0x1517328 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +if (!gdjs.__WithThreeJS.has("Raycaster")) { + gdjs.__WithThreeJS.set("Raycaster", new THREE.Raycaster()); + gdjs.__WithThreeJS.set("RaycastResult", new Array()); +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Camera = gdjs.__WithThreeJS.get("Camera"); +const Raycaster = gdjs.__WithThreeJS.get("Raycaster"); +// +const FromX = eventsFunctionContext.getArgument("FromX"); +const FromY = eventsFunctionContext.getArgument("FromY"); +const FromZ = eventsFunctionContext.getArgument("FromZ"); +const ToX = eventsFunctionContext.getArgument("ToX"); +const ToY = eventsFunctionContext.getArgument("ToY"); +const ToZ = eventsFunctionContext.getArgument("ToZ"); +// +const From = new THREE.Vector3(FromX, FromY, FromZ); +const To = new THREE.Vector3(ToX, ToY, ToZ); +const Distance = From.distanceTo(To); +const Direction = new THREE.Vector3().subVectors(To, From).normalize(); +// +Raycaster.camera = Camera; +Raycaster.set(From, Direction); +Raycaster.far = Distance; +gdjs.__WithThreeJS.set("RaycastResult", Raycaster.intersectObjects(Scene.children, true)); + + +}; +gdjs.evtsExt__WithThreeJS__Raycast.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__Raycast.userFunc0x1517328(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__Raycast.func = function(runtimeScene, FromX, FromY, FromZ, ToX, ToY, ToZ, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "FromX") return FromX; +if (argName === "FromY") return FromY; +if (argName === "FromZ") return FromZ; +if (argName === "ToX") return ToX; +if (argName === "ToY") return ToY; +if (argName === "ToZ") return ToZ; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__Raycast.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__Raycast.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__raycastfrom3dcamera-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__raycastfrom3dcamera-func.js new file mode 100644 index 0000000..983ecdc --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__raycastfrom3dcamera-func.js @@ -0,0 +1,108 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__RaycastFrom3DCamera !== "undefined") { + gdjs.evtsExt__WithThreeJS__RaycastFrom3DCamera.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__RaycastFrom3DCamera = {}; + + +gdjs.evtsExt__WithThreeJS__RaycastFrom3DCamera.userFunc0x1517328 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +if (!gdjs.__WithThreeJS.has("Raycaster")) { + gdjs.__WithThreeJS.set("Raycaster", new THREE.Raycaster()); + gdjs.__WithThreeJS.set("RaycastResult", new Array()); +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Camera = gdjs.__WithThreeJS.get("Camera"); +const Raycaster = gdjs.__WithThreeJS.get("Raycaster"); +// +const ScreenX = eventsFunctionContext.getArgument("ScreenX"); +const ScreenY = eventsFunctionContext.getArgument("ScreenY"); +const ScreenPoint = new THREE.Vector2(); +// +ScreenPoint.x = (ScreenX / runtimeScene.getGame().getGameResolutionWidth()) * 2 - 1; +ScreenPoint.y = -(ScreenY / runtimeScene.getGame().getGameResolutionHeight()) * 2 + 1; +// +Raycaster.setFromCamera(ScreenPoint, Camera); +Raycaster.far = Camera.far; +gdjs.__WithThreeJS.set("RaycastResult", Raycaster.intersectObjects(Scene.children, true)); + + +}; +gdjs.evtsExt__WithThreeJS__RaycastFrom3DCamera.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__RaycastFrom3DCamera.userFunc0x1517328(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__RaycastFrom3DCamera.func = function(runtimeScene, ScreenX, ScreenY, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "ScreenX") return ScreenX; +if (argName === "ScreenY") return ScreenY; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__RaycastFrom3DCamera.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__RaycastFrom3DCamera.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__raycastresultcount-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__raycastresultcount-func.js new file mode 100644 index 0000000..4d7557e --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__raycastresultcount-func.js @@ -0,0 +1,94 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__RaycastResultCount !== "undefined") { + gdjs.evtsExt__WithThreeJS__RaycastResultCount.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__RaycastResultCount = {}; + + +gdjs.evtsExt__WithThreeJS__RaycastResultCount.userFunc0x148ede0 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +if (!gdjs.__WithThreeJS.has("RaycastResult")) { + console.warn("No raycast has been done yet."); + return; +} +const RaycastResult = gdjs.__WithThreeJS.get("RaycastResult"); +eventsFunctionContext.returnValue = RaycastResult.length; + + +}; +gdjs.evtsExt__WithThreeJS__RaycastResultCount.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__RaycastResultCount.userFunc0x148ede0(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__RaycastResultCount.func = function(runtimeScene, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__RaycastResultCount.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__WithThreeJS__RaycastResultCount.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__raycastresultnumber-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__raycastresultnumber-func.js new file mode 100644 index 0000000..beb880a --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__raycastresultnumber-func.js @@ -0,0 +1,113 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__RaycastResultNumber !== "undefined") { + gdjs.evtsExt__WithThreeJS__RaycastResultNumber.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__RaycastResultNumber = {}; + + +gdjs.evtsExt__WithThreeJS__RaycastResultNumber.userFunc0x148ede0 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +if (!gdjs.__WithThreeJS.has("RaycastResult")) { + console.warn("No raycast has been done yet."); + return; +} +const RaycastResult = gdjs.__WithThreeJS.get("RaycastResult"); +// +const Index = eventsFunctionContext.getArgument("Index"); +const Item = eventsFunctionContext.getArgument("Item"); +// +if (Index < 0 || RaycastResult.length <= Index) { + // console.warn("Incorrect index."); + eventsFunctionContext.returnValue = 0; + return; +} +if (Item == "Distance") { + eventsFunctionContext.returnValue = RaycastResult[Index].distance; +} else if (Item == "Point X") { + eventsFunctionContext.returnValue = RaycastResult[Index].point.x; +} else if (Item == "Point Y") { + eventsFunctionContext.returnValue = RaycastResult[Index].point.y; +} else if (Item == "Point Z") { + eventsFunctionContext.returnValue = RaycastResult[Index].point.z; +} + + +}; +gdjs.evtsExt__WithThreeJS__RaycastResultNumber.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__RaycastResultNumber.userFunc0x148ede0(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__RaycastResultNumber.func = function(runtimeScene, Index, Item, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Index") return Index; +if (argName === "Item") return Item; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__RaycastResultNumber.eventsList0(runtimeScene, eventsFunctionContext); + +return Number(eventsFunctionContext.returnValue) || 0; +} + +gdjs.evtsExt__WithThreeJS__RaycastResultNumber.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__raycastresultstring-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__raycastresultstring-func.js new file mode 100644 index 0000000..278aa16 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__raycastresultstring-func.js @@ -0,0 +1,111 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__RaycastResultString !== "undefined") { + gdjs.evtsExt__WithThreeJS__RaycastResultString.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__RaycastResultString = {}; + + +gdjs.evtsExt__WithThreeJS__RaycastResultString.userFunc0x148ede0 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +if (!gdjs.__WithThreeJS.has("RaycastResult")) { + console.warn("No raycast has been done yet."); + return; +} +const RaycastResult = gdjs.__WithThreeJS.get("RaycastResult"); +// +const Index = eventsFunctionContext.getArgument("Index"); +const Item = eventsFunctionContext.getArgument("Item"); +// +if (Index < 0 || RaycastResult.length <= Index) { + // console.warn("Incorrect index."); + eventsFunctionContext.returnValue = ""; + return; +} +if (Item == "3D Object ID") { + eventsFunctionContext.returnValue = RaycastResult[Index].object.name; +} else if (Item == "Parent 3D Object ID") { + if (RaycastResult[Index].object.parent) { + eventsFunctionContext.returnValue = RaycastResult[Index].object.parent.name; + } +} + + +}; +gdjs.evtsExt__WithThreeJS__RaycastResultString.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__RaycastResultString.userFunc0x148ede0(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__RaycastResultString.func = function(runtimeScene, Index, Item, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Index") return Index; +if (argName === "Item") return Item; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__RaycastResultString.eventsList0(runtimeScene, eventsFunctionContext); + +return "" + eventsFunctionContext.returnValue; +} + +gdjs.evtsExt__WithThreeJS__RaycastResultString.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__remove3dobject-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__remove3dobject-func.js new file mode 100644 index 0000000..c9ee02a --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__remove3dobject-func.js @@ -0,0 +1,105 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__Remove3DObject !== "undefined") { + gdjs.evtsExt__WithThreeJS__Remove3DObject.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__Remove3DObject = {}; + + +gdjs.evtsExt__WithThreeJS__Remove3DObject.userFunc0x13e7f88 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Id = eventsFunctionContext.getArgument("Id"); +// +const Obj = Scene.getObjectByName(Id); +if (!Obj) { + console.warn("3D Object not found."); + return; +} +if (Obj.userData.Use3DProjectionBehavior) { + console.warn("3D Object could not be removed."); + return; +} +// +// Obj.clear(); +gdjs.__WithThreeJS.get("AllMaterialDispose")(Obj); +Obj.removeFromParent(); + + +}; +gdjs.evtsExt__WithThreeJS__Remove3DObject.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__Remove3DObject.userFunc0x13e7f88(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__Remove3DObject.func = function(runtimeScene, Id, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Id") return Id; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__Remove3DObject.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__Remove3DObject.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__rotate3dcamera-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__rotate3dcamera-func.js new file mode 100644 index 0000000..41af84a --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__rotate3dcamera-func.js @@ -0,0 +1,109 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__Rotate3DCamera !== "undefined") { + gdjs.evtsExt__WithThreeJS__Rotate3DCamera.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__Rotate3DCamera = {}; + + +gdjs.evtsExt__WithThreeJS__Rotate3DCamera.userFunc0x13b7958 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Camera = gdjs.__WithThreeJS.get("Camera"); +const Operator = eventsFunctionContext.getArgument("Operator"); +const AngleX = eventsFunctionContext.getArgument("AngleX"); +const AngleY = eventsFunctionContext.getArgument("AngleY"); +const AngleZ = eventsFunctionContext.getArgument("AngleZ"); +// +if (Operator == "=") { + Camera.rotation.set(gdjs.toRad(AngleX), gdjs.toRad(AngleY), gdjs.toRad(AngleZ)); +} else if (Operator == "+") { + Camera.rotateX(gdjs.toRad(AngleX)); + Camera.rotateY(gdjs.toRad(AngleY)); + Camera.rotateZ(gdjs.toRad(AngleZ)); +} else { + Camera.rotateX(gdjs.toRad(-AngleX)); + Camera.rotateY(gdjs.toRad(-AngleY)); + Camera.rotateZ(gdjs.toRad(-AngleZ)); +} + + +}; +gdjs.evtsExt__WithThreeJS__Rotate3DCamera.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__Rotate3DCamera.userFunc0x13b7958(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__Rotate3DCamera.func = function(runtimeScene, Operator, AngleX, AngleY, AngleZ, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Operator") return Operator; +if (argName === "AngleX") return AngleX; +if (argName === "AngleY") return AngleY; +if (argName === "AngleZ") return AngleZ; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__Rotate3DCamera.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__Rotate3DCamera.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__rotate3dcameralikehead-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__rotate3dcameralikehead-func.js new file mode 100644 index 0000000..9ff03a7 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__rotate3dcameralikehead-func.js @@ -0,0 +1,114 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__Rotate3DCameraLikeHead !== "undefined") { + gdjs.evtsExt__WithThreeJS__Rotate3DCameraLikeHead.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__Rotate3DCameraLikeHead = {}; + + +gdjs.evtsExt__WithThreeJS__Rotate3DCameraLikeHead.userFunc0x13b7958 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} + +try { + + const Camera = gdjs.__WithThreeJS.get("Camera"); + const Operator = eventsFunctionContext.getArgument("Operator"); + const AngleX = eventsFunctionContext.getArgument("AngleX"); + const AngleY = eventsFunctionContext.getArgument("AngleY"); + const AngleZ = eventsFunctionContext.getArgument("AngleZ"); + // + if (Operator == "=") { + Camera.rotation.set(gdjs.toRad(AngleX), gdjs.toRad(AngleY), gdjs.toRad(AngleZ), "YXZ"); + } else if (Operator == "+") { + Camera.rotateX(gdjs.toRad(AngleX)); + Camera.rotateOnWorldAxis(new THREE.Vector3(0, 1, 0), gdjs.toRad(AngleY)); + Camera.rotateZ(gdjs.toRad(AngleZ)); + } else { + Camera.rotateX(gdjs.toRad(-AngleX)); + Camera.rotateOnWorldAxis(new THREE.Vector3(0, 1, 0), gdjs.toRad(-AngleY)); + Camera.rotateZ(gdjs.toRad(-AngleZ)); + } + +} catch(e) { + +} +}; +gdjs.evtsExt__WithThreeJS__Rotate3DCameraLikeHead.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__Rotate3DCameraLikeHead.userFunc0x13b7958(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__Rotate3DCameraLikeHead.func = function(runtimeScene, Operator, AngleX, AngleY, AngleZ, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Operator") return Operator; +if (argName === "AngleX") return AngleX; +if (argName === "AngleY") return AngleY; +if (argName === "AngleZ") return AngleZ; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__Rotate3DCameraLikeHead.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__Rotate3DCameraLikeHead.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__rotate3dcameraonworld-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__rotate3dcameraonworld-func.js new file mode 100644 index 0000000..610f5cd --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__rotate3dcameraonworld-func.js @@ -0,0 +1,112 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__Rotate3DCameraOnWorld !== "undefined") { + gdjs.evtsExt__WithThreeJS__Rotate3DCameraOnWorld.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__Rotate3DCameraOnWorld = {}; + + +gdjs.evtsExt__WithThreeJS__Rotate3DCameraOnWorld.userFunc0x13b7958 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Camera = gdjs.__WithThreeJS.get("Camera"); +const Operator = eventsFunctionContext.getArgument("Operator"); +const AngleX = eventsFunctionContext.getArgument("AngleX"); +const AngleY = eventsFunctionContext.getArgument("AngleY"); +const AngleZ = eventsFunctionContext.getArgument("AngleZ"); +// +if (Operator == "=") { + Camera.rotation.set(0, 0, 0); + Camera.rotateOnWorldAxis(new THREE.Vector3(1, 0, 0), gdjs.toRad(AngleX)); + Camera.rotateOnWorldAxis(new THREE.Vector3(0, 1, 0), gdjs.toRad(AngleY)); + Camera.rotateOnWorldAxis(new THREE.Vector3(0, 0, 1), gdjs.toRad(AngleZ)); +} else if (Operator == "+") { + Camera.rotateOnWorldAxis(new THREE.Vector3(1, 0, 0), gdjs.toRad(AngleX)); + Camera.rotateOnWorldAxis(new THREE.Vector3(0, 1, 0), gdjs.toRad(AngleY)); + Camera.rotateOnWorldAxis(new THREE.Vector3(0, 0, 1), gdjs.toRad(AngleZ)); +} else { + Camera.rotateOnWorldAxis(new THREE.Vector3(1, 0, 0), gdjs.toRad(-AngleX)); + Camera.rotateOnWorldAxis(new THREE.Vector3(0, 1, 0), gdjs.toRad(-AngleY)); + Camera.rotateOnWorldAxis(new THREE.Vector3(0, 0, 1), gdjs.toRad(-AngleZ)); +} + + +}; +gdjs.evtsExt__WithThreeJS__Rotate3DCameraOnWorld.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__Rotate3DCameraOnWorld.userFunc0x13b7958(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__Rotate3DCameraOnWorld.func = function(runtimeScene, Operator, AngleX, AngleY, AngleZ, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Operator") return Operator; +if (argName === "AngleX") return AngleX; +if (argName === "AngleY") return AngleY; +if (argName === "AngleZ") return AngleZ; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__Rotate3DCameraOnWorld.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__Rotate3DCameraOnWorld.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__rotate3dobject-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__rotate3dobject-func.js new file mode 100644 index 0000000..4e7c74c --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__rotate3dobject-func.js @@ -0,0 +1,117 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__Rotate3DObject !== "undefined") { + gdjs.evtsExt__WithThreeJS__Rotate3DObject.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__Rotate3DObject = {}; + + +gdjs.evtsExt__WithThreeJS__Rotate3DObject.userFunc0x1385690 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Id = eventsFunctionContext.getArgument("Id"); +const Operator = eventsFunctionContext.getArgument("Operator"); +const AngleX = eventsFunctionContext.getArgument("AngleX"); +const AngleY = eventsFunctionContext.getArgument("AngleY"); +const AngleZ = eventsFunctionContext.getArgument("AngleZ"); +// +const Obj = Scene.getObjectByName(Id); +if (!Obj) { + console.warn("3D Object not found."); + return; +} +// +if (Operator == "=") { + Obj.rotation.set(gdjs.toRad(AngleX), gdjs.toRad(AngleY), gdjs.toRad(AngleZ)); +} else if (Operator == "+") { + Obj.rotateX(gdjs.toRad(AngleX)); + Obj.rotateY(gdjs.toRad(AngleY)); + Obj.rotateZ(gdjs.toRad(AngleZ)); +} else { + Obj.rotateX(gdjs.toRad(-AngleX)); + Obj.rotateY(gdjs.toRad(-AngleY)); + Obj.rotateZ(gdjs.toRad(-AngleZ)); +} + + +}; +gdjs.evtsExt__WithThreeJS__Rotate3DObject.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__Rotate3DObject.userFunc0x1385690(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__Rotate3DObject.func = function(runtimeScene, Id, Operator, AngleX, AngleY, AngleZ, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Id") return Id; +if (argName === "Operator") return Operator; +if (argName === "AngleX") return AngleX; +if (argName === "AngleY") return AngleY; +if (argName === "AngleZ") return AngleZ; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__Rotate3DObject.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__Rotate3DObject.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__rotate3dobjectonworld-func.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__rotate3dobjectonworld-func.js new file mode 100644 index 0000000..8e273a4 --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__rotate3dobjectonworld-func.js @@ -0,0 +1,120 @@ + +if (typeof gdjs.evtsExt__WithThreeJS__Rotate3DObjectOnWorld !== "undefined") { + gdjs.evtsExt__WithThreeJS__Rotate3DObjectOnWorld.registeredGdjsCallbacks.forEach(callback => + gdjs._unregisterCallback(callback) + ); +} + +gdjs.evtsExt__WithThreeJS__Rotate3DObjectOnWorld = {}; + + +gdjs.evtsExt__WithThreeJS__Rotate3DObjectOnWorld.userFunc0x13e7f88 = function(runtimeScene, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +const Id = eventsFunctionContext.getArgument("Id"); +const Operator = eventsFunctionContext.getArgument("Operator"); +const AngleX = eventsFunctionContext.getArgument("AngleX"); +const AngleY = eventsFunctionContext.getArgument("AngleY"); +const AngleZ = eventsFunctionContext.getArgument("AngleZ"); +// +const Obj = Scene.getObjectByName(Id); +if (!Obj) { + console.warn("3D Object not found."); + return; +} +// +if (Operator == "=") { + Obj.rotation.set(0, 0, 0); + Obj.rotateOnWorldAxis(new THREE.Vector3(1, 0, 0), gdjs.toRad(AngleX)); + Obj.rotateOnWorldAxis(new THREE.Vector3(0, 1, 0), gdjs.toRad(AngleY)); + Obj.rotateOnWorldAxis(new THREE.Vector3(0, 0, 1), gdjs.toRad(AngleZ)); +} else if (Operator == "+") { + Obj.rotateOnWorldAxis(new THREE.Vector3(1, 0, 0), gdjs.toRad(AngleX)); + Obj.rotateOnWorldAxis(new THREE.Vector3(0, 1, 0), gdjs.toRad(AngleY)); + Obj.rotateOnWorldAxis(new THREE.Vector3(0, 0, 1), gdjs.toRad(AngleZ)); +} else { + Obj.rotateOnWorldAxis(new THREE.Vector3(1, 0, 0), gdjs.toRad(-AngleX)); + Obj.rotateOnWorldAxis(new THREE.Vector3(0, 1, 0), gdjs.toRad(-AngleY)); + Obj.rotateOnWorldAxis(new THREE.Vector3(0, 0, 1), gdjs.toRad(-AngleZ)); +} + + +}; +gdjs.evtsExt__WithThreeJS__Rotate3DObjectOnWorld.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + + +gdjs.evtsExt__WithThreeJS__Rotate3DObjectOnWorld.userFunc0x13e7f88(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +}; + +gdjs.evtsExt__WithThreeJS__Rotate3DObjectOnWorld.func = function(runtimeScene, Id, Operator, AngleX, AngleY, AngleZ, parentEventsFunctionContext) { +var eventsFunctionContext = { + _objectsMap: { +}, + _objectArraysMap: { +}, + _behaviorNamesMap: { +}, + getObjects: function(objectName) { + return eventsFunctionContext._objectArraysMap[objectName] || []; + }, + getObjectsLists: function(objectName) { + return eventsFunctionContext._objectsMap[objectName] || null; + }, + getBehaviorName: function(behaviorName) { + return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName; + }, + createObject: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + if (objectsList) { + const object = parentEventsFunctionContext ? + parentEventsFunctionContext.createObject(objectsList.firstKey()) : + runtimeScene.createObject(objectsList.firstKey()); + if (object) { + objectsList.get(objectsList.firstKey()).push(object); + eventsFunctionContext._objectArraysMap[objectName].push(object); + } + return object; } + return null; + }, + getInstancesCountOnScene: function(objectName) { + const objectsList = eventsFunctionContext._objectsMap[objectName]; + let count = 0; + if (objectsList) { + for(const objectName in objectsList.items) + count += parentEventsFunctionContext ? +parentEventsFunctionContext.getInstancesCountOnScene(objectName) : + runtimeScene.getInstancesCountOnScene(objectName); + } + return count; + }, + getLayer: function(layerName) { + return runtimeScene.getLayer(layerName); + }, + getArgument: function(argName) { +if (argName === "Id") return Id; +if (argName === "Operator") return Operator; +if (argName === "AngleX") return AngleX; +if (argName === "AngleY") return AngleY; +if (argName === "AngleZ") return AngleZ; + return ""; + }, + getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); } +}; + + +gdjs.evtsExt__WithThreeJS__Rotate3DObjectOnWorld.eventsList0(runtimeScene, eventsFunctionContext); + +return; +} + +gdjs.evtsExt__WithThreeJS__Rotate3DObjectOnWorld.registeredGdjsCallbacks = []; \ No newline at end of file diff --git a/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__spriteprojection.js b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__spriteprojection.js new file mode 100644 index 0000000..509559c --- /dev/null +++ b/desktop/apps/dezunkrr/gdjs-evtsext__withthreejs__spriteprojection.js @@ -0,0 +1,3042 @@ + +gdjs.evtsExt__WithThreeJS__SpriteProjection = gdjs.evtsExt__WithThreeJS__SpriteProjection || {}; + +/** + * Behavior generated from 3D Sprite Projection + */ +gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection = class SpriteProjection extends gdjs.RuntimeBehavior { + constructor(instanceContainer, behaviorData, owner) { + super(instanceContainer, behaviorData, owner); + this._runtimeScene = instanceContainer; + + this._onceTriggers = new gdjs.OnceTriggers(); + this._behaviorData = {}; + this._sharedData = gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.getSharedData( + instanceContainer, + behaviorData.name + ); + + this._behaviorData.Id = ""; + this._behaviorData.FirstFrame = true; + this._behaviorData.CurrentTextureId = ""; + this._behaviorData.ProjectionScale = behaviorData.ProjectionScale !== undefined ? behaviorData.ProjectionScale : Number("0.01") || 0; + this._behaviorData.ViewMode = behaviorData.ViewMode !== undefined ? behaviorData.ViewMode : "Top Down"; + this._behaviorData.Hide = behaviorData.Hide !== undefined ? behaviorData.Hide : true; + this._behaviorData.AlphaTest = behaviorData.AlphaTest !== undefined ? behaviorData.AlphaTest : Number("0") || 0; + this._behaviorData.AntiAliasing = behaviorData.AntiAliasing !== undefined ? behaviorData.AntiAliasing : true; + this._behaviorData.CollisionX = Number("0") || 0; + this._behaviorData.CollisionY = Number("0") || 0; + this._behaviorData.CollisionIndex = Number("0") || 0; + this._behaviorData.IsHit = false; + this._behaviorData.CollisionDirection = "left"; + } + + // Hot-reload: + updateFromBehaviorData(oldBehaviorData, newBehaviorData) { + + if (oldBehaviorData.Id !== newBehaviorData.Id) + this._behaviorData.Id = newBehaviorData.Id; + if (oldBehaviorData.FirstFrame !== newBehaviorData.FirstFrame) + this._behaviorData.FirstFrame = newBehaviorData.FirstFrame; + if (oldBehaviorData.CurrentTextureId !== newBehaviorData.CurrentTextureId) + this._behaviorData.CurrentTextureId = newBehaviorData.CurrentTextureId; + if (oldBehaviorData.ProjectionScale !== newBehaviorData.ProjectionScale) + this._behaviorData.ProjectionScale = newBehaviorData.ProjectionScale; + if (oldBehaviorData.ViewMode !== newBehaviorData.ViewMode) + this._behaviorData.ViewMode = newBehaviorData.ViewMode; + if (oldBehaviorData.Hide !== newBehaviorData.Hide) + this._behaviorData.Hide = newBehaviorData.Hide; + if (oldBehaviorData.AlphaTest !== newBehaviorData.AlphaTest) + this._behaviorData.AlphaTest = newBehaviorData.AlphaTest; + if (oldBehaviorData.AntiAliasing !== newBehaviorData.AntiAliasing) + this._behaviorData.AntiAliasing = newBehaviorData.AntiAliasing; + if (oldBehaviorData.CollisionX !== newBehaviorData.CollisionX) + this._behaviorData.CollisionX = newBehaviorData.CollisionX; + if (oldBehaviorData.CollisionY !== newBehaviorData.CollisionY) + this._behaviorData.CollisionY = newBehaviorData.CollisionY; + if (oldBehaviorData.CollisionIndex !== newBehaviorData.CollisionIndex) + this._behaviorData.CollisionIndex = newBehaviorData.CollisionIndex; + if (oldBehaviorData.IsHit !== newBehaviorData.IsHit) + this._behaviorData.IsHit = newBehaviorData.IsHit; + if (oldBehaviorData.CollisionDirection !== newBehaviorData.CollisionDirection) + this._behaviorData.CollisionDirection = newBehaviorData.CollisionDirection; + + return true; + } + + // Properties: + + _getId() { + return this._behaviorData.Id !== undefined ? this._behaviorData.Id : ""; + } + _setId(newValue) { + this._behaviorData.Id = newValue; + } + _getFirstFrame() { + return this._behaviorData.FirstFrame !== undefined ? this._behaviorData.FirstFrame : true; + } + _setFirstFrame(newValue) { + this._behaviorData.FirstFrame = newValue; + } + _toggleFirstFrame() { + this._setFirstFrame(!this._getFirstFrame()); + } + _getCurrentTextureId() { + return this._behaviorData.CurrentTextureId !== undefined ? this._behaviorData.CurrentTextureId : ""; + } + _setCurrentTextureId(newValue) { + this._behaviorData.CurrentTextureId = newValue; + } + _getProjectionScale() { + return this._behaviorData.ProjectionScale !== undefined ? this._behaviorData.ProjectionScale : Number("0.01") || 0; + } + _setProjectionScale(newValue) { + this._behaviorData.ProjectionScale = newValue; + } + _getViewMode() { + return this._behaviorData.ViewMode !== undefined ? this._behaviorData.ViewMode : "Top Down"; + } + _setViewMode(newValue) { + this._behaviorData.ViewMode = newValue; + } + _getHide() { + return this._behaviorData.Hide !== undefined ? this._behaviorData.Hide : true; + } + _setHide(newValue) { + this._behaviorData.Hide = newValue; + } + _toggleHide() { + this._setHide(!this._getHide()); + } + _getAlphaTest() { + return this._behaviorData.AlphaTest !== undefined ? this._behaviorData.AlphaTest : Number("0") || 0; + } + _setAlphaTest(newValue) { + this._behaviorData.AlphaTest = newValue; + } + _getAntiAliasing() { + return this._behaviorData.AntiAliasing !== undefined ? this._behaviorData.AntiAliasing : true; + } + _setAntiAliasing(newValue) { + this._behaviorData.AntiAliasing = newValue; + } + _toggleAntiAliasing() { + this._setAntiAliasing(!this._getAntiAliasing()); + } + _getCollisionX() { + return this._behaviorData.CollisionX !== undefined ? this._behaviorData.CollisionX : Number("0") || 0; + } + _setCollisionX(newValue) { + this._behaviorData.CollisionX = newValue; + } + _getCollisionY() { + return this._behaviorData.CollisionY !== undefined ? this._behaviorData.CollisionY : Number("0") || 0; + } + _setCollisionY(newValue) { + this._behaviorData.CollisionY = newValue; + } + _getCollisionIndex() { + return this._behaviorData.CollisionIndex !== undefined ? this._behaviorData.CollisionIndex : Number("0") || 0; + } + _setCollisionIndex(newValue) { + this._behaviorData.CollisionIndex = newValue; + } + _getIsHit() { + return this._behaviorData.IsHit !== undefined ? this._behaviorData.IsHit : false; + } + _setIsHit(newValue) { + this._behaviorData.IsHit = newValue; + } + _toggleIsHit() { + this._setIsHit(!this._getIsHit()); + } + _getCollisionDirection() { + return this._behaviorData.CollisionDirection !== undefined ? this._behaviorData.CollisionDirection : "left"; + } + _setCollisionDirection(newValue) { + this._behaviorData.CollisionDirection = newValue; + } +} + +/** + * Shared data generated from 3D Sprite Projection + */ +gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.SharedData = class SpriteProjectionSharedData { + constructor(sharedData) { + + } + + // Shared properties: + +} + +gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.getSharedData = function(instanceContainer, behaviorName) { + if (!instanceContainer._WithThreeJS_SpriteProjectionSharedData) { + const initialData = instanceContainer.getInitialSharedDataForBehavior( + behaviorName + ); + instanceContainer._WithThreeJS_SpriteProjectionSharedData = new gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.SharedData( + initialData + ); + } + return instanceContainer._WithThreeJS_SpriteProjectionSharedData; +} + +// Methods: +gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.doStepPostEventsContext = {}; +gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.doStepPostEventsContext.GDObjectObjects1= []; +gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.doStepPostEventsContext.GDObjectObjects2= []; + + +gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.doStepPostEventsContext.userFunc0x12c0368 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +if (!gdjs.__WithThreeJS.has("Renderer")) { + console.warn("!"); + return; +} +if (!gdjs.__WithThreeJS.has("Textures")) { + gdjs.__WithThreeJS.set("Textures", new Map()); +} +const Scene = gdjs.__WithThreeJS.get("Scene"); +let Textures = gdjs.__WithThreeJS.get("Textures"); +// +const Behavior = objects[0].getBehavior("SpriteProjection"); +const Id = objects[0].name + objects[0].id; +// const X = objects[0].x; +// const Y = objects[0].y; +// const Z = objects[0].zOrder; +const ProjectionScale = Behavior.ProjectionScale(); +const ViewMode = Behavior.ViewMode(); +const AlphaTest = Behavior.AlphaTest(); +const Transparent = AlphaTest !== 0; +const AntiAliasing = Behavior.AntiAliasing(); +// const Blend = THREE.NormalBlending; +// const Opacity = 1.0; +// +//スプライトのすべてのアニメーション画像を取得 +let AllAnimationSources = []; +for(const V of objects[0]._animations) { + for(const VV of V.directions[0].frames) { + AllAnimationSources.push(VV.texture.baseTexture.resource); + } +} +//その画像がTexturesに登録されているか確認。未登録の場合は作成。 +for(const V of AllAnimationSources) { + const TexId = "_" + V.url; + if (!Textures.has(TexId)) { + const T = new THREE.Texture(); + T.image = V.source; + T.wrapS = THREE.MirroredRepeatWrapping; + T.wrapT = THREE.MirroredRepeatWrapping; + if (!AntiAliasing) { + T.magFilter = THREE.NearestFilter;// THREE.LinearFilter + T.minFilter = THREE.NearestFilter;// THREE.LinearMipmapLinearFilter + } + T.needsUpdate = true;//必須 + Textures.set(TexId, T); + //FlipX + const T_FlipX = T.clone(); + T_FlipX.offset.x = 1; + Textures.set(TexId + "_FlipX", T_FlipX); + //FlipY + const T_FlipY = T.clone(); + T_FlipY.offset.y = 1; + Textures.set(TexId + "_FlipY", T_FlipY); + //FlipXY + const T_FlipXY = T.clone(); + T_FlipXY.offset.x = 1; + T_FlipXY.offset.y = 1; + Textures.set(TexId + "_FlipX_FlipY", T_FlipXY); + } +} +// +const TextureId = "_" + objects[0].getRendererObject().texture.baseTexture.resource.url; +Behavior.SetCurrentTextureId(TextureId); +const Texture = Textures.get(TextureId); +const TextureWidth = Texture.image.width; +const TextureHeight = Texture.image.height; +const Material = new THREE.SpriteMaterial({map:Texture, transparent:Transparent, alphaTest:AlphaTest});// blendingとopacityは2D依存 +const Sprite = new THREE.Sprite(Material); +Sprite.name = Id; +Sprite.userData.Use3DProjectionBehavior = true; +Sprite.scale.set(TextureWidth * ProjectionScale, TextureHeight * ProjectionScale, 1); +Behavior.SetId(Id); +Scene.add(Sprite); + + +}; +gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.doStepPostEventsContext.eventsList0 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.doStepPostEventsContext.GDObjectObjects1, gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.doStepPostEventsContext.GDObjectObjects2); + + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.doStepPostEventsContext.GDObjectObjects2); +gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.doStepPostEventsContext.userFunc0x12c0368(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +{ + +/* Reuse gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.doStepPostEventsContext.GDObjectObjects1 */ + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.doStepPostEventsContext.GDObjectObjects1.length;i (( gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects5.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects5[0].getCenterYInScene())); +} +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects5 */ +{for(var i = 0, len = gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects5.length ;i < len;++i) { + gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects5[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetCollisionDirection("left", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +{ + +/* Reuse gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects4 */ + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((gdjs.evtsExt__WithThreeJS__RaycastResultNumber.func(runtimeScene, 0, "Point Z", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) / 0.01) < (( gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects4.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects4[0].getCenterYInScene())); +} +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects4 */ +{for(var i = 0, len = gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects4.length ;i < len;++i) { + gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects4[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetCollisionDirection("right", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +};gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList1 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ + +{ //Subevents +gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList0(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList2 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3, gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects4); + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((gdjs.evtsExt__WithThreeJS__RaycastResultNumber.func(runtimeScene, 0, "Point Z", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) / 0.01) > (( gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects4.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects4[0].getCenterYInScene())); +} +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects4 */ +{for(var i = 0, len = gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects4.length ;i < len;++i) { + gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects4[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetCollisionDirection("right", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +{ + +/* Reuse gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3 */ + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((gdjs.evtsExt__WithThreeJS__RaycastResultNumber.func(runtimeScene, 0, "Point Z", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) / 0.01) < (( gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3[0].getCenterYInScene())); +} +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3 */ +{for(var i = 0, len = gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3.length ;i < len;++i) { + gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetCollisionDirection("left", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +};gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList3 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ + +{ //Subevents +gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList2(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList4 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDCameraObjects3, gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDCameraObjects4); + +gdjs.copyArray(gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3, gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects4); + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((( gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDCameraObjects4.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDCameraObjects4[0].getCenterXInScene()) > (( gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects4.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects4[0].getCenterXInScene())); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList1(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + +/* Reuse gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3 */ + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((( gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3[0].getCenterXInScene()) < 0); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList3(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList5 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3, gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects4); + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((gdjs.evtsExt__WithThreeJS__RaycastResultNumber.func(runtimeScene, 0, "Point X", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) / 0.01) > (( gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects4.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects4[0].getCenterXInScene())); +} +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects4 */ +{for(var i = 0, len = gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects4.length ;i < len;++i) { + gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects4[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetCollisionDirection("right", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +{ + +/* Reuse gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3 */ + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((gdjs.evtsExt__WithThreeJS__RaycastResultNumber.func(runtimeScene, 0, "Point X", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) / 0.01) < (( gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3[0].getCenterXInScene())); +} +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3 */ +{for(var i = 0, len = gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3.length ;i < len;++i) { + gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetCollisionDirection("left", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +};gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList6 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ + +{ //Subevents +gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList5(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList7 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2, gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3); + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((gdjs.evtsExt__WithThreeJS__RaycastResultNumber.func(runtimeScene, 0, "Point X", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) / 0.01) > (( gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3[0].getCenterXInScene())); +} +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3 */ +{for(var i = 0, len = gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3.length ;i < len;++i) { + gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetCollisionDirection("left", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +{ + +/* Reuse gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2 */ + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((gdjs.evtsExt__WithThreeJS__RaycastResultNumber.func(runtimeScene, 0, "Point X", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) / 0.01) < (( gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2[0].getCenterXInScene())); +} +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2 */ +{for(var i = 0, len = gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetCollisionDirection("right", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +};gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList8 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ + +{ //Subevents +gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList7(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList9 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDCameraObjects2, gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDCameraObjects3); + +gdjs.copyArray(gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2, gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3); + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((( gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDCameraObjects3.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDCameraObjects3[0].getCenterYInScene()) > (( gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3[0].getCenterYInScene())); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList6(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + +/* Reuse gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDCameraObjects2 */ +/* Reuse gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2 */ + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((( gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDCameraObjects2.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDCameraObjects2[0].getCenterYInScene()) < (( gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2[0].getCenterYInScene())); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList8(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList10 = function(runtimeScene, eventsFunctionContext) { + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Camera"), gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDCameraObjects3); +gdjs.copyArray(gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects1, gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3); + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (Math.abs((( gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDCameraObjects3.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDCameraObjects3[0].getCenterYInScene()) - (( gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3[0].getCenterYInScene())) < Math.abs((( gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDCameraObjects3.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDCameraObjects3[0].getCenterXInScene()) - (( gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects3[0].getCenterXInScene()))); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList4(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Camera"), gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDCameraObjects2); +gdjs.copyArray(gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects1, gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2); + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = (Math.abs((( gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDCameraObjects2.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDCameraObjects2[0].getCenterYInScene()) - (( gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2[0].getCenterYInScene())) > Math.abs((( gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDCameraObjects2.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDCameraObjects2[0].getCenterXInScene()) - (( gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2.length === 0 ) ? 0 :gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2[0].getCenterXInScene()))); +} +if (isConditionTrue_0) { + +{ //Subevents +gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList9(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.userFunc0x1409030 = function(runtimeScene, objects, eventsFunctionContext) { +"use strict"; +if(objects.length == 0) return; + +const SpriteBehavior = objects[0].getBehavior("SpriteProjection"); +const Collision = runtimeScene.getVariables().get("Collision").toJSObject(); +const SpriteObject = objects[0]; + +function insidePolygon(point, vs) { + // ray-casting algorithm based on + // https://wrf.ecse.rpi.edu/Research/Short_Notes/pnpoly.html/pnpoly.html + + var x = point[0], y = point[1]; + + var inside = false; + for (var i = 0, j = vs.length - 1; i < vs.length; j = i++) { + var xi = vs[i][0], yi = vs[i][1]; + var xj = vs[j][0], yj = vs[j][1]; + + var intersect = ((yi > y) != (yj > y)) + && (x < (xj - xi) * (y - yi) / (yj - yi) + xi); + if (intersect) inside = !inside; + } + + return inside; +}; + +function GetRelativeVerticesfromArray(Vertices, SpriteObject) { + const relativeVertices = []; + + Vertices.forEach((vertix) => { + relativeVertices.push([ + vertix[0]-SpriteObject.getX(), + vertix[1]-SpriteObject.getY() + ]) + }); + + return relativeVertices; +} + + +const HitBoxes = []; + +let IsHit = false; + +SpriteObject.getHitBoxes().forEach((Hitbox, Index)=>{ + const polygon = GetRelativeVerticesfromArray(Hitbox.vertices, SpriteObject); + const point = [ + SpriteBehavior.CollisionX(), + SpriteBehavior.CollisionY() + ]; + + const result = insidePolygon(point,polygon); + + if(result) { + SpriteBehavior.SetCollisionIndex(Index); + IsHit = true; + } +}) + +SpriteBehavior.SetIsHit(IsHit); + + +}; +gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList11 = function(runtimeScene, eventsFunctionContext) { + +{ + +/* Reuse gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects1 */ + +var objects = []; +objects.push.apply(objects,gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects1); +gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.userFunc0x1409030(runtimeScene, objects, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined); + +} + + +};gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList12 = function(runtimeScene, eventsFunctionContext) { + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects1, gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2); + +{for(var i = 0, len = gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetCollisionYAction(((gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2[i].getHeight()) + (gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2[i].getZOrder()) - (gdjs.evtsExt__WithThreeJS__RaycastResultNumber.func(runtimeScene, 0, "Point Y", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) / 0.01) - ((gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2[i].getHeight()) / 2)), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +{ + + +let isConditionTrue_0 = false; +{ + +{ //Subevents +gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList10(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + +gdjs.copyArray(gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects1, gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2); + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((( gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2.length === 0 ) ? "" :gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).CollisionDirection((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))) == "left"); +} +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2 */ +{for(var i = 0, len = gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetCollisionXAction(((gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2[i].getWidth()) / 2) - (gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).CollisionX((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +{ + +gdjs.copyArray(gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects1, gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2); + + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +{isConditionTrue_0 = ((( gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2.length === 0 ) ? "" :gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2[0].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).CollisionDirection((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))) == "right"); +} +if (isConditionTrue_0) { +/* Reuse gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2 */ +{for(var i = 0, len = gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2.length ;i < len;++i) { + gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetCollisionXAction((gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).CollisionX((typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined))) + ((gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects2[i].getWidth()) / 2), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +}} + +} + + +{ + + +let isConditionTrue_0 = false; +{ + +{ //Subevents +gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList11(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +};gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList13 = function(runtimeScene, eventsFunctionContext) { + +{ + + + +} + + +{ + + +let isConditionTrue_0 = false; +{ +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects1); +{for(var i = 0, len = gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects1.length ;i < len;++i) { + gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects1[i].getBehavior(eventsFunctionContext.getBehaviorName("Behavior")).SetCollisionXAction(gdjs.evtTools.common.distanceBetweenPositions((gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects1[i].getCenterXInScene()), (gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects1[i].getCenterYInScene()), (gdjs.evtsExt__WithThreeJS__RaycastResultNumber.func(runtimeScene, 0, "Point X", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) / 0.01), (gdjs.evtsExt__WithThreeJS__RaycastResultNumber.func(runtimeScene, 0, "Point Z", (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)) / 0.01)), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined)); +} +} +{ //Subevents +gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.eventsList12(runtimeScene, eventsFunctionContext);} //End of subevents +} + +} + + +{ + + +let isConditionTrue_0 = false; +{ +{if (typeof eventsFunctionContext !== 'undefined') { eventsFunctionContext.returnValue = false; }}} + +} + + +{ + +gdjs.copyArray(eventsFunctionContext.getObjects("Object"), gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects1); + +let isConditionTrue_0 = false; +isConditionTrue_0 = false; +for (var i = 0, k = 0, l = gdjs.evtsExt__WithThreeJS__SpriteProjection.SpriteProjection.prototype.CheckFor3dCollisionContext.GDObjectObjects1.length;ig.error("Can't play an audio file: "+e),onloaderror:(d,e)=>g.error("Error while loading an audio file: "+e)},w=d=>d>1?1:d<0?0:d;class H{constructor(e,t,s,i){this._id=null;this._oncePlay=[];this._onPlay=[];this._howl=e,this._initialVolume=w(t),this._loop=s,this._rate=i}isLoaded(){return this._howl.state()==="loaded"}play(){if(this.isLoaded()){const e=this._howl.play(this._id===null?"__default":this._id);this._id=e,this._howl.volume(this._initialVolume,e),this._howl.loop(this._loop,e),this._howl.rate(f.HowlerSoundManager.clampRate(this._rate),e),this._onPlay.forEach(t=>{this.on("play",t),t(e)}),this._oncePlay.forEach(t=>t(e)),this._onPlay=[],this._oncePlay=[]}else this._howl.once("load",()=>this.play());return this}pause(){return this._id!==null&&this._howl.pause(this._id),this}stop(){return this._id!==null&&this._howl.stop(this._id),this}playing(){return(this._id!==null?this._howl.playing(this._id):!0)||!this.isLoaded()}paused(){return!this.playing()}stopped(){return this.paused()&&this.getSeek()===0}getRate(){return this._rate}setRate(e){return this._rate=e,this._id!==null&&(e=f.HowlerSoundManager.clampRate(e),this._howl.rate(e,this._id)),this}getLoop(){return this._loop}setLoop(e){return this._loop=e,this._id!==null&&this._howl.loop(e,this._id),this}getVolume(){return this._id===null?this._initialVolume:this._howl.volume(this._id)}setVolume(e){return this._initialVolume=w(e),this._id!==null&&this._howl.volume(this._initialVolume,this._id),this}getMute(){return this._id===null?!1:this._howl.mute(this._id)}setMute(e){return this._id!==null&&this._howl.mute(e,this._id),this}getSeek(){return this._id===null?0:this._howl.seek(this._id)}setSeek(e){return this._id!==null&&this._howl.seek(e,this._id),this}getSpatialPosition(e){return this._id===null?0:this._howl.pos(this._id)[e==="x"?0:e==="y"?1:2]}setSpatialPosition(e,t,s){return this._id!==null&&this._howl.pos(e,t,s,this._id),this}fade(e,t,s){return this._id!==null&&this._howl.fade(w(e),w(t),s,this._id),this}on(e,t){return e==="play"?this._id===null?this._onPlay.push(t):this._howl.on(e,t,this._id):this._id===null?this.once("play",()=>this.on(e,t)):this._howl.on(e,t,this._id),this}once(e,t){return e==="play"?this._id===null?this._oncePlay.push(t):this.playing()?t(this._id):this._howl.once(e,t,this._id):this._id===null?this.once("play",()=>this.once(e,t)):this._howl.once(e,t,this._id),this}off(e,t){return this._id!==null&&this._howl.off(e,t,this._id),this}}f.HowlerSound=H;class b{constructor(e,t){this._loadedMusics={};this._loadedSounds={};this._availableResources={};this._globalVolume=100;this._sounds={};this._musics={};this._freeSounds=[];this._freeMusics=[];this._pausedSounds=[];this._paused=!1;this._resources=e,this._resourcesLoader=t;const s=this;document.addEventListener("deviceready",function(){document.addEventListener("pause",function(){const i=s._freeSounds.concat(s._freeMusics);for(let o in s._sounds)s._sounds.hasOwnProperty(o)&&i.push(s._sounds[o]);for(let o in s._musics)s._musics.hasOwnProperty(o)&&i.push(s._musics[o]);for(let o=0;o4?4:e<.5?.5:e}_getFileFromSoundName(e){return this._availableResources.hasOwnProperty(e)&&this._availableResources[e].file?this._availableResources[e].file:e}_storeSoundInArray(e,t){for(let s=0,i=e.length;s{this._paused&&(o.pause(),this._pausedSounds.push(o))}),o.play()}playSoundOnChannel(e,t,s,i,o){this._sounds[t]&&this._sounds[t].stop();const l=this.createHowlerSound(e,!1,i/100,s,o);this._sounds[t]=l,l.once("play",()=>{this._paused&&(l.pause(),this._pausedSounds.push(l))}),l.play()}getSoundOnChannel(e){return this._sounds[e]||null}playMusic(e,t,s,i){const o=this.createHowlerSound(e,!0,s/100,t,i);this._storeSoundInArray(this._freeMusics,o),o.once("play",()=>{this._paused&&(o.pause(),this._pausedSounds.push(o))}),o.play()}playMusicOnChannel(e,t,s,i,o){this._musics[t]&&this._musics[t].stop();const l=this.createHowlerSound(e,!0,i/100,s,o);this._musics[t]=l,l.once("play",()=>{this._paused&&(l.pause(),this._pausedSounds.push(l))}),l.play()}getMusicOnChannel(e){return this._musics[e]||null}setGlobalVolume(e){this._globalVolume=e,this._globalVolume>100&&(this._globalVolume=100),this._globalVolume<0&&(this._globalVolume=0),Howler.volume(this._globalVolume/100)}getGlobalVolume(){return this._globalVolume}clearAll(){Howler.stop(),this._freeSounds.length=0,this._freeMusics.length=0,this._sounds={},this._musics={},this._pausedSounds.length=0}preloadAudio(e,t,s){s=s||this._resources;const i={};for(let a=0,u=s.length;a{if(u&&g.warn("There was an error while preloading an audio file: "+u),r++,r===l)return t(l);e(r,l),y()},S=(a,u,n)=>{const c=n?this._loadedMusics:this._loadedSounds;c[a]=new Howl(Object.assign({},m,{src:[this._resourcesLoader.getFullUrl(a)],onload:u,onloaderror:u,html5:n,xhr:{withCredentials:this._resourcesLoader.checkIfCredentialsRequired(a)},volume:0}))},y=()=>{if(!o.length)return;const a=o.shift(),u=i[a][0];let n=0;const c=(h,p)=>{n--,n||_(h,p)};if(u.preloadAsMusic&&(n++,S(a,c,!0)),u.preloadAsSound)n++,S(a,c,!1);else if(u.preloadInCache){n++;const h=new XMLHttpRequest;h.withCredentials=this._resourcesLoader.checkIfCredentialsRequired(a),h.addEventListener("load",c),h.addEventListener("error",p=>c(p,"XHR error: "+a)),h.addEventListener("abort",p=>c(p,"XHR abort: "+a)),h.open("GET",this._resourcesLoader.getFullUrl(a)),h.send()}n||_()};y()}}f.HowlerSoundManager=b,f.SoundManager=b})(gdjs||(gdjs={})); +//# sourceMappingURL=howler-sound-manager.js.map diff --git a/desktop/apps/dezunkrr/howler-sound-manager/howler.min.js b/desktop/apps/dezunkrr/howler-sound-manager/howler.min.js new file mode 100644 index 0000000..c031150 --- /dev/null +++ b/desktop/apps/dezunkrr/howler-sound-manager/howler.min.js @@ -0,0 +1,3 @@ +/*! howler.js v2.2.3 | (c) 2013-2020, James Simpson of GoldFire Studios | MIT License | howlerjs.com */ +/* Modified for GDevelop by reverting commit 0323af9b843351cacc47893aed8e65cd8ba3b0cb to fix https://github.com/goldfire/howler.js/issues/1603 */ +!function(){"use strict";var e=function(){this.init()};e.prototype={init:function(){var e=this||n;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=!1,e._volume=1,e._canPlayEvent="canplaythrough",e._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=!1,e.usingWebAudio=!0,e.autoSuspend=!0,e.ctx=null,e.autoUnlock=!0,e._setup(),e},volume:function(e){var o=this||n;if(e=parseFloat(e),o.ctx||_(),void 0!==e&&e>=0&&e<=1){if(o._volume=e,o._muted)return o;o.usingWebAudio&&o.masterGain.gain.setValueAtTime(e,n.ctx.currentTime);for(var t=0;t=0;o--)e._howls[o].unload();return e.usingWebAudio&&e.ctx&&void 0!==e.ctx.close&&(e.ctx.close(),e.ctx=null,_()),e},codecs:function(e){return(this||n)._codecs[e.replace(/^x-/,"")]},_setup:function(){var e=this||n;if(e.state=e.ctx?e.ctx.state||"suspended":"suspended",e._autoSuspend(),!e.usingWebAudio)if("undefined"!=typeof Audio)try{var o=new Audio;void 0===o.oncanplaythrough&&(e._canPlayEvent="canplay")}catch(n){e.noAudio=!0}else e.noAudio=!0;try{var o=new Audio;o.muted&&(e.noAudio=!0)}catch(e){}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||n,o=null;try{o="undefined"!=typeof Audio?new Audio:null}catch(n){return e}if(!o||"function"!=typeof o.canPlayType)return e;var t=o.canPlayType("audio/mpeg;").replace(/^no$/,""),r=e._navigator?e._navigator.userAgent:"",a=r.match(/OPR\/([0-6].)/g),u=a&&parseInt(a[0].split("/")[1],10)<33,d=-1!==r.indexOf("Safari")&&-1===r.indexOf("Chrome"),i=r.match(/Version\/(.*?) /),_=d&&i&&parseInt(i[1],10)<15;return e._codecs={mp3:!(u||!t&&!o.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!t,opus:!!o.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!o.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!o.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(o.canPlayType('audio/wav; codecs="1"')||o.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!o.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!o.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(o.canPlayType("audio/x-m4a;")||o.canPlayType("audio/m4a;")||o.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(o.canPlayType("audio/x-m4b;")||o.canPlayType("audio/m4b;")||o.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(o.canPlayType("audio/x-mp4;")||o.canPlayType("audio/mp4;")||o.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(_||!o.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(_||!o.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!o.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(o.canPlayType("audio/x-flac;")||o.canPlayType("audio/flac;")).replace(/^no$/,"")},e},_unlockAudio:function(){var e=this||n;if(!e._audioUnlocked&&e.ctx){e._audioUnlocked=!1,e.autoUnlock=!1,e._mobileUnloaded||44100===e.ctx.sampleRate||(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var o=function(n){for(;e._html5AudioPool.length0?d._seek:t._sprite[e][0]/1e3),s=Math.max(0,(t._sprite[e][0]+t._sprite[e][1])/1e3-_),l=1e3*s/Math.abs(d._rate),c=t._sprite[e][0]/1e3,f=(t._sprite[e][0]+t._sprite[e][1])/1e3;d._sprite=e,d._ended=!1;var p=function(){d._paused=!1,d._seek=_,d._start=c,d._stop=f,d._loop=!(!d._loop&&!t._sprite[e][2])};if(_>=f)return void t._ended(d);var m=d._node;if(t._webAudio){var v=function(){t._playLock=!1,p(),t._refreshBuffer(d);var e=d._muted||t._muted?0:d._volume;m.gain.setValueAtTime(e,n.ctx.currentTime),d._playStart=n.ctx.currentTime,void 0===m.bufferSource.start?d._loop?m.bufferSource.noteGrainOn(0,_,86400):m.bufferSource.noteGrainOn(0,_,s):d._loop?m.bufferSource.start(0,_,86400):m.bufferSource.start(0,_,s),l!==1/0&&(t._endTimers[d._id]=setTimeout(t._ended.bind(t,d),l)),o||setTimeout(function(){t._emit("play",d._id),t._loadQueue()},0)};"running"===n.state&&"interrupted"!==n.ctx.state?v():(t._playLock=!0,t.once("resume",v),t._clearTimer(d._id))}else{var h=function(){m.currentTime=_,m.muted=d._muted||t._muted||n._muted||m.muted,m.volume=d._volume*n.volume(),m.playbackRate=d._rate;try{var r=m.play();if(r&&"undefined"!=typeof Promise&&(r instanceof Promise||"function"==typeof r.then)?(t._playLock=!0,p(),r.then(function(){t._playLock=!1,m._unlocked=!0,o||(t._emit("play",d._id),t._loadQueue())}).catch(function(){t._playLock=!1,t._emit("playerror",d._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),d._ended=!0,d._paused=!0})):o||(t._playLock=!1,p(),t._emit("play",d._id),t._loadQueue()),m.playbackRate=d._rate,m.paused)return void t._emit("playerror",d._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==e||d._loop?t._endTimers[d._id]=setTimeout(t._ended.bind(t,d),l):(t._endTimers[d._id]=function(){t._ended(d),m.removeEventListener("ended",t._endTimers[d._id],!1)},m.addEventListener("ended",t._endTimers[d._id],!1))}catch(e){t._emit("playerror",d._id,e)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===m.src&&(m.src=t._src,m.load());var y=window&&window.ejecta||!m.readyState&&n._navigator.isCocoonJS;if(m.readyState>=3||y)h();else{t._playLock=!0,t._state="loading";var g=function(){t._state="loaded",h(),m.removeEventListener(n._canPlayEvent,g,!1)};m.addEventListener(n._canPlayEvent,g,!1),t._clearTimer(d._id)}}return d._id},pause:function(e){var n=this;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"pause",action:function(){n.pause(e)}}),n;for(var o=n._getSoundIds(e),t=0;t=0?o=parseInt(r[0],10):e=parseFloat(r[0])}else r.length>=2&&(e=parseFloat(r[0]),o=parseInt(r[1],10));var a;if(!(void 0!==e&&e>=0&&e<=1))return a=o?t._soundById(o):t._sounds[0],a?a._volume:0;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"volume",action:function(){t.volume.apply(t,r)}}),t;void 0===o&&(t._volume=e),o=t._getSoundIds(o);for(var u=0;u0?t/_:t),l=Date.now();e._fadeTo=o,e._interval=setInterval(function(){var r=(Date.now()-l)/t;l=Date.now(),d+=i*r,d=Math.round(100*d)/100,d=i<0?Math.max(o,d):Math.min(o,d),u._webAudio?e._volume=d:u.volume(d,e._id,!0),a&&(u._volume=d),(on&&d>=o)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,u.volume(o,e._id),u._emit("fade",e._id))},s)},_stopFade:function(e){var o=this,t=o._soundById(e);return t&&t._interval&&(o._webAudio&&t._node.gain.cancelScheduledValues(n.ctx.currentTime),clearInterval(t._interval),t._interval=null,o.volume(t._fadeTo,e),t._fadeTo=null,o._emit("fade",e)),o},loop:function(){var e,n,o,t=this,r=arguments;if(0===r.length)return t._loop;if(1===r.length){if("boolean"!=typeof r[0])return!!(o=t._soundById(parseInt(r[0],10)))&&o._loop;e=r[0],t._loop=e}else 2===r.length&&(e=r[0],n=parseInt(r[1],10));for(var a=t._getSoundIds(n),u=0;u=0?o=parseInt(r[0],10):e=parseFloat(r[0])}else 2===r.length&&(e=parseFloat(r[0]),o=parseInt(r[1],10));var d;if("number"!=typeof e)return d=t._soundById(o),d?d._rate:t._rate;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"rate",action:function(){t.rate.apply(t,r)}}),t;void 0===o&&(t._rate=e),o=t._getSoundIds(o);for(var i=0;i=0?o=parseInt(r[0],10):t._sounds.length&&(o=t._sounds[0]._id,e=parseFloat(r[0]))}else 2===r.length&&(e=parseFloat(r[0]),o=parseInt(r[1],10));if(void 0===o)return 0;if("number"==typeof e&&("loaded"!==t._state||t._playLock))return t._queue.push({event:"seek",action:function(){t.seek.apply(t,r)}}),t;var d=t._soundById(o);if(d){if(!("number"==typeof e&&e>=0)){if(t._webAudio){var i=t.playing(o)?n.ctx.currentTime-d._playStart:0,_=d._rateSeek?d._rateSeek-d._seek:0;return d._seek+(_+i*Math.abs(d._rate))}return d._node.currentTime}var s=t.playing(o);s&&t.pause(o,!0),d._seek=e,d._ended=!1,t._clearTimer(o),t._webAudio||!d._node||isNaN(d._node.duration)||(d._node.currentTime=e);var l=function(){t._emit("seek",o),s&&t.play(o,!0)};if(s&&!t._webAudio){var c=function(){t._playLock?setTimeout(c,0):l()};setTimeout(c,0)}else l()}return t},playing:function(e){var n=this;if("number"==typeof e){var o=n._soundById(e);return!!o&&!o._paused}for(var t=0;t=0&&n._howls.splice(a,1);var u=!0;for(t=0;t=0){u=!1;break}return r&&u&&delete r[e._src],n.noAudio=!1,e._state="unloaded",e._sounds=[],e=null,null},on:function(e,n,o,t){var r=this,a=r["_on"+e];return"function"==typeof n&&a.push(t?{id:o,fn:n,once:t}:{id:o,fn:n}),r},off:function(e,n,o){var t=this,r=t["_on"+e],a=0;if("number"==typeof n&&(o=n,n=null),n||o)for(a=0;a=0;a--)r[a].id&&r[a].id!==n&&"load"!==e||(setTimeout(function(e){e.call(this,n,o)}.bind(t,r[a].fn),0),r[a].once&&t.off(e,r[a].fn,r[a].id));return t._loadQueue(e),t},_loadQueue:function(e){var n=this;if(n._queue.length>0){var o=n._queue[0];o.event===e&&(n._queue.shift(),n._loadQueue()),e||o.action()}return n},_ended:function(e){var o=this,t=e._sprite;if(!o._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime=0;t--){if(o<=n)return;e._sounds[t]._ended&&(e._webAudio&&e._sounds[t]._node&&e._sounds[t]._node.disconnect(0),e._sounds.splice(t,1),o--)}}},_getSoundIds:function(e){var n=this;if(void 0===e){for(var o=[],t=0;t=0;if(n._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),t))try{e.bufferSource.buffer=n._scratchBuffer}catch(e){}return e.bufferSource=null,o},_clearSound:function(e){/MSIE |Trident\//.test(n._navigator&&n._navigator.userAgent)||(e.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var t=function(e){this._parent=e,this.init()};t.prototype={init:function(){var e=this,o=e._parent;return e._muted=o._muted,e._loop=o._loop,e._volume=o._volume,e._rate=o._rate,e._seek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++n._counter,o._sounds.push(e),e.create(),e},create:function(){var e=this,o=e._parent,t=n._muted||e._muted||e._parent._muted?0:e._volume;return o._webAudio?(e._node=void 0===n.ctx.createGain?n.ctx.createGainNode():n.ctx.createGain(),e._node.gain.setValueAtTime(t,n.ctx.currentTime),e._node.paused=!0,e._node.connect(n.masterGain)):n.noAudio||(e._node=n._obtainHtml5Audio(),e._errorFn=e._errorListener.bind(e),e._node.addEventListener("error",e._errorFn,!1),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(n._canPlayEvent,e._loadFn,!1),e._endFn=e._endListener.bind(e),e._node.addEventListener("ended",e._endFn,!1),e._node.src=o._src,e._node.preload=!0===o._preload?"auto":o._preload,e._node.volume=t*n.volume(),e._node.load()),e},reset:function(){var e=this,o=e._parent;return e._muted=o._muted,e._loop=o._loop,e._volume=o._volume,e._rate=o._rate,e._seek=0,e._rateSeek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++n._counter,e},_errorListener:function(){var e=this;e._parent._emit("loaderror",e._id,e._node.error?e._node.error.code:0),e._node.removeEventListener("error",e._errorFn,!1)},_loadListener:function(){var e=this,o=e._parent;o._duration=Math.ceil(10*e._node.duration)/10,0===Object.keys(o._sprite).length&&(o._sprite={__default:[0,1e3*o._duration]}),"loaded"!==o._state&&(o._state="loaded",o._emit("load"),o._loadQueue()),e._node.removeEventListener(n._canPlayEvent,e._loadFn,!1)},_endListener:function(){var e=this,n=e._parent;n._duration===1/0&&(n._duration=Math.ceil(10*e._node.duration)/10,n._sprite.__default[1]===1/0&&(n._sprite.__default[1]=1e3*n._duration),n._ended(e)),e._node.removeEventListener("ended",e._endFn,!1)}};var r={},a=function(e){var n=e._src;if(r[n])return e._duration=r[n].duration,void i(e);if(/^data:[^;]+;base64,/.test(n)){for(var o=atob(n.split(",")[1]),t=new Uint8Array(o.length),a=0;a0?(r[o._src]=e,i(o,e)):t()};"undefined"!=typeof Promise&&1===n.ctx.decodeAudioData.length?n.ctx.decodeAudioData(e).then(a).catch(t):n.ctx.decodeAudioData(e,a,t)},i=function(e,n){n&&!e._duration&&(e._duration=n.duration),0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue())},_=function(){if(n.usingWebAudio){try{"undefined"!=typeof AudioContext?n.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?n.ctx=new webkitAudioContext:n.usingWebAudio=!1}catch(e){n.usingWebAudio=!1}n.ctx||(n.usingWebAudio=!1);var e=/iP(hone|od|ad)/.test(n._navigator&&n._navigator.platform),o=n._navigator&&n._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),t=o?parseInt(o[1],10):null;if(e&&t&&t<9){var r=/safari/.test(n._navigator&&n._navigator.userAgent.toLowerCase());n._navigator&&!r&&(n.usingWebAudio=!1)}n.usingWebAudio&&(n.masterGain=void 0===n.ctx.createGain?n.ctx.createGainNode():n.ctx.createGain(),n.masterGain.gain.setValueAtTime(n._muted?0:n._volume,n.ctx.currentTime),n.masterGain.connect(n.ctx.destination)),n._setup()}};"function"==typeof define&&define.amd&&define([],function(){return{Howler:n,Howl:o}}),"undefined"!=typeof exports&&(exports.Howler=n,exports.Howl=o),"undefined"!=typeof global?(global.HowlerGlobal=e,global.Howler=n,global.Howl=o,global.Sound=t):"undefined"!=typeof window&&(window.HowlerGlobal=e,window.Howler=n,window.Howl=o,window.Sound=t)}(); diff --git a/desktop/apps/dezunkrr/index.html b/desktop/apps/dezunkrr/index.html new file mode 100644 index 0000000..98f71c7 --- /dev/null +++ b/desktop/apps/dezunkrr/index.html @@ -0,0 +1,378 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/desktop/apps/dezunkrr/inputmanager.js b/desktop/apps/dezunkrr/inputmanager.js new file mode 100644 index 0000000..dcc07f2 --- /dev/null +++ b/desktop/apps/dezunkrr/inputmanager.js @@ -0,0 +1,2 @@ +var gdjs;(function(i){const o=class{constructor(){this._lastPressedKey=0;this._cursorX=0;this._cursorY=0;this._mouseX=0;this._mouseY=0;this._isMouseInsideCanvas=!0;this._mouseWheelDelta=0;this._touches={firstKey:()=>{for(const e in this._mouseOrTouches.items)if(e!=="1")return e;return null}};this._startedTouches=[];this._endedTouches=[];this._touchSimulateMouse=!0;this._lastStartedTouchIndex=0;this._lastEndedTouchIndex=0;this._pressedKeys=new Hashtable,this._releasedKeys=new Hashtable,this._pressedMouseButtons=new Array(5),this._releasedMouseButtons=new Array(5),this._mouseOrTouches=new Hashtable}_getLocationAwareKeyCode(e,s){return s?96<=e&&e<=105?e:e+1e3*s:o._DEFAULT_LEFT_VARIANT_KEYS.indexOf(e)!==-1?e+1e3:e}onKeyPressed(e,s){const t=this._getLocationAwareKeyCode(e,s);this._pressedKeys.put(t,!0),this._lastPressedKey=t}onKeyReleased(e,s){const t=this._getLocationAwareKeyCode(e,s);this._pressedKeys.put(t,!1),this._releasedKeys.put(t,!0)}getLastPressedKey(){return this._lastPressedKey}isKeyPressed(e){return this._pressedKeys.containsKey(e)&&this._pressedKeys.get(e)}wasKeyReleased(e){return this._releasedKeys.containsKey(e)&&this._releasedKeys.get(e)}anyKeyPressed(){for(const e in this._pressedKeys.items)if(this._pressedKeys.items.hasOwnProperty(e)&&this._pressedKeys.items[e])return!0;return!1}anyKeyReleased(){for(const e in this._releasedKeys.items)if(this._releasedKeys.items.hasOwnProperty(e)&&this._releasedKeys.items[e])return!0;return!1}onMouseMove(e,s){this._setCursorPosition(e,s),this._mouseX=e,this._mouseY=s,this.isMouseButtonPressed(o.MOUSE_LEFT_BUTTON)&&this._moveTouch(o.MOUSE_TOUCH_ID,this.getCursorX(),this.getCursorY())}_setCursorPosition(e,s){this._cursorX=e,this._cursorY=s}getCursorX(){return this._cursorX}getCursorY(){return this._cursorY}getMouseX(){return this._mouseX}getMouseY(){return this._mouseY}onMouseLeave(){this._isMouseInsideCanvas=!1}onMouseEnter(){this._isMouseInsideCanvas=!0}isMouseInsideCanvas(){return this._isMouseInsideCanvas}onMouseButtonPressed(e){this._setMouseButtonPressed(e),e===o.MOUSE_LEFT_BUTTON&&this._addTouch(o.MOUSE_TOUCH_ID,this.getCursorX(),this.getCursorY())}_setMouseButtonPressed(e){this._pressedMouseButtons[e]=!0,this._releasedMouseButtons[e]=!1}onMouseButtonReleased(e){this._setMouseButtonReleased(e),e===o.MOUSE_LEFT_BUTTON&&this._removeTouch(o.MOUSE_TOUCH_ID)}_setMouseButtonReleased(e){this._pressedMouseButtons[e]=!1,this._releasedMouseButtons[e]=!0}isMouseButtonPressed(e){return this._pressedMouseButtons[e]!==void 0&&this._pressedMouseButtons[e]}isMouseButtonReleased(e){return this._releasedMouseButtons[e]!==void 0&&this._releasedMouseButtons[e]}onMouseWheel(e){this._mouseWheelDelta=e}getMouseWheelDelta(){return this._mouseWheelDelta}getTouchX(e){return this._mouseOrTouches.containsKey(e)?this._mouseOrTouches.get(e).x:0}getTouchY(e){return this._mouseOrTouches.containsKey(e)?this._mouseOrTouches.get(e).y:0}hasTouchEnded(e){return this._endedTouches.includes(e)&&this._mouseOrTouches.get(e).justEnded}getAllTouchIdentifiers(){o._allTouchIds.length=0;for(const e in this._mouseOrTouches.items)this._mouseOrTouches.items.hasOwnProperty(e)&&o._allTouchIds.push(parseInt(e,10));return o._allTouchIds}onTouchStart(e,s,t){this._addTouch(this.getPublicTouchIdentifier(e),s,t),this._touchSimulateMouse&&(this._setCursorPosition(s,t),this._setMouseButtonPressed(o.MOUSE_LEFT_BUTTON))}_addTouch(e,s,t){this._endedTouches.includes(e)||(this._startedTouches.push(e),this._mouseOrTouches.put(e,{x:s,y:t,justEnded:!1}))}onTouchMove(e,s,t){this._moveTouch(this.getPublicTouchIdentifier(e),s,t),this._touchSimulateMouse&&this._setCursorPosition(s,t)}_moveTouch(e,s,t){const r=this._mouseOrTouches.get(e);!r||(r.x=s,r.y=t)}onTouchEnd(e){this._removeTouch(this.getPublicTouchIdentifier(e)),this._touchSimulateMouse&&this._setMouseButtonReleased(o.MOUSE_LEFT_BUTTON)}onTouchCancel(e){this.onTouchEnd(e)}_removeTouch(e){this._endedTouches.push(e),this._mouseOrTouches.containsKey(e)&&(this._mouseOrTouches.get(e).justEnded=!0)}getPublicTouchIdentifier(e){return e+2}getStartedTouchIdentifiers(){return this._startedTouches}popStartedTouch(){const e=this._startedTouches[this._lastStartedTouchIndex];return this._lastStartedTouchIndex++,e}popEndedTouch(){const e=this._endedTouches[this._lastEndedTouchIndex];return this._lastEndedTouchIndex++,e}touchSimulateMouse(e){e===void 0&&(e=!0),this._touchSimulateMouse=e}isSimulatingMouseWithTouch(){return this._touchSimulateMouse}onFrameEnded(){for(const e in this._mouseOrTouches.items)this._mouseOrTouches.items.hasOwnProperty(e)&&this._mouseOrTouches.items[e].justEnded&&this._mouseOrTouches.remove(e);this._startedTouches.length=0,this._endedTouches.length=0,this._releasedKeys.clear(),this._releasedMouseButtons.length=0,this._mouseWheelDelta=0,this._lastStartedTouchIndex=0,this._lastEndedTouchIndex=0}isScrollingUp(){return this.getMouseWheelDelta()>0}isScrollingDown(){return this.getMouseWheelDelta()<0}};let u=o;u.MOUSE_LEFT_BUTTON=0,u.MOUSE_RIGHT_BUTTON=1,u.MOUSE_MIDDLE_BUTTON=2,u.MOUSE_BACK_BUTTON=3,u.MOUSE_FORWARD_BUTTON=4,u.MOUSE_TOUCH_ID=1,u._DEFAULT_LEFT_VARIANT_KEYS=[16,17,18,91],u._allTouchIds=[],i.InputManager=u})(gdjs||(gdjs={})); +//# sourceMappingURL=inputmanager.js.map diff --git a/desktop/apps/dezunkrr/ios-icon-100.png b/desktop/apps/dezunkrr/ios-icon-100.png new file mode 100644 index 0000000..85c53dc Binary files /dev/null and b/desktop/apps/dezunkrr/ios-icon-100.png differ diff --git a/desktop/apps/dezunkrr/ios-icon-1024.png b/desktop/apps/dezunkrr/ios-icon-1024.png new file mode 100644 index 0000000..f4ca5b0 Binary files /dev/null and b/desktop/apps/dezunkrr/ios-icon-1024.png differ diff --git a/desktop/apps/dezunkrr/ios-icon-114.png b/desktop/apps/dezunkrr/ios-icon-114.png new file mode 100644 index 0000000..7e03b93 Binary files /dev/null and b/desktop/apps/dezunkrr/ios-icon-114.png differ diff --git a/desktop/apps/dezunkrr/ios-icon-120.png b/desktop/apps/dezunkrr/ios-icon-120.png new file mode 100644 index 0000000..7d90b99 Binary files /dev/null and b/desktop/apps/dezunkrr/ios-icon-120.png differ diff --git a/desktop/apps/dezunkrr/ios-icon-144.png b/desktop/apps/dezunkrr/ios-icon-144.png new file mode 100644 index 0000000..72752ad Binary files /dev/null and b/desktop/apps/dezunkrr/ios-icon-144.png differ diff --git a/desktop/apps/dezunkrr/ios-icon-152.png b/desktop/apps/dezunkrr/ios-icon-152.png new file mode 100644 index 0000000..dc6e993 Binary files /dev/null and b/desktop/apps/dezunkrr/ios-icon-152.png differ diff --git a/desktop/apps/dezunkrr/ios-icon-167.png b/desktop/apps/dezunkrr/ios-icon-167.png new file mode 100644 index 0000000..9905578 Binary files /dev/null and b/desktop/apps/dezunkrr/ios-icon-167.png differ diff --git a/desktop/apps/dezunkrr/ios-icon-180.png b/desktop/apps/dezunkrr/ios-icon-180.png new file mode 100644 index 0000000..767dc04 Binary files /dev/null and b/desktop/apps/dezunkrr/ios-icon-180.png differ diff --git a/desktop/apps/dezunkrr/ios-icon-20.png b/desktop/apps/dezunkrr/ios-icon-20.png new file mode 100644 index 0000000..27defe9 Binary files /dev/null and b/desktop/apps/dezunkrr/ios-icon-20.png differ diff --git a/desktop/apps/dezunkrr/ios-icon-29.png b/desktop/apps/dezunkrr/ios-icon-29.png new file mode 100644 index 0000000..6324bb9 Binary files /dev/null and b/desktop/apps/dezunkrr/ios-icon-29.png differ diff --git a/desktop/apps/dezunkrr/ios-icon-40.png b/desktop/apps/dezunkrr/ios-icon-40.png new file mode 100644 index 0000000..77677b7 Binary files /dev/null and b/desktop/apps/dezunkrr/ios-icon-40.png differ diff --git a/desktop/apps/dezunkrr/ios-icon-50.png b/desktop/apps/dezunkrr/ios-icon-50.png new file mode 100644 index 0000000..ec9c1c8 Binary files /dev/null and b/desktop/apps/dezunkrr/ios-icon-50.png differ diff --git a/desktop/apps/dezunkrr/ios-icon-57.png b/desktop/apps/dezunkrr/ios-icon-57.png new file mode 100644 index 0000000..32b4cb7 Binary files /dev/null and b/desktop/apps/dezunkrr/ios-icon-57.png differ diff --git a/desktop/apps/dezunkrr/ios-icon-58.png b/desktop/apps/dezunkrr/ios-icon-58.png new file mode 100644 index 0000000..ddee424 Binary files /dev/null and b/desktop/apps/dezunkrr/ios-icon-58.png differ diff --git a/desktop/apps/dezunkrr/ios-icon-60.png b/desktop/apps/dezunkrr/ios-icon-60.png new file mode 100644 index 0000000..dd15199 Binary files /dev/null and b/desktop/apps/dezunkrr/ios-icon-60.png differ diff --git a/desktop/apps/dezunkrr/ios-icon-72.png b/desktop/apps/dezunkrr/ios-icon-72.png new file mode 100644 index 0000000..0e4b70f Binary files /dev/null and b/desktop/apps/dezunkrr/ios-icon-72.png differ diff --git a/desktop/apps/dezunkrr/ios-icon-76.png b/desktop/apps/dezunkrr/ios-icon-76.png new file mode 100644 index 0000000..4147626 Binary files /dev/null and b/desktop/apps/dezunkrr/ios-icon-76.png differ diff --git a/desktop/apps/dezunkrr/ios-icon-80.png b/desktop/apps/dezunkrr/ios-icon-80.png new file mode 100644 index 0000000..3f5a13b Binary files /dev/null and b/desktop/apps/dezunkrr/ios-icon-80.png differ diff --git a/desktop/apps/dezunkrr/ios-icon-87.png b/desktop/apps/dezunkrr/ios-icon-87.png new file mode 100644 index 0000000..cd60ef6 Binary files /dev/null and b/desktop/apps/dezunkrr/ios-icon-87.png differ diff --git a/desktop/apps/dezunkrr/jsonmanager.js b/desktop/apps/dezunkrr/jsonmanager.js new file mode 100644 index 0000000..0bf4a2a --- /dev/null +++ b/desktop/apps/dezunkrr/jsonmanager.js @@ -0,0 +1,2 @@ +var gdjs;(function(i){const a=new i.Logger("JSON Manager");class c{constructor(e,l){this._loadedJsons={};this._callbacks={};this._resources=e,this._resourcesLoader=l}setResources(e){this._resources=e}preloadJsons(e,l){const t=this._resources.filter(function(s){return(s.kind==="json"||s.kind==="tilemap"||s.kind==="tileset")&&!s.disablePreload});if(t.length===0)return l(t.length);let o=0;const n=function(s){s&&a.error("Error while preloading a json resource:"+s),o++,o===t.length?l(t.length):e(o,t.length)};for(let s=0;s0&&(this._zoomFactor=a),this._cameraZ=t,this._isCameraZDirty=!1,this._renderer.updatePosition()}getCameraZ(t=45,e){return this._isCameraZDirty?.5*this.getHeight()/this.getCameraZoom()/Math.tan(.5*m.toRad(t)):this._cameraZ}getCameraRotation(t){return this._cameraRotation}setCameraRotation(t,e){this._cameraRotation=t,this._renderer.updatePosition()}convertCoords(t,e,i=0,o){let a=o||[0,0];t-=this.getRuntimeScene()._cachedGameResolutionWidth/2,e-=this.getRuntimeScene()._cachedGameResolutionHeight/2,t/=Math.abs(this._zoomFactor),e/=Math.abs(this._zoomFactor);const n=this._cameraRotation/180*Math.PI,s=t,r=Math.cos(n),h=Math.sin(n);return t=r*t-h*e,e=h*s+r*e,a[0]=t+this.getCameraX(i),a[1]=e+this.getCameraY(i),a}applyLayerInverseTransformation(t,e,i,o){t-=this._runtimeScene.getViewportOriginX(),e-=this._runtimeScene.getViewportOriginY(),t/=Math.abs(this._zoomFactor),e/=Math.abs(this._zoomFactor);const a=this._cameraRotation/180*Math.PI,n=t,s=Math.cos(a),r=Math.sin(a);return t=s*t-r*e,e=r*n+s*e,o[0]=t+this.getCameraX(i),o[1]=e+this.getCameraY(i),o}convertInverseCoords(t,e,i=0,o){let a=o||[0,0];t-=this.getCameraX(i),e-=this.getCameraY(i);const n=this._cameraRotation/180*Math.PI,s=t,r=Math.cos(-n),h=Math.sin(-n);return t=r*t-h*e,e=h*s+r*e,t*=Math.abs(this._zoomFactor),e*=Math.abs(this._zoomFactor),a[0]=t+this.getRuntimeScene()._cachedGameResolutionWidth/2,a[1]=e+this.getRuntimeScene()._cachedGameResolutionHeight/2,a}applyLayerTransformation(t,e,i,o){t-=this.getCameraX(i),e-=this.getCameraY(i);const a=this._cameraRotation/180*Math.PI,n=t,s=Math.cos(-a),r=Math.sin(-a);return t=s*t-r*e,e=r*n+s*e,t*=Math.abs(this._zoomFactor),e*=Math.abs(this._zoomFactor),t+=this._runtimeScene.getViewportOriginX(),e+=this._runtimeScene.getViewportOriginY(),o[0]=t,o[1]=e,o}_forceDimensionUpdate(){this._runtimeScene.getViewportWidth()}}m.Layer=c})(gdjs||(gdjs={})); +//# sourceMappingURL=layer.js.map diff --git a/desktop/apps/dezunkrr/libs/jshashtable.js b/desktop/apps/dezunkrr/libs/jshashtable.js new file mode 100644 index 0000000..efef562 --- /dev/null +++ b/desktop/apps/dezunkrr/libs/jshashtable.js @@ -0,0 +1,2 @@ +class Hashtable{constructor(){this.items={}}static newFrom(t){const s=new Hashtable;return s.items=t,s}put(t,s){this.items[t]=s}get(t){return this.items[t]}containsKey(t){return this.items.hasOwnProperty(t)}remove(t){delete this.items[t]}firstKey(){for(const t in this.items)if(this.items.hasOwnProperty(t))return t;return null}keys(t){t.length=0;for(const s in this.items)this.items.hasOwnProperty(s)&&t.push(s)}values(t){t.length=0;for(const s in this.items)this.items.hasOwnProperty(s)&&t.push(this.items[s])}clear(){for(const t in this.items)this.items.hasOwnProperty(t)&&delete this.items[t]}} +//# sourceMappingURL=jshashtable.js.map diff --git a/desktop/apps/dezunkrr/libs/rbush.js b/desktop/apps/dezunkrr/libs/rbush.js new file mode 100644 index 0000000..96c70f1 --- /dev/null +++ b/desktop/apps/dezunkrr/libs/rbush.js @@ -0,0 +1,624 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.rbush = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 0) { + if (insertPath[level].children.length > this._maxEntries) { + this._split(insertPath, level); + level--; + } else break; + } + + // adjust bboxes along the insertion path + this._adjustParentBBoxes(bbox, insertPath, level); + }, + + // split overflowed node into two + _split: function (insertPath, level) { + + var node = insertPath[level], + M = node.children.length, + m = this._minEntries; + + this._chooseSplitAxis(node, m, M); + + var splitIndex = this._chooseSplitIndex(node, m, M); + + var newNode = createNode(node.children.splice(splitIndex, node.children.length - splitIndex)); + newNode.height = node.height; + newNode.leaf = node.leaf; + + calcBBox(node, this.toBBox); + calcBBox(newNode, this.toBBox); + + if (level) insertPath[level - 1].children.push(newNode); + else this._splitRoot(node, newNode); + }, + + _splitRoot: function (node, newNode) { + // split root node + this.data = createNode([node, newNode]); + this.data.height = node.height + 1; + this.data.leaf = false; + calcBBox(this.data, this.toBBox); + }, + + _chooseSplitIndex: function (node, m, M) { + + var i, bbox1, bbox2, overlap, area, minOverlap, minArea, index; + + minOverlap = minArea = Infinity; + + for (i = m; i <= M - m; i++) { + bbox1 = distBBox(node, 0, i, this.toBBox); + bbox2 = distBBox(node, i, M, this.toBBox); + + overlap = intersectionArea(bbox1, bbox2); + area = bboxArea(bbox1) + bboxArea(bbox2); + + // choose distribution with minimum overlap + if (overlap < minOverlap) { + minOverlap = overlap; + index = i; + + minArea = area < minArea ? area : minArea; + + } else if (overlap === minOverlap) { + // otherwise choose distribution with minimum area + if (area < minArea) { + minArea = area; + index = i; + } + } + } + + return index; + }, + + // sorts node children by the best axis for split + _chooseSplitAxis: function (node, m, M) { + + var compareMinX = node.leaf ? this.compareMinX : compareNodeMinX, + compareMinY = node.leaf ? this.compareMinY : compareNodeMinY, + xMargin = this._allDistMargin(node, m, M, compareMinX), + yMargin = this._allDistMargin(node, m, M, compareMinY); + + // if total distributions margin value is minimal for x, sort by minX, + // otherwise it's already sorted by minY + if (xMargin < yMargin) node.children.sort(compareMinX); + }, + + // total margin of all possible split distributions where each node is at least m full + _allDistMargin: function (node, m, M, compare) { + + node.children.sort(compare); + + var toBBox = this.toBBox, + leftBBox = distBBox(node, 0, m, toBBox), + rightBBox = distBBox(node, M - m, M, toBBox), + margin = bboxMargin(leftBBox) + bboxMargin(rightBBox), + i, child; + + for (i = m; i < M - m; i++) { + child = node.children[i]; + extend(leftBBox, node.leaf ? toBBox(child) : child); + margin += bboxMargin(leftBBox); + } + + for (i = M - m - 1; i >= m; i--) { + child = node.children[i]; + extend(rightBBox, node.leaf ? toBBox(child) : child); + margin += bboxMargin(rightBBox); + } + + return margin; + }, + + _adjustParentBBoxes: function (bbox, path, level) { + // adjust bboxes along the given tree path + for (var i = level; i >= 0; i--) { + extend(path[i], bbox); + } + }, + + _condense: function (path) { + // go through the path, removing empty nodes and updating bboxes + for (var i = path.length - 1, siblings; i >= 0; i--) { + if (path[i].children.length === 0) { + if (i > 0) { + siblings = path[i - 1].children; + siblings.splice(siblings.indexOf(path[i]), 1); + + } else this.clear(); + + } else calcBBox(path[i], this.toBBox); + } + }, + + _initFormat: function (format) { + // data format (minX, minY, maxX, maxY accessors) + + // uses eval-type function compilation instead of just accepting a toBBox function + // because the algorithms are very sensitive to sorting functions performance, + // so they should be dead simple and without inner calls + + var compareArr = ['return a', ' - b', ';']; + + this.compareMinX = new Function('a', 'b', compareArr.join(format[0])); + this.compareMinY = new Function('a', 'b', compareArr.join(format[1])); + + this.toBBox = new Function('a', + 'return {minX: a' + format[0] + + ', minY: a' + format[1] + + ', maxX: a' + format[2] + + ', maxY: a' + format[3] + '};'); + } +}; + +function findItem(item, items, equalsFn) { + if (!equalsFn) return items.indexOf(item); + + for (var i = 0; i < items.length; i++) { + if (equalsFn(item, items[i])) return i; + } + return -1; +} + +// calculate node's bbox from bboxes of its children +function calcBBox(node, toBBox) { + distBBox(node, 0, node.children.length, toBBox, node); +} + +// min bounding rectangle of node children from k to p-1 +function distBBox(node, k, p, toBBox, destNode) { + if (!destNode) destNode = createNode(null); + destNode.minX = Infinity; + destNode.minY = Infinity; + destNode.maxX = -Infinity; + destNode.maxY = -Infinity; + + for (var i = k, child; i < p; i++) { + child = node.children[i]; + extend(destNode, node.leaf ? toBBox(child) : child); + } + + return destNode; +} + +function extend(a, b) { + a.minX = Math.min(a.minX, b.minX); + a.minY = Math.min(a.minY, b.minY); + a.maxX = Math.max(a.maxX, b.maxX); + a.maxY = Math.max(a.maxY, b.maxY); + return a; +} + +function compareNodeMinX(a, b) { return a.minX - b.minX; } +function compareNodeMinY(a, b) { return a.minY - b.minY; } + +function bboxArea(a) { return (a.maxX - a.minX) * (a.maxY - a.minY); } +function bboxMargin(a) { return (a.maxX - a.minX) + (a.maxY - a.minY); } + +function enlargedArea(a, b) { + return (Math.max(b.maxX, a.maxX) - Math.min(b.minX, a.minX)) * + (Math.max(b.maxY, a.maxY) - Math.min(b.minY, a.minY)); +} + +function intersectionArea(a, b) { + var minX = Math.max(a.minX, b.minX), + minY = Math.max(a.minY, b.minY), + maxX = Math.min(a.maxX, b.maxX), + maxY = Math.min(a.maxY, b.maxY); + + return Math.max(0, maxX - minX) * + Math.max(0, maxY - minY); +} + +function contains(a, b) { + return a.minX <= b.minX && + a.minY <= b.minY && + b.maxX <= a.maxX && + b.maxY <= a.maxY; +} + +function intersects(a, b) { + return b.minX <= a.maxX && + b.minY <= a.maxY && + b.maxX >= a.minX && + b.maxY >= a.minY; +} + +function createNode(children) { + return { + children: children, + height: 1, + leaf: true, + minX: Infinity, + minY: Infinity, + maxX: -Infinity, + maxY: -Infinity + }; +} + +// sort an array so that items come in groups of n unsorted items, with groups sorted between each other; +// combines selection algorithm with binary divide & conquer approach + +function multiSelect(arr, left, right, n, compare) { + var stack = [left, right], + mid; + + while (stack.length) { + right = stack.pop(); + left = stack.pop(); + + if (right - left <= n) continue; + + mid = left + Math.ceil((right - left) / n / 2) * n; + quickselect(arr, mid, left, right, compare); + + stack.push(left, mid, mid, right); + } +} + +},{"quickselect":2}],2:[function(require,module,exports){ +'use strict'; + +module.exports = partialSort; + +// Floyd-Rivest selection algorithm: +// Rearrange items so that all items in the [left, k] range are smaller than all items in (k, right]; +// The k-th element will have the (k - left + 1)th smallest value in [left, right] + +function partialSort(arr, k, left, right, compare) { + + while (right > left) { + if (right - left > 600) { + var n = right - left + 1; + var m = k - left + 1; + var z = Math.log(n); + var s = 0.5 * Math.exp(2 * z / 3); + var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1); + var newLeft = Math.max(left, Math.floor(k - m * s / n + sd)); + var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd)); + partialSort(arr, k, newLeft, newRight, compare); + } + + var t = arr[k]; + var i = left; + var j = right; + + swap(arr, left, k); + if (compare(arr[right], t) > 0) swap(arr, left, right); + + while (i < j) { + swap(arr, i, j); + i++; + j--; + while (compare(arr[i], t) < 0) i++; + while (compare(arr[j], t) > 0) j--; + } + + if (compare(arr[left], t) === 0) swap(arr, left, j); + else { + j++; + swap(arr, j, right); + } + + if (j <= k) left = j + 1; + if (k <= j) right = j - 1; + } +} + +function swap(arr, i, j) { + var tmp = arr[i]; + arr[i] = arr[j]; + arr[j] = tmp; +} + +function defaultCompare(a, b) { + return a < b ? -1 : a > b ? 1 : 0; +} + +},{}]},{},[1])(1) +}); diff --git a/desktop/apps/dezunkrr/logger.js b/desktop/apps/dezunkrr/logger.js new file mode 100644 index 0000000..98a4cf6 --- /dev/null +++ b/desktop/apps/dezunkrr/logger.js @@ -0,0 +1,2 @@ +var gdjs;(function(l){const g={info:console.log,warning:console.warn,error:console.error};class i{constructor(){this.discardedConsoleGroups=new Set}discardGroup(o){this.discardedConsoleGroups.add(o)}enableGroup(o){this.discardedConsoleGroups.delete(o)}log(o,n,u="info",p=!0){if(this.discardedConsoleGroups.has(o))return;(g[u]||g.info)(`[${o}] ${n}`)}}const s=new i;let r=s;function t(e){return e.reduce((o,n)=>o+n.toString(),"")}class a{constructor(o){this.group=o}log(...o){r.log(this.group,t(o),"info")}info(...o){r.log(this.group,t(o),"info")}warn(...o){r.log(this.group,t(o),"warning")}error(...o){r.log(this.group,t(o),"error")}static getDefaultConsoleLoggerOutput(){return s}static getLoggerOutput(){return r}static setLoggerOutput(o){r=o}}l.Logger=a})(gdjs||(gdjs={})); +//# sourceMappingURL=logger.js.map diff --git a/desktop/apps/dezunkrr/manifest.webmanifest b/desktop/apps/dezunkrr/manifest.webmanifest new file mode 100644 index 0000000..85247f8 --- /dev/null +++ b/desktop/apps/dezunkrr/manifest.webmanifest @@ -0,0 +1,84 @@ +{ + "name": "Dezunkrr", + "short_name": "Dezunkrr", + "id": "com.dezunkrr.itsicecreeperpe", + "description": "Fast pace game where you gotta shoot down enemies with your epic lil gun and use your magic timeline watch to navigate between timelines in order to complete levels!\nSubmission to GDevelop's First 3D Game Jam #1 - Theme : Navigation\nHow did I get during game jam: I only made the tutorial and many things are broken :p\nhttps://itsicecreeperpe.itch.io/dezunkrr\n\nNo gamepad support yet, mobile broken.", + "orientation": "landscape", + "start_url": "./index.html", + "display": "standalone", + "background_color": "black", + "categories": ["games", "entertainment"], + "icons": [{ + "src": "ios-icon-20.png", + "sizes": "20x20" + },{ + "src": "ios-icon-29.png", + "sizes": "29x29" + },{ + "src": "android-icon-36.png", + "sizes": "36x36" + },{ + "src": "ios-icon-40.png", + "sizes": "40x40" + },{ + "src": "android-icon-48.png", + "sizes": "48x48" + },{ + "src": "ios-icon-50.png", + "sizes": "50x50" + },{ + "src": "ios-icon-57.png", + "sizes": "57x57" + },{ + "src": "ios-icon-58.png", + "sizes": "58x58" + },{ + "src": "ios-icon-60.png", + "sizes": "60x60" + },{ + "src": "android-icon-72.png", + "sizes": "72x72" + },{ + "src": "ios-icon-76.png", + "sizes": "76x76" + },{ + "src": "ios-icon-80.png", + "sizes": "80x80" + },{ + "src": "ios-icon-87.png", + "sizes": "87x87" + },{ + "src": "android-icon-96.png", + "sizes": "96x96" + },{ + "src": "ios-icon-100.png", + "sizes": "100x100" + },{ + "src": "ios-icon-114.png", + "sizes": "114x114" + },{ + "src": "ios-icon-120.png", + "sizes": "120x120" + },{ + "src": "android-icon-144.png", + "sizes": "144x144" + },{ + "src": "ios-icon-152.png", + "sizes": "152x152" + },{ + "src": "ios-icon-167.png", + "sizes": "167x167" + },{ + "src": "ios-icon-180.png", + "sizes": "180x180" + },{ + "src": "android-icon-192.png", + "sizes": "192x192" + },{ + "src": "desktop-icon-512.png", + "sizes": "512x512" + },{ + "src": "ios-icon-1024.png", + "sizes": "1024x1024" + }] +} \ No newline at end of file diff --git a/desktop/apps/dezunkrr/nebula_1.png b/desktop/apps/dezunkrr/nebula_1.png new file mode 100644 index 0000000..84c59bd Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_1.png differ diff --git a/desktop/apps/dezunkrr/nebula_10.png b/desktop/apps/dezunkrr/nebula_10.png new file mode 100644 index 0000000..85f6731 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_10.png differ diff --git a/desktop/apps/dezunkrr/nebula_11.png b/desktop/apps/dezunkrr/nebula_11.png new file mode 100644 index 0000000..1c2b2a7 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_11.png differ diff --git a/desktop/apps/dezunkrr/nebula_12.png b/desktop/apps/dezunkrr/nebula_12.png new file mode 100644 index 0000000..b61ab80 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_12.png differ diff --git a/desktop/apps/dezunkrr/nebula_13.png b/desktop/apps/dezunkrr/nebula_13.png new file mode 100644 index 0000000..de12226 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_13.png differ diff --git a/desktop/apps/dezunkrr/nebula_14.png b/desktop/apps/dezunkrr/nebula_14.png new file mode 100644 index 0000000..ae3ff58 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_14.png differ diff --git a/desktop/apps/dezunkrr/nebula_15.png b/desktop/apps/dezunkrr/nebula_15.png new file mode 100644 index 0000000..7190e35 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_15.png differ diff --git a/desktop/apps/dezunkrr/nebula_16.png b/desktop/apps/dezunkrr/nebula_16.png new file mode 100644 index 0000000..5744a33 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_16.png differ diff --git a/desktop/apps/dezunkrr/nebula_17.png b/desktop/apps/dezunkrr/nebula_17.png new file mode 100644 index 0000000..3276876 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_17.png differ diff --git a/desktop/apps/dezunkrr/nebula_18.png b/desktop/apps/dezunkrr/nebula_18.png new file mode 100644 index 0000000..a1d6f70 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_18.png differ diff --git a/desktop/apps/dezunkrr/nebula_19.png b/desktop/apps/dezunkrr/nebula_19.png new file mode 100644 index 0000000..ce2c4eb Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_19.png differ diff --git a/desktop/apps/dezunkrr/nebula_2.png b/desktop/apps/dezunkrr/nebula_2.png new file mode 100644 index 0000000..633a5f9 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_2.png differ diff --git a/desktop/apps/dezunkrr/nebula_20.png b/desktop/apps/dezunkrr/nebula_20.png new file mode 100644 index 0000000..6816c03 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_20.png differ diff --git a/desktop/apps/dezunkrr/nebula_21.png b/desktop/apps/dezunkrr/nebula_21.png new file mode 100644 index 0000000..ff9e821 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_21.png differ diff --git a/desktop/apps/dezunkrr/nebula_22.png b/desktop/apps/dezunkrr/nebula_22.png new file mode 100644 index 0000000..323848f Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_22.png differ diff --git a/desktop/apps/dezunkrr/nebula_23.png b/desktop/apps/dezunkrr/nebula_23.png new file mode 100644 index 0000000..d89b2c0 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_23.png differ diff --git a/desktop/apps/dezunkrr/nebula_24.png b/desktop/apps/dezunkrr/nebula_24.png new file mode 100644 index 0000000..62f6e1c Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_24.png differ diff --git a/desktop/apps/dezunkrr/nebula_25.png b/desktop/apps/dezunkrr/nebula_25.png new file mode 100644 index 0000000..81f0edf Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_25.png differ diff --git a/desktop/apps/dezunkrr/nebula_26.png b/desktop/apps/dezunkrr/nebula_26.png new file mode 100644 index 0000000..66da675 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_26.png differ diff --git a/desktop/apps/dezunkrr/nebula_27.png b/desktop/apps/dezunkrr/nebula_27.png new file mode 100644 index 0000000..6ada837 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_27.png differ diff --git a/desktop/apps/dezunkrr/nebula_28.png b/desktop/apps/dezunkrr/nebula_28.png new file mode 100644 index 0000000..9dd7e98 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_28.png differ diff --git a/desktop/apps/dezunkrr/nebula_29.png b/desktop/apps/dezunkrr/nebula_29.png new file mode 100644 index 0000000..2ef85c8 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_29.png differ diff --git a/desktop/apps/dezunkrr/nebula_3.png b/desktop/apps/dezunkrr/nebula_3.png new file mode 100644 index 0000000..5d1ddd0 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_3.png differ diff --git a/desktop/apps/dezunkrr/nebula_30.png b/desktop/apps/dezunkrr/nebula_30.png new file mode 100644 index 0000000..dd1e381 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_30.png differ diff --git a/desktop/apps/dezunkrr/nebula_31.png b/desktop/apps/dezunkrr/nebula_31.png new file mode 100644 index 0000000..e65e05c Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_31.png differ diff --git a/desktop/apps/dezunkrr/nebula_32.png b/desktop/apps/dezunkrr/nebula_32.png new file mode 100644 index 0000000..f1fd2ba Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_32.png differ diff --git a/desktop/apps/dezunkrr/nebula_33.png b/desktop/apps/dezunkrr/nebula_33.png new file mode 100644 index 0000000..ff57b1f Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_33.png differ diff --git a/desktop/apps/dezunkrr/nebula_34.png b/desktop/apps/dezunkrr/nebula_34.png new file mode 100644 index 0000000..ade5412 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_34.png differ diff --git a/desktop/apps/dezunkrr/nebula_35.png b/desktop/apps/dezunkrr/nebula_35.png new file mode 100644 index 0000000..d489740 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_35.png differ diff --git a/desktop/apps/dezunkrr/nebula_36.png b/desktop/apps/dezunkrr/nebula_36.png new file mode 100644 index 0000000..8003372 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_36.png differ diff --git a/desktop/apps/dezunkrr/nebula_37.png b/desktop/apps/dezunkrr/nebula_37.png new file mode 100644 index 0000000..7bbd8dc Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_37.png differ diff --git a/desktop/apps/dezunkrr/nebula_38.png b/desktop/apps/dezunkrr/nebula_38.png new file mode 100644 index 0000000..bd660ca Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_38.png differ diff --git a/desktop/apps/dezunkrr/nebula_39.png b/desktop/apps/dezunkrr/nebula_39.png new file mode 100644 index 0000000..0075f6b Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_39.png differ diff --git a/desktop/apps/dezunkrr/nebula_4.png b/desktop/apps/dezunkrr/nebula_4.png new file mode 100644 index 0000000..04e7999 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_4.png differ diff --git a/desktop/apps/dezunkrr/nebula_40.png b/desktop/apps/dezunkrr/nebula_40.png new file mode 100644 index 0000000..f08aed9 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_40.png differ diff --git a/desktop/apps/dezunkrr/nebula_41.png b/desktop/apps/dezunkrr/nebula_41.png new file mode 100644 index 0000000..3a10335 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_41.png differ diff --git a/desktop/apps/dezunkrr/nebula_42.png b/desktop/apps/dezunkrr/nebula_42.png new file mode 100644 index 0000000..dabd1ba Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_42.png differ diff --git a/desktop/apps/dezunkrr/nebula_43.png b/desktop/apps/dezunkrr/nebula_43.png new file mode 100644 index 0000000..d5fa9c6 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_43.png differ diff --git a/desktop/apps/dezunkrr/nebula_44.png b/desktop/apps/dezunkrr/nebula_44.png new file mode 100644 index 0000000..b781fb5 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_44.png differ diff --git a/desktop/apps/dezunkrr/nebula_45.png b/desktop/apps/dezunkrr/nebula_45.png new file mode 100644 index 0000000..853ad15 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_45.png differ diff --git a/desktop/apps/dezunkrr/nebula_46.png b/desktop/apps/dezunkrr/nebula_46.png new file mode 100644 index 0000000..1d5f736 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_46.png differ diff --git a/desktop/apps/dezunkrr/nebula_47.png b/desktop/apps/dezunkrr/nebula_47.png new file mode 100644 index 0000000..18c6e28 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_47.png differ diff --git a/desktop/apps/dezunkrr/nebula_48.png b/desktop/apps/dezunkrr/nebula_48.png new file mode 100644 index 0000000..727af54 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_48.png differ diff --git a/desktop/apps/dezunkrr/nebula_49.png b/desktop/apps/dezunkrr/nebula_49.png new file mode 100644 index 0000000..45956fb Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_49.png differ diff --git a/desktop/apps/dezunkrr/nebula_5.png b/desktop/apps/dezunkrr/nebula_5.png new file mode 100644 index 0000000..7d4448c Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_5.png differ diff --git a/desktop/apps/dezunkrr/nebula_50.png b/desktop/apps/dezunkrr/nebula_50.png new file mode 100644 index 0000000..96dca64 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_50.png differ diff --git a/desktop/apps/dezunkrr/nebula_51.png b/desktop/apps/dezunkrr/nebula_51.png new file mode 100644 index 0000000..cc21ba4 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_51.png differ diff --git a/desktop/apps/dezunkrr/nebula_52.png b/desktop/apps/dezunkrr/nebula_52.png new file mode 100644 index 0000000..9cad14a Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_52.png differ diff --git a/desktop/apps/dezunkrr/nebula_53.png b/desktop/apps/dezunkrr/nebula_53.png new file mode 100644 index 0000000..9d3b5f0 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_53.png differ diff --git a/desktop/apps/dezunkrr/nebula_54.png b/desktop/apps/dezunkrr/nebula_54.png new file mode 100644 index 0000000..1a415ff Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_54.png differ diff --git a/desktop/apps/dezunkrr/nebula_55.png b/desktop/apps/dezunkrr/nebula_55.png new file mode 100644 index 0000000..f356afe Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_55.png differ diff --git a/desktop/apps/dezunkrr/nebula_56.png b/desktop/apps/dezunkrr/nebula_56.png new file mode 100644 index 0000000..5f45fbc Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_56.png differ diff --git a/desktop/apps/dezunkrr/nebula_57.png b/desktop/apps/dezunkrr/nebula_57.png new file mode 100644 index 0000000..b89f399 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_57.png differ diff --git a/desktop/apps/dezunkrr/nebula_58.png b/desktop/apps/dezunkrr/nebula_58.png new file mode 100644 index 0000000..1ed24dc Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_58.png differ diff --git a/desktop/apps/dezunkrr/nebula_59.png b/desktop/apps/dezunkrr/nebula_59.png new file mode 100644 index 0000000..31f2986 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_59.png differ diff --git a/desktop/apps/dezunkrr/nebula_6.png b/desktop/apps/dezunkrr/nebula_6.png new file mode 100644 index 0000000..701a2e0 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_6.png differ diff --git a/desktop/apps/dezunkrr/nebula_60.png b/desktop/apps/dezunkrr/nebula_60.png new file mode 100644 index 0000000..e6fd63b Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_60.png differ diff --git a/desktop/apps/dezunkrr/nebula_61.png b/desktop/apps/dezunkrr/nebula_61.png new file mode 100644 index 0000000..84c59bd Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_61.png differ diff --git a/desktop/apps/dezunkrr/nebula_7.png b/desktop/apps/dezunkrr/nebula_7.png new file mode 100644 index 0000000..e40c1b4 Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_7.png differ diff --git a/desktop/apps/dezunkrr/nebula_8.png b/desktop/apps/dezunkrr/nebula_8.png new file mode 100644 index 0000000..ec7da3a Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_8.png differ diff --git a/desktop/apps/dezunkrr/nebula_9.png b/desktop/apps/dezunkrr/nebula_9.png new file mode 100644 index 0000000..d868f7f Binary files /dev/null and b/desktop/apps/dezunkrr/nebula_9.png differ diff --git a/desktop/apps/dezunkrr/oncetriggers.js b/desktop/apps/dezunkrr/oncetriggers.js new file mode 100644 index 0000000..d8dab5b --- /dev/null +++ b/desktop/apps/dezunkrr/oncetriggers.js @@ -0,0 +1,2 @@ +var gdjs;(function(i){class r{constructor(){this._onceTriggers={};this._lastFrameOnceTrigger={}}startNewFrame(){for(const e in this._lastFrameOnceTrigger)this._lastFrameOnceTrigger.hasOwnProperty(e)&&delete this._lastFrameOnceTrigger[e];for(const e in this._onceTriggers)this._onceTriggers.hasOwnProperty(e)&&(this._lastFrameOnceTrigger[e]=this._onceTriggers[e],delete this._onceTriggers[e])}triggerOnce(e){return this._onceTriggers[e]=!0,!this._lastFrameOnceTrigger.hasOwnProperty(e)}}i.OnceTriggers=r})(gdjs||(gdjs={})); +//# sourceMappingURL=oncetriggers.js.map diff --git a/desktop/apps/dezunkrr/pixi-renderers/CustomObjectPixiRenderer.js b/desktop/apps/dezunkrr/pixi-renderers/CustomObjectPixiRenderer.js new file mode 100644 index 0000000..654dc6f --- /dev/null +++ b/desktop/apps/dezunkrr/pixi-renderers/CustomObjectPixiRenderer.js @@ -0,0 +1,2 @@ +var gdjs;(function(r){const o=GlobalPIXIModule.PIXI;class s{constructor(e,i,n){this._isContainerDirty=!0;this._debugDraw=null;this._debugDrawContainer=null;this._object=e,this._instanceContainer=i,this._pixiContainer=new o.Container,this._threeGroup=typeof THREE!="undefined"?new THREE.Group:null,this._debugDrawRenderedObjectsPoints={},this._pixiContainer.sortableChildren=!0,this._debugDraw=null;const t=n.getLayer("");t&&(t.getRenderer().addRendererObject(this._pixiContainer,e.getZOrder()),this._threeGroup&&t.getRenderer().add3DRendererObject(this._threeGroup))}reinitialize(e,i){this._object=e,this._isContainerDirty=!0;const n=i.getLayer("");n&&(n.getRenderer().addRendererObject(this._pixiContainer,e.getZOrder()),this._threeGroup&&n.getRenderer().add3DRendererObject(this._threeGroup))}getRendererObject(){return this._pixiContainer}get3DRendererObject(){return this._threeGroup}_updatePIXIContainer(){this._pixiContainer.pivot.x=this._object.getUnscaledCenterX(),this._pixiContainer.pivot.y=this._object.getUnscaledCenterY(),this._pixiContainer.position.x=this._object.getX()+this._pixiContainer.pivot.x*Math.abs(this._object._scaleX),this._pixiContainer.position.y=this._object.getY()+this._pixiContainer.pivot.y*Math.abs(this._object._scaleY),this._pixiContainer.rotation=r.toRad(this._object.angle),this._pixiContainer.scale.x=this._object._scaleX,this._pixiContainer.scale.y=this._object._scaleY,this._pixiContainer.visible=!this._object.hidden,this._pixiContainer.alpha=this._object.opacity/255,this._isContainerDirty=!1}_updateThreeGroup(){if(!this._threeGroup)return;const e=this._object.getUnscaledCenterX(),i=this._object.getUnscaledCenterY();this._threeGroup.position.x=this._object.getX()+e*Math.abs(this._object._scaleX),this._threeGroup.position.y=this._object.getY()+i*Math.abs(this._object._scaleY),this._threeGroup.rotation.z=r.toRad(this._object.angle),this._threeGroup.scale.x=this._object._scaleX,this._threeGroup.scale.y=this._object._scaleY,this._threeGroup.visible=!this._object.hidden}ensureUpToDate(){this._isContainerDirty&&(this._updatePIXIContainer(),this._updateThreeGroup())}update(){this._isContainerDirty=!0}updateX(){this._pixiContainer.position.x=this._object.x+this._pixiContainer.pivot.x*Math.abs(this._object._scaleX),this._threeGroup&&(this._threeGroup.position.x=this._object.getX()+.5*Math.abs(this._object._scaleX))}updateY(){this._pixiContainer.position.y=this._object.y+this._pixiContainer.pivot.y*Math.abs(this._object._scaleY),this._threeGroup&&(this._threeGroup.position.y=this._object.getY()+.5*Math.abs(this._object._scaleY))}updateAngle(){this._pixiContainer.rotation=r.toRad(this._object.angle),this._threeGroup&&(this._threeGroup.rotation.z=r.toRad(this._object.angle))}updateOpacity(){this._pixiContainer.alpha=this._object.opacity/255}updateVisibility(){this._pixiContainer.visible=!this._object.hidden,this._threeGroup&&(this._threeGroup.visible=!this._object.hidden)}getPIXIContainer(){return this._pixiContainer}getPIXIRenderer(){return null}setLayerIndex(e,i){const n=e.getRenderer();let t=n.getRendererObject();e.isLightingLayer()&&(t=n.getLightingSprite()),!!t&&this._pixiContainer.children.indexOf(t)!==i&&(this._pixiContainer.removeChild(t),this._pixiContainer.addChildAt(t,i))}}r.CustomObjectPixiRenderer=s,r.CustomObjectRenderer=r.CustomObjectPixiRenderer})(gdjs||(gdjs={})); +//# sourceMappingURL=CustomObjectPixiRenderer.js.map diff --git a/desktop/apps/dezunkrr/pixi-renderers/DebuggerPixiRenderer.js b/desktop/apps/dezunkrr/pixi-renderers/DebuggerPixiRenderer.js new file mode 100644 index 0000000..00a1478 --- /dev/null +++ b/desktop/apps/dezunkrr/pixi-renderers/DebuggerPixiRenderer.js @@ -0,0 +1,2 @@ +var gdjs;(function(g){const h=GlobalPIXIModule.PIXI;class y{constructor(l){this._debugDraw=null;this._debugDrawContainer=null;this._instanceContainer=l,this._debugDrawRenderedObjectsPoints={},this._debugDraw=null}getRendererObject(){return this._debugDrawContainer}renderDebugDraw(l,p,_,P){const R=this._instanceContainer.getRenderer().getRendererObject();(!this._debugDraw||!this._debugDrawContainer)&&(this._debugDrawContainer=new h.Container,this._debugDraw=new h.Graphics,this._debugDrawContainer.addChild(this._debugDraw),R.addChild(this._debugDrawContainer));const t=this._debugDraw;for(let i in this._debugDrawRenderedObjectsPoints)this._debugDrawRenderedObjectsPoints[i].wasRendered=!1;const u=(i,e,n,c,r)=>{t.line.color=n,t.fill.color=n,t.drawCircle(c,r,3),_&&(i[e]||(i[e]=new h.Text(e,{fill:n,fontSize:12}),this._debugDrawContainer.addChild(i[e])),i[e].position.set(c,r))};t.clear(),t.beginFill(),t.alpha=.8,t.lineStyle(2,255,1);const s=[0,0];for(let i=0;i{b=n.applyLayerTransformation(b[0],b[1],0,s),d.push(b[0]),d.push(b[1])}),t.fill.alpha=0,t.line.alpha=.5,t.line.color=16711680,t.drawPolygon(d)}t.fill.alpha=.3;const D=n.applyLayerTransformation(e.getCenterXInScene(),e.getCenterYInScene(),0,s);u(o.points,"Center",16776960,D[0],D[1]);const f=n.applyLayerTransformation(e.getX(),e.getY(),0,s);if(u(o.points,"Position",16711680,f[0],f[1]),e instanceof g.SpriteRuntimeObject){let a=e.getPointPosition("origin");(Math.abs(a[0]-f[0])>=1||Math.abs(a[1]-f[1])>=1)&&(a=n.applyLayerTransformation(a[0],a[1],0,s),u(o.points,"Origin",16711680,a[0],a[1]))}if(P&&e instanceof g.SpriteRuntimeObject){if(!e._animationFrame)continue;for(const a in e._animationFrame.points.items){let d=e.getPointPosition(a);d=n.applyLayerTransformation(d[0],d[1],0,s),u(o.points,a,255,d[0],d[1])}}}for(const i in this._debugDrawRenderedObjectsPoints){const e=this._debugDrawRenderedObjectsPoints[i];if(e.wasRendered)continue;const n=e.points;for(const c in n)this._debugDrawContainer.removeChild(n[c])}t.endFill()}clearDebugDraw(){this._debugDraw&&this._debugDraw.clear(),this._debugDrawContainer&&(this._debugDrawContainer.destroy({children:!0}),this._instanceContainer.getRenderer().getRendererObject().removeChild(this._debugDrawContainer)),this._debugDraw=null,this._debugDrawContainer=null,this._debugDrawRenderedObjectsPoints={}}}g.DebuggerPixiRenderer=y,g.DebuggerRenderer=g.DebuggerPixiRenderer})(gdjs||(gdjs={})); +//# sourceMappingURL=DebuggerPixiRenderer.js.map diff --git a/desktop/apps/dezunkrr/pixi-renderers/layer-pixi-renderer.js b/desktop/apps/dezunkrr/pixi-renderers/layer-pixi-renderer.js new file mode 100644 index 0000000..a5b2b14 --- /dev/null +++ b/desktop/apps/dezunkrr/pixi-renderers/layer-pixi-renderer.js @@ -0,0 +1,2 @@ +var gdjs;(function(n){const a=GlobalPIXIModule.PIXI,l=new n.Logger("LayerPixiRenderer"),h=class{constructor(e,t,r){this._lightingSprite=null;this._renderTexture=null;this._oldWidth=null;this._oldHeight=null;this._threeGroup=null;this._threeScene=null;this._threeCamera=null;this._threeCameraDirty=!1;this._threePlaneTexture=null;this._threePlaneGeometry=null;this._threePlaneMaterial=null;this._threePlaneMesh=null;this._pixiContainer=new a.Container,this._pixiContainer.sortableChildren=!0,this._layer=e,this._isLightingLayer=e.isLightingLayer(),this._clearColor=e.getClearColor(),t.getRendererObject().addChild(this._pixiContainer),this._pixiContainer.filters=[];const i=r.getPIXIRenderer();this._isLightingLayer?this._setupLightingRendering(i,t):this._setup3DRendering(i,t)}onCreated(){this._update3DCameraAspectAndPosition()}onGameResolutionResized(){this._update3DCameraAspectAndPosition()}_update3DCameraAspectAndPosition(){this._threeCamera&&(this._threeCamera.aspect=this._layer.getWidth()/this._layer.getHeight(),this._threeCamera.updateProjectionMatrix(),this.updatePosition())}getRendererObject(){return this._pixiContainer}getThreeScene(){return this._threeScene}getThreeCamera(){return this._threeCamera}getLightingSprite(){return this._lightingSprite}_setup3DRendering(e,t){if(typeof THREE!="undefined")if(this._layer instanceof n.Layer){if(this._layer.getRenderingType()===n.RuntimeLayerRenderingType.THREE_D||this._layer.getRenderingType()===n.RuntimeLayerRenderingType.TWO_D_PLUS_THREE_D){if(this._threeScene||this._threeGroup||this._threeCamera)throw new Error("Tried to setup 3D rendering for a layer that is already set up.");if(this._threeScene=new THREE.Scene,this._threeScene.scale.y=-1,this._threeGroup=new THREE.Group,this._threeScene.add(this._threeGroup),this._threeCamera=new THREE.PerspectiveCamera(this._layer.getInitialCamera3DFieldOfView(),1,this._layer.getInitialCamera3DNearPlaneDistance(),this._layer.getInitialCamera3DFarPlaneDistance()),this._threeCamera.rotation.order="ZYX",this._layer.getRenderingType()===n.RuntimeLayerRenderingType.TWO_D_PLUS_THREE_D){if(this._renderTexture||this._threePlaneGeometry||this._threePlaneMaterial||this._threePlaneTexture||this._threePlaneMesh)throw new Error("Tried to setup PixiJS plane for 2D rendering in 3D for a layer that is already set up.");this._createPixiRenderTexture(e),this._threePlaneGeometry=new THREE.PlaneGeometry(1,1),this._threePlaneMaterial=new THREE.MeshBasicMaterial({side:THREE.FrontSide,transparent:!0});const r=1,i=1,s=r*i,o=new Uint8Array(4*s),d=new THREE.DataTexture(o,r,i);d.needsUpdate=!0,this._threePlaneTexture=d,this._threePlaneTexture.generateMipmaps=!1;const u=this._layer.getRuntimeScene().getGame().getScaleMode()==="nearest"?THREE.NearestFilter:THREE.LinearFilter;this._threePlaneTexture.minFilter=u,this._threePlaneTexture.magFilter=u,this._threePlaneTexture.wrapS=THREE.ClampToEdgeWrapping,this._threePlaneTexture.wrapT=THREE.ClampToEdgeWrapping,this._threePlaneMaterial.map=this._threePlaneTexture,this._threePlaneMesh=new THREE.Mesh(this._threePlaneGeometry,this._threePlaneMaterial),this._threeScene.add(this._threePlaneMesh)}}}else{const r=t.get3DRendererObject();if(!r)return;this._threeGroup||(this._threeGroup=new THREE.Group,r.add(this._threeGroup))}}setThreeCameraDirty(e){this._threeCameraDirty=e}show2DRenderingPlane(e){!this._threePlaneMesh||this._threePlaneMesh.visible!==e&&(this._threePlaneMesh.visible=e)}updatePosition(){const e=-n.toRad(this._layer.getCameraRotation()),t=this._layer.getCameraZoom();this._pixiContainer.rotation=e,this._pixiContainer.scale.x=t,this._pixiContainer.scale.y=t;const r=Math.cos(e),i=Math.sin(e),s=this._layer.getCameraX()*t*r-this._layer.getCameraY()*t*i,o=this._layer.getCameraX()*t*i+this._layer.getCameraY()*t*r;this._pixiContainer.position.x=this._layer.getWidth()/2-s,this._pixiContainer.position.y=this._layer.getHeight()/2-o,this._layer.getRuntimeScene().getGame().getPixelsRounding()&&(r===0||i===0)&&Number.isInteger(t)&&(this._pixiContainer.position.x=Math.ceil(this._pixiContainer.position.x),this._pixiContainer.position.y=Math.ceil(this._pixiContainer.position.y)),this._threeCamera&&(this._threeCamera.position.x=this._layer.getCameraX(),this._threeCamera.position.y=-this._layer.getCameraY(),this._threeCamera.rotation.z=e,this._threeCamera.position.z=this._layer.getCameraZ(this._threeCamera.fov),this._threePlaneMesh&&(this._threePlaneMesh.scale.x=this._layer.getWidth()/t,this._threePlaneMesh.scale.y=this._layer.getHeight()/t,this._threePlaneMesh.position.x=this._threeCamera.position.x,this._threePlaneMesh.position.y=-this._threeCamera.position.y,this._threePlaneMesh.rotation.z=-e))}updateVisibility(e){this._pixiContainer.visible=!!e,this._threeGroup&&(this._threeGroup.visible=!!e)}updatePreRender(){if(this._threeCameraDirty){const e=this.getThreeCamera();e&&e.updateProjectionMatrix(),this._threeCameraDirty=!1}}addRendererObject(e,t){const r=e;r.zIndex=t||h.zeroZOrderForPixi,this._pixiContainer.addChild(r)}changeRendererObjectZOrder(e,t){const r=e;r.zIndex=t}removeRendererObject(e){this._pixiContainer.removeChild(e)}has3DObjects(){return!!this._threeGroup&&this._threeGroup.children.length>0}has2DObjects(){return this._pixiContainer.children.length>0}add3DRendererObject(e){!this._threeGroup||this._threeGroup.add(e)}remove3DRendererObject(e){!this._threeGroup||this._threeGroup.remove(e)}updateClearColor(){this._clearColor=this._layer.getClearColor()}_createPixiRenderTexture(e){if(!e||e.type!==a.RENDERER_TYPE.WEBGL)return;if(this._renderTexture){l.error("Tried to create a PixiJS RenderTexture for a layer that already has one.");return}this._oldWidth=e.screen.width,this._oldHeight=e.screen.height;const t=this._oldWidth,r=this._oldHeight,i=e.resolution;this._renderTexture=a.RenderTexture.create({width:t,height:r,resolution:i}),this._renderTexture.baseTexture.scaleMode=a.SCALE_MODES.LINEAR,l.info(`RenderTexture created for layer ${this._layer.getName()}.`)}renderOnPixiRenderTexture(e){if(!this._renderTexture)return;(this._oldWidth!==e.screen.width||this._oldHeight!==e.screen.height)&&(this._renderTexture.resize(e.screen.width,e.screen.height),this._oldWidth=e.screen.width,this._oldHeight=e.screen.height);const t=e.renderTexture.current,r=e.renderTexture.sourceFrame;e.renderTexture.bind(this._renderTexture),this._clearColor[3]=this._isLightingLayer?1:0,e.renderTexture.clear(this._clearColor),e.render(this._pixiContainer,{renderTexture:this._renderTexture,clear:!1}),e.renderTexture.bind(t,r,void 0)}updateThreePlaneTextureFromPixiRenderTexture(e,t){if(!this._threePlaneTexture||!this._renderTexture)return;const r=this._renderTexture.baseTexture._glTextures[t.CONTEXT_UID];if(r){const i=e.properties.get(this._threePlaneTexture);i.__webglTexture=r.texture}}_setupLightingRendering(e,t){if(this._createPixiRenderTexture(e),!this._renderTexture)return;this._lightingSprite=new a.Sprite(this._renderTexture),this._lightingSprite.blendMode=a.BLEND_MODES.MULTIPLY;const r=t.getRendererObject(),i=r.getChildIndex(this._pixiContainer);r.addChildAt(this._lightingSprite,i),r.removeChild(this._pixiContainer)}};let _=h;_.zeroZOrderForPixi=Math.pow(2,-24),n.LayerPixiRenderer=_,n.LayerRenderer=n.LayerPixiRenderer})(gdjs||(gdjs={})); +//# sourceMappingURL=layer-pixi-renderer.js.map diff --git a/desktop/apps/dezunkrr/pixi-renderers/loadingscreen-pixi-renderer.js b/desktop/apps/dezunkrr/pixi-renderers/loadingscreen-pixi-renderer.js new file mode 100644 index 0000000..dd1616b --- /dev/null +++ b/desktop/apps/dezunkrr/pixi-renderers/loadingscreen-pixi-renderer.js @@ -0,0 +1,2 @@ +var gdjs;(function(g){const h=GlobalPIXIModule.PIXI;let s;(function(i){i[i.NOT_STARTED=0]="NOT_STARTED",i[i.STARTED=1]="STARTED",i[i.FINISHED=2]="FINISHED"})(s||(s={}));const p=(a,e,r)=>{!a||(e>0?(a.alpha+=1/e*r/1e3,a.alpha>1&&(a.alpha=1)):a.alpha=1)},c=a=>!a||a.alpha>=1;class u{constructor(e,r,i){this._backgroundSprite=null;this._gdevelopLogoSprite=null;this._progressBarGraphics=null;this._state=0;this._startTimeInMs=0;this._backgroundReadyTimeInMs=0;this._lastFrameTimeInMs=0;this._progressPercent=0;if(this._loadingScreenData=i,this._loadingScreenContainer=new h.Container,this._pixiRenderer=e.getPIXIRenderer(),!this._pixiRenderer)return;this._pixiRenderer.backgroundColor=this._loadingScreenData.backgroundColor;const t=r.getPIXITexture(i.backgroundImageResourceName);t!==r.getInvalidPIXITexture()&&(this._backgroundSprite=h.Sprite.from(t),this._backgroundSprite.alpha=0,this._backgroundSprite.anchor.x=.5,this._backgroundSprite.anchor.y=.5,this._loadingScreenContainer.addChild(this._backgroundSprite)),i.showGDevelopSplash&&(this._gdevelopLogoSprite=h.Sprite.from(g.gdevelopLogo),this._gdevelopLogoSprite.alpha=0,this._gdevelopLogoSprite.anchor.x=.5,this._gdevelopLogoSprite.anchor.y=.5,this._loadingScreenContainer.addChild(this._gdevelopLogoSprite)),i.showProgressBar&&(this._progressBarGraphics=new h.Graphics,this._progressBarGraphics.alpha=0,this._loadingScreenContainer.addChild(this._progressBarGraphics)),this._render(performance.now())}setPercent(e){this._progressPercent=e}_startLoadingScreen(){!this._pixiRenderer||(this._state=1,this._startTimeInMs=performance.now())}_updatePositions(){if(!!this._pixiRenderer){if(this._backgroundSprite&&this._backgroundSprite.texture.valid){this._backgroundSprite.position.x=this._pixiRenderer.width/2,this._backgroundSprite.position.y=this._pixiRenderer.height/2;const e=Math.max(this._pixiRenderer.width/this._backgroundSprite.texture.width,this._pixiRenderer.height/this._backgroundSprite.texture.height);this._backgroundSprite.scale.x=e,this._backgroundSprite.scale.y=e}if(this._gdevelopLogoSprite){this._gdevelopLogoSprite.position.x=this._pixiRenderer.width/2,this._gdevelopLogoSprite.position.y=this._pixiRenderer.height/2;const e=680,r=this._pixiRenderer.width>this._pixiRenderer.height&&this._pixiRenderer.width>500?150:35,t=Math.min(e,Math.max(1,this._pixiRenderer.width-r*2))/e;this._gdevelopLogoSprite.scale.x=t,this._gdevelopLogoSprite.scale.y=t,this._gdevelopLogoSprite.visible=this._pixiRenderer.width>200&&this._pixiRenderer.height>200}}}_render(e){if(!this._pixiRenderer)return;this._state!==2&&requestAnimationFrame(()=>this._render(performance.now()));const r=this._lastFrameTimeInMs?e-this._lastFrameTimeInMs:0;if(this._lastFrameTimeInMs=e,this._updatePositions(),this._state==0)(!this._backgroundSprite||this._backgroundSprite.texture.valid)&&this._startLoadingScreen();else if(this._state==1){const i=this._loadingScreenData.backgroundFadeInDuration;if(p(this._backgroundSprite,i,r),c(this._backgroundSprite)){this._backgroundReadyTimeInMs||(this._backgroundReadyTimeInMs=e);const t=this._loadingScreenData.logoAndProgressFadeInDuration,o=this._loadingScreenData.logoAndProgressLogoFadeInDelay;e-this._backgroundReadyTimeInMs>o*1e3&&(p(this._gdevelopLogoSprite,t,r),p(this._progressBarGraphics,t,r))}if(this._progressBarGraphics){const t=this._loadingScreenData.progressBarColor;let o=this._loadingScreenData.progressBarWidthPercent/100*this._pixiRenderer.width;this._loadingScreenData.progressBarMaxWidth>0&&o>this._loadingScreenData.progressBarMaxWidth&&(o=this._loadingScreenData.progressBarMaxWidth),this._loadingScreenData.progressBarMinWidth>0&&osetTimeout(()=>{this._state=2,i()},r*1e3))}}g.LoadingScreenRenderer=u})(gdjs||(gdjs={})); +//# sourceMappingURL=loadingscreen-pixi-renderer.js.map diff --git a/desktop/apps/dezunkrr/pixi-renderers/pixi-bitmapfont-manager.js b/desktop/apps/dezunkrr/pixi-renderers/pixi-bitmapfont-manager.js new file mode 100644 index 0000000..bbbcb2f --- /dev/null +++ b/desktop/apps/dezunkrr/pixi-renderers/pixi-bitmapfont-manager.js @@ -0,0 +1,2 @@ +var gdjs;(function(l){const o=new l.Logger("Bitmap text"),a=GlobalPIXIModule.PIXI,m="GDJS-DEFAULT-BITMAP-FONT",u=5,d=(r,t)=>{const e=r.font;return r.font=t,a.BitmapFont.available[t]=r,delete a.BitmapFont.available[e],a.BitmapFont.available[t]};class h{constructor(t,e,i){this._pixiBitmapFontsInUse={};this._pixiBitmapFontsToUninstall=[];this._loadedFontsData={};this._defaultSlugFontName=null;this._resources=t,this._imageManager=i,this._resourcesLoader=e}getDefaultBitmapFont(){if(this._defaultSlugFontName!==null)return a.BitmapFont.available[this._defaultSlugFontName];const t="Arial",e=new a.TextStyle({fontFamily:t,fontSize:20,padding:5,align:"left",fill:"#ffffff",wordWrap:!0,lineHeight:20}),i=d(a.BitmapFont.from(t,e,{chars:[[" ","~"]]}),m);return this._defaultSlugFontName=i.font,i}setResources(t){this._resources=t}_markBitmapFontAsUsed(t){this._pixiBitmapFontsInUse[t]=this._pixiBitmapFontsInUse[t]||{objectsUsingTheFont:0},this._pixiBitmapFontsInUse[t].objectsUsingTheFont++;for(let e=0;eu)){const e=this._pixiBitmapFontsToUninstall.shift();a.BitmapFont.uninstall(e),o.log("Bitmap Text",'Uninstalled BitmapFont "'+e+'" from memory.')}}}obtainBitmapFont(t,e){const i=t+"@"+e;if(a.BitmapFont.available[i])return this._markBitmapFontAsUsed(i),a.BitmapFont.available[i];const n=this._loadedFontsData[t];if(!n)return o.warn('Could not find Bitmap Font for resource named "'+t+'". The default font will be used.'),this.getDefaultBitmapFont();const s=this._imageManager.getPIXITexture(e);try{const p=d(a.BitmapFont.install(n,s),i);return this._markBitmapFontAsUsed(i),p}catch(p){return o.error('Could not load the Bitmap Font for resource named "'+t+'". The default font will be used. Error is: '+p),this.getDefaultBitmapFont()}}loadBitmapFontData(t){const e=this._resources.filter(n=>n.kind==="bitmapFont"&&!n.disablePreload);if(e.length===0)return Promise.resolve([]);let i=0;return Promise.all(e.map(n=>fetch(this._resourcesLoader.getFullUrl(n.file),{credentials:this._resourcesLoader.checkIfCredentialsRequired(n.file)?"include":"same-origin"}).then(s=>s.text()).then(s=>{this._loadedFontsData[n.name]=s}).catch(s=>{o.error("Can't fetch the bitmap font file "+n.file+", error: "+s)}).then(()=>{i++,t(i,e.length)})))}}l.PixiBitmapFontManager=h,l.BitmapFontManager=l.PixiBitmapFontManager})(gdjs||(gdjs={})); +//# sourceMappingURL=pixi-bitmapfont-manager.js.map diff --git a/desktop/apps/dezunkrr/pixi-renderers/pixi-effects-manager.js b/desktop/apps/dezunkrr/pixi-renderers/pixi-effects-manager.js new file mode 100644 index 0000000..fe6ad96 --- /dev/null +++ b/desktop/apps/dezunkrr/pixi-renderers/pixi-effects-manager.js @@ -0,0 +1,2 @@ +var gdjs;(function(i){const o=GlobalPIXIModule.PIXI;class f{initializeEffect(e,t,n){const r=i.PixiFiltersTools.getFilterCreator(e.effectType);return r?(t[e.name]=r.makeFilter(n,e),!0):(console.warn(`Effect: "${e.name}", on layer: "${n.getName()}", has an unknown effect type: "${e.effectType}". Was it registered properly? Is the effect type correct?`),!1)}updatePreRender(e,t){for(const n in e)e[n].updatePreRender(t)}addEffect(e,t,n){let r=!0;return r=this.initializeEffect(e,t,n)&&r,r=this.updateAllEffectParameters(t,e)&&r,t[e.name]&&(r=t[e.name].applyEffect(n)&&r),r}removeEffect(e,t,n){const r=e[n];return r?(r.removeEffect(t),delete e[n],!0):!1}clearEffects(e){return e&&(e.filters=[]),!0}setEffectDoubleParameter(e,t,n,r){const a=e[t];return a?(a.updateDoubleParameter(n,r),!0):!1}setEffectStringParameter(e,t,n,r){const a=e[t];return a?(a.updateStringParameter(n,r),!0):!1}setEffectBooleanParameter(e,t,n,r){const a=e[t];return a?(a.updateBooleanParameter(n,r),!0):!1}updateAllEffectParameters(e,t){let n=!0,r=!0,a=!0;for(let s in t.doubleParameters)n=this.setEffectDoubleParameter(e,t.name,s,t.doubleParameters[s])&&n;for(let s in t.stringParameters)r=this.setEffectStringParameter(e,t.name,s,t.stringParameters[s])&&r;for(let s in t.booleanParameters)a=this.setEffectBooleanParameter(e,t.name,s,t.booleanParameters[s])&&a;return n&&r&&a}hasEffect(e,t){return!!e[t]}enableEffect(e,t,n,r){const a=e[n];!a||a.setEnabled(t,r)}isEffectEnabled(e,t,n){const r=e[n];return r?r.isEnabled(t):!1}}i.EffectsManager=f})(gdjs||(gdjs={})); +//# sourceMappingURL=pixi-effects-manager.js.map diff --git a/desktop/apps/dezunkrr/pixi-renderers/pixi-filters-tools.js b/desktop/apps/dezunkrr/pixi-renderers/pixi-filters-tools.js new file mode 100644 index 0000000..d7ad737 --- /dev/null +++ b/desktop/apps/dezunkrr/pixi-renderers/pixi-filters-tools.js @@ -0,0 +1,2 @@ +var gdjs;(function(n){const f=new n.Logger("Filters"),c=GlobalPIXIModule.PIXI;let p;(function(i){i.clampValue=function(r,e,t){return Math.max(e,Math.min(t,r))},i.clampKernelSize=function(r,e,t){const a=Math.round((t-e)/2+1),s=new Array(a);for(let o=0;oa!==this.pixiFilter),!0):!1}updatePreRender(e){this.filterCreator.updatePreRender(this.pixiFilter,e)}updateDoubleParameter(e,t){this.filterCreator.updateDoubleParameter(this.pixiFilter,e,t)}updateStringParameter(e,t){this.filterCreator.updateStringParameter(this.pixiFilter,e,t)}updateBooleanParameter(e,t){this.filterCreator.updateBooleanParameter(this.pixiFilter,e,t)}}i.PixiFilter=g})(p=n.PixiFiltersTools||(n.PixiFiltersTools={}))})(gdjs||(gdjs={})); +//# sourceMappingURL=pixi-filters-tools.js.map diff --git a/desktop/apps/dezunkrr/pixi-renderers/pixi-image-manager.js b/desktop/apps/dezunkrr/pixi-renderers/pixi-image-manager.js new file mode 100644 index 0000000..be550d9 --- /dev/null +++ b/desktop/apps/dezunkrr/pixi-renderers/pixi-image-manager.js @@ -0,0 +1,2 @@ +var gdjs;(function(x){const l=new x.Logger("PIXI Image manager"),d=GlobalPIXIModule.PIXI,T=(a,e)=>{l.error("Unable to load file "+a+" with error:",e||"(unknown error)")},E=(a,e)=>{!a||e.smoothed||(a.baseTexture.scaleMode=d.SCALE_MODES.NEAREST)},R=(a,e)=>{e&&!e.smoothed&&(a.magFilter=THREE.NearestFilter,a.minFilter=THREE.NearestFilter)},g=(a,e,r)=>{for(let s=0,t=a.length;s{T(s,i)});return E(t,r),this._loadedTextures.put(e,t),t}getThreeTexture(e){const r=this._loadedThreeTextures.get(e);if(r)return r;const s=this.getPIXITexture(e);if(!this._resourcesLoader._runtimeGame.getRenderer().getPIXIRenderer())throw new Error("No PIXI renderer was found.");const i=s.baseTexture.resource.source;if(!(i instanceof HTMLImageElement))throw new Error(`Can't load texture for resource "${e}" as it's not an image.`);const o=new THREE.Texture(i);o.magFilter=THREE.LinearFilter,o.minFilter=THREE.LinearFilter,o.wrapS=THREE.RepeatWrapping,o.wrapT=THREE.RepeatWrapping,o.needsUpdate=!0;const h=g(this._resources,e,"image");return R(o,h),this._loadedThreeTextures.put(e,o),o}getThreeMaterial(e,{useTransparentTexture:r,forceBasicMaterial:s}){const t=`${e}|${r?1:0}|${s?1:0}`,i=this._loadedThreeMaterials.get(t);if(i)return i;const o=s?new THREE.MeshBasicMaterial({map:this.getThreeTexture(e),side:r?THREE.DoubleSide:THREE.FrontSide,transparent:r}):new THREE.MeshStandardMaterial({map:this.getThreeTexture(e),side:r?THREE.DoubleSide:THREE.FrontSide,transparent:r,metalness:0});return this._loadedThreeMaterials.put(t,o),o}getPIXIVideoTexture(e){if(this._loadedTextures.containsKey(e))return this._loadedTextures.get(e);if(e==="")return this._invalidTexture;const r=g(this._resources,e,"video");if(!r)return l.warn('Unable to find video texture for resource "'+e+'".'),this._invalidTexture;const s=r.file;l.log('Loading video texture for resource "'+e+'"...');const t=d.Texture.from(this._resourcesLoader.getFullUrl(s),{resourceOptions:{crossorigin:this._resourcesLoader.checkIfCredentialsRequired(s)?"use-credentials":"anonymous"}}).on("error",i=>{T(s,i)});return this._loadedTextures.put(e,t),t}getInvalidPIXITexture(){return this._invalidTexture}loadTextures(e,r){const s=this._resources,t={};for(let u=0,c=s.length;u{u.onProgress.detach(_);for(const n in c)if(c.hasOwnProperty(n)){if(!t.hasOwnProperty(n))continue;t[n].forEach(I=>{const f=c[n].texture;if(!f){const p=c[n].error;T(n,p);return}this._loadedTextures.put(I.name,f),E(f,I)})}r(i)})}}x.PixiImageManager=A,x.ImageManager=x.PixiImageManager})(gdjs||(gdjs={})); +//# sourceMappingURL=pixi-image-manager.js.map diff --git a/desktop/apps/dezunkrr/pixi-renderers/pixi.js b/desktop/apps/dezunkrr/pixi-renderers/pixi.js new file mode 100644 index 0000000..06eacbc --- /dev/null +++ b/desktop/apps/dezunkrr/pixi-renderers/pixi.js @@ -0,0 +1,11 @@ +/*! + * pixi.js-legacy - v6.1.2 + * Compiled Thu, 12 Aug 2021 17:05:28 UTC + * + * pixi.js-legacy is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + */ +var PIXI=function(t){"use strict";var e=setTimeout;function r(t){return Boolean(t&&void 0!==t.length)}function i(){}function n(t){if(!(this instanceof n))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function o(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,n._immediateFn(function(){var r=1===t._state?e.onFulfilled:e.onRejected;if(null!==r){var i;try{i=r(t._value)}catch(t){return void a(e.promise,t)}s(e.promise,i)}else(1===t._state?s:a)(e.promise,t._value)})):t._deferreds.push(e)}function s(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var r=e.then;if(e instanceof n)return t._state=3,t._value=e,void h(t);if("function"==typeof r)return void l((i=r,o=e,function(){i.apply(o,arguments)}),t)}t._state=1,t._value=e,h(t)}catch(e){a(t,e)}var i,o}function a(t,e){t._state=2,t._value=e,h(t)}function h(t){2===t._state&&0===t._deferreds.length&&n._immediateFn(function(){t._handled||n._unhandledRejectionFn(t._value)});for(var e=0,r=t._deferreds.length;e0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),self.ArrayBuffer||(self.ArrayBuffer=Array),self.Float32Array||(self.Float32Array=Array),self.Uint32Array||(self.Uint32Array=Array),self.Uint16Array||(self.Uint16Array=Array),self.Uint8Array||(self.Uint8Array=Array),self.Int32Array||(self.Int32Array=Array);var E=/iPhone/i,T=/iPod/i,x=/iPad/i,b=/\biOS-universal(?:.+)Mac\b/i,S=/\bAndroid(?:.+)Mobile\b/i,A=/Android/i,R=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,O=/Silk/i,I=/Windows Phone/i,M=/\bWindows(?:.+)ARM\b/i,P=/BlackBerry/i,w=/BB10/i,D=/Opera Mini/i,N=/\b(CriOS|Chrome)(?:.+)Mobile/i,C=/Mobile(?:.+)Firefox\b/i,L=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream};var F,B,U,G,k,X,H,j,Y,V,z,W,q,K,Z,Q,J,$,tt,et=function(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||"undefined"==typeof navigator?"string"==typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var r=e.userAgent,i=r.split("[FBAN");void 0!==i[1]&&(r=i[0]),void 0!==(i=r.split("Twitter"))[1]&&(r=i[0]);var n=function(t){return function(e){return e.test(t)}}(r),o={apple:{phone:n(E)&&!n(I),ipod:n(T),tablet:!n(E)&&(n(x)||L(e))&&!n(I),universal:n(b),device:(n(E)||n(T)||n(x)||n(b)||L(e))&&!n(I)},amazon:{phone:n(R),tablet:!n(R)&&n(O),device:n(R)||n(O)},android:{phone:!n(I)&&n(R)||!n(I)&&n(S),tablet:!n(I)&&!n(R)&&!n(S)&&(n(O)||n(A)),device:!n(I)&&(n(R)||n(O)||n(S)||n(A))||n(/\bokhttp\b/i)},windows:{phone:n(I),tablet:n(M),device:n(I)||n(M)},other:{blackberry:n(P),blackberry10:n(w),opera:n(D),firefox:n(C),chrome:n(N),device:n(P)||n(w)||n(D)||n(C)||n(N)},any:!1,phone:!1,tablet:!1};return o.any=o.apple.device||o.android.device||o.windows.device||o.other.device,o.phone=o.apple.phone||o.android.phone||o.windows.phone,o.tablet=o.apple.tablet||o.android.tablet||o.windows.tablet,o}(self.navigator);!function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(F||(F={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(B||(B={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(U||(U={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"}(G||(G={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(k||(k={})),function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(X||(X={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(H||(H={})),function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"}(j||(j={})),function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"}(Y||(Y={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(V||(V={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(z||(z={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"}(W||(W={})),function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA"}(q||(q={})),function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"}(K||(K={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(Z||(Z={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(Q||(Q={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(J||(J={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}($||($={})),function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(tt||(tt={}));var rt={MIPMAP_TEXTURES:W.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:$.NONE,SPRITE_MAX_TEXTURES:function(t){var e,r=!0;(et.tablet||et.phone)&&(et.apple.device&&(e=navigator.userAgent.match(/OS (\d+)_(\d+)?/))&&parseInt(e[1],10)<11&&(r=!1),et.android.device&&(e=navigator.userAgent.match(/Android\s([0-9.]*)/))&&parseInt(e[1],10)<7&&(r=!1));return r?32:4}(),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:Z.AUTO,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:z.CLAMP,SCALE_MODE:V.LINEAR,PRECISION_VERTEX:Q.HIGH,PRECISION_FRAGMENT:et.apple.device?Q.HIGH:Q.MEDIUM,CAN_UPLOAD_SAME_BUFFER:!et.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},it="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function nt(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var ot=nt(function(t){var e=Object.prototype.hasOwnProperty,r="~";function i(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,i,o,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new n(i,o||t,s),h=r?r+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,i,n=[];if(0===this._eventsCount)return n;for(i in t=this._events)e.call(t,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,s=new Array(o);n80*r){i=o=t[0],n=s=t[1];for(var p=r;po&&(o=a),h>s&&(s=h);u=0!==(u=Math.max(o-i,s-n))?1/u:0}return ct(d,f,r,i,n,u),f}function ut(t,e,r,i,n){var o,s;if(n===Nt(t,e,r,i)>0)for(o=e;o=e;o-=i)s=Pt(o,t[o],t[o+1],s);return s&&St(s,s.next)&&(wt(s),s=s.next),s}function lt(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!St(i,i.next)&&0!==bt(i.prev,i,i.next))i=i.next;else{if(wt(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function ct(t,e,r,i,n,o,s){if(t){!s&&o&&function(t,e,r,i){var n=t;do{null===n.z&&(n.z=gt(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,r,i,n,o,s,a,h,u=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,i=r,a=0,e=0;e0||h>0&&i;)0!==a&&(0===h||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(s>1)}(n)}(t,i,n,o);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,o?ft(t,i,n,o):dt(t))e.push(a.i/r),e.push(t.i/r),e.push(h.i/r),wt(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?ct(t=pt(lt(t),e,r),e,r,i,n,o,2):2===s&&_t(t,e,r,i,n,o):ct(lt(t),e,r,i,n,o,1);break}}}function dt(t){var e=t.prev,r=t,i=t.next;if(bt(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(Tt(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&bt(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function ft(t,e,r,i){var n=t.prev,o=t,s=t.next;if(bt(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=gt(a,h,e,r,i),d=gt(u,l,e,r,i),f=t.prevZ,p=t.nextZ;f&&f.z>=c&&p&&p.z<=d;){if(f!==t.prev&&f!==t.next&&Tt(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&bt(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,p!==t.prev&&p!==t.next&&Tt(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&bt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;f&&f.z>=c;){if(f!==t.prev&&f!==t.next&&Tt(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&bt(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&Tt(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&bt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function pt(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!St(n,o)&&At(n,i,i.next,o)&&It(n,o)&&It(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),wt(i),wt(i.next),i=t=o),i=i.next}while(i!==t);return lt(i)}function _t(t,e,r,i,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&xt(s,a)){var h=Mt(s,a);return s=lt(s,s.next),h=lt(h,h.next),ct(s,e,r,i,n,o),void ct(h,e,r,i,n,o)}a=a.next}s=s.next}while(s!==t)}function mt(t,e){return t.x-e.x}function vt(t,e){if(e=function(t,e){var r,i=e,n=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>s){if(s=a,a===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x=i.x&&i.x>=l&&n!==i.x&&Tt(or.x||i.x===r.x&&yt(r,i)))&&(r=i,d=h)),i=i.next}while(i!==u);return r}(t,e)){var r=Mt(e,t);lt(e,e.next),lt(r,r.next)}}function yt(t,e){return bt(t.prev,t,e.prev)<0&&bt(e.next,t,t.next)<0}function gt(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Et(t){var e=t,r=t;do{(e.x=0&&(t-s)*(i-a)-(r-s)*(e-a)>=0&&(r-s)*(o-a)-(n-s)*(i-a)>=0}function xt(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&At(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(It(t,e)&&It(e,t)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)&&(bt(t.prev,t,e.prev)||bt(t,e.prev,e))||St(t,e)&&bt(t.prev,t,t.next)>0&&bt(e.prev,e,e.next)>0)}function bt(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function St(t,e){return t.x===e.x&&t.y===e.y}function At(t,e,r,i){var n=Ot(bt(t,e,r)),o=Ot(bt(t,e,i)),s=Ot(bt(r,i,t)),a=Ot(bt(r,i,e));return n!==o&&s!==a||(!(0!==n||!Rt(t,r,e))||(!(0!==o||!Rt(t,i,e))||(!(0!==s||!Rt(r,t,i))||!(0!==a||!Rt(r,e,i)))))}function Rt(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Ot(t){return t>0?1:t<0?-1:0}function It(t,e){return bt(t.prev,t,t.next)<0?bt(t,e,t.next)>=0&&bt(t,t.prev,e)>=0:bt(t,e,t.prev)<0||bt(t,t.next,e)<0}function Mt(t,e){var r=new Dt(t.i,t.x,t.y),i=new Dt(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function Pt(t,e,r,i){var n=new Dt(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function wt(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Dt(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Nt(t,e,r,i){for(var n=0,o=e,s=r-i;o0&&(i+=t[n-1].length,r.holes.push(i))}return r},st.default=at;var Ct=nt(function(t,e){!function(r){var i=e&&!e.nodeType&&e,n=t&&!t.nodeType&&t,o="object"==typeof it&⁢o.global!==o&&o.window!==o&&o.self!==o||(r=o);var s,a,h=2147483647,u=36,l=1,c=26,d=38,f=700,p=72,_=128,m="-",v=/^xn--/,y=/[^\x20-\x7E]/,g=/[\x2E\u3002\uFF0E\uFF61]/g,E={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=u-l,x=Math.floor,b=String.fromCharCode;function S(t){throw RangeError(E[t])}function A(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function R(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+A((t=t.replace(g,".")).split("."),e).join(".")}function O(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=b((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=b(t)}).join("")}function M(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function P(t,e,r){var i=0;for(t=r?x(t/f):t>>1,t+=x(t/e);t>T*c>>1;i+=u)t=x(t/T);return x(i+(T+1)*t/(t+d))}function w(t){var e,r,i,n,o,s,a,d,f,v,y,g=[],E=t.length,T=0,b=_,A=p;for((r=t.lastIndexOf(m))<0&&(r=0),i=0;i=128&&S("not-basic"),g.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=E&&S("invalid-input"),((d=(y=t.charCodeAt(n++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:u)>=u||d>x((h-T)/s))&&S("overflow"),T+=d*s,!(d<(f=a<=A?l:a>=A+c?c:a-A));a+=u)s>x(h/(v=u-f))&&S("overflow"),s*=v;A=P(T-o,e=g.length+1,0==o),x(T/e)>h-b&&S("overflow"),b+=x(T/e),T%=e,g.splice(T++,0,b)}return I(g)}function D(t){var e,r,i,n,o,s,a,d,f,v,y,g,E,T,A,R=[];for(g=(t=O(t)).length,e=_,r=0,o=p,s=0;s=e&&yx((h-r)/(E=i+1))&&S("overflow"),r+=(a-e)*E,e=a,s=0;sh&&S("overflow"),y==e){for(d=r,f=u;!(d<(v=f<=o?l:f>=o+c?c:f-o));f+=u)A=d-v,T=u-v,R.push(b(M(v+A%T,0))),d=x(A/T);R.push(b(M(d,0))),o=P(r,E,i==n),r=0,++i}++r,++e}return R.join("")}if(s={version:"1.3.2",ucs2:{decode:O,encode:I},decode:w,encode:D,toASCII:function(t){return R(t,function(t){return y.test(t)?"xn--"+D(t):t})},toUnicode:function(t){return R(t,function(t){return v.test(t)?w(t.slice(4).toLowerCase()):t})}},i&&n)if(t.exports==i)n.exports=s;else for(a in s)s.hasOwnProperty(a)&&(i[a]=s[a]);else r.punycode=s}(it)}),Lt={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};function Ft(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var Bt=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h=0?(u=f.substr(0,p),l=f.substr(p+1)):(u=f,l=""),c=decodeURIComponent(u),d=decodeURIComponent(l),Ft(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},Ut=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Gt=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(i){var n=encodeURIComponent(Ut(i))+r;return Array.isArray(t[i])?t[i].map(function(t){return n+encodeURIComponent(Ut(t))}).join(e):n+encodeURIComponent(Ut(t[i]))}).join(e):i?encodeURIComponent(Ut(i))+r+encodeURIComponent(Ut(t)):""},kt=nt(function(t,e){e.decode=e.parse=Bt,e.encode=e.stringify=Gt}),Xt=ie,Ht=function(t,e){return ie(t,!1,!0).resolve(e)},jt=function(t){Lt.isString(t)&&(t=ie(t));if(!(t instanceof Yt))return Yt.prototype.format.call(t);return t.format()};function Yt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var Vt=/^([a-z0-9.+-]+:)/i,zt=/:[0-9]*$/,Wt=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,qt=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),Kt=["'"].concat(qt),Zt=["%","/","?",";","#"].concat(Kt),Qt=["/","?","#"],Jt=/^[+a-z0-9A-Z_-]{0,63}$/,$t=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,te={javascript:!0,"javascript:":!0},ee={javascript:!0,"javascript:":!0},re={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function ie(t,e,r){if(t&&Lt.isObject(t)&&t instanceof Yt)return t;var i=new Yt;return i.parse(t,e,r),i}Yt.prototype.parse=function(t,e,r){if(!Lt.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i127?E+="x":E+=g[T];if(!E.match(Jt)){var b=v.slice(0,p),S=v.slice(p+1),A=g.match($t);A&&(b.push(A[1]),S.unshift(A[2])),S.length&&(s="/"+S.join(".")+s),this.hostname=b.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),m||(this.hostname=Ct.toASCII(this.hostname));var R=this.port?":"+this.port:"",O=this.hostname||"";this.host=O+R,this.href+=this.host,m&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!te[u])for(p=0,y=Kt.length;p0)&&r.host.split("@"))&&(r.auth=A.shift(),r.host=r.hostname=A.shift());return r.search=t.search,r.query=t.query,Lt.isNull(r.pathname)&&Lt.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!g.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var T=g.slice(-1)[0],x=(r.host||t.host||g.length>1)&&("."===T||".."===T)||""===T,b=0,S=g.length;S>=0;S--)"."===(T=g[S])?g.splice(S,1):".."===T?(g.splice(S,1),b++):b&&(g.splice(S,1),b--);if(!v&&!y)for(;b--;b)g.unshift("..");!v||""===g[0]||g[0]&&"/"===g[0].charAt(0)||g.unshift(""),x&&"/"!==g.join("/").substr(-1)&&g.push("");var A,R=""===g[0]||g[0]&&"/"===g[0].charAt(0);E&&(r.hostname=r.host=R?"":g.length?g.shift():"",(A=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=A.shift(),r.host=r.hostname=A.shift()));return(v=v||r.host&&g.length)&&!R&&g.unshift(""),g.length?r.pathname=g.join("/"):(r.pathname=null,r.path=null),Lt.isNull(r.pathname)&&Lt.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},Yt.prototype.parseHost=function(){var t=this.host,e=zt.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};!function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(t.ENV||(t.ENV={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(t.RENDERER_TYPE||(t.RENDERER_TYPE={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(t.BUFFER_BITS||(t.BUFFER_BITS={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"}(t.BLEND_MODES||(t.BLEND_MODES={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(t.DRAW_MODES||(t.DRAW_MODES={})),function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(t.FORMATS||(t.FORMATS={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(t.TARGETS||(t.TARGETS={})),function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"}(t.TYPES||(t.TYPES={})),function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"}(t.SAMPLER_TYPES||(t.SAMPLER_TYPES={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(t.SCALE_MODES||(t.SCALE_MODES={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(t.WRAP_MODES||(t.WRAP_MODES={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"}(t.MIPMAP_MODES||(t.MIPMAP_MODES={})),function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA"}(t.ALPHA_MODES||(t.ALPHA_MODES={})),function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"}(t.CLEAR_MODES||(t.CLEAR_MODES={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(t.GC_MODES||(t.GC_MODES={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(t.PRECISION||(t.PRECISION={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(t.MASK_TYPES||(t.MASK_TYPES={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(t.MSAA_QUALITY||(t.MSAA_QUALITY={})),function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(t.BUFFER_TYPE||(t.BUFFER_TYPE={}));var ne={parse:Xt,format:jt,resolve:Ht};rt.RETINA_PREFIX=/@([0-9\.]+)x/,rt.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var oe,se=!1,ae="6.1.2";function he(t){var e;if(!se){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var r=["\n %c %c %c PixiJS "+ae+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(e=self.console).log.apply(e,r)}else self.console&&self.console.log("PixiJS "+ae+" - "+t+" - http://www.pixijs.com/");se=!0}}function ue(){return void 0===oe&&(oe=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:rt.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!self.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),i=!(!r||!r.getContextAttributes().stencil);if(r){var n=r.getExtension("WEBGL_lose_context");n&&n.loseContext()}return r=null,i}catch(t){return!1}}()),oe}var le={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function ce(t,e){return void 0===e&&(e=[]),e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function de(t){var e=t.toString(16);return"#"+("000000".substr(0,6-e.length)+e)}function fe(t){return"string"==typeof t&&"#"===(t=le[t.toLowerCase()]||t)[0]&&(t=t.substr(1)),parseInt(t,16)}function pe(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}var _e=function(){for(var e=[],r=[],i=0;i<32;i++)e[i]=i,r[i]=i;e[t.BLEND_MODES.NORMAL_NPM]=t.BLEND_MODES.NORMAL,e[t.BLEND_MODES.ADD_NPM]=t.BLEND_MODES.ADD,e[t.BLEND_MODES.SCREEN_NPM]=t.BLEND_MODES.SCREEN,r[t.BLEND_MODES.NORMAL]=t.BLEND_MODES.NORMAL_NPM,r[t.BLEND_MODES.ADD]=t.BLEND_MODES.ADD_NPM,r[t.BLEND_MODES.SCREEN]=t.BLEND_MODES.SCREEN_NPM;var n=[];return n.push(r),n.push(e),n}();function me(t,e){return _e[e?1:0][t]}function ve(t,e,r,i){return r=r||new Float32Array(4),i||void 0===i?(r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e):(r[0]=t[0],r[1]=t[1],r[2]=t[2]),r[3]=e,r}function ye(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,i=t>>8&255,n=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((i=i*e+.5|0)<<8)+(n*e+.5|0)}function ge(t,e,r,i){return(r=r||new Float32Array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(i||void 0===i)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r}function Ee(t,e){void 0===e&&(e=null);var r=6*t;if((e=e||new Uint16Array(r)).length!==r)throw new Error("Out buffer length is incorrect, got "+e.length+" and expected "+r);for(var i=0,n=0;i>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)}function Se(t){return!(t&t-1||!t)}function Ae(t){var e=(t>65535?1:0)<<4,r=((t>>>=e)>255?1:0)<<3;return e|=r,e|=r=((t>>>=r)>15?1:0)<<2,(e|=r=((t>>>=r)>3?1:0)<<1)|(t>>>=r)>>1}function Re(t,e,r){var i,n=t.length;if(!(e>=n||0===r)){var o=n-(r=e+r>n?n-e:r);for(i=e;i=this.x&&t=this.y&&ee!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(r=!r)}return r},e}(),qe=function(){function e(e,r,i,n,o){void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===o&&(o=20),this.x=e,this.y=r,this.width=i,this.height=n,this.radius=o,this.type=t.SHAPES.RREC}return e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height,this.radius)},e.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var r=t-(this.x+this.radius),i=e-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=t-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=e-(this.y+this.height-this.radius))*i<=n)return!0;if((r=t-(this.x+this.radius))*r+i*i<=n)return!0}return!1},e}(),Ke=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},t.prototype.copyTo=function(t){return t.set(this.x,this.y),t},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this},t}(),Ze=function(){function t(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),this._x=r,this._y=i,this.cb=t,this.scope=e}return t.prototype.clone=function(e,r){return void 0===e&&(e=this.cb),void 0===r&&(r=this.scope),new t(e,r,this._x,this._y)},t.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._x===t&&this._y===e||(this._x=t,this._y=e,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),t}(),Qe=function(){function t(t,e,r,i,n,o){void 0===t&&(t=1),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=1),void 0===n&&(n=0),void 0===o&&(o=0),this.array=null,this.a=t,this.b=e,this.c=r,this.d=i,this.tx=n,this.ty=o}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,e,r,i,n,o){return this.a=t,this.b=e,this.c=r,this.d=i,this.tx=n,this.ty=o,this},t.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r},t.prototype.apply=function(t,e){e=e||new Ke;var r=t.x,i=t.y;return e.x=this.a*r+this.c*i+this.tx,e.y=this.b*r+this.d*i+this.ty,e},t.prototype.applyInverse=function(t,e){e=e||new Ke;var r=1/(this.a*this.d+this.c*-this.b),i=t.x,n=t.y;return e.x=this.d*r*i+-this.c*r*n+(this.ty*this.c-this.tx*this.d)*r,e.y=this.a*r*n+-this.b*r*i+(-this.ty*this.a+this.tx*this.b)*r,e},t.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},t.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},t.prototype.rotate=function(t){var e=Math.cos(t),r=Math.sin(t),i=this.a,n=this.c,o=this.tx;return this.a=i*e-this.b*r,this.b=i*r+this.b*e,this.c=n*e-this.d*r,this.d=n*r+this.d*e,this.tx=o*e-this.ty*r,this.ty=o*r+this.ty*e,this},t.prototype.append=function(t){var e=this.a,r=this.b,i=this.c,n=this.d;return this.a=t.a*e+t.b*i,this.b=t.a*r+t.b*n,this.c=t.c*e+t.d*i,this.d=t.c*r+t.d*n,this.tx=t.tx*e+t.ty*i+this.tx,this.ty=t.tx*r+t.ty*n+this.ty,this},t.prototype.setTransform=function(t,e,r,i,n,o,s,a,h){return this.a=Math.cos(s+h)*n,this.b=Math.sin(s+h)*n,this.c=-Math.sin(s-a)*o,this.d=Math.cos(s-a)*o,this.tx=t-(r*this.a+i*this.c),this.ty=e-(r*this.b+i*this.d),this},t.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var r=this.a,i=this.c;this.a=r*t.a+this.b*t.c,this.b=r*t.b+this.b*t.d,this.c=i*t.a+this.d*t.c,this.d=i*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var e=this.a,r=this.b,i=this.c,n=this.d,o=t.pivot,s=-Math.atan2(-i,n),a=Math.atan2(r,e),h=Math.abs(s+a);return h<1e-5||Math.abs(Xe-h)<1e-5?(t.rotation=a,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=s,t.skew.y=a),t.scale.x=Math.sqrt(e*e+r*r),t.scale.y=Math.sqrt(i*i+n*n),t.position.x=this.tx+(o.x*e+o.y*i),t.position.y=this.ty+(o.x*r+o.y*n),t},t.prototype.invert=function(){var t=this.a,e=this.b,r=this.c,i=this.d,n=this.tx,o=t*i-e*r;return this.a=i/o,this.b=-e/o,this.c=-r/o,this.d=t/o,this.tx=(r*this.ty-i*n)/o,this.ty=-(t*this.ty-e*n)/o,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var e=new t;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},t.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},Object.defineProperty(t,"IDENTITY",{get:function(){return new t},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEMP_MATRIX",{get:function(){return new t},enumerable:!1,configurable:!0}),t}(),Je=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],$e=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],tr=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],er=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],rr=[],ir=[],nr=Math.sign;!function(){for(var t=0;t<16;t++){var e=[];rr.push(e);for(var r=0;r<16;r++)for(var i=nr(Je[t]*Je[r]+tr[t]*$e[r]),n=nr($e[t]*Je[r]+er[t]*$e[r]),o=nr(Je[t]*tr[r]+tr[t]*er[r]),s=nr($e[t]*tr[r]+er[t]*er[r]),a=0;a<16;a++)if(Je[a]===i&&$e[a]===n&&tr[a]===o&&er[a]===s){e.push(a);break}}for(t=0;t<16;t++){var h=new Qe;h.set(Je[t],$e[t],tr[t],er[t],0,0),ir.push(h)}}();var or={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return Je[t]},uY:function(t){return $e[t]},vX:function(t){return tr[t]},vY:function(t){return er[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return rr[t][e]},sub:function(t,e){return rr[t][or.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?or.S:or.N:2*Math.abs(e)<=Math.abs(t)?t>0?or.E:or.W:e>0?t>0?or.SE:or.SW:t>0?or.NE:or.NW},matrixAppendRotationInv:function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var n=ir[or.inv(e)];n.tx=r,n.ty=i,t.append(n)}},sr=function(){function t(){this.worldTransform=new Qe,this.localTransform=new Qe,this.position=new Ze(this.onChange,this,0,0),this.scale=new Ze(this.onChange,this,1,1),this.pivot=new Ze(this.onChange,this,0,0),this.skew=new Ze(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t,t}();rt.SORTABLE_CHILDREN=!1;var ar=function(){function t(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return t.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},t.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},t.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Ye.EMPTY:((t=t||new Ye(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},t.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},t.prototype.addPointMatrix=function(t,e){var r=t.a,i=t.b,n=t.c,o=t.d,s=t.tx,a=t.ty,h=r*e.x+n*e.y+s,u=i*e.x+o*e.y+a;this.minX=Math.min(this.minX,h),this.maxX=Math.max(this.maxX,h),this.minY=Math.min(this.minY,u),this.maxY=Math.max(this.maxY,u)},t.prototype.addQuad=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=t[0],s=t[1];e=oi?o:i,n=s>n?s:n,e=(o=t[2])i?o:i,n=s>n?s:n,e=(o=t[4])i?o:i,n=s>n?s:n,e=(o=t[6])i?o:i,n=s>n?s:n,this.minX=e,this.minY=r,this.maxX=i,this.maxY=n},t.prototype.addFrame=function(t,e,r,i,n){this.addFrameMatrix(t.worldTransform,e,r,i,n)},t.prototype.addFrameMatrix=function(t,e,r,i,n){var o=t.a,s=t.b,a=t.c,h=t.d,u=t.tx,l=t.ty,c=this.minX,d=this.minY,f=this.maxX,p=this.maxY,_=o*e+a*r+u,m=s*e+h*r+l;c=_f?_:f,p=m>p?m:p,c=(_=o*i+a*r+u)f?_:f,p=m>p?m:p,c=(_=o*e+a*n+u)f?_:f,p=m>p?m:p,c=(_=o*i+a*n+u)f?_:f,p=m>p?m:p,this.minX=c,this.minY=d,this.maxX=f,this.maxY=p},t.prototype.addVertexData=function(t,e,r){for(var i=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;ao?h:o,s=u>s?u:s}this.minX=i,this.minY=n,this.maxX=o,this.maxY=s},t.prototype.addVertices=function(t,e,r,i){this.addVerticesMatrix(t.worldTransform,e,r,i)},t.prototype.addVerticesMatrix=function(t,e,r,i,n,o){void 0===n&&(n=0),void 0===o&&(o=n);for(var s=t.a,a=t.b,h=t.c,u=t.d,l=t.tx,c=t.ty,d=this.minX,f=this.minY,p=this.maxX,_=this.maxY,m=r;mi?t.maxX:i,this.maxY=t.maxY>n?t.maxY:n},t.prototype.addBoundsMask=function(t,e){var r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,n=t.maxXh?n:h,this.maxY=o>u?o:u}},t.prototype.addBoundsMatrix=function(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)},t.prototype.addBoundsArea=function(t,e){var r=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,n=t.maxXh?n:h,this.maxY=o>u?o:u}},t.prototype.pad=function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)},t.prototype.addFramePad=function(t,e,r,i,n,o){t-=n,e-=o,r+=n,i+=o,this.minX=this.minXr?this.maxX:r,this.minY=this.minYi?this.maxY:i},t}(),hr=function(t,e){return(hr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function ur(t,e){function r(){this.constructor=t}hr(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var lr=function(t){function e(){var e=t.call(this)||this;return e.tempDisplayObjectParent=null,e.transform=new sr,e.alpha=1,e.visible=!0,e.renderable=!0,e.parent=null,e.worldAlpha=1,e._lastSortedIndex=0,e._zIndex=0,e.filterArea=null,e.filters=null,e._enabledFilters=null,e._bounds=new ar,e._localBounds=null,e._boundsID=0,e._boundsRect=null,e._localBoundsRect=null,e._mask=null,e._destroyed=!1,e.isSprite=!1,e.isMask=!1,e}return ur(e,t),e.mixin=function(t){for(var r=Object.keys(t),i=0;i1)for(var i=0;ithis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);Re(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(){for(var t=arguments,e=[],r=0;r1)for(var i=0;i0&&n<=e){r=this.children.splice(i,n);for(var o=0;o1&&this.children.sort(dr),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;t title : "+t.title+"
tabIndex: "+t.tabIndex},t.prototype.capHitArea=function(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0);var e=this.renderer,r=e.width,i=e.height;t.x+t.width>r&&(t.width=r-t.x),t.y+t.height>i&&(t.height=i-t.y)},t.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width=_r+"px",e.style.height=_r+"px",e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=yr.toString(),e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),e.style.pointerEvents=t.accessiblePointerEvents,e.type=t.accessibleType,t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),this.debug&&this.updateDebugHTML(e),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},t.prototype._onClick=function(t){var e=this.renderer.plugins.interaction,r=t.target.displayObject,i=e.eventData;e.dispatchEvent(r,"click",i),e.dispatchEvent(r,"pointertap",i),e.dispatchEvent(r,"tap",i)},t.prototype._onFocus=function(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction,r=t.target.displayObject,i=e.eventData;e.dispatchEvent(r,"mouseover",i)},t.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction,r=t.target.displayObject,i=e.eventData;e.dispatchEvent(r,"mouseout",i)},t.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},t.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},t.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,self.document.removeEventListener("mousemove",this._onMouseMove,!0),self.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},t}();rt.TARGET_FPMS=.06,function(t){t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY"}(t.UPDATE_PRIORITY||(t.UPDATE_PRIORITY={}));var Er=function(){function t(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=0),void 0===i&&(i=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=r,this.once=i}return t.prototype.match=function(t,e){return void 0===e&&(e=null),this.fn===t&&this.context===e},t.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},t.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},t.prototype.destroy=function(t){void 0===t&&(t=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e},t}(),Tr=function(){function e(){var t=this;this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Er(null,null,1/0),this.deltaMS=1/rt.TARGET_FPMS,this.elapsedMS=1/rt.TARGET_FPMS,this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&null===t._requestId&&t._head.next&&(t._requestId=requestAnimationFrame(t._tick)))}}return e.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},e.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},e.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},e.prototype.add=function(e,r,i){return void 0===i&&(i=t.UPDATE_PRIORITY.NORMAL),this._addListener(new Er(e,r,i))},e.prototype.addOnce=function(e,r,i){return void 0===i&&(i=t.UPDATE_PRIORITY.NORMAL),this._addListener(new Er(e,r,i,!0))},e.prototype._addListener=function(t){var e=this._head.next,r=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},e.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(e.prototype,"count",{get:function(){if(!this._head)return 0;for(var t=0,e=this._head;e=e.next;)t++;return t},enumerable:!1,configurable:!0}),e.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},e.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},e.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},e.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var r=t-this._lastFrame|0;if(r=0;l--){var c=u[l],d=this.recursiveFindHit(t,c,r,i,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(i=!1),s=!0)}}return n&&(i&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),r&&r(t,e,!!s))),s},t.prototype.findHit=function(t,e,r,i){this.recursiveFindHit(t,e,r,i,!1)},t}(),Ir={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return"pointer"===this.cursor},set buttonMode(t){t?this.cursor="pointer":"pointer"===this.cursor&&(this.cursor=null)},cursor:null,get trackedPointers(){return void 0===this._trackedPointers&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};lr.mixin(Ir);var Mr=1,Pr={target:null,data:{global:null}},wr=function(e){function r(t,r){var i=e.call(this)||this;return r=r||{},i.renderer=t,i.autoPreventDefault=void 0===r.autoPreventDefault||r.autoPreventDefault,i.interactionFrequency=r.interactionFrequency||10,i.mouse=new br,i.mouse.identifier=Mr,i.mouse.global.set(-999999),i.activeInteractionData={},i.activeInteractionData[Mr]=i.mouse,i.interactionDataPool=[],i.eventData=new Ar,i.interactionDOMElement=null,i.moveWhenInside=!1,i.eventsAdded=!1,i.tickerAdded=!1,i.mouseOverRenderer=!("PointerEvent"in self),i.supportsTouchEvents="ontouchstart"in self,i.supportsPointerEvents=!!self.PointerEvent,i.onPointerUp=i.onPointerUp.bind(i),i.processPointerUp=i.processPointerUp.bind(i),i.onPointerCancel=i.onPointerCancel.bind(i),i.processPointerCancel=i.processPointerCancel.bind(i),i.onPointerDown=i.onPointerDown.bind(i),i.processPointerDown=i.processPointerDown.bind(i),i.onPointerMove=i.onPointerMove.bind(i),i.processPointerMove=i.processPointerMove.bind(i),i.onPointerOut=i.onPointerOut.bind(i),i.processPointerOverOut=i.processPointerOverOut.bind(i),i.onPointerOver=i.onPointerOver.bind(i),i.cursorStyles={default:"inherit",pointer:"pointer"},i.currentCursorMode=null,i.cursor=null,i.resolution=1,i.delayedEvents=[],i.search=new Or,i._tempDisplayObject=new cr,i._eventListenerOptions={capture:!0,passive:!1},i._useSystemTicker=void 0===r.useSystemTicker||r.useSystemTicker,i.setTargetElement(i.renderer.view,i.renderer.resolution),i}return function(t,e){function r(){this.constructor=t}Sr(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(r,e),Object.defineProperty(r.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(t){this._useSystemTicker=t,t?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),r.prototype.hitTest=function(t,e){return Pr.target=null,Pr.data.global=t,e||(e=this.lastObjectRendered),this.processInteractive(Pr,e,null,!0),Pr.target},r.prototype.setTargetElement=function(t,e){void 0===e&&(e=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=t,this.resolution=e,this.addEvents(),this.addTickerListener()},r.prototype.addTickerListener=function(){!this.tickerAdded&&this.interactionDOMElement&&this._useSystemTicker&&(Tr.system.add(this.tickerUpdate,this,t.UPDATE_PRIORITY.INTERACTION),this.tickerAdded=!0)},r.prototype.removeTickerListener=function(){this.tickerAdded&&(Tr.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},r.prototype.addEvents=function(){if(!this.eventsAdded&&this.interactionDOMElement){var t=this.interactionDOMElement.style;self.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none"),this.supportsPointerEvents?(self.document.addEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),self.addEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),self.addEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(self.document.addEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),self.addEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},r.prototype.removeEvents=function(){if(this.eventsAdded&&this.interactionDOMElement){var t=this.interactionDOMElement.style;self.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction=""),this.supportsPointerEvents?(self.document.removeEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),self.removeEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),self.removeEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(self.document.removeEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),self.removeEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},r.prototype.tickerUpdate=function(t){this._deltaTime+=t,this._deltaTime8)throw new Error("max arguments reached");var h=this.name,u=this.items;this._aliasCount++;for(var l=0,c=u.length;l0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},t.prototype.add=function(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this},t.prototype.remove=function(t){var e=this.items.indexOf(t);return-1!==e&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this},t.prototype.contains=function(t){return-1!==this.items.indexOf(t)},t.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},t.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this.items.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),t}();Object.defineProperties(Dr.prototype,{dispatch:{value:Dr.prototype.emit},run:{value:Dr.prototype.emit}}),rt.PREFER_ENV=et.any?t.ENV.WEBGL:t.ENV.WEBGL2,rt.STRICT_TEXTURE_CACHE=!1;var Nr=[];function Cr(t,e){if(!t)return null;var r="";if("string"==typeof t){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);i&&(r=i[1].toLowerCase())}for(var n=Nr.length-1;n>=0;--n){var o=Nr[n];if(o.test&&o.test(t,r))return new o(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}var Lr=function(t,e){return(Lr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function Fr(t,e){function r(){this.constructor=t}Lr(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var Br=function(){return(Br=Object.assign||function(t){for(var e,r=arguments,i=1,n=arguments.length;i0&&l>0,n.textureCacheIds=[],n.destroyed=!1,n.resource=null,n._batchEnabled=0,n._batchLocation=0,n.parentTextureArray=null,n.setResource(r),n}return Fr(r,e),Object.defineProperty(r.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mipmap",{get:function(){return this._mipmap},set:function(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),r.prototype.setStyle=function(t,e){var r;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this},r.prototype.setSize=function(t,e,r){return r=r||this.resolution,this.setRealSize(t*r,e*r,r)},r.prototype.setRealSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(e)/this.resolution,this._refreshPOT(),this.update(),this},r.prototype._refreshPOT=function(){this.isPowerOfTwo=Se(this.realWidth)&&Se(this.realHeight)},r.prototype.setResolution=function(t){var e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=Math.round(this.width*e)/t,this.height=Math.round(this.height*e)/t,this.emit("update",this)),this._refreshPOT(),this)},r.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},r.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},r.prototype.onError=function(t){this.emit("error",this,t)},r.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Ne[this.cacheId],delete De[this.cacheId],this.cacheId=null),this.dispose(),r.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},r.prototype.dispose=function(){this.emit("dispose",this)},r.prototype.castToBaseTexture=function(){return this},r.from=function(t,e,i){void 0===i&&(i=rt.STRICT_TEXTURE_CACHE);var n="string"==typeof t,o=null;if(n)o=t;else{if(!t._pixiId){var s=e&&e.pixiIdPrefix||"pixiid";t._pixiId=s+"_"+Me()}o=t._pixiId}var a=Ne[o];if(n&&i&&!a)throw new Error('The cacheId "'+o+'" does not exist in BaseTextureCache.');return a||((a=new r(t,e)).cacheId=o,r.addToCache(a,o)),a},r.fromBuffer=function(e,i,n,o){e=e||new Float32Array(i*n*4);var s=new Gr(e,{width:i,height:n}),a=e instanceof Float32Array?t.TYPES.FLOAT:t.TYPES.UNSIGNED_BYTE;return new r(s,Object.assign(kr,o||{width:i,height:n,type:a}))},r.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),Ne[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),Ne[e]=t)},r.removeFromCache=function(t){if("string"==typeof t){var e=Ne[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete Ne[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i0){if(!e.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(e.resource,r)}else e.target=t.TARGETS.TEXTURE_CUBE_MAP_POSITIVE_X+r,e.parentTextureArray=this.baseTexture,this.items[r]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[r]=e,this},r.prototype.upload=function(t,e,i){for(var n=this.itemDirtyIds,o=0;o)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,e}(Yr),Kr=function(t){function e(r,i){var n=this;if(i=i||{},!(r instanceof HTMLVideoElement)){var o=document.createElement("video");o.setAttribute("preload","auto"),o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline",""),"string"==typeof r&&(r=[r]);var s=r[0].src||r[0];Yr.crossOrigin(o,s,i.crossorigin);for(var a=0;a0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){var t=this.source;return 3===t.readyState||4===t.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(Tr.shared.add(this.update,this),this._isConnectedToTicker=!0)},e.prototype._onPlayStop=function(){this._isConnectedToTicker&&(Tr.shared.remove(this.update,this),this._isConnectedToTicker=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isConnectedToTicker&&(Tr.shared.remove(this.update,this),this._isConnectedToTicker=!1);var e=this.source;e&&(e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(Tr.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(Tr.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(t){t!==this._updateFPS&&(this._updateFPS=t)},enumerable:!1,configurable:!0}),e.test=function(t,r){return self.HTMLVideoElement&&t instanceof HTMLVideoElement||e.TYPES.indexOf(r)>-1},e.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],e.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},e}(Yr),Zr=function(t){function e(e){return t.call(this,e)||this}return Fr(e,t),e.test=function(t){return!!self.createImageBitmap&&t instanceof ImageBitmap},e}(Yr);Nr.push(Wr,Zr,Vr,Kr,qr,Gr,zr,jr);var Qr={__proto__:null,Resource:Ur,BaseImageResource:Yr,INSTALLED:Nr,autoDetectResource:Cr,AbstractMultiResource:Hr,ArrayResource:jr,BufferResource:Gr,CanvasResource:Vr,CubeResource:zr,ImageResource:Wr,SVGResource:qr,VideoResource:Kr,ImageBitmapResource:Zr},Jr=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Fr(r,e),r.prototype.upload=function(e,r,i){var n=e.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===t.ALPHA_MODES.UNPACK);var o=r.realWidth,s=r.realHeight;return i.width===o&&i.height===s?n.texSubImage2D(r.target,0,0,0,o,s,r.format,i.type,this.data):(i.width=o,i.height=s,n.texImage2D(r.target,0,i.internalFormat,o,s,0,r.format,i.type,this.data)),!0},r}(Gr),$r=function(){function e(e,r){this.width=Math.round(e||100),this.height=Math.round(r||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Dr("disposeFramebuffer"),this.multisample=t.MSAA_QUALITY.NONE}return Object.defineProperty(e.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),e.prototype.addColorTexture=function(e,r){return void 0===e&&(e=0),this.colorTextures[e]=r||new Xr(null,{scaleMode:t.SCALE_MODES.NEAREST,resolution:1,mipmap:t.MIPMAP_MODES.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.addDepthTexture=function(e){return this.depthTexture=e||new Xr(new Jr(null,{width:this.width,height:this.height}),{scaleMode:t.SCALE_MODES.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:t.MIPMAP_MODES.OFF,format:t.FORMATS.DEPTH_COMPONENT,type:t.TYPES.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.resize=function(t,e){if(t=Math.round(t),e=Math.round(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var r=0;r-1&&e.textureCacheIds.splice(r,1),delete De[t],e}}else if(t&&t.textureCacheIds){for(var i=0;ithis.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,u="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=i&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),e.prototype.castToBaseTexture=function(){return this.baseTexture},e}(ot);function ni(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}ii.EMPTY=new ii(new Xr),ni(ii.EMPTY),ni(ii.EMPTY.baseTexture),ii.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new ii(new Xr(new Vr(t)))}(),ni(ii.WHITE),ni(ii.WHITE.baseTexture);var oi=function(t){function e(e,r){var i=t.call(this,e,r)||this;return i.valid=!0,i.filterFrame=null,i.filterPoolKey=null,i.updateUvs(),i}return Fr(e,t),Object.defineProperty(e.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(t){this.framebuffer.multisample=t},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,e,r){void 0===r&&(r=!0);var i=this.baseTexture.resolution,n=Math.round(t*i)/i,o=Math.round(e*i)/i;this.valid=n>0&&o>0,this._frame.width=this.orig.width=n,this._frame.height=this.orig.height=o,r&&this.baseTexture.resize(n,o),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){for(var r=arguments,i=[],n=1;n1?-n:-1:(o=((65535&(e=be(e)))<<16|65535&(r=be(r)))>>>0,n>1&&(o+=4294967296*n)),this.texturePool[o]||(this.texturePool[o]=[]);var s=this.texturePool[o].pop();return s||(s=this.createTexture(e,r,n)),s.filterPoolKey=o,s.setResolution(i),s},e.prototype.getFilterTexture=function(e,r,i){var n=this.getOptimalTexture(e.width,e.height,r||e.resolution,i||t.MSAA_QUALITY.NONE);return n.filterFrame=e.filterFrame,n},e.prototype.returnTexture=function(t){var e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)},e.prototype.returnFilterTexture=function(t){this.returnTexture(t)},e.prototype.clear=function(t){if(t=!1!==t)for(var e in this.texturePool){var r=this.texturePool[e];if(r)for(var i=0;i0&&t.height>0,this.texturePool)if(Number(e)<0){var r=this.texturePool[e];if(r)for(var i=0;i1){for(var u=0;u1&&((c=this.getOptimalFilterTexture(l.width,l.height,r.resolution)).filterFrame=l.filterFrame),i[d].apply(this,l,c,t.CLEAR_MODES.CLEAR,r);var f=l;l=c,c=f}i[d].apply(this,l,u.renderTexture,t.CLEAR_MODES.BLEND,r),d>1&&r.multisample>1&&this.returnFilterTexture(r.renderTexture),this.returnFilterTexture(l),this.returnFilterTexture(c)}r.clear(),this.statePool.push(r)},e.prototype.bindAndClear=function(e,r){void 0===r&&(r=t.CLEAR_MODES.CLEAR);var i=this.renderer,n=i.renderTexture,o=i.state;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e&&e.filterFrame){var s=this.tempRect;s.x=0,s.y=0,s.width=e.filterFrame.width,s.height=e.filterFrame.height,n.bind(e,e.filterFrame,s)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?n.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var a=1&o.stateId||this.forceClear;(r===t.CLEAR_MODES.CLEAR||r===t.CLEAR_MODES.BLIT&&a)&&this.renderer.framebuffer.clear(0,0,0,0)},e.prototype.applyFilter=function(e,r,i,n){var o=this.renderer;o.state.set(e.state),this.bindAndClear(i,n),e.uniforms.uSampler=r,e.uniforms.filterGlobals=this.globalUniforms,o.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(r._frame,r.filterFrame),o.geometry.bind(this.quadUv),o.geometry.draw(t.DRAW_MODES.TRIANGLES)):(o.geometry.bind(this.quad),o.geometry.draw(t.DRAW_MODES.TRIANGLE_STRIP))},e.prototype.calculateSpriteMatrix=function(t,e){var r=this.activeState,i=r.sourceFrame,n=r.destinationFrame,o=e._texture.orig,s=t.set(n.width,0,0,n.height,i.x,i.y),a=e.worldTransform.copyTo(Qe.TEMP_MATRIX);return a.invert(),s.prepend(a),s.scale(1/o.width,1/o.height),s.translate(e.anchor.x,e.anchor.y),s},e.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},e.prototype.getOptimalFilterTexture=function(e,r,i,n){return void 0===i&&(i=1),void 0===n&&(n=t.MSAA_QUALITY.NONE),this.texturePool.getOptimalTexture(e,r,i,n)},e.prototype.getFilterTexture=function(e,r,i){if("number"==typeof e){var n=e;e=r,r=n}e=e||this.activeState.renderTexture;var o=this.texturePool.getOptimalTexture(e.width,e.height,r||e.resolution,i||t.MSAA_QUALITY.NONE);return o.filterFrame=e.filterFrame,o},e.prototype.returnFilterTexture=function(t){this.texturePool.returnTexture(t)},e.prototype.emptyPool=function(){this.texturePool.clear(!0)},e.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},e.prototype.transformAABB=function(t,e){var r=Ei[0],i=Ei[1],n=Ei[2],o=Ei[3];r.set(e.left,e.top),i.set(e.left,e.bottom),n.set(e.right,e.top),o.set(e.right,e.bottom),t.apply(r,r),t.apply(i,i),t.apply(n,n),t.apply(o,o);var s=Math.min(r.x,i.x,n.x,o.x),a=Math.min(r.y,i.y,n.y,o.y),h=Math.max(r.x,i.x,n.x,o.x),u=Math.max(r.y,i.y,n.y,o.y);e.x=s,e.y=a,e.width=h-s,e.height=u-a},e.prototype.roundFrame=function(t,e,r,i,n){if(n){var o=n.a,s=n.b,a=n.c,h=n.d;if((Math.abs(s)>1e-4||Math.abs(a)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(h)>1e-4))return}(n=n?Ti.copyFrom(n):Ti.identity()).translate(-r.x,-r.y).scale(i.width/r.width,i.height/r.height).translate(i.x,i.y),this.transformAABB(n,t),t.ceil(e),this.transformAABB(n.invert(),t)},e}(),bi=function(){function t(t){this.renderer=t}return t.prototype.flush=function(){},t.prototype.destroy=function(){this.renderer=null},t.prototype.start=function(){},t.prototype.stop=function(){this.flush()},t.prototype.render=function(t){},t}(),Si=function(){function t(t){this.renderer=t,this.emptyRenderer=new bi(t),this.currentRenderer=this.emptyRenderer}return t.prototype.setObjectRenderer=function(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())},t.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},t.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},t.prototype.copyBoundTextures=function(t,e){for(var r=this.renderer.texture.boundTextures,i=e-1;i>=0;--i)t[i]=r[i]||null,t[i]&&(t[i]._batchLocation=i)},t.prototype.boundArray=function(t,e,r,i){for(var n=t.elements,o=t.ids,s=t.count,a=0,h=0;h=0&&l=t.ENV.WEBGL2&&(i=e.getContext("webgl2",r)),i)this.webGLVersion=2;else if(this.webGLVersion=1,!(i=e.getContext("webgl",r)||e.getContext("experimental-webgl",r)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl},e.prototype.getExtensions=function(){var t=this.gl,e={anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};1===this.webGLVersion?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,e,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;this.renderer=null,t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},e.prototype.validateContext=function(t){var e=t.getContextAttributes(),r="WebGL2RenderingContext"in self&&t instanceof self.WebGL2RenderingContext;r&&(this.webGLVersion=2),e.stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var i=r||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=i,i||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},e}(),Oi=function(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=t.MSAA_QUALITY.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},Ii=new Ye,Mi=function(){function e(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new $r(10,10),this.msaaSamples=null}return e.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Ye,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var r=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;rt.PREFER_ENV===t.ENV.WEBGL_LEGACY&&(r=null,i=null),r?e.drawBuffers=function(t){return r.drawBuffersWEBGL(t)}:(this.hasMRT=!1,e.drawBuffers=function(){}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)},e.prototype.bind=function(t,e,r){void 0===r&&(r=0);var i=this.gl;if(t){var n=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,n.framebuffer)),n.mipLevel!==r&&(t.dirtyId++,t.dirtyFormat++,n.mipLevel=r),n.dirtyId!==t.dirtyId&&(n.dirtyId=t.dirtyId,n.dirtyFormat!==t.dirtyFormat?(n.dirtyFormat=t.dirtyFormat,n.dirtySize=t.dirtySize,this.updateFramebuffer(t,r)):n.dirtySize!==t.dirtySize&&(n.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var o=0;o>r,h=e.height>>r,u=a/e.width;this.setViewport(e.x*u,e.y*u,a,h)}else a=t.width>>r,h=t.height>>r,this.setViewport(0,0,a,h)}else this.current&&(this.current=null,i.bindFramebuffer(i.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},e.prototype.setViewport=function(t,e,r,i){var n=this.viewport;t=Math.round(t),e=Math.round(e),r=Math.round(r),i=Math.round(i),n.width===r&&n.height===i&&n.x===t&&n.y===e||(n.x=t,n.y=e,n.width=r,n.height=i,this.gl.viewport(t,e,r,i))},Object.defineProperty(e.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),e.prototype.clear=function(e,r,i,n,o){void 0===o&&(o=t.BUFFER_BITS.COLOR|t.BUFFER_BITS.DEPTH);var s=this.gl;s.clearColor(e,r,i,n),s.clear(o)},e.prototype.initFramebuffer=function(t){var e=this.gl,r=new Oi(e.createFramebuffer());return r.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=r,this.managedFramebuffers.push(t),t.disposeRunner.add(this),r},e.prototype.resizeFramebuffer=function(t){var e=this.gl,r=t.glFramebuffers[this.CONTEXT_UID];r.msaaBuffer&&(e.bindRenderbuffer(e.RENDERBUFFER,r.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,r.multisample,e.RGBA8,t.width,t.height)),r.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),r.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,r.multisample,e.DEPTH24_STENCIL8,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height));var i=t.colorTextures,n=i.length;e.drawBuffers||(n=Math.min(n,1));for(var o=0;o1&&this.canMultisampleFramebuffer(t)?(i.msaaBuffer=i.msaaBuffer||r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,i.msaaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,r.RGBA8,t.width,t.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,i.msaaBuffer)):i.msaaBuffer&&(r.deleteRenderbuffer(i.msaaBuffer),i.msaaBuffer=null);for(var s=[],a=0;a1&&r.drawBuffers(s),t.depthTexture&&this.writeDepthTexture){var l=t.depthTexture;this.renderer.texture.bind(l,0),r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,l._glTextures[this.CONTEXT_UID].texture,e)}!t.stencil&&!t.depth||t.depthTexture&&this.writeDepthTexture?i.stencil&&(r.deleteRenderbuffer(i.stencil),i.stencil=null):(i.stencil=i.stencil||r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,i.stencil),i.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,r.DEPTH24_STENCIL8,t.width,t.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t.width,t.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,i.stencil))},e.prototype.canMultisampleFramebuffer=function(t){return 1!==this.renderer.context.webGLVersion&&t.colorTextures.length<=1&&!t.depthTexture},e.prototype.detectSamples=function(e){var r=this.msaaSamples,i=t.MSAA_QUALITY.NONE;if(e<=1||null===r)return i;for(var n=0;n=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.msaaBuffer&&i.deleteRenderbuffer(r.msaaBuffer),r.stencil&&i.deleteRenderbuffer(r.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r=t.ENV.WEBGL2&&(r=e.getContext("webgl2",{})),r||((r=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}))?r.getExtension("WEBGL_draw_buffers"):r=null),Gi=r}return Gi}function Xi(e,r,i){if("precision"!==e.substring(0,9)){var n=r;return r===t.PRECISION.HIGH&&i!==t.PRECISION.HIGH&&(n=t.PRECISION.MEDIUM),"precision "+n+" float;\n"+e}return i!==t.PRECISION.HIGH&&"precision highp"===e.substring(0,15)?e.replace("precision highp","precision mediump"):e}var Hi={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function ji(t){return Hi[t]}var Yi=null,Vi={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function zi(t,e){if(!Yi){var r=Object.keys(Vi);Yi={};for(var i=0;i0&&(e+="\nelse "),r0?this._useCurrent():t.disable(t.SCISSOR_TEST)},e.prototype._useCurrent=function(){var t=this.maskStack[this.maskStack.length-1]._scissorRect,e=this.renderer.renderTexture.current,r=this.renderer.projection,i=r.transform,n=r.sourceFrame,o=r.destinationFrame,s=e?e.resolution:this.renderer.resolution,a=o.width/n.width,h=o.height/n.height,u=((t.x-n.x)*a+o.x)*s,l=((t.y-n.y)*h+o.y)*s,c=t.width*a*s,d=t.height*h*s;i&&(u+=i.tx*s,l+=i.ty*s),e||(l=this.renderer.height-d-l),u=Math.round(u),l=Math.round(l),c=Math.round(c),d=Math.round(d),this.renderer.gl.scissor(u,l,c,d)},e}(fn),_n=function(t){function e(e){var r=t.call(this,e)||this;return r.glConst=WebGLRenderingContext.STENCIL_TEST,r}return Fr(e,t),e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0},e.prototype.push=function(t){var e=t.maskObject,r=this.renderer.gl,i=t._stencilCounter;0===i&&(this.renderer.framebuffer.forceStencil(),r.enable(r.STENCIL_TEST)),t._stencilCounter++,r.colorMask(!1,!1,!1,!1),r.stencilFunc(r.EQUAL,i,this._getBitwiseMask()),r.stencilOp(r.KEEP,r.KEEP,r.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,this._useCurrent()},e.prototype.pop=function(t){var e=this.renderer.gl;0===this.getStackLength()?(e.disable(e.STENCIL_TEST),e.clear(e.STENCIL_BUFFER_BIT),e.clearStencil(0)):(e.colorMask(!1,!1,!1,!1),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,this._useCurrent())},e.prototype._useCurrent=function(){var t=this.renderer.gl;t.colorMask(!0,!0,!0,!0),t.stencilFunc(t.EQUAL,this.getStackLength(),this._getBitwiseMask()),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)},e.prototype._getBitwiseMask=function(){return(1<1&&(r=Math.max(r,16)*s.data.size),s.dataLen=r,i%r!=0&&i<16){var a=i%r%16;i+=a,n+=a}i+r>16?(n=16*Math.ceil(n/16),s.offset=n,n+=r,i=r):(s.offset=n,i+=r,n+=r)}return{uboElements:e,size:n=16*Math.ceil(n/16)}}function Sn(t,e){var r=[];for(var i in t)e[i]&&r.push(e[i]);return r.sort(function(t,e){return t.index-e.index}),r}function An(t,e){if(!t.autoManage)return{size:0,syncFunc:En};for(var r=bn(Sn(t.uniforms,e)),i=r.uboElements,n=r.size,o=["\n var v = null;\n var v2 = null;\n var cv = null;\n var t = 0;\n var gl = renderer.gl\n var index = 0;\n var data = buffer.data;\n "],s=0;s1){var f=ji(a.data.type),p=Math.max(xn[a.data.type]/16,1),_=f/p,m=(4-_%4)%4;o.push("\n cv = ud."+u+".value;\n v = uv."+u+";\n offset = "+a.offset/4+";\n\n t = 0;\n\n for(var i=0; i < "+a.data.size*p+"; i++)\n {\n for(var j = 0; j < "+_+"; j++)\n {\n data[offset++] = v[t++];\n }\n offset += "+m+";\n }\n\n ")}else{var v=Tn[a.data.type];o.push("\n cv = ud."+u+".value;\n v = uv."+u+";\n offset = "+a.offset/4+";\n "+v+";\n ")}}return o.push("\n renderer.buffer.update(buffer);\n "),{size:n,syncFunc:new Function("ud","uv","renderer","syncData","buffer",o.join("\n"))}}var Rn=function(){},On=function(){function t(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return t.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},t}();function In(t,e){var r=Ni(t,t.VERTEX_SHADER,e.vertexSrc),i=Ni(t,t.FRAGMENT_SHADER,e.fragmentSrc),n=t.createProgram();t.attachShader(n,r),t.attachShader(n,i),t.linkProgram(n),t.getProgramParameter(n,t.LINK_STATUS)||function(t,e,r,i){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(r,t.COMPILE_STATUS)||Ci(t,r),t.getShaderParameter(i,t.COMPILE_STATUS)||Ci(t,i),console.error("PixiJS Error: Could not initialize shader."),""!==t.getProgramInfoLog(e)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}(t,n,r,i),e.attributeData=function(t,e){for(var r={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),n=0;ne?1:-1});for(var s=0;s>=1,r++;this.stateId=t.data}for(r=0;rthis.checkCountMax&&(this.checkCount=0,this.run())))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,i=0;ithis.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){var o=0;for(i=0;i=0;i--)this.unload(t.children[i])},e.prototype.destroy=function(){this.renderer=null},e}(),kn=function(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=t.TYPES.UNSIGNED_BYTE,this.internalFormat=t.FORMATS.RGBA,this.samplerType=0},Xn=function(){function e(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new Xr,this.hasIntegerTextures=!1}return e.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=function(e){var r,i,n,o,s,a,h,u,l,c,d,f,p,_,m,v,y,g,E,T,x,b,S;return"WebGL2RenderingContext"in self&&e instanceof self.WebGL2RenderingContext?((r={})[t.TYPES.UNSIGNED_BYTE]=((i={})[t.FORMATS.RGBA]=e.RGBA8,i[t.FORMATS.RGB]=e.RGB8,i[t.FORMATS.RG]=e.RG8,i[t.FORMATS.RED]=e.R8,i[t.FORMATS.RGBA_INTEGER]=e.RGBA8UI,i[t.FORMATS.RGB_INTEGER]=e.RGB8UI,i[t.FORMATS.RG_INTEGER]=e.RG8UI,i[t.FORMATS.RED_INTEGER]=e.R8UI,i[t.FORMATS.ALPHA]=e.ALPHA,i[t.FORMATS.LUMINANCE]=e.LUMINANCE,i[t.FORMATS.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,i),r[t.TYPES.BYTE]=((n={})[t.FORMATS.RGBA]=e.RGBA8_SNORM,n[t.FORMATS.RGB]=e.RGB8_SNORM,n[t.FORMATS.RG]=e.RG8_SNORM,n[t.FORMATS.RED]=e.R8_SNORM,n[t.FORMATS.RGBA_INTEGER]=e.RGBA8I,n[t.FORMATS.RGB_INTEGER]=e.RGB8I,n[t.FORMATS.RG_INTEGER]=e.RG8I,n[t.FORMATS.RED_INTEGER]=e.R8I,n),r[t.TYPES.UNSIGNED_SHORT]=((o={})[t.FORMATS.RGBA_INTEGER]=e.RGBA16UI,o[t.FORMATS.RGB_INTEGER]=e.RGB16UI,o[t.FORMATS.RG_INTEGER]=e.RG16UI,o[t.FORMATS.RED_INTEGER]=e.R16UI,o[t.FORMATS.DEPTH_COMPONENT]=e.DEPTH_COMPONENT16,o),r[t.TYPES.SHORT]=((s={})[t.FORMATS.RGBA_INTEGER]=e.RGBA16I,s[t.FORMATS.RGB_INTEGER]=e.RGB16I,s[t.FORMATS.RG_INTEGER]=e.RG16I,s[t.FORMATS.RED_INTEGER]=e.R16I,s),r[t.TYPES.UNSIGNED_INT]=((a={})[t.FORMATS.RGBA_INTEGER]=e.RGBA32UI,a[t.FORMATS.RGB_INTEGER]=e.RGB32UI,a[t.FORMATS.RG_INTEGER]=e.RG32UI,a[t.FORMATS.RED_INTEGER]=e.R32UI,a[t.FORMATS.DEPTH_COMPONENT]=e.DEPTH_COMPONENT24,a),r[t.TYPES.INT]=((h={})[t.FORMATS.RGBA_INTEGER]=e.RGBA32I,h[t.FORMATS.RGB_INTEGER]=e.RGB32I,h[t.FORMATS.RG_INTEGER]=e.RG32I,h[t.FORMATS.RED_INTEGER]=e.R32I,h),r[t.TYPES.FLOAT]=((u={})[t.FORMATS.RGBA]=e.RGBA32F,u[t.FORMATS.RGB]=e.RGB32F,u[t.FORMATS.RG]=e.RG32F,u[t.FORMATS.RED]=e.R32F,u[t.FORMATS.DEPTH_COMPONENT]=e.DEPTH_COMPONENT32F,u),r[t.TYPES.HALF_FLOAT]=((l={})[t.FORMATS.RGBA]=e.RGBA16F,l[t.FORMATS.RGB]=e.RGB16F,l[t.FORMATS.RG]=e.RG16F,l[t.FORMATS.RED]=e.R16F,l),r[t.TYPES.UNSIGNED_SHORT_5_6_5]=((c={})[t.FORMATS.RGB]=e.RGB565,c),r[t.TYPES.UNSIGNED_SHORT_4_4_4_4]=((d={})[t.FORMATS.RGBA]=e.RGBA4,d),r[t.TYPES.UNSIGNED_SHORT_5_5_5_1]=((f={})[t.FORMATS.RGBA]=e.RGB5_A1,f),r[t.TYPES.UNSIGNED_INT_2_10_10_10_REV]=((p={})[t.FORMATS.RGBA]=e.RGB10_A2,p[t.FORMATS.RGBA_INTEGER]=e.RGB10_A2UI,p),r[t.TYPES.UNSIGNED_INT_10F_11F_11F_REV]=((_={})[t.FORMATS.RGB]=e.R11F_G11F_B10F,_),r[t.TYPES.UNSIGNED_INT_5_9_9_9_REV]=((m={})[t.FORMATS.RGB]=e.RGB9_E5,m),r[t.TYPES.UNSIGNED_INT_24_8]=((v={})[t.FORMATS.DEPTH_STENCIL]=e.DEPTH24_STENCIL8,v),r[t.TYPES.FLOAT_32_UNSIGNED_INT_24_8_REV]=((y={})[t.FORMATS.DEPTH_STENCIL]=e.DEPTH32F_STENCIL8,y),S=r):((g={})[t.TYPES.UNSIGNED_BYTE]=((E={})[t.FORMATS.RGBA]=e.RGBA,E[t.FORMATS.RGB]=e.RGB,E[t.FORMATS.ALPHA]=e.ALPHA,E[t.FORMATS.LUMINANCE]=e.LUMINANCE,E[t.FORMATS.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,E),g[t.TYPES.UNSIGNED_SHORT_5_6_5]=((T={})[t.FORMATS.RGB]=e.RGB,T),g[t.TYPES.UNSIGNED_SHORT_4_4_4_4]=((x={})[t.FORMATS.RGBA]=e.RGBA,x),g[t.TYPES.UNSIGNED_SHORT_5_5_5_1]=((b={})[t.FORMATS.RGBA]=e.RGBA,b),S=g),S}(e);var r=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=r;for(var i=0;i=0;--o){var s=r[o];s&&s._glTextures[n].samplerType!==t.SAMPLER_TYPES.FLOAT&&this.renderer.texture.unbind(s)}},e.prototype.initTexture=function(t){var e=new kn(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e},e.prototype.initTextureType=function(e,r){var i,n;r.internalFormat=null!==(n=null===(i=this.internalFormats[e.type])||void 0===i?void 0:i[e.format])&&void 0!==n?n:e.format,2===this.webGLVersion&&e.type===t.TYPES.HALF_FLOAT?r.type=this.gl.HALF_FLOAT:r.type=e.type},e.prototype.updateTexture=function(e){var r=e._glTextures[this.CONTEXT_UID];if(r){var i=this.renderer;if(this.initTextureType(e,r),e.resource&&e.resource.upload(i,e,r))r.samplerType!==t.SAMPLER_TYPES.FLOAT&&(this.hasIntegerTextures=!0);else{var n=e.realWidth,o=e.realHeight,s=i.gl;(r.width!==n||r.height!==o||r.dirtyId<0)&&(r.width=n,r.height=o,s.texImage2D(e.target,0,r.internalFormat,n,o,0,e.format,r.type,null))}e.dirtyStyleId!==r.dirtyStyleId&&this.updateTextureStyle(e),r.dirtyId=e.dirtyId}},e.prototype.destroyTexture=function(t,e){var r=this.gl;if((t=t.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(t),r.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){var i=this.managedTextures.indexOf(t);-1!==i&&Re(this.managedTextures,i,1)}},e.prototype.updateTextureStyle=function(e){var r=e._glTextures[this.CONTEXT_UID];r&&(e.mipmap!==t.MIPMAP_MODES.POW2&&2===this.webGLVersion||e.isPowerOfTwo?r.mipmap=e.mipmap>=1:r.mipmap=!1,2===this.webGLVersion||e.isPowerOfTwo?r.wrapMode=e.wrapMode:r.wrapMode=t.WRAP_MODES.CLAMP,e.resource&&e.resource.style(this.renderer,e,r)||this.setStyle(e,r),r.dirtyStyleId=e.dirtyStyleId)},e.prototype.setStyle=function(e,r){var i=this.gl;if(r.mipmap&&e.mipmap!==t.MIPMAP_MODES.ON_MANUAL&&i.generateMipmap(e.target),i.texParameteri(e.target,i.TEXTURE_WRAP_S,r.wrapMode),i.texParameteri(e.target,i.TEXTURE_WRAP_T,r.wrapMode),r.mipmap){i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===t.SCALE_MODES.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===t.SCALE_MODES.LINEAR){var o=Math.min(e.anisotropicLevel,i.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(e.target,n.TEXTURE_MAX_ANISOTROPY_EXT,o)}}else i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===t.SCALE_MODES.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(e.target,i.TEXTURE_MAG_FILTER,e.scaleMode===t.SCALE_MODES.LINEAR?i.LINEAR:i.NEAREST)},e.prototype.destroy=function(){this.renderer=null},e}(),Hn={__proto__:null,FilterSystem:xi,BatchSystem:Si,ContextSystem:Ri,FramebufferSystem:Mi,GeometrySystem:wi,MaskSystem:dn,ScissorSystem:pn,StencilSystem:_n,ProjectionSystem:mn,RenderTextureSystem:gn,ShaderSystem:wn,StateSystem:Un,TextureGCSystem:Gn,TextureSystem:Xn},jn=new Qe,Yn=function(e){function r(r,i){void 0===r&&(r=t.RENDERER_TYPE.UNKNOWN);var n=e.call(this)||this;return i=Object.assign({},rt.RENDER_OPTIONS,i),n.options=i,n.type=r,n.screen=new Ye(0,0,i.width,i.height),n.view=i.view||document.createElement("canvas"),n.resolution=i.resolution||rt.RESOLUTION,n.useContextAlpha=i.useContextAlpha,n.autoDensity=!!i.autoDensity,n.preserveDrawingBuffer=i.preserveDrawingBuffer,n.clearBeforeRender=i.clearBeforeRender,n._backgroundColor=0,n._backgroundColorRgba=[0,0,0,1],n._backgroundColorString="#000000",n.backgroundColor=i.backgroundColor||n._backgroundColor,n.backgroundAlpha=i.backgroundAlpha,void 0!==i.transparent&&(n.useContextAlpha=i.transparent,n.backgroundAlpha=i.transparent?0:1),n._lastObjectRendered=null,n.plugins={},n}return Fr(r,e),r.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},Object.defineProperty(r.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),r.prototype.resize=function(t,e){this.view.width=Math.round(t*this.resolution),this.view.height=Math.round(e*this.resolution);var r=this.view.width/this.resolution,i=this.view.height/this.resolution;this.screen.width=r,this.screen.height=i,this.autoDensity&&(this.view.style.width=r+"px",this.view.style.height=i+"px"),this.emit("resize",r,i)},r.prototype.generateTexture=function(t,e,r,i){void 0===e&&(e={}),"number"==typeof e&&(e={scaleMode:e,resolution:r,region:i});var n=e.region,o=function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n=t.data.byteLength)e.bufferSubData(t.type,0,t.data);else{var n=t.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;i.byteLength=t.data.byteLength,e.bufferData(t.type,t.data,n)}},t.prototype.dispose=function(t,e){if(this.managedBuffers[t.id]){delete this.managedBuffers[t.id];var r=t._glBuffers[this.CONTEXT_UID],i=this.gl;t.disposeRunner.remove(this),r&&(e||i.deleteBuffer(r.buffer),delete t._glBuffers[this.CONTEXT_UID])}},t.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedBuffers),r=0;r=t.MSAA_QUALITY.HIGH?this.multisample=t.MSAA_QUALITY.HIGH:e>=t.MSAA_QUALITY.MEDIUM?this.multisample=t.MSAA_QUALITY.MEDIUM:e>=t.MSAA_QUALITY.LOW?this.multisample=t.MSAA_QUALITY.LOW:this.multisample=t.MSAA_QUALITY.NONE},r.prototype.addSystem=function(t,e){var r=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var i in this[e]=r,this.runners)this.runners[i].add(r);return this},r.prototype.render=function(t,e){var r,i,n,o;if(e&&(e instanceof oi?(r=e,i=arguments[2],n=arguments[3],o=arguments[4]):(r=e.renderTexture,i=e.clear,n=e.transform,o=e.skipUpdateTransform)),this.renderingToScreen=!r,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=n,!this.context.isLost){if(r||(this._lastObjectRendered=t),!o){var s=t.enableTempParent();t.updateTransform(),t.disableTempParent(s)}this.renderTexture.bind(r),this.batch.currentRenderer.start(),(void 0!==i?i:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),r&&r.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},r.prototype.generateTexture=function(t,r,i,n){void 0===r&&(r={});var o=e.prototype.generateTexture.call(this,t,r,i,n);return this.framebuffer.blit(),o},r.prototype.resize=function(t,r){e.prototype.resize.call(this,t,r),this.runners.resize.emit(this.screen.height,this.screen.width)},r.prototype.reset=function(){return this.runners.reset.emit(),this},r.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},r.prototype.destroy=function(t){for(var r in this.runners.destroy.emit(),this.runners)this.runners[r].destroy();e.prototype.destroy.call(this,t),this.gl=null},Object.defineProperty(r.prototype,"extract",{get:function(){return this.plugins.extract},enumerable:!1,configurable:!0}),r.registerPlugin=function(t,e){r.__plugins=r.__plugins||{},r.__plugins[t]=e},r}(Yn);function qn(t){return Wn.create(t)}var Kn="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",Zn="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",Qn=function(){function t(t){this.renderer=t}return t.prototype.destroy=function(){this.renderer=null},t}(),Jn=function(){this.texArray=null,this.blend=0,this.type=t.DRAW_MODES.TRIANGLES,this.start=0,this.size=0,this.data=null},$n=function(){function t(){this.elements=[],this.ids=[],this.count=0}return t.prototype.clear=function(){for(var t=0;tthis.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)},r.prototype.buildTexturesAndDrawCalls=function(){var t=this._bufferedTextures,e=this.MAX_TEXTURES,i=r._textureArrayPool,n=this.renderer.batch,o=this._tempBoundTextures,s=this.renderer.textureGC.count,a=++Xr._globalBatch,h=0,u=i[0],l=0;n.copyBoundTextures(o,e);for(var c=0;c=e&&(n.boundArray(u,o,a,e),this.buildDrawCalls(u,l,c),l=c,u=i[++h],++a),d._batchEnabled=a,d.touched=s,u.elements[u.count++]=d)}for(u.count>0&&(n.boundArray(u,o,a,e),this.buildDrawCalls(u,l,this._bufferSize),++h,++a),c=0;c0&&(e+="\nelse "),r0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2==(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(self.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(self.origin!==self.location.origin)return"anonymous";e=e||self.location,bo||(bo=document.createElement("a")),bo.href=t;var r=To(bo.href,{strictMode:!0}),i=!r.port&&""===e.port||r.port===e.port,n=r.protocol?r.protocol+":":"";return r.host===e.hostname&&i&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(t){void 0===t&&(t=this.url);var e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},t}(),function(t){!function(t){t[t.NONE=0]="NONE",t[t.DATA_URL=1]="DATA_URL",t[t.COMPLETE=2]="COMPLETE",t[t.LOADING=4]="LOADING"}(t.STATUS_FLAGS||(t.STATUS_FLAGS={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.JSON=1]="JSON",t[t.XML=2]="XML",t[t.IMAGE=3]="IMAGE",t[t.AUDIO=4]="AUDIO",t[t.VIDEO=5]="VIDEO",t[t.TEXT=6]="TEXT"}(t.TYPE||(t.TYPE={})),function(t){t[t.XHR=1]="XHR",t[t.IMAGE=2]="IMAGE",t[t.AUDIO=3]="AUDIO",t[t.VIDEO=4]="VIDEO"}(t.LOAD_TYPE||(t.LOAD_TYPE={})),function(t){t.DEFAULT="text",t.BUFFER="arraybuffer",t.BLOB="blob",t.DOCUMENT="document",t.JSON="json",t.TEXT="text"}(t.XHR_RESPONSE_TYPE||(t.XHR_RESPONSE_TYPE={})),t._loadTypeMap={gif:t.LOAD_TYPE.IMAGE,png:t.LOAD_TYPE.IMAGE,bmp:t.LOAD_TYPE.IMAGE,jpg:t.LOAD_TYPE.IMAGE,jpeg:t.LOAD_TYPE.IMAGE,tif:t.LOAD_TYPE.IMAGE,tiff:t.LOAD_TYPE.IMAGE,webp:t.LOAD_TYPE.IMAGE,tga:t.LOAD_TYPE.IMAGE,svg:t.LOAD_TYPE.IMAGE,"svg+xml":t.LOAD_TYPE.IMAGE,mp3:t.LOAD_TYPE.AUDIO,ogg:t.LOAD_TYPE.AUDIO,wav:t.LOAD_TYPE.AUDIO,mp4:t.LOAD_TYPE.VIDEO,webm:t.LOAD_TYPE.VIDEO},t._xhrTypeMap={xhtml:t.XHR_RESPONSE_TYPE.DOCUMENT,html:t.XHR_RESPONSE_TYPE.DOCUMENT,htm:t.XHR_RESPONSE_TYPE.DOCUMENT,xml:t.XHR_RESPONSE_TYPE.DOCUMENT,tmx:t.XHR_RESPONSE_TYPE.DOCUMENT,svg:t.XHR_RESPONSE_TYPE.DOCUMENT,tsx:t.XHR_RESPONSE_TYPE.DOCUMENT,gif:t.XHR_RESPONSE_TYPE.BLOB,png:t.XHR_RESPONSE_TYPE.BLOB,bmp:t.XHR_RESPONSE_TYPE.BLOB,jpg:t.XHR_RESPONSE_TYPE.BLOB,jpeg:t.XHR_RESPONSE_TYPE.BLOB,tif:t.XHR_RESPONSE_TYPE.BLOB,tiff:t.XHR_RESPONSE_TYPE.BLOB,webp:t.XHR_RESPONSE_TYPE.BLOB,tga:t.XHR_RESPONSE_TYPE.BLOB,json:t.XHR_RESPONSE_TYPE.JSON,text:t.XHR_RESPONSE_TYPE.TEXT,txt:t.XHR_RESPONSE_TYPE.TEXT,ttf:t.XHR_RESPONSE_TYPE.BUFFER,otf:t.XHR_RESPONSE_TYPE.BUFFER},t.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="}(t.LoaderResource||(t.LoaderResource={}));var Mo=function(t,e){this.data=t,this.callback=e},Po=function(){function t(t,e){var r=this;if(void 0===e&&(e=1),this.workers=0,this.saturated=Oo,this.unsaturated=Oo,this.empty=Oo,this.drain=Oo,this.error=Oo,this.started=!1,this.paused=!1,this._tasks=[],this._insert=function(t,e,i){if(i&&"function"!=typeof i)throw new Error("task callback must be a function");if(r.started=!0,null==t&&r.idle())setTimeout(function(){return r.drain()},1);else{var n=new Mo(t,"function"==typeof i?i:Oo);e?r._tasks.unshift(n):r._tasks.push(n),setTimeout(r.process,1)}},this.process=function(){for(;!r.paused&&r.workers>2,n[1]=(3&i[0])<<4|i[1]>>4,n[2]=(15&i[1])<<2|i[2]>>6,n[3]=63&i[2],r-(t.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(o=0;o0&&n[n.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]=33776&&t<=33779)return"s3tc";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(t>=36196)return"etc1";if(t>=35986&&t<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")},e._createLevelBuffers=function(t,e,r,i,n,o,s){for(var a=new Array(r),h=t.byteOffset,u=o,l=s,c=u+i-1&~(i-1),d=l+n-1&~(n-1),f=c*d*Bo[e],p=0;p1?u:c,levelHeight:r>1?l:d,levelBuffer:new Uint8Array(t.buffer,h,f)},h+=f,f=(c=(u=u>>1||1)+i-1&~(i-1))*(d=(l=l>>1||1)+n-1&~(n-1))*Bo[e];return a},e}(Ho),Yo=function(){function e(){}return e.use=function(r,i){var n=r.data;if(r.type===t.LoaderResource.TYPE.JSON&&n&&n.cacheID&&n.textures){for(var o=n.textures,s=void 0,a=void 0,h=0,u=o.length;h>>=1,T>>>=1;var b=148;for(x=0;x<_;x++)v.push(new Uint8Array(t,b,g)),b+=g}return v.map(function(t){return new jo(t,{format:m,width:n,height:i,levels:o})})}if(64&a)throw new Error("DDSLoader does not support uncompressed texture data.");if(512&a)throw new Error("DDSLoader does not supported YUV uncompressed texture data.");if(131072&a)throw new Error("DDSLoader does not support single-channel (lumninance) texture data!");if(2&a)throw new Error("DDSLoader does not support single-channel (alpha) texture data!");throw new Error("DDSLoader failed to load a texture file due to an unknown reason!")},t}();t.LoaderResource.setExtensionXhrType("ktx",t.LoaderResource.XHR_RESPONSE_TYPE.BUFFER);var ts=[171,75,84,88,32,49,49,187,13,10,26,10],es=((qo={})[t.TYPES.UNSIGNED_BYTE]=1,qo[t.TYPES.UNSIGNED_SHORT]=2,qo[t.TYPES.FLOAT]=4,qo[t.TYPES.HALF_FLOAT]=8,qo),rs=((Ko={})[t.FORMATS.RGBA]=4,Ko[t.FORMATS.RGB]=3,Ko[t.FORMATS.LUMINANCE]=1,Ko[t.FORMATS.LUMINANCE_ALPHA]=2,Ko[t.FORMATS.ALPHA]=1,Ko),is=((Zo={})[t.TYPES.UNSIGNED_SHORT_4_4_4_4]=2,Zo[t.TYPES.UNSIGNED_SHORT_5_5_5_1]=2,Zo[t.TYPES.UNSIGNED_SHORT_5_6_5]=2,Zo),ns=function(){function t(){}return t.use=function(e,r){if("ktx"===e.extension&&e.data)try{var i=e.name||e.url;Object.assign(e,Vo(i,t.parse(i,e.data),e.metadata))}catch(t){return void r(t)}r()},t.parse=function(e,r){var i=new DataView(r);if(!t.validate(e,i))return null;var n=67305985===i.getUint32(12,!0),o=i.getUint32(16,n),s=i.getUint32(24,n),a=i.getUint32(28,n),h=i.getUint32(36,n),u=i.getUint32(40,n)||1,l=i.getUint32(44,n)||1,c=i.getUint32(48,n)||1,d=i.getUint32(52,n),f=i.getUint32(56,n),p=i.getUint32(60,n);if(0===u||1!==l)throw new Error("Only 2D textures are supported");if(1!==d)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(1!==c)throw new Error("WebGL does not support array textures");var _,m=h+3&-4,v=u+3&-4,y=new Array(c),g=h*u;if(0===o&&(g=m*v),void 0===(_=0!==o?es[o]?es[o]*rs[s]:is[o]:Bo[a]))throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");for(var E=g*_,T=h,x=u,b=m,S=v,A=64+p,R=0;R1?T:b,levelHeight:f>1?x:S,levelBuffer:new Uint8Array(r,I,E)},I+=E}A=(A+=O+4)%4!=0?A+4-A%4:A,E=(b=(T=T>>1||1)+4-1&-4)*(S=(x=x>>1||1)+4-1&-4)*_}if(0!==o)throw new Error("TODO: Uncompressed");return y.map(function(t){return new jo(null,{format:a,width:h,height:u,levels:f,levelBuffers:t})})},t.validate=function(t,e){for(var r=0;r16384&&(n=16384),s._properties=[!1,!0,!1,!1,!1],s._maxSize=r,s._batchSize=n,s._buffers=null,s._bufferUpdateIDs=[],s._updateID=0,s.interactiveChildren=!1,s.blendMode=t.BLEND_MODES.NORMAL,s.autoResize=o,s.roundPixels=!0,s.baseTexture=null,s.setProperties(i),s._tint=0,s.tintRgb=new Float32Array(4),s.tint=16777215,s}return ss(r,e),r.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},r.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(r.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,ce(t,this.tintRgb)},enumerable:!1,configurable:!0}),r.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},r.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthr&&!t.autoResize&&(o=r);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.state.blendMode=me(t.blendMode,a.alphaMode),n.state.set(this.state);var h=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=ve(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.alphaMode),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;ci&&(f=i),d>=s.length&&s.push(this._generateOneMoreBuffer(t));var p=s[d];p.uploadDynamic(e,c,f);var _=t._bufferUpdateIDs[d]||0;(l=l||p._updateID<_)&&(p._updateID=t._updateID,p.uploadStatic(e,c,f)),n.geometry.bind(p.geometry),h.drawElements(h.TRIANGLES,6*f,h.UNSIGNED_SHORT,0)}}},r.prototype.generateBuffers=function(t){for(var e=[],r=t._maxSize,i=t._batchSize,n=t._properties,o=0;o0,u=a.alpha,l=u<1&&h?ye(a._tintRGB,u):a._tintRGB+(255*u<<24);i[o]=l,i[o+n]=l,i[o+2*n]=l,i[o+3*n]=l,o+=4*n}},r.prototype.destroy=function(){e.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},r}(bi);!function(t){t.MITER="miter",t.BEVEL="bevel",t.ROUND="round"}(t.LINE_JOIN||(t.LINE_JOIN={})),function(t){t.BUTT="butt",t.ROUND="round",t.SQUARE="square"}(t.LINE_CAP||(t.LINE_CAP={}));var ds={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(t,e){if(void 0===e&&(e=20),!this.adaptive||!t||isNaN(t))return e;var r=Math.ceil(t/this.maxLength);return rthis.maxSegments&&(r=this.maxSegments),r}},fs=function(){function t(){this.color=16777215,this.alpha=1,this.texture=ii.WHITE,this.matrix=null,this.visible=!1,this.reset()}return t.prototype.clone=function(){var e=new t;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e},t.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=ii.WHITE,this.matrix=null,this.visible=!1},t.prototype.destroy=function(){this.texture=null,this.matrix=null},t}(),ps=function(t,e){return(ps=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function _s(t,e){function r(){this.constructor=t}ps(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var ms={build:function(t){t.points=t.shape.points.slice()},triangulate:function(t,e){var r=t.points,i=t.holes,n=e.points,o=e.indices;if(r.length>=6){for(var s=[],a=0;ac&&(c+=2*Math.PI);var d=l,f=c-l,p=Math.abs(f),_=Math.sqrt(h*h+u*u),m=1+(15*p*Math.sqrt(_)/Math.PI>>0),v=f/m;if(d+=v,a){s.push(t,e),s.push(r,i);for(var y=1,g=d;yg?(k?(f.push(z,W),f.push(x+R*N,b+O*N),f.push(z,W),f.push(x+I*N,b+M*N)):(f.push(x-R*D,b-O*D),f.push(q,K),f.push(x-I*D,b-M*D),f.push(q,K)),_+=2):s.join===t.LINE_JOIN.ROUND?k?(f.push(z,W),f.push(x+R*N,b+O*N),_+=bs(x,b,x+R*N,b+O*N,x+I*N,b+M*N,f,!0)+4,f.push(z,W),f.push(x+I*N,b+M*N)):(f.push(x-R*D,b-O*D),f.push(q,K),_+=bs(x,b,x-R*D,b-O*D,x-I*D,b-M*D,f,!1)+4,f.push(x-I*D,b-M*D),f.push(q,K)):(f.push(z,W),f.push(q,K)):(f.push(x-R*D,b-O*D),f.push(x+R*N,b+O*N),s.join===t.LINE_JOIN.BEVEL||V/y>g||(s.join===t.LINE_JOIN.ROUND?_+=k?bs(x,b,x+R*N,b+O*N,x+I*N,b+M*N,f,!0)+2:bs(x,b,x-R*D,b-O*D,x-I*D,b-M*D,f,!1)+2:(k?(f.push(q,K),f.push(q,K)):(f.push(z,W),f.push(z,W)),_+=2)),f.push(x-I*D,b-M*D),f.push(x+I*N,b+M*N),_+=2)}}E=n[2*(p-2)],T=n[2*(p-2)+1],x=n[2*(p-1)],R=-(T-(b=n[2*(p-1)+1])),O=E-x,R/=P=Math.sqrt(R*R+O*O),O/=P,R*=v,O*=v,f.push(x-R*D,b-O*D),f.push(x+R*N,b+O*N),u||(s.cap===t.LINE_CAP.ROUND?_+=bs(x-R*(D-N)*.5,b-O*(D-N)*.5,x-R*D,b-O*D,x+R*N,b+O*N,f,!1)+2:s.cap===t.LINE_CAP.SQUARE&&(_+=xs(x,b,R,O,D,N,!1,f)));var Q=r.indices,J=ds.epsilon*ds.epsilon;for(C=m;C<_+m-2;++C)E=f[2*C],T=f[2*C+1],x=f[2*(C+1)],b=f[2*(C+1)+1],S=f[2*(C+2)],A=f[2*(C+2)+1],Math.abs(E*(b-A)+x*(A-T)+S*(T-b))l*a}},t.arc=function(t,e,r,i,n,o,s,a,h){for(var u=s-o,l=ds._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/Xe)),c=u/(2*l),d=2*c,f=Math.cos(c),p=Math.sin(c),_=l-1,m=_%1/_,v=0;v<=_;++v){var y=c+o+d*(v+m*v),g=Math.cos(y),E=-Math.sin(y);h.push((f*g+p*E)*n+r,(f*-E+p*g)*n+i)}},t}(),Os=function(){function t(){}return t.curveLength=function(t,e,r,i,n,o,s,a){for(var h=0,u=0,l=0,c=0,d=0,f=0,p=0,_=0,m=0,v=0,y=0,g=t,E=e,T=1;T<=10;++T)v=g-(_=(p=(f=(d=1-(u=T/10))*d)*d)*t+3*f*u*r+3*d*(l=u*u)*n+(c=l*u)*s),y=E-(m=p*e+3*f*u*i+3*d*l*o+c*a),g=_,E=m,h+=Math.sqrt(v*v+y*y);return h},t.curveTo=function(e,r,i,n,o,s,a){var h=a[a.length-2],u=a[a.length-1];a.length-=2;var l=ds._segmentsCount(t.curveLength(h,u,e,r,i,n,o,s)),c=0,d=0,f=0,p=0,_=0;a.push(h,u);for(var m=1,v=0;m<=l;++m)f=(d=(c=1-(v=m/l))*c)*c,_=(p=v*v)*v,a.push(f*h+3*d*v*e+3*c*p*i+_*o,f*u+3*d*v*r+3*c*p*n+_*s)},t}(),Is=function(){function t(){}return t.curveLength=function(t,e,r,i,n,o){var s=t-2*r+n,a=e-2*i+o,h=2*r-2*t,u=2*i-2*e,l=4*(s*s+a*a),c=4*(s*h+a*u),d=h*h+u*u,f=2*Math.sqrt(l+c+d),p=Math.sqrt(l),_=2*l*p,m=2*Math.sqrt(d),v=c/p;return(_*f+p*c*(f-m)+(4*d*l-c*c)*Math.log((2*p+v+f)/(v+m)))/(4*_)},t.curveTo=function(e,r,i,n,o){for(var s=o[o.length-2],a=o[o.length-1],h=ds._segmentsCount(t.curveLength(s,a,e,r,i,n)),u=0,l=0,c=1;c<=h;++c){var d=c/h;u=s+(e-s)*d,l=a+(r-a)*d,o.push(u+(e+(i-e)*d-u)*d,l+(r+(n-r)*d-l)*d)}},t}(),Ms=function(){function t(){this.reset()}return t.prototype.begin=function(t,e,r){this.reset(),this.style=t,this.start=e,this.attribStart=r},t.prototype.end=function(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start},t.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},t}(),Ps=((As={})[t.SHAPES.POLY]=ms,As[t.SHAPES.CIRC]=vs,As[t.SHAPES.ELIP]=vs,As[t.SHAPES.RECT]=ys,As[t.SHAPES.RREC]=Ts,As),ws=[],Ds=[];function Ns(t){for(var e=t.points,r=0,i=0;i0}var Cs=function(){function t(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null),this.points=[],this.holes=[],this.shape=t,this.lineStyle=r,this.fillStyle=e,this.matrix=i,this.type=t.type}return t.prototype.clone=function(){return new t(this.shape,this.fillStyle,this.lineStyle,this.matrix)},t.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},t}(),Ls=new Ke,Fs=new ar,Bs=function(e){function r(){var t=e.call(this)||this;return t.closePointEps=1e-4,t.boundsPadding=0,t.uvsFloat32=null,t.indicesUint16=null,t.batchable=!1,t.points=[],t.colors=[],t.uvs=[],t.indices=[],t.textureIds=[],t.graphicsData=[],t.drawCalls=[],t.batchDirty=-1,t.batches=[],t.dirty=0,t.cacheDirty=-1,t.clearDirty=0,t.shapeIndex=0,t._bounds=new ar,t.boundsDirty=-1,t}return _s(r,e),Object.defineProperty(r.prototype,"bounds",{get:function(){return this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),r.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},r.prototype.drawShape=function(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null);var n=new Cs(t,e,r,i);return this.graphicsData.push(n),this.dirty++,this},r.prototype.drawHole=function(t,e){if(void 0===e&&(e=null),!this.graphicsData.length)return null;var r=new Cs(t,null,null,e),i=this.graphicsData[this.graphicsData.length-1];return r.lineStyle=i.lineStyle,i.holes.push(r),this.dirty++,this},r.prototype.destroy=function(){e.prototype.destroy.call(this);for(var t=0;t0&&(o=(n=this.batches[this.batches.length-1]).style);for(var s=this.shapeIndex;s65535&&e;this.indicesUint16=y?new Uint32Array(this.indices):new Uint16Array(this.indices)}this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}else this.batchable=!0}}else this.batchable=!0},r.prototype._compareStyles=function(t,e){return!(!t||!e)&&t.texture.baseTexture===e.texture.baseTexture&&t.color+t.alpha===e.color+e.alpha&&!!t.native==!!e.native},r.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,e=this.graphicsData.length;t131070)return!1;for(var t=this.batches,e=0;e0&&((o=Ds.pop())||((o=new Jn).texArray=new $n),this.drawCalls.push(o)),o.start=c,o.size=0,o.texArray.count=0,o.type=l),p.touched=1,p._batchEnabled=e,p._batchLocation=s,p.wrapMode=t.WRAP_MODES.REPEAT,o.texArray.elements[o.texArray.count++]=p,s++)),o.size+=d.size,c+=d.size,h=p._batchLocation,this.addColors(i,f.color,f.alpha,d.attribSize,d.attribStart),this.addTextureIds(n,h,d.attribSize,d.attribStart)}Xr._globalBatch=e,this.packAttributes()},r.prototype.packAttributes=function(){for(var t=this.points,e=this.uvs,r=this.colors,i=this.textureIds,n=new ArrayBuffer(3*t.length*4),o=new Float32Array(n),s=new Uint32Array(n),a=0,h=0;h>16)+(65280&e)+((255&e)<<16),r);t.length=Math.max(t.length,n+i);for(var s=0;s0&&e.alpha>0;return r?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:r},e)):this._lineStyle.reset(),this},r.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new We,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new We,this.currentPath.closeStroke=!1},r.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},r.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},r.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var r=this.currentPath.points,i=r[r.length-2],n=r[r.length-1];return i===t&&n===e||r.push(t,e),this},r.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},r.prototype.quadraticCurveTo=function(t,e,r,i){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Is.curveTo(t,e,r,i,n),this},r.prototype.bezierCurveTo=function(t,e,r,i,n,o){return this._initCurve(),Os.curveTo(t,e,r,i,n,o,this.currentPath.points),this},r.prototype.arcTo=function(t,e,r,i,n){this._initCurve(t,e);var o=this.currentPath.points,s=Rs.curveTo(t,e,r,i,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startAngle,c=s.endAngle,d=s.anticlockwise;this.arc(a,h,u,l,c,d)}return this},r.prototype.arc=function(t,e,r,i,n,o){if(void 0===o&&(o=!1),i===n)return this;if(!o&&n<=i?n+=Xe:o&&i<=n&&(i+=Xe),0==n-i)return this;var s=t+Math.cos(i)*r,a=e+Math.sin(i)*r,h=this._geometry.closePointEps,u=this.currentPath?this.currentPath.points:null;if(u){var l=Math.abs(u[u.length-2]-s),c=Math.abs(u[u.length-1]-a);l0;return e?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:e},t)):this._fillStyle.reset(),this},r.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},r.prototype.drawRect=function(t,e,r,i){return this.drawShape(new Ye(t,e,r,i))},r.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new qe(t,e,r,i,n))},r.prototype.drawCircle=function(t,e,r){return this.drawShape(new Ve(t,e,r))},r.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new ze(t,e,r,i))},r.prototype.drawPolygon=function(){for(var t,e=arguments,r=[],i=0;i>16&255)/255*n,o.tint[1]=(i>>8&255)/255*n,o.tint[2]=(255&i)/255*n,o.tint[3]=n,t.shader.bind(e),t.geometry.bind(r,e),t.state.set(this.state);for(var a=0,h=s.length;a>16)+(65280&n)+((255&n)<<16)}}},r.prototype.calculateVertices=function(){var t=this.transform._worldID;if(this._transformID!==t){this._transformID=t;for(var e=this.transform.worldTransform,r=e.a,i=e.b,n=e.c,o=e.d,s=e.tx,a=e.ty,h=this._geometry.points,u=this.vertexData,l=0,c=0;c=i&&Ys.x=n&&Ys.y>16)+(65280&t)+((255&t)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||ii.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),r}(fr),Ws=function(t,e){return(Ws=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};!function(t){t[t.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",t[t.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"}(t.TEXT_GRADIENT||(t.TEXT_GRADIENT={}));var qs={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:t.TEXT_GRADIENT.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Ks=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Zs=function(){function t(t){this.styleID=0,this.reset(),$s(this,t,t)}return t.prototype.clone=function(){var e={};return $s(e,this,qs),new t(e)},t.prototype.reset=function(){$s(this,qs,qs)},Object.defineProperty(t.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"breakWords",{get:function(){return this._breakWords},set:function(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(t){var e=Js(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fill",{get:function(){return this._fill},set:function(t){var e=Js(t);this._fill!==e&&(this._fill=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(t){(function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(var r=0;r=0;r--){var i=e[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&Ks.indexOf(i)<0&&(i='"'+i+'"'),e[r]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},t}();function Qs(t){return"number"==typeof t?de(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Js(t){if(Array.isArray(t)){for(var e=0;ep)if(""!==s&&(a+=t.addLine(s),s="",o=0),t.canBreakWords(v,r.breakWords))for(var T=t.wordWrapSplit(v),x=0;xp&&(a+=t.addLine(s),f=!1,s="",o=0),s+=b,o+=O}else{s.length>0&&(a+=t.addLine(s),s="",o=0);var I=m===_.length-1;a+=t.addLine(v,!I),f=!1,s="",o=0}else E+o>p&&(f=!1,a+=t.addLine(s),s="",o=0),(s.length>0||!t.isBreakingSpace(v)||f)&&(s+=v,o+=E)}return a+t.addLine(s,!1)},t.addLine=function(e,r){return void 0===r&&(r=!0),e=t.trimRight(e),r?e+"\n":e},t.getFromCache=function(t,e,r,i){var n=r[t];if("number"!=typeof n){var o=t.length*e;n=i.measureText(t).width+o,r[t]=n}return n},t.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},t.collapseNewlines=function(t){return"normal"===t},t.trimRight=function(e){if("string"!=typeof e)return"";for(var r=e.length-1;r>=0;r--){var i=e[r];if(!t.isBreakingSpace(i))break;e=e.slice(0,-1)}return e},t.isNewline=function(e){return"string"==typeof e&&t._newlines.indexOf(e.charCodeAt(0))>=0},t.isBreakingSpace=function(e,r){return"string"==typeof e&&t._breakingSpaces.indexOf(e.charCodeAt(0))>=0},t.tokenize=function(e){var r=[],i="";if("string"!=typeof e)return r;for(var n=0;na;--d){for(_=0;_0&&_>m&&(v=(m+_)/2);var y=m+p,g=i.lineHeight*(f+1),E=y;f+10},t}();function sa(t,e){var r=!1;if(t&&t._textures&&t._textures.length)for(var i=0;i=0;e--)this.add(t.children[e]);return this},e.prototype.destroy=function(){this.ticking&&Tr.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null},e}();function pa(t,e){return e instanceof Xr&&(e._glTextures[t.CONTEXT_UID]||t.texture.bind(e),!0)}function _a(t,e){if(!(e instanceof Xs))return!1;var r=e.geometry;e.finishPoly(),r.updateBatches();for(var i=r.batches,n=0;n=i&&ba.x=n&&ba.y>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;ge(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},e}(nn),Ga=function(e){function r(r,i,n){var o=e.call(this)||this,s=new ui(r),a=new ui(i,!0),h=new ui(n,!0,!0);return o.addAttribute("aVertexPosition",s,2,!1,t.TYPES.FLOAT).addAttribute("aTextureCoord",a,2,!1,t.TYPES.FLOAT).addIndex(h),o._updateId=-1,o}return wa(r,e),Object.defineProperty(r.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),r}(pi),ka=function(t,e){return(ka=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},Xa=function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[]},Ha=function(){function t(){}return t.test=function(t){return"string"==typeof t&&0===t.indexOf("info face=")},t.parse=function(t){var e=t.match(/^[a-z]+\s+.+$/gm),r={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[]};for(var i in e){var n=e[i].match(/^[a-z]+/gm)[0],o=e[i].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),s={};for(var a in o){var h=o[a].split("="),u=h[0],l=h[1].replace(/"/gm,""),c=parseFloat(l),d=isNaN(c)?l:c;s[u]=d}r[n].push(s)}var f=new Xa;return r.info.forEach(function(t){return f.info.push({face:t.face,size:parseInt(t.size,10)})}),r.common.forEach(function(t){return f.common.push({lineHeight:parseInt(t.lineHeight,10)})}),r.page.forEach(function(t){return f.page.push({id:parseInt(t.id,10),file:t.file})}),r.char.forEach(function(t){return f.char.push({id:parseInt(t.id,10),page:parseInt(t.page,10),x:parseInt(t.x,10),y:parseInt(t.y,10),width:parseInt(t.width,10),height:parseInt(t.height,10),xoffset:parseInt(t.xoffset,10),yoffset:parseInt(t.yoffset,10),xadvance:parseInt(t.xadvance,10)})}),r.kerning.forEach(function(t){return f.kerning.push({first:parseInt(t.first,10),second:parseInt(t.second,10),amount:parseInt(t.amount,10)})}),f},t}(),ja=function(){function t(){}return t.test=function(t){return t instanceof XMLDocument&&t.getElementsByTagName("page").length&&null!==t.getElementsByTagName("info")[0].getAttribute("face")},t.parse=function(t){for(var e=new Xa,r=t.getElementsByTagName("info"),i=t.getElementsByTagName("common"),n=t.getElementsByTagName("page"),o=t.getElementsByTagName("char"),s=t.getElementsByTagName("kerning"),a=0;a")>-1){var e=(new self.DOMParser).parseFromString(t,"text/xml");return ja.test(e)}return!1},t.parse=function(t){var e=(new self.DOMParser).parseFromString(t,"text/xml");return ja.parse(e)},t}(),Va=[Ha,ja,Ya];function za(t){for(var e=0;e=u-S*a){if(0===y)throw new Error("[BitmapFont] textureHeight "+u+"px is too small for "+c.fontSize+"px fonts");--T,p=null,_=null,m=null,y=0,v=0,g=0}else if(g=Math.max(S+x.fontProperties.descent,g),A*a+v>=d)--T,y+=g*a,y=Math.ceil(y),v=0,g=0;else{Wa(p,_,x,v,y,a,c);var R=x.text.charCodeAt(0);f.char.push({id:R,page:E.length-1,x:v/a,y:y/a,width:A,height:S,xoffset:0,yoffset:0,xadvance:Math.ceil(b-(c.dropShadow?c.dropShadowDistance:0)-(c.stroke?c.strokeThickness:0))}),v+=(A+2*s)*a,v=Math.ceil(v)}}T=0;for(var O=l.length;T0&&i.x>u&&(Re(n,1+p-++m,1+g-p),g=p,p=-1,o.push(_),s.push(n.length>0?n[n.length-1].prevSpaces:0),d=Math.max(d,_),f++,i.x=0,i.y+=e.lineHeight,l=null,y=0)}}else o.push(c),s.push(-1),d=Math.max(d,c),++f,++m,i.x=0,i.y+=e.lineHeight,l=null,y=0}var S=a.charAt(a.length-1);"\r"!==S&&"\n"!==S&&(/(?:\s)/.test(S)&&(c=_),o.push(c),d=Math.max(d,c),s.push(-1));var A=[];for(g=0;g<=f;g++){var R=0;"right"===this._align?R=d-o[g]:"center"===this._align?R=(d-o[g])/2:"justify"===this._align&&(R=s[g]<0?0:(d-o[g])/s[g]),A.push(R)}var O=n.length,I={},M=[],P=this._activePagesMeshData;for(g=0;g6*L)||W.vertices.length<2*La.BATCHABLE_SIZE)W.vertices=new Float32Array(8*L),W.uvs=new Float32Array(8*L),W.indices=new Uint16Array(6*L);else for(var F=W.total,B=W.vertices,U=4*F*2;U=i&&(e=t-s-1),o+=a=a.replace("%value%",r[e].toString()),o+="\n"}return(n=n.replace("%blur%",o)).replace("%size%",t.toString())}(o);return(s=t.call(this,a,h)||this).horizontal=e,s.resolution=n,s._quality=0,s.quality=i,s.blur=r,s}return ih(e,t),e.prototype.apply=function(t,e,r,i){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/e.width):this.uniforms.strength=1/r.height*(r.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,r,i);else{var n=t.getFilterTexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyFilter(this,s,a,vh.CLEAR);for(var h=1;h 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",Ph=function(t){function e(){var e=this,r={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};return(e=t.call(this,Zn,Mh,r)||this).alpha=1,e}return function(t,e){function r(){this.constructor=t}Ih(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r},e.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.tint=function(t,e){var r=[(t>>16&255)/255,0,0,0,0,0,(t>>8&255)/255,0,0,0,0,0,(255&t)/255,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),i=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[r+(1-r)*n,n*(1-r)-o*i,n*(1-r)+o*i,0,0,n*(1-r)+o*i,r+n*(1-r),n*(1-r)-o*i,0,0,n*(1-r)-o*i,n*(1-r)+o*i,r+n*(1-r),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var r=(t||0)+1,i=-.5*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var r=2*t/3+1,i=-.5*(r-1),n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,r,i,n){var o=((r=r||16770432)>>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,h=((i=i||3375104)>>16&255)/255,u=(i>>8&255)/255,l=(255&i)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var r=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},Object.defineProperty(e.prototype,"matrix",{get:function(){return this.uniforms.m},set:function(t){this.uniforms.m=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0}),e}(sn);Ph.prototype.grayscale=Ph.prototype.greyscale;var wh,Dh,Nh,Ch,Lh,Fh,Bh,Uh,Gh,kh,Xh,Hh,jh,Yh,Vh,zh,Wh,qh,Kh,Zh=function(t,e){return(Zh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},Qh="varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",Jh="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n",$h=function(t){function e(e,r){var i=this,n=new Qe;return e.renderable=!1,(i=t.call(this,Jh,Qh,{mapSampler:e._texture,filterMatrix:n,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})||this).maskSprite=e,i.maskMatrix=n,null==r&&(r=20),i.scale=new Ke(r,r),i}return function(t,e){function r(){this.constructor=t}Zh(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype.apply=function(t,e,r,i){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,r,i)},Object.defineProperty(e.prototype,"map",{get:function(){return this.uniforms.mapSampler},set:function(t){this.uniforms.mapSampler=t},enumerable:!1,configurable:!0}),e}(sn),tu=function(t,e){return(tu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},eu="\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",ru='varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputSize;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n',iu=function(t){function e(){return t.call(this,eu,ru)||this}return function(t,e){function r(){this.constructor=t}tu(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e}(sn),nu=function(t,e){return(nu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},ou="precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",su=function(t){function e(e,r){void 0===e&&(e=.5),void 0===r&&(r=Math.random());var i=t.call(this,Zn,ou,{uNoise:0,uSeed:0})||this;return i.noise=e,i.seed=r,i}return function(t,e){function r(){this.constructor=t}nu(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),Object.defineProperty(e.prototype,"noise",{get:function(){return this.uniforms.uNoise},set:function(t){this.uniforms.uNoise=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"seed",{get:function(){return this.uniforms.uSeed},set:function(t){this.uniforms.uSeed=t},enumerable:!1,configurable:!0}),e}(sn);!function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(wh||(wh={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(Dh||(Dh={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(Nh||(Nh={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"}(Ch||(Ch={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(Lh||(Lh={})),function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(Fh||(Fh={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(Bh||(Bh={})),function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"}(Uh||(Uh={})),function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"}(Gh||(Gh={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(kh||(kh={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(Xh||(Xh={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"}(Hh||(Hh={})),function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA"}(jh||(jh={})),function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"}(Yh||(Yh={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(Vh||(Vh={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(zh||(zh={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(Wh||(Wh={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(qh||(qh={})),function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(Kh||(Kh={}));var au=new Qe;lr.prototype._cacheAsBitmap=!1,lr.prototype._cacheData=null,lr.prototype._cacheAsBitmapResolution=null,lr.prototype._cacheAsBitmapMultisample=qh.NONE;var hu=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null};Object.defineProperties(lr.prototype,{cacheAsBitmapResolution:{get:function(){return this._cacheAsBitmapResolution},set:function(t){t!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get:function(){return this._cacheAsBitmapMultisample},set:function(t){t!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new hu),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),lr.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},lr.prototype._initCachedDisplayObject=function(t){var e;if(!this._cacheData||!this._cacheData.sprite){var r=this.alpha;this.alpha=1,t.batch.flush();var i=this.getLocalBounds(null,!0).clone();if(this.filters){var n=this.filters[0].padding;i.pad(n)}i.ceil(rt.RESOLUTION);var o=t.renderTexture.current,s=t.renderTexture.sourceFrame.clone(),a=t.renderTexture.destinationFrame.clone(),h=t.projection.transform,u=oi.create({width:i.width,height:i.height,resolution:this.cacheAsBitmapResolution||t.resolution,multisample:null!==(e=this.cacheAsBitmapMultisample)&&void 0!==e?e:t.multisample}),l="cacheAsBitmap_"+Me();this._cacheData.textureCacheId=l,Xr.addToCache(u.baseTexture,l),ii.addToCache(u,l);var c=this.transform.localTransform.copyTo(au).invert().translate(-i.x,-i.y);this.render=this._cacheData.originalRender,t.render(this,{renderTexture:u,clear:!0,transform:c,skipUpdateTransform:!1}),t.framebuffer.blit(),t.projection.transform=h,t.renderTexture.bind(o,s,a),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=r;var d=new zs(u);d.transform.worldTransform=this.transform.worldTransform,d.anchor.x=-i.x/i.width,d.anchor.y=-i.y/i.height,d.alpha=r,d._bounds=this._bounds,this._cacheData.sprite=d,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=d.containsPoint.bind(d)}},lr.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},lr.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(null,!0),r=this.alpha;this.alpha=1;var i=t.context,n=t._projTransform;e.ceil(rt.RESOLUTION);var o=oi.create({width:e.width,height:e.height}),s="cacheAsBitmap_"+Me();this._cacheData.textureCacheId=s,Xr.addToCache(o.baseTexture,s),ii.addToCache(o,s);var a=au;this.transform.localTransform.copyTo(a),a.invert(),a.tx-=e.x,a.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,{renderTexture:o,clear:!0,transform:a,skipUpdateTransform:!1}),t.context=i,t._projTransform=n,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=r;var h=new zs(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-e.x/e.width,h.anchor.y=-e.y/e.height,h.alpha=r,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},lr.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},lr.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},lr.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,Xr.removeFromCache(this._cacheData.textureCacheId),ii.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},lr.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},lr.prototype.name=null,fr.prototype.getChildByName=function(t,e){for(var r=0,i=this.children.length;r0){var d=a.x-t[l].x,f=a.y-t[l].y,p=Math.sqrt(d*d+f*f);a=t[l],s+=p/h}else s=l/(u-1);n[c]=s,n[c+1]=0,n[c+2]=s,n[c+3]=1}var _=0;for(l=0;l0?this.textureScale*this._width/2:this._width/2;i/=l,n/=l,i*=c,n*=c,o[u]=h.x+i,o[u+1]=h.y+n,o[u+2]=h.x-i,o[u+3]=h.y-n,r=h}this.buffers[0].update()}},e.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},e}(Ga),fu=function(e){function r(r,i,n){void 0===n&&(n=0);var o=this,s=new du(r.height,i,n),a=new Ua(r);return n>0&&(r.baseTexture.wrapMode=t.WRAP_MODES.REPEAT),(o=e.call(this,s,a)||this).autoUpdate=!0,o}return lu(r,e),r.prototype._render=function(t){var r=this.geometry;(this.autoUpdate||r._width!==this.shader.texture.height)&&(r._width=this.shader.texture.height,r.update()),e.prototype._render.call(this,t)},r}(La),pu=function(t){function e(e,r,i){var n=this,o=new cu(e.width,e.height,r,i),s=new Ua(ii.WHITE);return(n=t.call(this,o,s)||this).texture=e,n.autoResize=!0,n}return lu(e,t),e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var t=this.geometry,e=this.shader.texture,r=e.width,i=e.height;!this.autoResize||t.width===r&&t.height===i||(t.width=this.shader.texture.width,t.height=this.shader.texture.height,t.build())},Object.defineProperty(e.prototype,"texture",{get:function(){return this.shader.texture},set:function(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once("update",this.textureUpdated,this))},enumerable:!1,configurable:!0}),e.prototype._render=function(e){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),t.prototype._render.call(this,e)},e.prototype.destroy=function(e){this.shader.texture.off("update",this.textureUpdated,this),t.prototype.destroy.call(this,e)},e}(La),_u=function(t){function e(e,r,i,n,o){void 0===e&&(e=ii.EMPTY);var s=this,a=new Ga(r,i,n);a.getBuffer("aVertexPosition").static=!1;var h=new Ua(e);return(s=t.call(this,a,h,null,o)||this).autoUpdate=!0,s}return lu(e,t),Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype._render=function(e){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),t.prototype._render.call(this,e)},e}(La),mu=10,vu=function(t){function e(e,r,i,n,o){void 0===r&&(r=mu),void 0===i&&(i=mu),void 0===n&&(n=mu),void 0===o&&(o=mu);var s=t.call(this,ii.WHITE,4,4)||this;return s._origWidth=e.orig.width,s._origHeight=e.orig.height,s._width=s._origWidth,s._height=s._origHeight,s._leftWidth=r,s._rightWidth=n,s._topHeight=i,s._bottomHeight=o,s.texture=e,s}return lu(e,t),e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype.updateHorizontalVertices=function(){var t=this.vertices,e=this._getMinScale();t[9]=t[11]=t[13]=t[15]=this._topHeight*e,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*e,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._getMinScale();t[2]=t[10]=t[18]=t[26]=this._leftWidth*e,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*e,t[6]=t[14]=t[22]=t[30]=this._width},e.prototype._getMinScale=function(){var t=this._leftWidth+this._rightWidth,e=this._width>t?1:this._width/t,r=this._topHeight+this._bottomHeight,i=this._height>r?1:this._height/r;return Math.min(e,i)},Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(t){this._leftWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(t){this._rightWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"topHeight",{get:function(){return this._topHeight},set:function(t){this._topHeight=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(t){this._bottomHeight=t,this._refresh()},enumerable:!1,configurable:!0}),e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},e}(pu),yu=function(t,e){return(yu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},gu=function(e){function r(t,r){void 0===r&&(r=!0);var i=e.call(this,t[0]instanceof ii?t[0]:t[0].texture)||this;return i._textures=null,i._durations=null,i._autoUpdate=r,i._isConnectedToTicker=!1,i.animationSpeed=1,i.loop=!0,i.updateAnchor=!1,i.onComplete=null,i.onFrameChange=null,i.onLoop=null,i._currentTime=0,i._playing=!1,i._previousFrame=null,i.textures=t,i}return function(t,e){function r(){this.constructor=t}yu(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(r,e),r.prototype.stop=function(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(Tr.shared.remove(this.update,this),this._isConnectedToTicker=!1))},r.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(Tr.shared.add(this.update,this,t.UPDATE_PRIORITY.HIGH),this._isConnectedToTicker=!0))},r.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},r.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},r.prototype.update=function(t){if(this._playing){var e=this.animationSpeed*t,r=this.currentFrame;if(null!==this._durations){var i=this._currentTime%1*this._durations[this.currentFrame];for(i+=e/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramer&&this.onLoop()),this.updateTexture())}},r.prototype.updateTexture=function(){var t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this._texture=this._textures[t],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))},r.prototype.destroy=function(t){this.stop(),e.prototype.destroy.call(this,t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},r.fromFrames=function(t){for(var e=[],i=0;i0){var n=e.context;n.beginPath();for(var o=0;o0){for(l=0,d=h[0],f=h[1],p=2;p+2=0;p-=2)r.lineTo(h[p],h[p+1]);u[_].shape.closeStroke&&r.closePath()}}h[0]===h[h.length-2]&&h[1]===h[h.length-1]&&r.closePath()}else if(a.type===t.SHAPES.RECT)r.rect(a.x,a.y,a.width,a.height),r.closePath();else if(a.type===t.SHAPES.CIRC)r.arc(a.x,a.y,a.radius,0,2*Math.PI),r.closePath();else if(a.type===t.SHAPES.ELIP){var m=2*a.width,v=2*a.height,y=a.x-m/2,g=a.y-v/2,E=m/2*.5522848,T=v/2*.5522848,x=y+m,b=g+v,S=y+m/2,A=g+v/2;r.moveTo(y,A),r.bezierCurveTo(y,A-T,S-E,g,S,g),r.bezierCurveTo(S+E,g,x,A-T,x,A),r.bezierCurveTo(x,A+T,S+E,b,S,b),r.bezierCurveTo(S-E,b,y,A+T,y,A),r.closePath()}else if(a.type===t.SHAPES.RREC){var R=a.x,O=a.y,I=a.width,M=a.height,P=a.radius,w=Math.min(I,M)/2;P=P>w?w:P,r.moveTo(R,O+P),r.lineTo(R,O+M-P),r.quadraticCurveTo(R,O+M,R+P,O+M),r.lineTo(R+I-P,O+M),r.quadraticCurveTo(R+I,O+M,R+I,O+M-P),r.lineTo(R+I,O+P),r.quadraticCurveTo(R+I,O,R+I-P,O),r.lineTo(R+P,O),r.quadraticCurveTo(R,O,R,O+P),r.closePath()}}},e.prototype.popMask=function(t){t.context.restore(),t.invalidateBlendMode()},e.prototype.destroy=function(){},e}();function bu(t){var e=document.createElement("canvas");e.width=6,e.height=1;var r=e.getContext("2d");return r.fillStyle=t,r.fillRect(0,0,6,1),e}function Su(){if("undefined"==typeof document)return!1;var t=bu("#ff00ff"),e=bu("#ffff00"),r=document.createElement("canvas");r.width=6,r.height=1;var i=r.getContext("2d");i.globalCompositeOperation="multiply",i.drawImage(t,0,0),i.drawImage(e,2,0);var n=i.getImageData(2,0,1,1);if(!n)return!1;var o=n.data;return 255===o[0]&&0===o[1]&&0===o[2]}var Au=new Qe,Ru=function(e){function r(i){var n,o=e.call(this,t.RENDERER_TYPE.CANVAS,i)||this;if(o.refresh=!0,o.maskManager=new xu(o),o.smoothProperty="imageSmoothingEnabled",o.blendModes=(void 0===n&&(n=[]),Su()?(n[t.BLEND_MODES.NORMAL]="source-over",n[t.BLEND_MODES.ADD]="lighter",n[t.BLEND_MODES.MULTIPLY]="multiply",n[t.BLEND_MODES.SCREEN]="screen",n[t.BLEND_MODES.OVERLAY]="overlay",n[t.BLEND_MODES.DARKEN]="darken",n[t.BLEND_MODES.LIGHTEN]="lighten",n[t.BLEND_MODES.COLOR_DODGE]="color-dodge",n[t.BLEND_MODES.COLOR_BURN]="color-burn",n[t.BLEND_MODES.HARD_LIGHT]="hard-light",n[t.BLEND_MODES.SOFT_LIGHT]="soft-light",n[t.BLEND_MODES.DIFFERENCE]="difference",n[t.BLEND_MODES.EXCLUSION]="exclusion",n[t.BLEND_MODES.HUE]="hue",n[t.BLEND_MODES.SATURATION]="saturate",n[t.BLEND_MODES.COLOR]="color",n[t.BLEND_MODES.LUMINOSITY]="luminosity"):(n[t.BLEND_MODES.NORMAL]="source-over",n[t.BLEND_MODES.ADD]="lighter",n[t.BLEND_MODES.MULTIPLY]="source-over",n[t.BLEND_MODES.SCREEN]="source-over",n[t.BLEND_MODES.OVERLAY]="source-over",n[t.BLEND_MODES.DARKEN]="source-over",n[t.BLEND_MODES.LIGHTEN]="source-over",n[t.BLEND_MODES.COLOR_DODGE]="source-over",n[t.BLEND_MODES.COLOR_BURN]="source-over",n[t.BLEND_MODES.HARD_LIGHT]="source-over",n[t.BLEND_MODES.SOFT_LIGHT]="source-over",n[t.BLEND_MODES.DIFFERENCE]="source-over",n[t.BLEND_MODES.EXCLUSION]="source-over",n[t.BLEND_MODES.HUE]="source-over",n[t.BLEND_MODES.SATURATION]="source-over",n[t.BLEND_MODES.COLOR]="source-over",n[t.BLEND_MODES.LUMINOSITY]="source-over"),n[t.BLEND_MODES.NORMAL_NPM]=n[t.BLEND_MODES.NORMAL],n[t.BLEND_MODES.ADD_NPM]=n[t.BLEND_MODES.ADD],n[t.BLEND_MODES.SCREEN_NPM]=n[t.BLEND_MODES.SCREEN],n[t.BLEND_MODES.SRC_IN]="source-in",n[t.BLEND_MODES.SRC_OUT]="source-out",n[t.BLEND_MODES.SRC_ATOP]="source-atop",n[t.BLEND_MODES.DST_OVER]="destination-over",n[t.BLEND_MODES.DST_IN]="destination-in",n[t.BLEND_MODES.DST_OUT]="destination-out",n[t.BLEND_MODES.DST_ATOP]="destination-atop",n[t.BLEND_MODES.XOR]="xor",n[t.BLEND_MODES.SUBTRACT]="source-over",n),o.renderingToScreen=!1,o._activeBlendMode=null,o._projTransform=null,o._outerBlend=!1,o.rootContext=o.view.getContext("2d",{alpha:o.useContextAlpha}),o.context=o.rootContext,!o.rootContext.imageSmoothingEnabled){var s=o.rootContext;s.webkitImageSmoothingEnabled?o.smoothProperty="webkitImageSmoothingEnabled":s.mozImageSmoothingEnabled?o.smoothProperty="mozImageSmoothingEnabled":s.oImageSmoothingEnabled?o.smoothProperty="oImageSmoothingEnabled":s.msImageSmoothingEnabled&&(o.smoothProperty="msImageSmoothingEnabled")}return o.initPlugins(r.__plugins),he("Canvas"),o.resize(o.options.width,o.options.height),o}return function(t,e){function r(){this.constructor=t}Tu(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(r,e),r.prototype.render=function(e,r){if(this.view){var i,n,o,s;r&&(r instanceof oi||r instanceof ti?(i=r,n=arguments[2],o=arguments[3],s=arguments[4]):(i=r.renderTexture,n=r.clear,o=r.transform,s=r.skipUpdateTransform)),this.renderingToScreen=!i,this.emit("prerender");var a=this.resolution;i?((i=i.castToBaseTexture())._canvasRenderTarget||(i._canvasRenderTarget=new Ce(i.width,i.height,i.resolution),i.resource=new Vr(i._canvasRenderTarget.canvas),i.valid=!0),this.context=i._canvasRenderTarget.context,this.resolution=i._canvasRenderTarget.resolution):this.context=this.rootContext;var h=this.context;if(this._projTransform=o||null,i||(this._lastObjectRendered=e),!s){var u=e.enableTempParent();e.updateTransform(),e.disableTempParent(u)}if(h.save(),h.setTransform(1,0,0,1,0,0),h.globalAlpha=1,this._activeBlendMode=t.BLEND_MODES.NORMAL,this._outerBlend=!1,h.globalCompositeOperation=this.blendModes[t.BLEND_MODES.NORMAL],void 0!==n?n:this.clearBeforeRender)if(this.renderingToScreen)h.clearRect(0,0,this.width,this.height),this.backgroundAlpha>0&&(h.globalAlpha=this.useContextAlpha?this.backgroundAlpha:1,h.fillStyle=this._backgroundColorString,h.fillRect(0,0,this.width,this.height),h.globalAlpha=1);else{(i=i)._canvasRenderTarget.clear();var l=i.clearColor;l[3]>0&&(h.globalAlpha=this.useContextAlpha?l[3]:1,h.fillStyle=de(pe(l)),h.fillRect(0,0,i.realWidth,i.realHeight),h.globalAlpha=1)}var c=this.context;this.context=h,e.renderCanvas(this),this.context=c,h.restore(),this.resolution=a,this._projTransform=null,this.emit("postrender")}},r.prototype.setContextTransform=function(t,e,r){var i=t,n=this._projTransform,o=this.resolution;r=r||o,n&&((i=Au).copyFrom(t),i.prepend(n)),e?this.context.setTransform(i.a*r,i.b*r,i.c*r,i.d*r,i.tx*o|0,i.ty*o|0):this.context.setTransform(i.a*r,i.b*r,i.c*r,i.d*r,i.tx*o,i.ty*o)},r.prototype.clear=function(t,e){void 0===t&&(t=this._backgroundColorString),void 0===e&&(e=this.backgroundAlpha);var r=this.context;r.clearRect(0,0,this.width,this.height),t&&(r.globalAlpha=this.useContextAlpha?e:1,r.fillStyle=t,r.fillRect(0,0,this.width,this.height),r.globalAlpha=1)},r.prototype.setBlendMode=function(e,r){var i=e===t.BLEND_MODES.SRC_IN||e===t.BLEND_MODES.SRC_OUT||e===t.BLEND_MODES.DST_IN||e===t.BLEND_MODES.DST_ATOP;!r&&i&&(e=t.BLEND_MODES.NORMAL),this._activeBlendMode!==e&&(this._activeBlendMode=e,this._outerBlend=i,this.context.globalCompositeOperation=this.blendModes[e])},r.prototype.destroy=function(t){e.prototype.destroy.call(this,t),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},r.prototype.resize=function(r,i){e.prototype.resize.call(this,r,i),this.smoothProperty&&(this.rootContext[this.smoothProperty]=rt.SCALE_MODE===t.SCALE_MODES.LINEAR)},r.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},r.registerPlugin=function(t,e){r.__plugins=r.__plugins||{},r.__plugins[t]=e},r}(Yn),Ou={canvas:null,getTintedCanvas:function(t,e){var r=t.texture,i="#"+("00000"+(0|(e=Ou.roundColor(e))).toString(16)).substr(-6);r.tintCache=r.tintCache||{};var n,o=r.tintCache[i];if(o){if(o.tintId===r._updateID)return r.tintCache[i];n=r.tintCache[i]}else n=document.createElement("canvas");if(Ou.tintMethod(r,e,n),n.tintId=r._updateID,Ou.convertTintToImage){var s=new Image;s.src=n.toDataURL(),r.tintCache[i]=s}else r.tintCache[i]=n;return n},getTintedPattern:function(t,e){var r="#"+("00000"+(0|(e=Ou.roundColor(e))).toString(16)).substr(-6);t.patternCache=t.patternCache||{};var i=t.patternCache[r];return i&&i.tintId===t._updateID?i:(Ou.canvas||(Ou.canvas=document.createElement("canvas")),Ou.tintMethod(t,e,Ou.canvas),(i=Ou.canvas.getContext("2d").createPattern(Ou.canvas,"repeat")).tintId=t._updateID,t.patternCache[r]=i,i)},tintWithMultiply:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply";var s=t.baseTexture.getDrawableSource();i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithOverlay:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithPerPixel:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore();for(var s=ce(e),a=s[0],h=s[1],u=s[2],l=i.getImageData(0,0,n.width,n.height),c=l.data,d=0;d= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=u-l,x=Math.floor,b=String.fromCharCode;function S(t){throw RangeError(E[t])}function A(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function R(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+A((t=t.replace(g,".")).split("."),e).join(".")}function O(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=b((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+b(t)}).join("")}function M(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function P(t,e,r){var i=0;for(t=r?x(t/f):t>>1,t+=x(t/e);t>T*c>>1;i+=u)t=x(t/T);return x(i+(T+1)*t/(t+d))}function w(t){var e,r,i,n,o,s,a,d,f,v,y,g=[],E=t.length,T=0,b=_,A=p;for((r=t.lastIndexOf(m))<0&&(r=0),i=0;i=128&&S("not-basic"),g.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=E&&S("invalid-input"),((d=(y=t.charCodeAt(n++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:u)>=u||d>x((h-T)/s))&&S("overflow"),T+=d*s,!(d<(f=a<=A?l:a>=A+c?c:a-A));a+=u)s>x(h/(v=u-f))&&S("overflow"),s*=v;A=P(T-o,e=g.length+1,0==o),x(T/e)>h-b&&S("overflow"),b+=x(T/e),T%=e,g.splice(T++,0,b)}return I(g)}function D(t){var e,r,i,n,o,s,a,d,f,v,y,g,E,T,A,R=[];for(g=(t=O(t)).length,e=_,r=0,o=p,s=0;s=e&&yx((h-r)/(E=i+1))&&S("overflow"),r+=(a-e)*E,e=a,s=0;sh&&S("overflow"),y==e){for(d=r,f=u;!(d<(v=f<=o?l:f>=o+c?c:f-o));f+=u)A=d-v,T=u-v,R.push(b(M(v+A%T,0))),d=x(A/T);R.push(b(M(d,0))),o=P(r,E,i==n),r=0,++i}++r,++e}return R.join("")}if(s={version:"1.3.2",ucs2:{decode:O,encode:I},decode:w,encode:D,toASCII:function(t){return R(t,function(t){return y.test(t)?"xn--"+D(t):t})},toUnicode:function(t){return R(t,function(t){return v.test(t)?w(t.slice(4).toLowerCase()):t})}},i&&n)if(t.exports==i)n.exports=s;else for(a in s)s.hasOwnProperty(a)&&(i[a]=s[a]);else r.punycode=s}(Mu)}),Nu={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};function Cu(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var Lu=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h=0?(u=f.substr(0,p),l=f.substr(p+1)):(u=f,l=""),c=decodeURIComponent(u),d=decodeURIComponent(l),Cu(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},Fu=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Bu=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(i){var n=encodeURIComponent(Fu(i))+r;return Array.isArray(t[i])?t[i].map(function(t){return n+encodeURIComponent(Fu(t))}).join(e):n+encodeURIComponent(Fu(t[i]))}).join(e):i?encodeURIComponent(Fu(i))+r+encodeURIComponent(Fu(t)):""},Uu=Pu(function(t,e){e.decode=e.parse=Lu,e.encode=e.stringify=Bu}),Gu=$u;function ku(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var Xu=/^([a-z0-9.+-]+:)/i,Hu=/:[0-9]*$/,ju=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Yu=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),Vu=["'"].concat(Yu),zu=["%","/","?",";","#"].concat(Vu),Wu=["/","?","#"],qu=/^[+a-z0-9A-Z_-]{0,63}$/,Ku=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Zu={javascript:!0,"javascript:":!0},Qu={javascript:!0,"javascript:":!0},Ju={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function $u(t,e,r){if(t&&Nu.isObject(t)&&t instanceof ku)return t;var i=new ku;return i.parse(t,e,r),i}ku.prototype.parse=function(t,e,r){if(!Nu.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i127?E+="x":E+=g[T];if(!E.match(qu)){var b=v.slice(0,p),S=v.slice(p+1),A=g.match(Ku);A&&(b.push(A[1]),S.unshift(A[2])),S.length&&(s="/"+S.join(".")+s),this.hostname=b.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),m||(this.hostname=Du.toASCII(this.hostname));var R=this.port?":"+this.port:"",O=this.hostname||"";this.host=O+R,this.href+=this.host,m&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!Zu[u])for(p=0,y=Vu.length;p0)&&r.host.split("@"))&&(r.auth=A.shift(),r.host=r.hostname=A.shift())),r.search=t.search,r.query=t.query,Nu.isNull(r.pathname)&&Nu.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!g.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var T=g.slice(-1)[0],x=(r.host||t.host||g.length>1)&&("."===T||".."===T)||""===T,b=0,S=g.length;S>=0;S--)"."===(T=g[S])?g.splice(S,1):".."===T?(g.splice(S,1),b++):b&&(g.splice(S,1),b--);if(!v&&!y)for(;b--;b)g.unshift("..");!v||""===g[0]||g[0]&&"/"===g[0].charAt(0)||g.unshift(""),x&&"/"!==g.join("/").substr(-1)&&g.push("");var A,R=""===g[0]||g[0]&&"/"===g[0].charAt(0);return E&&(r.hostname=r.host=R?"":g.length?g.shift():"",(A=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=A.shift(),r.host=r.hostname=A.shift())),(v=v||r.host&&g.length)&&!R&&g.unshift(""),g.length?r.pathname=g.join("/"):(r.pathname=null,r.path=null),Nu.isNull(r.pathname)&&Nu.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},ku.prototype.parseHost=function(){var t=this.host,e=Hu.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var tl={parse:Gu,format:function(t){return Nu.isString(t)&&(t=$u(t)),t instanceof ku?t.format():ku.prototype.format.call(t)},resolve:function(t,e){return $u(t,!1,!0).resolve(e)}};rt.RETINA_PREFIX=/@([0-9\.]+)x/,rt.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var el,rl=!1,il="6.1.2",nl=function(){for(var e=[],r=[],i=0;i<32;i++)e[i]=i,r[i]=i;e[t.BLEND_MODES.NORMAL_NPM]=t.BLEND_MODES.NORMAL,e[t.BLEND_MODES.ADD_NPM]=t.BLEND_MODES.ADD,e[t.BLEND_MODES.SCREEN_NPM]=t.BLEND_MODES.SCREEN,r[t.BLEND_MODES.NORMAL]=t.BLEND_MODES.NORMAL_NPM,r[t.BLEND_MODES.ADD]=t.BLEND_MODES.ADD_NPM,r[t.BLEND_MODES.SCREEN]=t.BLEND_MODES.SCREEN_NPM;var n=[];return n.push(r),n.push(e),n}();function ol(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}function sl(t){return t+=0===t?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)}function al(t){return!(t&t-1||!t)}function hl(t){var e=(t>65535?1:0)<<4,r=((t>>>=e)>255?1:0)<<3;return e|=r,e|=r=((t>>>=r)>15?1:0)<<2,(e|=r=((t>>>=r)>3?1:0)<<1)|(t>>>=r)>>1}var ul=0;function ll(){return++ul}var cl={};function dl(t,e,r){if(void 0===r&&(r=3),!cl[e]){var i=(new Error).stack;void 0===i?console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t):(i=i.split("\n").splice(r).join("\n"),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",e+"\nDeprecated since v"+t),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t),console.warn(i))),cl[e]=!0}}var fl,pl={},_l=Object.create(null),ml=Object.create(null);function vl(t,e){var r=rt.RETINA_PREFIX.exec(t);return r?parseFloat(r[1]):void 0!==e?e:1}!function(){function t(t,e,r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=r||rt.RESOLUTION,this.resize(t,e)}t.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},t.prototype.resize=function(t,e){this.canvas.width=Math.round(t*this.resolution),this.canvas.height=Math.round(e*this.resolution)},t.prototype.destroy=function(){this.context=null,this.canvas=null},Object.defineProperty(t.prototype,"width",{get:function(){return this.canvas.width},set:function(t){this.canvas.width=Math.round(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.canvas.height},set:function(t){this.canvas.height=Math.round(t)},enumerable:!1,configurable:!0})}();var yl,gl=function(){function t(t){this.items=[],this._name=t,this._aliasCount=0}return t.prototype.emit=function(t,e,r,i,n,o,s,a){if(arguments.length>8)throw new Error("max arguments reached");var h=this.name,u=this.items;this._aliasCount++;for(var l=0,c=u.length;l0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},t.prototype.add=function(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this},t.prototype.remove=function(t){var e=this.items.indexOf(t);return-1!==e&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this},t.prototype.contains=function(t){return-1!==this.items.indexOf(t)},t.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},t.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this.items.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),t}();Object.defineProperties(gl.prototype,{dispatch:{value:gl.prototype.emit},run:{value:gl.prototype.emit}}),rt.TARGET_FPMS=.06,function(t){t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY"}(yl||(yl={}));var El,Tl=function(){function t(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=0),void 0===i&&(i=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=r,this.once=i}return t.prototype.match=function(t,e){return void 0===e&&(e=null),this.fn===t&&this.context===e},t.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},t.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},t.prototype.destroy=function(t){void 0===t&&(t=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e},t}(),xl=function(){function t(){var t=this;this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Tl(null,null,1/0),this.deltaMS=1/rt.TARGET_FPMS,this.elapsedMS=1/rt.TARGET_FPMS,this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&null===t._requestId&&t._head.next&&(t._requestId=requestAnimationFrame(t._tick)))}}return t.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},t.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},t.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},t.prototype.add=function(t,e,r){return void 0===r&&(r=yl.NORMAL),this._addListener(new Tl(t,e,r))},t.prototype.addOnce=function(t,e,r){return void 0===r&&(r=yl.NORMAL),this._addListener(new Tl(t,e,r,!0))},t.prototype._addListener=function(t){var e=this._head.next,r=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},t.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(t.prototype,"count",{get:function(){if(!this._head)return 0;for(var t=0,e=this._head;e=e.next;)t++;return t},enumerable:!1,configurable:!0}),t.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},t.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},t.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},t.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var r=t-this._lastFrame|0;if(r=this.x&&t=this.y&&e=0?Ll.S:Ll.N:2*Math.abs(e)<=Math.abs(t)?t>0?Ll.E:Ll.W:e>0?t>0?Ll.SE:Ll.SW:t>0?Ll.NE:Ll.NW},matrixAppendRotationInv:function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var n=Nl[Ll.inv(e)];n.tx=r,n.ty=i,t.append(n)}};!function(){function t(){this.worldTransform=new Ol,this.localTransform=new Ol,this.position=new Rl(this.onChange,this,0,0),this.scale=new Rl(this.onChange,this,1,1),this.pivot=new Rl(this.onChange,this,0,0),this.skew=new Rl(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.toString=function(){return"[@pixi/math:Transform position=("+this.position.x+", "+this.position.y+") rotation="+this.rotation+" scale=("+this.scale.x+", "+this.scale.y+") skew=("+this.skew.x+", "+this.skew.y+") ]"},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t}(),rt.PREFER_ENV=et.any?t.ENV.WEBGL:t.ENV.WEBGL2,rt.STRICT_TEXTURE_CACHE=!1;var Fl=[];function Bl(t,e){if(!t)return null;var r="";if("string"==typeof t){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);i&&(r=i[1].toLowerCase())}for(var n=Fl.length-1;n>=0;--n){var o=Fl[n];if(o.test&&o.test(t,r))return new o(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}var Ul=function(t,e){return(Ul=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function Gl(t,e){function r(){this.constructor=t}Ul(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var kl=function(){return(kl=Object.assign||function(t){for(var e,r=arguments,i=1,n=arguments.length;i0&&l>0,n.textureCacheIds=[],n.destroyed=!1,n.resource=null,n._batchEnabled=0,n._batchLocation=0,n.parentTextureArray=null,n.setResource(r),n}return Gl(r,e),Object.defineProperty(r.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mipmap",{get:function(){return this._mipmap},set:function(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),r.prototype.setStyle=function(t,e){var r;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this},r.prototype.setSize=function(t,e,r){return r=r||this.resolution,this.setRealSize(t*r,e*r,r)},r.prototype.setRealSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(e)/this.resolution,this._refreshPOT(),this.update(),this},r.prototype._refreshPOT=function(){this.isPowerOfTwo=al(this.realWidth)&&al(this.realHeight)},r.prototype.setResolution=function(t){var e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=Math.round(this.width*e)/t,this.height=Math.round(this.height*e)/t,this.emit("update",this)),this._refreshPOT(),this)},r.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},r.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},r.prototype.onError=function(t){this.emit("error",this,t)},r.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete ml[this.cacheId],delete _l[this.cacheId],this.cacheId=null),this.dispose(),r.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},r.prototype.dispose=function(){this.emit("dispose",this)},r.prototype.castToBaseTexture=function(){return this},r.from=function(t,e,i){void 0===i&&(i=rt.STRICT_TEXTURE_CACHE);var n="string"==typeof t,o=null;if(n)o=t;else{if(!t._pixiId){var s=e&&e.pixiIdPrefix||"pixiid";t._pixiId=s+"_"+ll()}o=t._pixiId}var a=ml[o];if(n&&i&&!a)throw new Error('The cacheId "'+o+'" does not exist in BaseTextureCache.');return a||((a=new r(t,e)).cacheId=o,r.addToCache(a,o)),a},r.fromBuffer=function(e,i,n,o){e=e||new Float32Array(i*n*4);var s=new Hl(e,{width:i,height:n}),a=e instanceof Float32Array?t.TYPES.FLOAT:t.TYPES.UNSIGNED_BYTE;return new r(s,Object.assign(jl,o||{width:i,height:n,type:a}))},r.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),ml[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),ml[e]=t)},r.removeFromCache=function(t){if("string"==typeof t){var e=ml[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete ml[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i0){if(!e.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(e.resource,r)}else e.target=t.TARGETS.TEXTURE_CUBE_MAP_POSITIVE_X+r,e.parentTextureArray=this.baseTexture,this.items[r]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[r]=e,this},r.prototype.upload=function(t,e,i){for(var n=this.itemDirtyIds,o=0;o)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,e}(Wl),Jl=function(t){function e(r,i){var n=this;if(i=i||{},!(r instanceof HTMLVideoElement)){var o=document.createElement("video");o.setAttribute("preload","auto"),o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline",""),"string"==typeof r&&(r=[r]);var s=r[0].src||r[0];Wl.crossOrigin(o,s,i.crossorigin);for(var a=0;a0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){var t=this.source;return 3===t.readyState||4===t.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(xl.shared.add(this.update,this),this._isConnectedToTicker=!0)},e.prototype._onPlayStop=function(){this._isConnectedToTicker&&(xl.shared.remove(this.update,this),this._isConnectedToTicker=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isConnectedToTicker&&(xl.shared.remove(this.update,this),this._isConnectedToTicker=!1);var e=this.source;e&&(e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(xl.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(xl.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(t){t!==this._updateFPS&&(this._updateFPS=t)},enumerable:!1,configurable:!0}),e.test=function(t,r){return self.HTMLVideoElement&&t instanceof HTMLVideoElement||e.TYPES.indexOf(r)>-1},e.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],e.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},e}(Wl),$l=function(t){function e(e){return t.call(this,e)||this}return Gl(e,t),e.test=function(t){return!!self.createImageBitmap&&t instanceof ImageBitmap},e}(Wl);Fl.push(Zl,$l,ql,Jl,Ql,Hl,Kl,zl);var tc={__proto__:null,Resource:Xl,BaseImageResource:Wl,INSTALLED:Fl,autoDetectResource:Bl,AbstractMultiResource:Vl,ArrayResource:zl,BufferResource:Hl,CanvasResource:ql,CubeResource:Kl,ImageResource:Zl,SVGResource:Ql,VideoResource:Jl,ImageBitmapResource:$l},ec=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Gl(r,e),r.prototype.upload=function(e,r,i){var n=e.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===t.ALPHA_MODES.UNPACK);var o=r.realWidth,s=r.realHeight;return i.width===o&&i.height===s?n.texSubImage2D(r.target,0,0,0,o,s,r.format,i.type,this.data):(i.width=o,i.height=s,n.texImage2D(r.target,0,i.internalFormat,o,s,0,r.format,i.type,this.data)),!0},r}(Hl),rc=function(){function e(e,r){this.width=Math.round(e||100),this.height=Math.round(r||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new gl("disposeFramebuffer"),this.multisample=t.MSAA_QUALITY.NONE}return Object.defineProperty(e.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),e.prototype.addColorTexture=function(e,r){return void 0===e&&(e=0),this.colorTextures[e]=r||new Yl(null,{scaleMode:t.SCALE_MODES.NEAREST,resolution:1,mipmap:t.MIPMAP_MODES.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.addDepthTexture=function(e){return this.depthTexture=e||new Yl(new ec(null,{width:this.width,height:this.height}),{scaleMode:t.SCALE_MODES.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:t.MIPMAP_MODES.OFF,format:t.FORMATS.DEPTH_COMPONENT,type:t.TYPES.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.resize=function(t,e){if(t=Math.round(t),e=Math.round(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var r=0;r-1&&e.textureCacheIds.splice(r,1),delete _l[t],e}}else if(t&&t.textureCacheIds){for(var i=0;ithis.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,u="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=i&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),e.prototype.castToBaseTexture=function(){return this.baseTexture},e}(wu);function ac(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}sc.EMPTY=new sc(new Yl),ac(sc.EMPTY),ac(sc.EMPTY.baseTexture),sc.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new sc(new Yl(new ql(t)))}(),ac(sc.WHITE),ac(sc.WHITE.baseTexture);var hc=function(t){function e(e,r){var i=t.call(this,e,r)||this;return i.valid=!0,i.filterFrame=null,i.filterPoolKey=null,i.updateUvs(),i}return Gl(e,t),Object.defineProperty(e.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(t){this.framebuffer.multisample=t},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,e,r){void 0===r&&(r=!0);var i=this.baseTexture.resolution,n=Math.round(t*i)/i,o=Math.round(e*i)/i;this.valid=n>0&&o>0,this._frame.width=this.orig.width=n,this._frame.height=this.orig.height=o,r&&this.baseTexture.resize(n,o),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){for(var r=arguments,i=[],n=1;n1?-n:-1:(o=((65535&(e=sl(e)))<<16|65535&(r=sl(r)))>>>0,n>1&&(o+=4294967296*n)),this.texturePool[o]||(this.texturePool[o]=[]);var s=this.texturePool[o].pop();return s||(s=this.createTexture(e,r,n)),s.filterPoolKey=o,s.setResolution(i),s},e.prototype.getFilterTexture=function(e,r,i){var n=this.getOptimalTexture(e.width,e.height,r||e.resolution,i||t.MSAA_QUALITY.NONE);return n.filterFrame=e.filterFrame,n},e.prototype.returnTexture=function(t){var e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)},e.prototype.returnFilterTexture=function(t){this.returnTexture(t)},e.prototype.clear=function(t){if(t=!1!==t)for(var e in this.texturePool){var r=this.texturePool[e];if(r)for(var i=0;i0&&t.height>0,this.texturePool)if(Number(e)<0){var r=this.texturePool[e];if(r)for(var i=0;i1){for(var u=0;u1&&((c=this.getOptimalFilterTexture(l.width,l.height,r.resolution)).filterFrame=l.filterFrame),i[d].apply(this,l,c,t.CLEAR_MODES.CLEAR,r);var f=l;l=c,c=f}i[d].apply(this,l,u.renderTexture,t.CLEAR_MODES.BLEND,r),d>1&&r.multisample>1&&this.returnFilterTexture(r.renderTexture),this.returnFilterTexture(l),this.returnFilterTexture(c)}r.clear(),this.statePool.push(r)},e.prototype.bindAndClear=function(e,r){void 0===r&&(r=t.CLEAR_MODES.CLEAR);var i=this.renderer,n=i.renderTexture,o=i.state;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e&&e.filterFrame){var s=this.tempRect;s.x=0,s.y=0,s.width=e.filterFrame.width,s.height=e.filterFrame.height,n.bind(e,e.filterFrame,s)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?n.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var a=1&o.stateId||this.forceClear;(r===t.CLEAR_MODES.CLEAR||r===t.CLEAR_MODES.BLIT&&a)&&this.renderer.framebuffer.clear(0,0,0,0)},e.prototype.applyFilter=function(e,r,i,n){var o=this.renderer;o.state.set(e.state),this.bindAndClear(i,n),e.uniforms.uSampler=r,e.uniforms.filterGlobals=this.globalUniforms,o.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(r._frame,r.filterFrame),o.geometry.bind(this.quadUv),o.geometry.draw(t.DRAW_MODES.TRIANGLES)):(o.geometry.bind(this.quad),o.geometry.draw(t.DRAW_MODES.TRIANGLE_STRIP))},e.prototype.calculateSpriteMatrix=function(t,e){var r=this.activeState,i=r.sourceFrame,n=r.destinationFrame,o=e._texture.orig,s=t.set(n.width,0,0,n.height,i.x,i.y),a=e.worldTransform.copyTo(Ol.TEMP_MATRIX);return a.invert(),s.prepend(a),s.scale(1/o.width,1/o.height),s.translate(e.anchor.x,e.anchor.y),s},e.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},e.prototype.getOptimalFilterTexture=function(e,r,i,n){return void 0===i&&(i=1),void 0===n&&(n=t.MSAA_QUALITY.NONE),this.texturePool.getOptimalTexture(e,r,i,n)},e.prototype.getFilterTexture=function(e,r,i){if("number"==typeof e){var n=e;e=r,r=n}e=e||this.activeState.renderTexture;var o=this.texturePool.getOptimalTexture(e.width,e.height,r||e.resolution,i||t.MSAA_QUALITY.NONE);return o.filterFrame=e.filterFrame,o},e.prototype.returnFilterTexture=function(t){this.texturePool.returnTexture(t)},e.prototype.emptyPool=function(){this.texturePool.clear(!0)},e.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},e.prototype.transformAABB=function(t,e){var r=bc[0],i=bc[1],n=bc[2],o=bc[3];r.set(e.left,e.top),i.set(e.left,e.bottom),n.set(e.right,e.top),o.set(e.right,e.bottom),t.apply(r,r),t.apply(i,i),t.apply(n,n),t.apply(o,o);var s=Math.min(r.x,i.x,n.x,o.x),a=Math.min(r.y,i.y,n.y,o.y),h=Math.max(r.x,i.x,n.x,o.x),u=Math.max(r.y,i.y,n.y,o.y);e.x=s,e.y=a,e.width=h-s,e.height=u-a},e.prototype.roundFrame=function(t,e,r,i,n){if(n){var o=n.a,s=n.b,a=n.c,h=n.d;if((Math.abs(s)>1e-4||Math.abs(a)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(h)>1e-4))return}(n=n?Sc.copyFrom(n):Sc.identity()).translate(-r.x,-r.y).scale(i.width/r.width,i.height/r.height).translate(i.x,i.y),this.transformAABB(n,t),t.ceil(e),this.transformAABB(n.invert(),t)},e}(),Rc=function(){function t(t){this.renderer=t}return t.prototype.flush=function(){},t.prototype.destroy=function(){this.renderer=null},t.prototype.start=function(){},t.prototype.stop=function(){this.flush()},t.prototype.render=function(t){},t}(),Oc=function(){function t(t){this.renderer=t,this.emptyRenderer=new Rc(t),this.currentRenderer=this.emptyRenderer}return t.prototype.setObjectRenderer=function(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())},t.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},t.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},t.prototype.copyBoundTextures=function(t,e){for(var r=this.renderer.texture.boundTextures,i=e-1;i>=0;--i)t[i]=r[i]||null,t[i]&&(t[i]._batchLocation=i)},t.prototype.boundArray=function(t,e,r,i){for(var n=t.elements,o=t.ids,s=t.count,a=0,h=0;h=0&&l=t.ENV.WEBGL2&&(i=e.getContext("webgl2",r)),i)this.webGLVersion=2;else if(this.webGLVersion=1,!(i=e.getContext("webgl",r)||e.getContext("experimental-webgl",r)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl},e.prototype.getExtensions=function(){var t=this.gl,e={anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};1===this.webGLVersion?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,e,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;this.renderer=null,t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},e.prototype.validateContext=function(t){var e=t.getContextAttributes(),r="WebGL2RenderingContext"in self&&t instanceof self.WebGL2RenderingContext;r&&(this.webGLVersion=2),e.stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var i=r||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=i,i||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},e}(),Pc=function(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=t.MSAA_QUALITY.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},wc=new Sl,Dc=function(){function e(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new rc(10,10),this.msaaSamples=null}return e.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Sl,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var r=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;rt.PREFER_ENV===t.ENV.WEBGL_LEGACY&&(r=null,i=null),r?e.drawBuffers=function(t){return r.drawBuffersWEBGL(t)}:(this.hasMRT=!1,e.drawBuffers=function(){}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)},e.prototype.bind=function(t,e,r){void 0===r&&(r=0);var i=this.gl;if(t){var n=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,n.framebuffer)),n.mipLevel!==r&&(t.dirtyId++,t.dirtyFormat++,n.mipLevel=r),n.dirtyId!==t.dirtyId&&(n.dirtyId=t.dirtyId,n.dirtyFormat!==t.dirtyFormat?(n.dirtyFormat=t.dirtyFormat,n.dirtySize=t.dirtySize,this.updateFramebuffer(t,r)):n.dirtySize!==t.dirtySize&&(n.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var o=0;o>r,h=e.height>>r,u=a/e.width;this.setViewport(e.x*u,e.y*u,a,h)}else a=t.width>>r,h=t.height>>r,this.setViewport(0,0,a,h)}else this.current&&(this.current=null,i.bindFramebuffer(i.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},e.prototype.setViewport=function(t,e,r,i){var n=this.viewport;t=Math.round(t),e=Math.round(e),r=Math.round(r),i=Math.round(i),n.width===r&&n.height===i&&n.x===t&&n.y===e||(n.x=t,n.y=e,n.width=r,n.height=i,this.gl.viewport(t,e,r,i))},Object.defineProperty(e.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),e.prototype.clear=function(e,r,i,n,o){void 0===o&&(o=t.BUFFER_BITS.COLOR|t.BUFFER_BITS.DEPTH);var s=this.gl;s.clearColor(e,r,i,n),s.clear(o)},e.prototype.initFramebuffer=function(t){var e=this.gl,r=new Pc(e.createFramebuffer());return r.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=r,this.managedFramebuffers.push(t),t.disposeRunner.add(this),r},e.prototype.resizeFramebuffer=function(t){var e=this.gl,r=t.glFramebuffers[this.CONTEXT_UID];r.msaaBuffer&&(e.bindRenderbuffer(e.RENDERBUFFER,r.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,r.multisample,e.RGBA8,t.width,t.height)),r.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),r.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,r.multisample,e.DEPTH24_STENCIL8,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height));var i=t.colorTextures,n=i.length;e.drawBuffers||(n=Math.min(n,1));for(var o=0;o1&&this.canMultisampleFramebuffer(t)?(i.msaaBuffer=i.msaaBuffer||r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,i.msaaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,r.RGBA8,t.width,t.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,i.msaaBuffer)):i.msaaBuffer&&(r.deleteRenderbuffer(i.msaaBuffer),i.msaaBuffer=null);for(var s=[],a=0;a1&&r.drawBuffers(s),t.depthTexture&&this.writeDepthTexture){var l=t.depthTexture;this.renderer.texture.bind(l,0),r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,l._glTextures[this.CONTEXT_UID].texture,e)}!t.stencil&&!t.depth||t.depthTexture&&this.writeDepthTexture?i.stencil&&(r.deleteRenderbuffer(i.stencil),i.stencil=null):(i.stencil=i.stencil||r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,i.stencil),i.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,r.DEPTH24_STENCIL8,t.width,t.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t.width,t.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,i.stencil))},e.prototype.canMultisampleFramebuffer=function(t){return 1!==this.renderer.context.webGLVersion&&t.colorTextures.length<=1&&!t.depthTexture},e.prototype.detectSamples=function(e){var r=this.msaaSamples,i=t.MSAA_QUALITY.NONE;if(e<=1||null===r)return i;for(var n=0;n=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.msaaBuffer&&i.deleteRenderbuffer(r.msaaBuffer),r.stencil&&i.deleteRenderbuffer(r.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r0&&(e+="\nelse "),r=t.ENV.WEBGL2&&(r=e.getContext("webgl2",{})),r||((r=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}))?r.getExtension("WEBGL_draw_buffers"):r=null),Hc=r}return Hc}();if(e&&e.getShaderPrecisionFormat){var r=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT);kc=r.precision?t.PRECISION.HIGH:t.PRECISION.MEDIUM}}return kc}())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(e,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"},enumerable:!1,configurable:!0}),e.from=function(t,r,i){var n=t+r,o=pl[n];return o||(pl[n]=o=new e(t,r,i)),o},e}(),nd=function(){function t(t,e){this.uniformBindCount=0,this.program=t,this.uniformGroup=e?e instanceof Tc?e:new Tc(e):new Tc({})}return t.prototype.checkUniformExists=function(t,e){if(e.uniforms[t])return!0;for(var r in e.uniforms){var i=e.uniforms[r];if(i.group&&this.checkUniformExists(t,i))return!0}return!1},t.prototype.destroy=function(){this.uniformGroup=null},Object.defineProperty(t.prototype,"uniforms",{get:function(){return this.uniformGroup.uniforms},enumerable:!1,configurable:!0}),t.from=function(e,r,i){return new t(id.from(e,r),i)},t}(),od=function(){function e(){this.data=0,this.blendMode=t.BLEND_MODES.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}return Object.defineProperty(e.prototype,"blend",{get:function(){return!!(1&this.data)},set:function(t){!!(1&this.data)!==t&&(this.data^=1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsets",{get:function(){return!!(2&this.data)},set:function(t){!!(2&this.data)!==t&&(this.data^=2)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"culling",{get:function(){return!!(4&this.data)},set:function(t){!!(4&this.data)!==t&&(this.data^=4)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthTest",{get:function(){return!!(8&this.data)},set:function(t){!!(8&this.data)!==t&&(this.data^=8)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthMask",{get:function(){return!!(32&this.data)},set:function(t){!!(32&this.data)!==t&&(this.data^=32)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clockwiseFrontFace",{get:function(){return!!(16&this.data)},set:function(t){!!(16&this.data)!==t&&(this.data^=16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this._blendMode},set:function(e){this.blend=e!==t.BLEND_MODES.NONE,this._blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"polygonOffset",{get:function(){return this._polygonOffset},set:function(t){this.offsets=!!t,this._polygonOffset=t},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"[@pixi/core:State blendMode="+this.blendMode+" clockwiseFrontFace="+this.clockwiseFrontFace+" culling="+this.culling+" depthMask="+this.depthMask+" polygonOffset="+this.polygonOffset+"]"},e.for2d=function(){var t=new e;return t.depthTest=!1,t.blend=!0,t},e}(),sd=function(t){function e(r,i,n){var o=this,s=id.from(r||e.defaultVertexSrc,i||e.defaultFragmentSrc);return(o=t.call(this,s,n)||this).padding=0,o.resolution=rt.FILTER_RESOLUTION,o.multisample=rt.FILTER_MULTISAMPLE,o.enabled=!0,o.autoFit=!0,o.state=new od,o}return Gl(e,t),e.prototype.apply=function(t,e,r,i,n){t.applyFilter(this,e,r,i)},Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"},enumerable:!1,configurable:!0}),e}(nd),ad="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n}\n",hd="varying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D mask;\nuniform float alpha;\nuniform float npmAlpha;\nuniform vec4 maskClamp;\n\nvoid main(void)\n{\n float clip = step(3.5,\n step(maskClamp.x, vMaskCoord.x) +\n step(maskClamp.y, vMaskCoord.y) +\n step(vMaskCoord.x, maskClamp.z) +\n step(vMaskCoord.y, maskClamp.w));\n\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\n\n original *= (alphaMul * masky.r * alpha * clip);\n\n gl_FragColor = original;\n}\n",ud=new Ol,ld=function(){function t(t,e){this._texture=t,this.mapCoord=new Ol,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=void 0===e?.5:e,this.isSimple=!1}return Object.defineProperty(t.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture=t,this._textureID=-1},enumerable:!1,configurable:!0}),t.prototype.multiplyUvs=function(t,e){void 0===e&&(e=t);for(var r=this.mapCoord,i=0;i0?this._useCurrent():t.disable(t.SCISSOR_TEST)},e.prototype._useCurrent=function(){var t=this.maskStack[this.maskStack.length-1]._scissorRect,e=this.renderer.renderTexture.current,r=this.renderer.projection,i=r.transform,n=r.sourceFrame,o=r.destinationFrame,s=e?e.resolution:this.renderer.resolution,a=o.width/n.width,h=o.height/n.height,u=((t.x-n.x)*a+o.x)*s,l=((t.y-n.y)*h+o.y)*s,c=t.width*a*s,d=t.height*h*s;i&&(u+=i.tx*s,l+=i.ty*s),e||(l=this.renderer.height-d-l),u=Math.round(u),l=Math.round(l),c=Math.round(c),d=Math.round(d),this.renderer.gl.scissor(u,l,c,d)},e}(fd),_d=function(t){function e(e){var r=t.call(this,e)||this;return r.glConst=WebGLRenderingContext.STENCIL_TEST,r}return Gl(e,t),e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0},e.prototype.push=function(t){var e=t.maskObject,r=this.renderer.gl,i=t._stencilCounter;0===i&&(this.renderer.framebuffer.forceStencil(),r.enable(r.STENCIL_TEST)),t._stencilCounter++,r.colorMask(!1,!1,!1,!1),r.stencilFunc(r.EQUAL,i,this._getBitwiseMask()),r.stencilOp(r.KEEP,r.KEEP,r.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,this._useCurrent()},e.prototype.pop=function(t){var e=this.renderer.gl;0===this.getStackLength()?(e.disable(e.STENCIL_TEST),e.clear(e.STENCIL_BUFFER_BIT),e.clearStencil(0)):(e.colorMask(!1,!1,!1,!1),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,this._useCurrent())},e.prototype._useCurrent=function(){var t=this.renderer.gl;t.colorMask(!0,!0,!0,!0),t.stencilFunc(t.EQUAL,this.getStackLength(),this._getBitwiseMask()),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)},e.prototype._getBitwiseMask=function(){return(1<1&&(r=Math.max(r,16)*s.data.size),s.dataLen=r,i%r!=0&&i<16){var a=i%r%16;i+=a,n+=a}i+r>16?(n=16*Math.ceil(n/16),s.offset=n,n+=r,i=r):(s.offset=n,i+=r,n+=r)}return{uboElements:e,size:n=16*Math.ceil(n/16)}}(function(t,e){var r=[];for(var i in t)e[i]&&r.push(e[i]);return r.sort(function(t,e){return t.index-e.index}),r}(t.uniforms,e)),i=r.uboElements,n=r.size,o=["\n var v = null;\n var v2 = null;\n var cv = null;\n var t = 0;\n var gl = renderer.gl\n var index = 0;\n var data = buffer.data;\n "],s=0;s1){var f=Vc(a.data.type),p=Math.max(xd[a.data.type]/16,1),_=f/p,m=(4-_%4)%4;o.push("\n cv = ud."+u+".value;\n v = uv."+u+";\n offset = "+a.offset/4+";\n\n t = 0;\n\n for(var i=0; i < "+a.data.size*p+"; i++)\n {\n for(var j = 0; j < "+_+"; j++)\n {\n data[offset++] = v[t++];\n }\n offset += "+m+";\n }\n\n ")}else{var v=Td[a.data.type];o.push("\n cv = ud."+u+".value;\n v = uv."+u+";\n offset = "+a.offset/4+";\n "+v+";\n ")}}return o.push("\n renderer.buffer.update(buffer);\n "),{size:n,syncFunc:new Function("ud","uv","renderer","syncData","buffer",o.join("\n"))}}(t,this.shader.program.uniformData)),t.autoManage){var a=new Float32Array(s.size/4);t.buffer.update(a)}return e.uniformGroups[t.id]=s.syncFunc,e.uniformGroups[t.id]},t.prototype.getSignature=function(t,e,r){var i=t.uniforms,n=[r+"-"];for(var o in i)n.push(o),e[o]&&n.push(e[o].type);return n.join("-")},t.prototype.getGlProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},t.prototype.generateProgram=function(t){var e=this.gl,r=t.program,i=function(t,e){var r=Fc(t,t.VERTEX_SHADER,e.vertexSrc),i=Fc(t,t.FRAGMENT_SHADER,e.fragmentSrc),n=t.createProgram();t.attachShader(n,r),t.attachShader(n,i),t.linkProgram(n),t.getProgramParameter(n,t.LINK_STATUS)||function(t,e,r,i){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(r,t.COMPILE_STATUS)||Bc(t,r),t.getShaderParameter(i,t.COMPILE_STATUS)||Bc(t,i),console.error("PixiJS Error: Could not initialize shader."),""!==t.getProgramInfoLog(e)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}(t,n,r,i),e.attributeData=function(t,e){for(var r={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),n=0;ne?1:-1});for(var s=0;s>=1,r++;this.stateId=t.data}for(r=0;rthis.checkCountMax&&(this.checkCount=0,this.run())))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,i=0;ithis.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){var o=0;for(i=0;i=0;i--)this.unload(t.children[i])},e.prototype.destroy=function(){this.renderer=null},e}(),Ld=function(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=t.TYPES.UNSIGNED_BYTE,this.internalFormat=t.FORMATS.RGBA,this.samplerType=0},Fd=function(){function e(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new Yl,this.hasIntegerTextures=!1}return e.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=function(e){var r,i,n,o,s,a,h,u,l,c,d,f,p,_,m,v,y,g,E,T,x,b,S;return"WebGL2RenderingContext"in self&&e instanceof self.WebGL2RenderingContext?((r={})[t.TYPES.UNSIGNED_BYTE]=((i={})[t.FORMATS.RGBA]=e.RGBA8,i[t.FORMATS.RGB]=e.RGB8,i[t.FORMATS.RG]=e.RG8,i[t.FORMATS.RED]=e.R8,i[t.FORMATS.RGBA_INTEGER]=e.RGBA8UI,i[t.FORMATS.RGB_INTEGER]=e.RGB8UI,i[t.FORMATS.RG_INTEGER]=e.RG8UI,i[t.FORMATS.RED_INTEGER]=e.R8UI,i[t.FORMATS.ALPHA]=e.ALPHA,i[t.FORMATS.LUMINANCE]=e.LUMINANCE,i[t.FORMATS.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,i),r[t.TYPES.BYTE]=((n={})[t.FORMATS.RGBA]=e.RGBA8_SNORM,n[t.FORMATS.RGB]=e.RGB8_SNORM,n[t.FORMATS.RG]=e.RG8_SNORM,n[t.FORMATS.RED]=e.R8_SNORM,n[t.FORMATS.RGBA_INTEGER]=e.RGBA8I,n[t.FORMATS.RGB_INTEGER]=e.RGB8I,n[t.FORMATS.RG_INTEGER]=e.RG8I,n[t.FORMATS.RED_INTEGER]=e.R8I,n),r[t.TYPES.UNSIGNED_SHORT]=((o={})[t.FORMATS.RGBA_INTEGER]=e.RGBA16UI,o[t.FORMATS.RGB_INTEGER]=e.RGB16UI,o[t.FORMATS.RG_INTEGER]=e.RG16UI,o[t.FORMATS.RED_INTEGER]=e.R16UI,o[t.FORMATS.DEPTH_COMPONENT]=e.DEPTH_COMPONENT16,o),r[t.TYPES.SHORT]=((s={})[t.FORMATS.RGBA_INTEGER]=e.RGBA16I,s[t.FORMATS.RGB_INTEGER]=e.RGB16I,s[t.FORMATS.RG_INTEGER]=e.RG16I,s[t.FORMATS.RED_INTEGER]=e.R16I,s),r[t.TYPES.UNSIGNED_INT]=((a={})[t.FORMATS.RGBA_INTEGER]=e.RGBA32UI,a[t.FORMATS.RGB_INTEGER]=e.RGB32UI,a[t.FORMATS.RG_INTEGER]=e.RG32UI,a[t.FORMATS.RED_INTEGER]=e.R32UI,a[t.FORMATS.DEPTH_COMPONENT]=e.DEPTH_COMPONENT24,a),r[t.TYPES.INT]=((h={})[t.FORMATS.RGBA_INTEGER]=e.RGBA32I,h[t.FORMATS.RGB_INTEGER]=e.RGB32I,h[t.FORMATS.RG_INTEGER]=e.RG32I,h[t.FORMATS.RED_INTEGER]=e.R32I,h),r[t.TYPES.FLOAT]=((u={})[t.FORMATS.RGBA]=e.RGBA32F,u[t.FORMATS.RGB]=e.RGB32F,u[t.FORMATS.RG]=e.RG32F,u[t.FORMATS.RED]=e.R32F,u[t.FORMATS.DEPTH_COMPONENT]=e.DEPTH_COMPONENT32F,u),r[t.TYPES.HALF_FLOAT]=((l={})[t.FORMATS.RGBA]=e.RGBA16F,l[t.FORMATS.RGB]=e.RGB16F,l[t.FORMATS.RG]=e.RG16F,l[t.FORMATS.RED]=e.R16F,l),r[t.TYPES.UNSIGNED_SHORT_5_6_5]=((c={})[t.FORMATS.RGB]=e.RGB565,c),r[t.TYPES.UNSIGNED_SHORT_4_4_4_4]=((d={})[t.FORMATS.RGBA]=e.RGBA4,d),r[t.TYPES.UNSIGNED_SHORT_5_5_5_1]=((f={})[t.FORMATS.RGBA]=e.RGB5_A1,f),r[t.TYPES.UNSIGNED_INT_2_10_10_10_REV]=((p={})[t.FORMATS.RGBA]=e.RGB10_A2,p[t.FORMATS.RGBA_INTEGER]=e.RGB10_A2UI,p),r[t.TYPES.UNSIGNED_INT_10F_11F_11F_REV]=((_={})[t.FORMATS.RGB]=e.R11F_G11F_B10F,_),r[t.TYPES.UNSIGNED_INT_5_9_9_9_REV]=((m={})[t.FORMATS.RGB]=e.RGB9_E5,m),r[t.TYPES.UNSIGNED_INT_24_8]=((v={})[t.FORMATS.DEPTH_STENCIL]=e.DEPTH24_STENCIL8,v),r[t.TYPES.FLOAT_32_UNSIGNED_INT_24_8_REV]=((y={})[t.FORMATS.DEPTH_STENCIL]=e.DEPTH32F_STENCIL8,y),S=r):((g={})[t.TYPES.UNSIGNED_BYTE]=((E={})[t.FORMATS.RGBA]=e.RGBA,E[t.FORMATS.RGB]=e.RGB,E[t.FORMATS.ALPHA]=e.ALPHA,E[t.FORMATS.LUMINANCE]=e.LUMINANCE,E[t.FORMATS.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,E),g[t.TYPES.UNSIGNED_SHORT_5_6_5]=((T={})[t.FORMATS.RGB]=e.RGB,T),g[t.TYPES.UNSIGNED_SHORT_4_4_4_4]=((x={})[t.FORMATS.RGBA]=e.RGBA,x),g[t.TYPES.UNSIGNED_SHORT_5_5_5_1]=((b={})[t.FORMATS.RGBA]=e.RGBA,b),S=g),S}(e);var r=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=r;for(var i=0;i=0;--o){var s=r[o];s&&s._glTextures[n].samplerType!==t.SAMPLER_TYPES.FLOAT&&this.renderer.texture.unbind(s)}},e.prototype.initTexture=function(t){var e=new Ld(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e},e.prototype.initTextureType=function(e,r){var i,n;r.internalFormat=null!==(n=null===(i=this.internalFormats[e.type])||void 0===i?void 0:i[e.format])&&void 0!==n?n:e.format,2===this.webGLVersion&&e.type===t.TYPES.HALF_FLOAT?r.type=this.gl.HALF_FLOAT:r.type=e.type},e.prototype.updateTexture=function(e){var r=e._glTextures[this.CONTEXT_UID];if(r){var i=this.renderer;if(this.initTextureType(e,r),e.resource&&e.resource.upload(i,e,r))r.samplerType!==t.SAMPLER_TYPES.FLOAT&&(this.hasIntegerTextures=!0);else{var n=e.realWidth,o=e.realHeight,s=i.gl;(r.width!==n||r.height!==o||r.dirtyId<0)&&(r.width=n,r.height=o,s.texImage2D(e.target,0,r.internalFormat,n,o,0,e.format,r.type,null))}e.dirtyStyleId!==r.dirtyStyleId&&this.updateTextureStyle(e),r.dirtyId=e.dirtyId}},e.prototype.destroyTexture=function(t,e){var r=this.gl;if((t=t.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(t),r.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){var i=this.managedTextures.indexOf(t);-1!==i&&function(t,e,r){var i,n=t.length;if(!(e>=n||0===r)){var o=n-(r=e+r>n?n-e:r);for(i=e;i=1:r.mipmap=!1,2===this.webGLVersion||e.isPowerOfTwo?r.wrapMode=e.wrapMode:r.wrapMode=t.WRAP_MODES.CLAMP,e.resource&&e.resource.style(this.renderer,e,r)||this.setStyle(e,r),r.dirtyStyleId=e.dirtyStyleId)},e.prototype.setStyle=function(e,r){var i=this.gl;if(r.mipmap&&e.mipmap!==t.MIPMAP_MODES.ON_MANUAL&&i.generateMipmap(e.target),i.texParameteri(e.target,i.TEXTURE_WRAP_S,r.wrapMode),i.texParameteri(e.target,i.TEXTURE_WRAP_T,r.wrapMode),r.mipmap){i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===t.SCALE_MODES.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===t.SCALE_MODES.LINEAR){var o=Math.min(e.anisotropicLevel,i.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(e.target,n.TEXTURE_MAX_ANISOTROPY_EXT,o)}}else i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===t.SCALE_MODES.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(e.target,i.TEXTURE_MAG_FILTER,e.scaleMode===t.SCALE_MODES.LINEAR?i.LINEAR:i.NEAREST)},e.prototype.destroy=function(){this.renderer=null},e}(),Bd={__proto__:null,FilterSystem:Ac,BatchSystem:Oc,ContextSystem:Mc,FramebufferSystem:Dc,GeometrySystem:Cc,MaskSystem:dd,ScissorSystem:pd,StencilSystem:_d,ProjectionSystem:md,RenderTextureSystem:gd,ShaderSystem:Rd,StateSystem:Nd,TextureGCSystem:Cd,TextureSystem:Fd},Ud=new Ol,Gd=function(e){function r(r,i){void 0===r&&(r=t.RENDERER_TYPE.UNKNOWN);var n=e.call(this)||this;return i=Object.assign({},rt.RENDER_OPTIONS,i),n.options=i,n.type=r,n.screen=new Sl(0,0,i.width,i.height),n.view=i.view||document.createElement("canvas"),n.resolution=i.resolution||rt.RESOLUTION,n.useContextAlpha=i.useContextAlpha,n.autoDensity=!!i.autoDensity,n.preserveDrawingBuffer=i.preserveDrawingBuffer,n.clearBeforeRender=i.clearBeforeRender,n._backgroundColor=0,n._backgroundColorRgba=[0,0,0,1],n._backgroundColorString="#000000",n.backgroundColor=i.backgroundColor||n._backgroundColor,n.backgroundAlpha=i.backgroundAlpha,void 0!==i.transparent&&(dl("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),n.useContextAlpha=i.transparent,n.backgroundAlpha=i.transparent?0:1),n._lastObjectRendered=null,n.plugins={},n}return Gl(r,e),r.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},Object.defineProperty(r.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),r.prototype.resize=function(t,e){this.view.width=Math.round(t*this.resolution),this.view.height=Math.round(e*this.resolution);var r=this.view.width/this.resolution,i=this.view.height/this.resolution;this.screen.width=r,this.screen.height=i,this.autoDensity&&(this.view.style.width=r+"px",this.view.style.height=i+"px"),this.emit("resize",r,i)},r.prototype.generateTexture=function(t,e,r,i){void 0===e&&(e={}),"number"==typeof e&&(dl("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),e={scaleMode:e,resolution:r,region:i});var n=e.region,o=function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}(t,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(t){this._backgroundColorRgba[3]=t},enumerable:!1,configurable:!0}),r}(wu),kd=function(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0},Xd=function(){function t(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}return t.prototype.destroy=function(){this.renderer=null},t.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},t.prototype.bind=function(t){var e=this.gl,r=this.CONTEXT_UID,i=t._glBuffers[r]||this.createGLBuffer(t);e.bindBuffer(t.type,i.buffer)},t.prototype.bindBufferBase=function(t,e){var r=this.gl,i=this.CONTEXT_UID;if(this.boundBufferBases[e]!==t){var n=t._glBuffers[i]||this.createGLBuffer(t);this.boundBufferBases[e]=t,r.bindBufferBase(r.UNIFORM_BUFFER,e,n.buffer)}},t.prototype.bindBufferRange=function(t,e,r){var i=this.gl,n=this.CONTEXT_UID;r=r||0;var o=t._glBuffers[n]||this.createGLBuffer(t);i.bindBufferRange(i.UNIFORM_BUFFER,e||0,o.buffer,256*r,256)},t.prototype.update=function(t){var e=this.gl,r=this.CONTEXT_UID,i=t._glBuffers[r];if(t._updateID!==i.updateID)if(i.updateID=t._updateID,e.bindBuffer(t.type,i.buffer),i.byteLength>=t.data.byteLength)e.bufferSubData(t.type,0,t.data);else{var n=t.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;i.byteLength=t.data.byteLength,e.bufferData(t.type,t.data,n)}},t.prototype.dispose=function(t,e){if(this.managedBuffers[t.id]){delete this.managedBuffers[t.id];var r=t._glBuffers[this.CONTEXT_UID],i=this.gl;t.disposeRunner.remove(this),r&&(e||i.deleteBuffer(r.buffer),delete t._glBuffers[this.CONTEXT_UID])}},t.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedBuffers),r=0;r-1){var r=["\n %c %c %c PixiJS "+il+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(e=self.console).log.apply(e,r)}else self.console&&self.console.log("PixiJS "+il+" - "+t+" - http://www.pixijs.com/");rl=!0}}(2===n.context.webGLVersion?"WebGL 2":"WebGL 1"),n.resize(n.options.width,n.options.height),n}Gl(r,e),r.create=function(t){if(void 0===el&&(el=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:rt.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!self.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),i=!(!r||!r.getContextAttributes().stencil);if(r){var n=r.getExtension("WEBGL_lose_context");n&&n.loseContext()}return r=null,i}catch(t){return!1}}()),el)return new r(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},r.prototype.contextChange=function(){var e,r=this.gl;if(1===this.context.webGLVersion){var i=r.getParameter(r.FRAMEBUFFER_BINDING);r.bindFramebuffer(r.FRAMEBUFFER,null),e=r.getParameter(r.SAMPLES),r.bindFramebuffer(r.FRAMEBUFFER,i)}else i=r.getParameter(r.DRAW_FRAMEBUFFER_BINDING),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),e=r.getParameter(r.SAMPLES),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,i);e>=t.MSAA_QUALITY.HIGH?this.multisample=t.MSAA_QUALITY.HIGH:e>=t.MSAA_QUALITY.MEDIUM?this.multisample=t.MSAA_QUALITY.MEDIUM:e>=t.MSAA_QUALITY.LOW?this.multisample=t.MSAA_QUALITY.LOW:this.multisample=t.MSAA_QUALITY.NONE},r.prototype.addSystem=function(t,e){var r=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var i in this[e]=r,this.runners)this.runners[i].add(r);return this},r.prototype.render=function(t,e){var r,i,n,o;if(e&&(e instanceof hc?(dl("6.0.0","Renderer#render arguments changed, use options instead."),r=e,i=arguments[2],n=arguments[3],o=arguments[4]):(r=e.renderTexture,i=e.clear,n=e.transform,o=e.skipUpdateTransform)),this.renderingToScreen=!r,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=n,!this.context.isLost){if(r||(this._lastObjectRendered=t),!o){var s=t.enableTempParent();t.updateTransform(),t.disableTempParent(s)}this.renderTexture.bind(r),this.batch.currentRenderer.start(),(void 0!==i?i:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),r&&r.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},r.prototype.generateTexture=function(t,r,i,n){void 0===r&&(r={});var o=e.prototype.generateTexture.call(this,t,r,i,n);return this.framebuffer.blit(),o},r.prototype.resize=function(t,r){e.prototype.resize.call(this,t,r),this.runners.resize.emit(this.screen.height,this.screen.width)},r.prototype.reset=function(){return this.runners.reset.emit(),this},r.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},r.prototype.destroy=function(t){for(var r in this.runners.destroy.emit(),this.runners)this.runners[r].destroy();e.prototype.destroy.call(this,t),this.gl=null},Object.defineProperty(r.prototype,"extract",{get:function(){return dl("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),r.registerPlugin=function(t,e){r.__plugins=r.__plugins||{},r.__plugins[t]=e}}(Gd),function(){this.texArray=null,this.blend=0,this.type=t.DRAW_MODES.TRIANGLES,this.start=0,this.size=0,this.data=null}),jd=function(){function t(){this.elements=[],this.ids=[],this.count=0}return t.prototype.clear=function(){for(var t=0;tthis.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)},r.prototype.buildTexturesAndDrawCalls=function(){var t=this._bufferedTextures,e=this.MAX_TEXTURES,i=r._textureArrayPool,n=this.renderer.batch,o=this._tempBoundTextures,s=this.renderer.textureGC.count,a=++Yl._globalBatch,h=0,u=i[0],l=0;n.copyBoundTextures(o,e);for(var c=0;c=e&&(n.boundArray(u,o,a,e),this.buildDrawCalls(u,l,c),l=c,u=i[++h],++a),d._batchEnabled=a,d.touched=s,u.elements[u.count++]=d)}for(u.count>0&&(n.boundArray(u,o,a,e),this.buildDrawCalls(u,l,this._bufferSize),++h,++a),c=0;c>16&255,i=t>>8&255,n=255&t;return(255*d<<24)+((r=r*d+.5|0)<<16)+((i=i*d+.5|0)<<8)+(n*d+.5|0)}(t._tintRGB):t._tintRGB+(255*d<<24),p=0;p0&&(e+="\nelse "),r0){var R=t.worldTransform,O=R.a,I=R.b,M=R.c,P=R.d,w=(g+E+T)/3,D=(x+b+S)/3,N=g-w,C=x-D,L=O*N+M*C,F=I*N+P*C,B=Math.sqrt(L*L+F*F),U=1+A/B;g=w+N*U,x=D+C*U,L=O*(N=E-w)+M*(C=b-D),F=I*N+P*C,E=w+N*(U=1+A/(B=Math.sqrt(L*L+F*F))),b=D+C*U,L=O*(N=T-w)+M*(C=S-D),F=I*N+P*C,T=w+N*(U=1+A/(B=Math.sqrt(L*L+F*F))),S=D+C*U}n.save(),n.beginPath(),n.moveTo(g,x),n.lineTo(E,b),n.lineTo(T,S),n.closePath(),n.clip();var G=f*v+m*_+p*y-v*_-m*p-f*y,k=g*v+m*T+E*y-v*T-m*E-g*y,X=f*E+g*_+p*T-E*_-g*p-f*T,H=f*v*T+m*E*_+g*p*y-g*v*_-m*p*T-f*E*y,j=x*v+m*S+b*y-v*S-m*b-x*y,Y=f*b+x*_+p*S-b*_-x*p-f*S,V=f*v*S+m*b*_+x*p*y-x*v*_-m*p*S-f*b*y;n.transform(k/G,j/G,X/G,Y/G,H/G,V/G),n.drawImage(d,0,0,l*u.resolution,c*u.resolution,0,0,l,c),n.restore(),this.renderer.invalidateBlendMode()}},e.prototype.renderMeshFlat=function(t){var e=this.renderer.context,r=t.geometry.getBuffer("aVertexPosition").data,i=r.length/2;e.beginPath();for(var n=1;n0},t}(),sf=function(){function e(t){this._svgMatrix=null,this._tempMatrix=new Qe,this.renderer=t}return e.prototype._calcCanvasStyle=function(t,e){var r;return t.texture&&t.texture.baseTexture!==ii.WHITE.baseTexture?t.texture.valid?(r=Ou.getTintedPattern(t.texture,e),this.setPatternTransform(r,t.matrix||Qe.IDENTITY)):r="#808080":r="#"+("00000"+(0|e).toString(16)).substr(-6),r},e.prototype.render=function(e){var r=this.renderer,i=r.context,n=e.worldAlpha,o=e.transform.worldTransform;r.setContextTransform(o),r.setBlendMode(e.blendMode);for(var s,a,h=e.geometry.graphicsData,u=(e.tint>>16&255)/255,l=(e.tint>>8&255)/255,c=(255&e.tint)/255,d=0;d>16&255)/255*u*255<<16)+((v>>8&255)/255*l*255<<8)+(255&v)/255*c*255;s=this._calcCanvasStyle(_,g)}if(m.visible){var E=((y>>16&255)/255*u*255<<16)+((y>>8&255)/255*l*255<<8)+(255&y)/255*c*255;a=this._calcCanvasStyle(m,E)}if(i.lineWidth=m.width,i.lineCap=m.cap,i.lineJoin=m.join,i.miterLimit=m.miterLimit,f.type===t.SHAPES.POLY){i.beginPath();var T=(P=p).points,x=f.holes,b=void 0,S=void 0,A=void 0,R=void 0,O=void 0;i.moveTo(T[0],T[1]);for(var I=2;I0){for(O=[],b=0,A=T[0],R=T[1],I=2;I+2=0;I-=2)i.lineTo(T[I],T[I+1]);x[M].shape.closeStroke&&i.closePath(),O[M]=S*b<0}}_.visible&&(i.globalAlpha=_.alpha*n,i.fillStyle=s,i.fill()),m.visible&&this.paintPolygonStroke(P,m,a,x,O,n,i)}else if(f.type===t.SHAPES.RECT){var P=p;if(_.visible&&(i.globalAlpha=_.alpha*n,i.fillStyle=s,i.fillRect(P.x,P.y,P.width,P.height)),m.visible){var w=m.width*(.5-(1-m.alignment)),D=P.width+2*w,N=P.height+2*w;i.globalAlpha=m.alpha*n,i.strokeStyle=a,i.strokeRect(P.x-w,P.y-w,D,N)}}else if(f.type===t.SHAPES.CIRC)P=p,i.beginPath(),i.arc(P.x,P.y,P.radius,0,2*Math.PI),i.closePath(),_.visible&&(i.globalAlpha=_.alpha*n,i.fillStyle=s,i.fill()),m.visible&&(.5!==m.alignment&&(w=m.width*(.5-(1-m.alignment)),i.beginPath(),i.arc(P.x,P.y,P.radius+w,0,2*Math.PI),i.closePath()),i.globalAlpha=m.alpha*n,i.strokeStyle=a,i.stroke());else if(f.type===t.SHAPES.ELIP){if(P=p,(Y=1===m.alignment)||this.paintEllipse(P,_,m,s,n,i),m.visible){if(.5!==m.alignment){w=m.width*(.5-(1-m.alignment));var C=2*(P.width+w),L=2*(P.height+w),F=P.x-C/2,B=P.y-L/2,U=C/2*.5522848,G=L/2*.5522848,k=F+C,X=B+L,H=F+C/2,j=B+L/2;i.beginPath(),i.moveTo(F,j),i.bezierCurveTo(F,j-G,H-U,B,H,B),i.bezierCurveTo(H+U,B,k,j-G,k,j),i.bezierCurveTo(k,j+G,H+U,X,H,X),i.bezierCurveTo(H-U,X,F,j+G,F,j),i.closePath()}i.globalAlpha=m.alpha*n,i.strokeStyle=a,i.stroke()}Y&&this.paintEllipse(P,_,m,s,n,i)}else if(f.type===t.SHAPES.RREC){var Y;if(P=p,(Y=1===m.alignment)||this.paintRoundedRectangle(P,_,m,s,n,i),m.visible){if(.5!==m.alignment){D=P.width,N=P.height,w=m.width*(.5-(1-m.alignment));var V=P.x-w,z=P.y-w,W=P.width+2*w,q=P.height+2*w,K=w*(m.alignment>=1?Math.min(W/D,q/N):Math.min(D/W,N/q)),Z=P.radius+K,Q=Math.min(W,q)/2;Z=Z>Q?Q:Z,i.beginPath(),i.moveTo(V,z+Z),i.lineTo(V,z+q-Z),i.quadraticCurveTo(V,z+q,V+Z,z+q),i.lineTo(V+W-Z,z+q),i.quadraticCurveTo(V+W,z+q,V+W,z+q-Z),i.lineTo(V+W,z+Z),i.quadraticCurveTo(V+W,z,V+W-Z,z),i.lineTo(V+Z,z),i.quadraticCurveTo(V,z,V,z+Z),i.closePath()}i.globalAlpha=m.alpha*n,i.strokeStyle=a,i.stroke()}Y&&this.paintRoundedRectangle(P,_,m,s,n,i)}}},e.prototype.paintPolygonStroke=function(t,e,r,i,n,o,s){if(.5!==e.alignment){var a=e.width*(.5-(1-e.alignment)),h=of.offsetPolygon(t.points,a),u=void 0;s.beginPath(),s.moveTo(h[0],h[1]);for(var l=2;l=0;l-=2)s.lineTo(h[l],h[l+1]);i[c].shape.closeStroke&&s.closePath()}}s.globalAlpha=e.alpha*o,s.strokeStyle=r,s.stroke()},e.prototype.paintEllipse=function(t,e,r,i,n,o){var s=2*t.width,a=2*t.height,h=t.x-s/2,u=t.y-a/2,l=s/2*.5522848,c=a/2*.5522848,d=h+s,f=u+a,p=h+s/2,_=u+a/2;o.beginPath(),o.moveTo(h,_),o.bezierCurveTo(h,_-c,p-l,u,p,u),o.bezierCurveTo(p+l,u,d,_-c,d,_),o.bezierCurveTo(d,_+c,p+l,f,p,f),o.bezierCurveTo(p-l,f,h,_+c,h,_),o.closePath(),0===r.alignment&&o.clip(),e.visible&&(o.globalAlpha=e.alpha*n,o.fillStyle=i,o.fill())},e.prototype.paintRoundedRectangle=function(t,e,r,i,n,o){var s=t.x,a=t.y,h=t.width,u=t.height,l=t.radius,c=Math.min(h,u)/2;l=l>c?c:l,o.beginPath(),o.moveTo(s,a+l),o.lineTo(s,a+u-l),o.quadraticCurveTo(s,a+u,s+l,a+u),o.lineTo(s+h-l,a+u),o.quadraticCurveTo(s+h,a+u,s+h,a+u-l),o.lineTo(s+h,a+l),o.quadraticCurveTo(s+h,a,s+h-l,a),o.lineTo(s+l,a),o.quadraticCurveTo(s,a,s,a+l),o.closePath(),0===r.alignment&&o.clip(),e.visible&&(o.globalAlpha=e.alpha*n,o.fillStyle=i,o.fill())},e.prototype.setPatternTransform=function(t,e){if(!1!==this._svgMatrix){if(!this._svgMatrix){var r=document.createElementNS("http://www.w3.org/2000/svg","svg");if(r&&r.createSVGMatrix&&(this._svgMatrix=r.createSVGMatrix()),!this._svgMatrix||!t.setTransform)return void(this._svgMatrix=!1)}this._svgMatrix.a=e.a,this._svgMatrix.b=e.b,this._svgMatrix.c=e.c,this._svgMatrix.d=e.d,this._svgMatrix.e=e.tx,this._svgMatrix.f=e.ty,t.setTransform(this._svgMatrix.inverse())}},e.prototype.destroy=function(){this.renderer=null,this._svgMatrix=null,this._tempMatrix=null},e}(),af=new Qe;Xs.prototype.generateCanvasTexture=function(t,e){void 0===e&&(e=1);var r=this.getLocalBounds(),i=oi.create({width:r.width,height:r.height,scaleMode:t,resolution:e});nf||(nf=new Ru),this.transform.updateLocalTransform(),this.transform.localTransform.copyTo(af),af.invert(),af.tx-=r.x,af.ty-=r.y,nf.render(this,{renderTexture:i,clear:!0,transform:af});var n=ii.from(i.baseTexture._canvasRenderTarget.canvas,{scaleMode:t});return n.baseTexture.setResolution(e),n},Xs.prototype.cachedGraphicsData=[],Xs.prototype._renderCanvas=function(t){!0!==this.isMask&&(this.finishPoly(),t.plugins.graphics.render(this))};var hf=new Qe,uf=function(){function e(t){this.renderer=t}return e.prototype.render=function(e){var r=e._texture,i=this.renderer,n=i.context,o=r._frame.width,s=r._frame.height,a=e.transform.worldTransform,h=0,u=0,l=r.baseTexture.getDrawableSource();if(!(r.orig.width<=0||r.orig.height<=0)&&r.valid&&l&&r.valid){i.setBlendMode(e.blendMode,!0),i.context.globalAlpha=e.worldAlpha;var c=r.baseTexture.scaleMode===t.SCALE_MODES.LINEAR;i.smoothProperty&&i.context[i.smoothProperty]!==c&&(n[i.smoothProperty]=c),r.trim?(h=r.trim.width/2+r.trim.x-e.anchor.x*r.orig.width,u=r.trim.height/2+r.trim.y-e.anchor.y*r.orig.height):(h=(.5-e.anchor.x)*r.orig.width,u=(.5-e.anchor.y)*r.orig.height),r.rotate&&(a.copyTo(hf),a=hf,or.matrixAppendRotationInv(a,r.rotate,h,u),h=0,u=0),h-=o/2,u-=s/2,i.setContextTransform(a,e.roundPixels,1),e.roundPixels&&(h|=0,u|=0);var d=r.baseTexture.resolution,f=i._outerBlend;f&&(n.save(),n.beginPath(),n.rect(h*i.resolution,u*i.resolution,o*i.resolution,s*i.resolution),n.clip()),16777215!==e.tint?(e._cachedTint===e.tint&&e._tintedCanvas.tintId===e._texture._updateID||(e._cachedTint=e.tint,e._tintedCanvas=Ou.getTintedCanvas(e,e.tint)),n.drawImage(e._tintedCanvas,0,0,Math.floor(o*d),Math.floor(s*d),Math.floor(h*i.resolution),Math.floor(u*i.resolution),Math.floor(o*i.resolution),Math.floor(s*i.resolution))):n.drawImage(l,r._frame.x*d,r._frame.y*d,Math.floor(o*d),Math.floor(s*d),Math.floor(h*i.resolution),Math.floor(u*i.resolution),Math.floor(o*i.resolution),Math.floor(s*i.resolution)),f&&n.restore(),i.setBlendMode(t.BLEND_MODES.NORMAL)}},e.prototype.destroy=function(){this.renderer=null},e}();zs.prototype._tintedCanvas=null,zs.prototype._renderCanvas=function(t){t.plugins.sprite.render(this)};var lf=new Ye,cf=function(){function t(t){this.renderer=t}return t.prototype.image=function(t,e,r){var i=new Image;return i.src=this.base64(t,e,r),i},t.prototype.base64=function(t,e,r){return this.canvas(t).toDataURL(e,r)},t.prototype.canvas=function(t){var e,r,i,n,o=this.renderer;t&&(n=t instanceof oi?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,r=o.resolution,(i=lf).width=this.renderer.width,i.height=this.renderer.height);var s=Math.floor(i.width*r+1e-4),a=Math.floor(i.height*r+1e-4),h=new Ce(s,a,1),u=e.getImageData(i.x*r,i.y*r,s,a);return h.context.putImageData(u,0,0),h.canvas},t.prototype.pixels=function(t){var e,r,i,n,o=this.renderer;t&&(n=t instanceof oi?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,r=o.resolution,(i=lf).width=o.width,i.height=o.height);var s=i.x*r,a=i.y*r,h=i.width*r,u=i.height*r;return e.getImageData(s,a,h,u).data},t.prototype.destroy=function(){this.renderer=null},t}(),df=function(t,e){return(df=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},ff=16;function pf(t,e){var r=t;if(e instanceof Xr){var i=e.source,n=0===i.width?r.canvas.width:Math.min(r.canvas.width,i.width),o=0===i.height?r.canvas.height:Math.min(r.canvas.height,i.height);return r.ctx.drawImage(i,0,0,n,o,0,0,r.canvas.width,r.canvas.height),!0}return!1}var _f=function(t){function e(e){var r=t.call(this,e)||this;return r.uploadHookHelper=r,r.canvas=document.createElement("canvas"),r.canvas.width=ff,r.canvas.height=ff,r.ctx=r.canvas.getContext("2d"),r.registerUploadHook(pf),r}return function(t,e){function r(){this.constructor=t}df(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.ctx=null,this.canvas=null},e}(fa),mf=new Qe,vf=new Qe,yf=[new Ke,new Ke,new Ke,new Ke];return Sa.prototype._renderCanvas=function(t){var e=this._texture;if(e.baseTexture.valid){var r=t.context,i=this.worldTransform,n=e.baseTexture,o=n.getDrawableSource(),s=n.resolution;if(this._textureID!==this._texture._updateID||this._cachedTint!==this.tint){this._textureID=this._texture._updateID;var a=new Ce(e._frame.width,e._frame.height,s);16777215!==this.tint?(this._tintedCanvas=Ou.getTintedCanvas(this,this.tint),a.context.drawImage(this._tintedCanvas,0,0)):a.context.drawImage(o,-e._frame.x*s,-e._frame.y*s),this._cachedTint=this.tint,this._canvasPattern=a.context.createPattern(a.canvas,"repeat")}r.globalAlpha=this.worldAlpha,t.setBlendMode(this.blendMode),this.tileTransform.updateLocalTransform();var h=this.tileTransform.localTransform,u=this._width,l=this._height;mf.identity(),vf.copyFrom(h),this.uvRespectAnchor||vf.translate(-this.anchor.x*u,-this.anchor.y*l),mf.prepend(vf),mf.prepend(i),t.setContextTransform(mf),r.fillStyle=this._canvasPattern;var c=this.anchor.x*-u,d=this.anchor.y*-l;yf[0].set(c,d),yf[1].set(c+u,d),yf[2].set(c+u,d+l),yf[3].set(c,d+l);for(var f=0;f<4;f++)vf.applyInverse(yf[f],yf[f]);for(r.beginPath(),r.moveTo(yf[0].x,yf[0].y),f=1;f<4;f++)r.lineTo(yf[f].x,yf[f].y);r.closePath(),r.fill()}},as.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,r=this.worldTransform,i=!0,n=0,o=0,s=0,a=0;t.setBlendMode(this.blendMode),e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var h=0;h{if(typeof require=="function"){const n=this._game.getAdditionalOptions(),e=n&&n.electronRemoteRequirePath?n.electronRemoteRequirePath:"@electron/remote";try{return require(e)}catch(i){console.error(`Could not load @electron/remote from "${e}". Error is:`,i)}}return null};this._game=n,this._forceFullscreen=e,this._marginLeft=this._marginTop=this._marginRight=this._marginBottom=0,this._setupOrientation()}createStandardCanvas(n){let e;typeof THREE!="undefined"?(e=document.createElement("canvas"),this._threeRenderer=new THREE.WebGLRenderer({canvas:e}),this._threeRenderer.autoClear=!1,this._threeRenderer.setSize(this._game.getGameResolutionWidth(),this._game.getGameResolutionHeight()),this._pixiRenderer=new c.Renderer({width:this._game.getGameResolutionWidth(),height:this._game.getGameResolutionHeight(),view:e,context:this._threeRenderer.getContext(),clearBeforeRender:!1,preserveDrawingBuffer:!0,antialias:!1,backgroundAlpha:0}),e=this._threeRenderer.domElement):(this._pixiRenderer=c.autoDetectRenderer({width:this._game.getGameResolutionWidth(),height:this._game.getGameResolutionHeight(),preserveDrawingBuffer:!0,antialias:!1}),e=this._pixiRenderer.view),n.appendChild(e),this._gameCanvas=e,e.style.position="absolute",e.tabIndex=1,e.style.userSelect="none",e.style.outline="none";const i=document.createElement("div");i.style.position="absolute",i.style.overflow="hidden",i.style.outline="none",i.style.pointerEvents="none",i.addEventListener("scroll",o=>{i.scrollLeft=0,i.scrollTop=0,o.preventDefault()}),e.addEventListener("pointerdown",()=>{e.focus()}),i.style["-webkit-user-select"]="none",n.appendChild(i),this._domElementsContainer=i,this._resizeCanvas(),this._game.getScaleMode()==="nearest"&&(e.style["image-rendering"]="-moz-crisp-edges",e.style["image-rendering"]="-webkit-optimize-contrast",e.style["image-rendering"]="-webkit-crisp-edges",e.style["image-rendering"]="pixelated"),this._game.getPixelsRounding()&&(c.settings.ROUND_PIXELS=!0),window.addEventListener("resize",()=>{this._game.onWindowInnerSizeChanged(),this._resizeCanvas()}),e.focus()}static getWindowInnerWidth(){return typeof window!="undefined"?window.innerWidth:800}static getWindowInnerHeight(){return typeof window!="undefined"?window.innerHeight:800}updateRendererSize(){this._resizeCanvas()}_setupOrientation(){if(typeof window=="undefined"||!window.screen||!window.screen.orientation)return;const n=this._game.getGameData().properties.orientation;try{if(n==="default"){const e=window.screen.orientation.unlock();e&&e.catch(()=>{})}else window.screen.orientation.lock(n).catch(()=>{})}catch(e){f.error("Unexpected error while setting up orientation: ",e)}}_resizeCanvas(){if(!this._pixiRenderer||!this._domElementsContainer)return;(this._pixiRenderer.width!==this._game.getGameResolutionWidth()||this._pixiRenderer.height!==this._game.getGameResolutionHeight())&&(this._pixiRenderer.resize(this._game.getGameResolutionWidth(),this._game.getGameResolutionHeight()),this._threeRenderer&&this._threeRenderer.setSize(this._game.getGameResolutionWidth(),this._game.getGameResolutionHeight()));const n=this._forceFullscreen||this._isFullPage||this._isFullscreen;let e=this._game.getGameResolutionWidth(),i=this._game.getGameResolutionHeight(),o=window.innerWidth-this._marginLeft-this._marginRight,r=window.innerHeight-this._marginTop-this._marginBottom;if(o<0&&(o=0),r<0&&(r=0),n&&!this._keepRatio)e=o,i=r;else if(n&&this._keepRatio||e>o||i>r){let u=o/e;i*u>r&&(u=r/i),e*=u,i*=u}this._gameCanvas&&(this._gameCanvas.style.top=this._marginTop+(r-i)/2+"px",this._gameCanvas.style.left=this._marginLeft+(o-e)/2+"px",this._gameCanvas.style.width=e+"px",this._gameCanvas.style.height=i+"px"),this._domElementsContainer.style.top=this._marginTop+(r-i)/2+"px",this._domElementsContainer.style.left=this._marginLeft+(o-e)/2+"px",this._domElementsContainer.style.width=e+"px",this._domElementsContainer.style.height=i+"px",this._canvasWidth=e,this._canvasHeight=i}keepAspectRatio(n){this._keepRatio!==n&&(this._keepRatio=n,this._resizeCanvas())}setMargins(n,e,i,o){this._marginTop===n&&this._marginRight===e&&this._marginBottom===i&&this._marginLeft===o||(this._marginTop=n,this._marginRight=e,this._marginBottom=i,this._marginLeft=o,this._resizeCanvas())}setWindowSize(n,e){const i=this.getElectronRemote();if(i){const o=i.getCurrentWindow();o&&o.setContentSize(n,e)}else f.warn("Window size can't be changed on this platform.")}centerWindow(){const n=this.getElectronRemote();if(n){const e=n.getCurrentWindow();e&&e.center()}}setFullScreen(n){if(!this._forceFullscreen&&this._isFullscreen!==n){this._isFullscreen=!!n;const e=this.getElectronRemote();if(e){const i=e.getCurrentWindow();i&&i.setFullScreen(this._isFullscreen)}else this._isFullscreen?document.documentElement.requestFullscreen?document.documentElement.requestFullscreen():document.documentElement.mozRequestFullScreen?document.documentElement.mozRequestFullScreen():document.documentElement.webkitRequestFullScreen&&document.documentElement.webkitRequestFullScreen():document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen();this._resizeCanvas()}}isFullScreen(){const n=this.getElectronRemote();return n?n.getCurrentWindow().isFullScreen():this._isFullscreen||window.screen.height===window.innerHeight}convertCanvasToDomElementContainerCoords(n,e){const i=e||[0,0];return i[0]=n[0]*this._canvasWidth/this._game.getGameResolutionWidth(),i[1]=n[1]*this._canvasHeight/this._game.getGameResolutionHeight(),i}getCanvasToDomElementContainerHeightScale(){return(this._canvasHeight||1)/this._game.getGameResolutionHeight()}bindStandardEvents(n,e,i){const o=this._gameCanvas;if(!o)return;const r=t=>{const s=[t.pageX-o.offsetLeft,t.pageY-o.offsetTop];return s[0]*=this._game.getGameResolutionWidth()/(this._canvasWidth||1),s[1]*=this._game.getGameResolutionHeight()/(this._canvasHeight||1),s},u=t=>{const s=t.pageX-o.offsetLeft,a=t.pageY-o.offsetTop;return 0<=s&&s<(this._canvasWidth||1)&&0<=a&&a<(this._canvasHeight||1)};(function(){isNaN(o.offsetLeft)&&(o.offsetLeft=0,o.offsetTop=0),isNaN(i.body.scrollLeft)&&(i.body.scrollLeft=0,i.body.scrollTop=0),(i.documentElement===void 0||i.documentElement===null)&&(i.documentElement={}),isNaN(i.documentElement.scrollLeft)&&(i.documentElement.scrollLeft=0,i.documentElement.scrollTop=0),isNaN(o.offsetLeft)&&(o.offsetLeft=0,o.offsetTop=0)})();const g=()=>!(i.activeElement===o||i.activeElement===i.body||i.activeElement===null),h=t=>!(t.target===o||t.target===i.body);i.onkeydown=function(t){g()||(m.includes(t.keyCode)&&t.preventDefault(),n.onKeyPressed(t.keyCode,t.location))},i.onkeyup=function(t){g()||(m.includes(t.keyCode)&&t.preventDefault(),n.onKeyReleased(t.keyCode,t.location))};function _(t){switch(t){case 1:return l.InputManager.MOUSE_MIDDLE_BUTTON;case 2:return l.InputManager.MOUSE_RIGHT_BUTTON}return t}o.onmousemove=function(t){const s=r(t);n.onMouseMove(s[0],s[1])},o.onmousedown=function(t){return n.onMouseButtonPressed(_(t.button)),e.focus!==void 0&&e.focus(),!1},o.onmouseup=function(t){return n.onMouseButtonReleased(_(t.button)),!1},o.onmouseleave=function(t){n.onMouseLeave()},o.onmouseenter=function(t){n.onMouseEnter();const s=[l.InputManager.MOUSE_LEFT_BUTTON,l.InputManager.MOUSE_RIGHT_BUTTON,l.InputManager.MOUSE_MIDDLE_BUTTON,l.InputManager.MOUSE_BACK_BUTTON,l.InputManager.MOUSE_FORWARD_BUTTON];for(let a=0,E=s.length;a{this._nextFrameId=requestAnimationFrame(i);const r=e?o-e:0;e=o,n(r)||cancelAnimationFrame(this._nextFrameId)};requestAnimationFrame(i)}getPIXIRenderer(){return this._pixiRenderer}getThreeRenderer(){return this._threeRenderer}getDomElementContainer(){return this._domElementsContainer}openURL(n){if(typeof window!="undefined"){const e=this.getElectron();if(e)e.shell.openExternal(n);else{const i=window.cordova?"_system":"_blank";window.open(n,i)}}}stopGame(){const n=this.getElectronRemote();if(n){const e=n.getCurrentWindow();e&&e.close()}else typeof navigator!="undefined"&&navigator.app&&navigator.app.exitApp&&navigator.app.exitApp()}getCanvas(){return this._gameCanvas}isWebGLSupported(){return!!this._pixiRenderer&&this._pixiRenderer.type===c.RENDERER_TYPE.WEBGL}getElectron(){return typeof require=="function"?require("electron"):null}}l.RuntimeGamePixiRenderer=v,l.RuntimeGameRenderer=v})(gdjs||(gdjs={})); +//# sourceMappingURL=runtimegame-pixi-renderer.js.map diff --git a/desktop/apps/dezunkrr/pixi-renderers/runtimescene-pixi-renderer.js b/desktop/apps/dezunkrr/pixi-renderers/runtimescene-pixi-renderer.js new file mode 100644 index 0000000..7307bf0 --- /dev/null +++ b/desktop/apps/dezunkrr/pixi-renderers/runtimescene-pixi-renderer.js @@ -0,0 +1,3 @@ +var gdjs;(function(a){const l=GlobalPIXIModule.PIXI;class g{constructor(t,e){this._profilerText=null;this._showCursorAtNextRender=!1;this._threeRenderer=null;this._layerRenderingMetrics={rendered2DLayersCount:0,rendered3DLayersCount:0};this._runtimeGameRenderer=e,this._runtimeScene=t,this._pixiContainer=new l.Container,this._pixiContainer.sortableChildren=!0,this._threeRenderer=this._runtimeGameRenderer?this._runtimeGameRenderer.getThreeRenderer():null}onGameResolutionResized(){const t=this._runtimeGameRenderer?this._runtimeGameRenderer.getPIXIRenderer():null;if(!t)return;const e=this._runtimeScene.getGame();this._pixiContainer.scale.x=t.width/e.getGameResolutionWidth(),this._pixiContainer.scale.y=t.height/e.getGameResolutionHeight();for(const r of this._runtimeScene._orderedLayers)r.getRenderer().onGameResolutionResized()}onSceneUnloaded(){}render(){const t=this._runtimeGameRenderer;if(!t)return;const e=t.getPIXIRenderer();if(!e)return;const r=this._threeRenderer;if(this._layerRenderingMetrics.rendered2DLayersCount=0,this._layerRenderingMetrics.rendered3DLayersCount=0,r){r.info.autoReset=!1,r.info.reset();let n=!0,s=!0;r.resetState();for(let u=0;u({collision:!1,move_axis:[0,0]}),S=()=>({collision:!1,closeX:0,closeY:0,closeSqDist:0,farX:0,farY:0,farSqDist:0}),F={minMaxA:[0,0],minMaxB:[0,0],edge:[0,0],axis:[0,0],move_axis:[0,0],result:D()},R={p:[0,0],q:[0,0],r:[0,0],s:[0,0],deltaQP:[0,0],axis:[0,0],result:S()},n=class{constructor(){this.vertices=[];this.edges=[];this.center=[0,0]}move(t,e){for(let o=0,i=this.vertices.length;o=e?this.vertices[0]:this.vertices[t+1];this.edges[t][0]=i[0]-o[0],this.edges[t][1]=i[1]-o[1]}}isConvex(){this.computeEdges();const t=this.edges.length;if(t<3)return!1;const e=this.edges[0][0]*this.edges[0+1][1]-this.edges[0][1]*this.edges[0+1][0]>0;for(let i=1;i0!==e)return!1;return this.edges[t-1][0]*this.edges[0][1]-this.edges[t-1][1]*this.edges[0][0]>0===e}computeCenter(){this.center[0]=0,this.center[1]=0;const t=this.vertices.length;for(let e=0;e0||r===0&&o)return s.collision=!1,s.move_axis[0]=0,s.move_axis[1]=0,s;const d=Math.abs(r);dA)return s;s.collision=!0,u===0&&(s.closeX=e,s.closeY=o,s.closeSqDist=0,s.farX=e,s.farY=o,s.farSqDist=0);const q=b/Math.abs(u),T=A/Math.abs(u);return s.closeX=e+q*c[0],s.closeY=o+q*c[1],s.closeSqDist=q*q*(c[0]*c[0]+c[1]*c[1]),s.farX=e+T*c[0],s.farY=o+T*c[1],s.farSqDist=T*T*(c[0]*c[0]+c[1]*c[1]),s}else if(f!==0&&0<=x&&x<=1&&0<=M&&M<=1){const r=a[0]+x*c[0],d=a[1]+x*c[1],u=(r-e)*(r-e)+(d-o)*(d-o);uo[1]&&(o[1]=i)}static distance(t,e,o,i){return to!=h[1]>o&&e<(h[0]-a[0])*(o-a[1])/(h[1]-a[1])+a[0]&&(i=!i)}return i}static copyCollisionTestResult(t,e){e.collision=t.collision,e.move_axis[0]=t.move_axis[0],e.move_axis[1]=t.move_axis[1]}static copyRaycastTestResult(t,e){e.collision=t.collision,e.closeX=t.closeX,e.closeY=t.closeY,e.closeSqDist=t.closeSqDist,e.farX=t.farX,e.farY=t.farY,e.farSqDist=t.farSqDist}};let C=n;C.makeNewCollisionTestResult=D,C.makeNewRaycastTestResult=S,j.Polygon=C})(gdjs||(gdjs={})); +//# sourceMappingURL=polygon.js.map diff --git a/desktop/apps/dezunkrr/portal.glb b/desktop/apps/dezunkrr/portal.glb new file mode 100644 index 0000000..9bac4d1 Binary files /dev/null and b/desktop/apps/dezunkrr/portal.glb differ diff --git a/desktop/apps/dezunkrr/profiler.js b/desktop/apps/dezunkrr/profiler.js new file mode 100644 index 0000000..c170532 --- /dev/null +++ b/desktop/apps/dezunkrr/profiler.js @@ -0,0 +1,2 @@ +var gdjs;(function(m){class a{constructor(){this._framesMeasures=[];this._currentFrameIndex=0;this._currentFrameMeasure={parent:null,time:0,lastStartTime:0,subsections:{}};this._currentSection=null;this._maxFramesCount=600;this._framesCount=0;for(;this._framesMeasures.lengththis._maxFramesCount&&(this._framesCount=this._maxFramesCount),this._framesMeasures[this._currentFrameIndex]=this._currentFrameMeasure,this._currentFrameIndex++,this._currentFrameIndex>=this._maxFramesCount&&(this._currentFrameIndex=0)}static _addAverageSectionTimes(t,e,r,o){e.time=(e.time||0)+t.time/r;for(const s in t.subsections)if(t.subsections.hasOwnProperty(s)){const n=e.subsections,i=n[s]=n[s]||{parent:e,time:0,subsections:{}};a._addAverageSectionTimes(t.subsections[s],i,r,o)}}getFramesAverageMeasures(){const t={parent:null,time:0,lastStartTime:0,subsections:{}};for(let e=0;e{if(d.startsWith("data:")||d.startsWith("blob:"))return d;const s=d.indexOf("?")===-1?"?":"&";return d+s+e+"="+t},m=d=>d.startsWith("https://project-resources.gdevelop.io/")||d.startsWith("https://project-resources-dev.gdevelop.io/");class f{constructor(e){this._runtimeGame=e}getFullUrl(e){const{gdevelopResourceToken:t}=this._runtimeGame._options;return!t||!m(e)?e:p(e,"gd_resource_token",encodeURIComponent(t))}checkIfCredentialsRequired(e){return this._runtimeGame._options.gdevelopResourceToken?!1:!!m(e)}}i.RuntimeGameResourcesLoader=f;class R{constructor(e,t){this._notifyScenesForGameResolutionResize=!1;this._paused=!1;this._hasJustResumed=!1;this._sessionMetricsInitialized=!1;this._disableMetrics=!1;this._options=t||{},this._variables=new i.VariablesContainer(e.variables),this._data=e,this._resourcesLoader=new i.RuntimeGameResourcesLoader(this),this._imageManager=new i.ImageManager(this._data.resources.resources,this._resourcesLoader),this._soundManager=new i.SoundManager(this._data.resources.resources,this._resourcesLoader),this._fontManager=new i.FontManager(this._data.resources.resources,this._resourcesLoader),this._jsonManager=new i.JsonManager(this._data.resources.resources,this._resourcesLoader),this._bitmapFontManager=new i.BitmapFontManager(this._data.resources.resources,this._resourcesLoader,this._imageManager),this._model3DManager=new i.Model3DManager(this._data.resources.resources,this._resourcesLoader),this._effectsManager=new i.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._renderer=new i.RuntimeGameRenderer(this,this._options.forceFullscreen||!1),this._watermark=new i.watermark.RuntimeWatermark(this,e.properties.authorUsernames,this._data.properties.watermark),this._sceneStack=new i.SceneStack(this),this._inputManager=new i.InputManager,this._injectExternalLayout=this._options.injectExternalLayout||"",this._debuggerClient=i.DebuggerClient?new i.DebuggerClient(this):null,this._isPreview=this._options.isPreview||!1,this._sessionId=null,this._playerId=null,this._embeddedResourcesMappings=new Map;for(const s of this._data.resources.resources)if(s.metadata)try{const n=JSON.parse(s.metadata);n?.embeddedResourcesMapping&&this._embeddedResourcesMappings.set(s.name,n.embeddedResourcesMapping)}catch{c.error("Some metadata of resources can not be successfully parsed.")}if(this._eventsBasedObjectDatas=new Map,this._data.eventsFunctionsExtensions)for(const s of this._data.eventsFunctionsExtensions)for(const n of s.eventsBasedObjects)this._eventsBasedObjectDatas.set(s.name+"::"+n.name,n);this.isUsingGDevelopDevelopmentEnvironment()&&c.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||(c.error('The game has no events-based object of the type "'+e+'"'),null)}getSceneData(e){let t=null;for(let s=0,n=this._data.layouts.length;s{var _=Math.floor((r+o+u+l+h+g)/n*100);s.setPercent(_),t&&t(_)}).then(()=>s.unload()).then(()=>i.getAllAsynchronouslyLoadingLibraryPromise()).then(()=>{e()})})})})})})}startGameLoop(){try{if(!this.hasScene()){c.error("The game has no scene.");return}this._forceGameResolutionUpdate();const e=this._data.firstLayout;this._sceneStack.push(this.hasScene(e)?e:this.getSceneData().name,this._injectExternalLayout),this._watermark.displayAtStartup(),this._setupGameVisibilityEvents();const t=this;let s=0;this._hasJustResumed=!1,this._renderer.startGameLoop(function(n){if(t._paused||(s+=n,t._maxFPS>0&&1e3/s>t._maxFPS+7))return!0;const a=s;return s=0,t._notifyScenesForGameResolutionResize&&(t._sceneStack.onGameResolutionResized(),t._notifyScenesForGameResolutionResize=!1),t._sceneStack.step(a)?(t.getInputManager().onFrameEnded(),t._hasJustResumed=!1,!0):!1}),setTimeout(()=>{this._setupSessionMetrics()},1e4)}catch(e){throw c.error("Internal crash: "+e),e}}enableMetrics(e){this._disableMetrics=!e,e&&this._setupSessionMetrics()}_setupGameVisibilityEvents(){typeof navigator!="undefined"&&typeof document!="undefined"&&(document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(this._hasJustResumed=!0)}),window.addEventListener("resume",()=>{this._hasJustResumed=!0},!1))}_setupSessionMetrics(){if(this._sessionMetricsInitialized||this._disableMetrics||this.isPreview()||typeof fetch=="undefined"||!this._data.properties.projectUuid)return;const e="https://api.gdevelop-app.com/analytics";this._playerId=this._makePlayerUuid();let t=0,s=0,n=Date.now();fetch(e+"/session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gameId:this._data.properties.projectUuid,playerId:this._playerId,game:{name:this._data.properties.name||"",packageName:this._data.properties.packageName||"",version:this._data.properties.version||"",location:window.location.href},platform:{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}})}).then(r=>{if(!r.ok)throw console.error("Error while creating the session",r),new Error("Error while creating the session");return r}).then(r=>r.text()).then(r=>{this._sessionId=r}).catch(()=>{});const a=()=>{if(!this._sessionId)return;const r=Date.now();if(s+=r-n,n=r,s<5*1e3)return;const o=Math.floor(s/1e3)*1e3;t+=o,s-=o,navigator.sendBeacon(e+"/session-hit",JSON.stringify({gameId:this._data.properties.projectUuid,playerId:this._playerId,sessionId:this._sessionId,duration:Math.floor(t/1e3)}))};if(typeof navigator!="undefined"&&typeof document!="undefined"){document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"?n=Date.now():a()}),window.addEventListener("pagehide",a,!1),window.addEventListener("pause",a,!1),window.addEventListener("resume",()=>{n=Date.now()},!1);const r=typeof safari=="object"&&safari.pushNotification,o=/electron/i.test(navigator.userAgent);(r||o)&&window.addEventListener("beforeunload",()=>{a()})}this._sessionMetricsInitialized=!0,this._sessionId=this._sessionId}_makePlayerUuid(){try{const e="GDJS-internal-player-uuid",t=localStorage.getItem(e);if(t)return t;const s=i.makeUuid();return localStorage.setItem(e,s),s}catch{return i.makeUuid()}}getSessionId(){return this._sessionId}getPlayerId(){return this._playerId}onWindowInnerSizeChanged(){this._forceGameResolutionUpdate()}_forceGameResolutionUpdate(){this.setGameResolutionSize(this._gameResolutionWidth,this._gameResolutionHeight)}startCurrentSceneProfiler(e){const t=this._sceneStack.getCurrentScene();return t?(t.startProfiler(e),!0):!1}stopCurrentSceneProfiler(){const e=this._sceneStack.getCurrentScene();!e||e.stopProfiler()}wasFirstSceneLoaded(){return this._sceneStack.wasFirstSceneLoaded()}getSceneStack(){return this._sceneStack}isPreview(){return this._isPreview}isUsingGDevelopDevelopmentEnvironment(){return this._options.environment==="dev"}getExtensionProperty(e,t){for(let s of this._data.properties.extensionProperties)if(s.extension===e&&s.property===t)return s.value;return null}resolveEmbeddedResource(e,t){const s=this._embeddedResourcesMappings.get(e);return s&&s[t]?s[t]:t}}i.RuntimeGame=R})(gdjs||(gdjs={})); +//# sourceMappingURL=runtimegame.js.map diff --git a/desktop/apps/dezunkrr/runtimeobject.js b/desktop/apps/dezunkrr/runtimeobject.js new file mode 100644 index 0000000..589b184 --- /dev/null +++ b/desktop/apps/dezunkrr/runtimeobject.js @@ -0,0 +1,2 @@ +var gdjs;(function(n){const _=(A,e,t,i)=>{const s=Math.max(t,A-t),r=Math.max(i,e-i);return Math.pow(s,2)+Math.pow(r,2)},y={moveXArray:[],moveYArray:[]},w={result:n.Polygon.makeNewRaycastTestResult()},D=(A,e,t)=>{if(e.length===0)return e.length=0,t.length=0,!1;if(e.length===1)return A.setPosition(A.getX()+e[0],A.getY()+t[0]),e.length=0,t.length=0,!0;let i=0,s=0;for(let b=0;bi&&(i=x,s=b)}const r=Math.sqrt(i),a=e[s]/r,c=-(t[s]/r),g=a;let f=0,h=0;for(let b=0;br()),this.clearEffects()}onScenePaused(e){}onSceneResumed(e){}getRendererObject(){}get3DRendererObject(){}getName(){return this.name}getNameId(){return this._nameId}getUniqueId(){return this.id}setPosition(e,t){this.setX(e),this.setY(t)}setX(e){e!==this.x&&(this.x=e,this.invalidateHitboxes())}invalidateHitboxes(){this.hitBoxesDirty=!0,this._runtimeScene.onChildrenLocationChanged()}getX(){return this.x}setY(e){e!==this.y&&(this.y=e,this.invalidateHitboxes())}getY(){return this.y}getDrawableX(){return this.getX()}getDrawableY(){return this.getY()}rotateTowardPosition(e,t,i,s){this.rotateTowardAngle(n.toDegrees(Math.atan2(t-(this.getDrawableY()+this.getCenterY()),e-(this.getDrawableX()+this.getCenterX()))),i,s)}rotateTowardAngle(e,t,i){if(t===0){this.setAngle(e);return}const r=n.evtTools.common.angleDifference(this.getAngle(),e)>=0;let a=this.getAngle()+(r?-1:1)*t*this.getElapsedTime()/1e3;n.evtTools.common.angleDifference(a,e)>0^r&&(a=e),this.setAngle(a),this.getAngle()!==a&&this.setAngle(e)}rotate(e,t){this.setAngle(this.getAngle()+e*this.getElapsedTime()/1e3)}setAngle(e){this.angle!==e&&(this.angle=e,this.invalidateHitboxes())}getAngle(){return this.angle}setLayer(e){if(e===this.layer)return;const t=this._runtimeScene.getLayer(this.layer);this.layer=e;const i=this._runtimeScene.getLayer(this.layer),s=this.getRendererObject();s&&(t.getRenderer().removeRendererObject(s),i.getRenderer().addRendererObject(s,this.zOrder));const r=this.get3DRendererObject();r&&(t.getRenderer().remove3DRendererObject(r),i.getRenderer().add3DRendererObject(r))}getLayer(){return this.layer}isOnLayer(e){return this.layer===e}setZOrder(e){if(e===this.zOrder)return;this.zOrder=e;const t=this.getRendererObject();t&&this._runtimeScene.getLayer(this.layer).getRenderer().changeRendererObjectZOrder(t,e)}getZOrder(){return this.zOrder}getVariables(){return this._variables}static getVariableNumber(e){return e.getAsNumber()}static returnVariable(e){return e}static getVariableString(e){return e.getAsString()}static getVariableChildCount(e){return e.getChildrenCount()}static setVariableNumber(e,t){e.setNumber(t)}static setVariableString(e,t){e.setString(t)}static variableChildExists(e,t){return e.hasChild(t)}static variableRemoveChild(e,t){e.removeChild(t)}static variableClearChildren(e){e.clearChildren()}hasVariable(e){return this._variables.has(e)}getRendererEffects(){return this._rendererEffects}addEffect(e){return this.getRendererObject()?this._runtimeScene.getGame().getEffectsManager().addEffect(e,this._rendererEffects,this):!1}removeEffect(e){return this.getRendererObject()?this._runtimeScene.getGame().getEffectsManager().removeEffect(this._rendererEffects,this,e):!1}clearEffects(){const e=this.getRendererObject();return e?(this._rendererEffects={},this._runtimeScene.getGame().getEffectsManager().clearEffects(e)):!1}setEffectDoubleParameter(e,t,i){return this._runtimeScene.getGame().getEffectsManager().setEffectDoubleParameter(this._rendererEffects,e,t,i)}setEffectStringParameter(e,t,i){return this._runtimeScene.getGame().getEffectsManager().setEffectStringParameter(this._rendererEffects,e,t,i)}setEffectBooleanParameter(e,t,i){return this._runtimeScene.getGame().getEffectsManager().setEffectBooleanParameter(this._rendererEffects,e,t,i)}updateAllEffectParameters(e){return this._runtimeScene.getGame().getEffectsManager().updateAllEffectParameters(this._rendererEffects,e)}enableEffect(e,t){this._runtimeScene.getGame().getEffectsManager().enableEffect(this._rendererEffects,this,e,t)}isEffectEnabled(e){return this._runtimeScene.getGame().getEffectsManager().isEffectEnabled(this._rendererEffects,this,e)}hasEffect(e){return this._runtimeScene.getGame().getEffectsManager().hasEffect(this._rendererEffects,e)}hide(e){e===void 0&&(e=!0),this.hidden=e}isVisible(){return!this.hidden}isHidden(){return this.hidden}setWidth(e){}setHeight(e){}getWidth(){return 0}getHeight(){return 0}getCenterX(){return this.getWidth()/2}getCenterY(){return this.getHeight()/2}getCenterXInScene(){return this.getDrawableX()+this.getCenterX()}getCenterYInScene(){return this.getDrawableY()+this.getCenterY()}setCenterPositionInScene(e,t){this.setX(e+this.x-(this.getDrawableX()+this.getCenterX())),this.setY(t+this.y-(this.getDrawableY()+this.getCenterY()))}setCenterXInScene(e){this.setX(e+this.x-(this.getDrawableX()+this.getCenterX()))}setCenterYInScene(e){this.setY(e+this.y-(this.getDrawableY()+this.getCenterY()))}_getRecycledForce(e,t,i){if(o.forcesGarbage.length===0)return new n.Force(e,t,i);{const s=o.forcesGarbage.pop();return s.setX(e),s.setY(t),s.setMultiplier(i),s}}addForce(e,t,i){this._forces.push(this._getRecycledForce(e,t,i))}addPolarForce(e,t,i){const s=n.toRad(e),r=Math.cos(s)*t,a=Math.sin(s)*t;this._forces.push(this._getRecycledForce(r,a,i))}addForceTowardPosition(e,t,i,s){const r=Math.atan2(t-(this.getDrawableY()+this.getCenterY()),e-(this.getDrawableX()+this.getCenterX())),a=Math.cos(r)*i,l=Math.sin(r)*i;this._forces.push(this._getRecycledForce(a,l,s))}addForceTowardObject(e,t,i){e!=null&&this.addForceTowardPosition(e.getDrawableX()+e.getCenterX(),e.getDrawableY()+e.getCenterY(),t,i)}clearForces(){o.forcesGarbage.push.apply(o.forcesGarbage,this._forces),this._forces.length=0}hasNoForces(){return this._forces.length===0}updateForces(e){for(let t=0;t=t:(this._timers.put(e,new n.Timer(e)),!1)}timerPaused(e){return this._timers.containsKey(e)?this._timers.get(e).isPaused():!1}resetTimer(e){this._timers.containsKey(e)||this._timers.put(e,new n.Timer(e)),this._timers.get(e).reset()}pauseTimer(e){this._timers.containsKey(e)||this._timers.put(e,new n.Timer(e)),this._timers.get(e).setPaused(!0)}unpauseTimer(e){this._timers.containsKey(e)||this._timers.put(e,new n.Timer(e)),this._timers.get(e).setPaused(!1)}removeTimer(e){this._timers.containsKey(e)&&this._timers.remove(e)}getTimerElapsedTimeInSeconds(e){return this._timers.containsKey(e)?this._timers.get(e).getTime()/1e3:0}getTimerElapsedTimeInSecondsOrNaN(e){return this._timers.containsKey(e)?this._timers.get(e).getTime()/1e3:Number.NaN}separateFromObjects(e,t){let i=y.moveXArray,s=y.moveYArray;i.length=0,s.length=0;const r=this.getHitBoxes();let a=null;for(const l of e){if(l.id===this.id)continue;let c=l.getHitBoxes(),g=c;c.length>4&&(a||(a=this.getAABB()),g=l.getHitBoxesAround(a.min[0],a.min[1],a.max[0],a.max[1]));for(const f of r)for(const h of g){const u=n.Polygon.collisionTest(f,h,t);u.collision&&(i.push(u.move_axis[0]),s.push(u.move_axis[1]))}}return D(this,i,s)}separateFromObjectsList(e,t){let i=y.moveXArray,s=y.moveYArray;i.length=0,s.length=0;const r=this.getHitBoxes();let a=null;for(const l in e.items)if(e.items.hasOwnProperty(l)){const c=e.items[l];for(const g of c){if(g.id===this.id)continue;let f=g.getHitBoxes(),h=f;f.length>4&&(a||(a=this.getAABB()),h=g.getHitBoxesAround(a.min[0],a.min[1],a.max[0],a.max[1]));for(const u of r)for(const B of h){const v=n.Polygon.collisionTest(u,B,t);v.collision&&(i.push(v.move_axis[0]),s.push(v.move_axis[1]))}}}return D(this,i,s)}getDistanceToObject(e){return Math.sqrt(this.getSqDistanceToObject(e))}getSqDistanceToObject(e){if(e===null)return 0;const t=this.getDrawableX()+this.getCenterX()-(e.getDrawableX()+e.getCenterX()),i=this.getDrawableY()+this.getCenterY()-(e.getDrawableY()+e.getCenterY());return t*t+i*i}getDistanceToPosition(e,t){return Math.sqrt(this.getSqDistanceToPosition(e,t))}getSqDistanceToPosition(e,t){const i=this.getDrawableX()+this.getCenterX()-e,s=this.getDrawableY()+this.getCenterY()-t;return i*i+s*s}getAngleToObject(e){if(e===null)return 0;const t=this.getDrawableX()+this.getCenterX()-(e.getDrawableX()+e.getCenterX()),i=this.getDrawableY()+this.getCenterY()-(e.getDrawableY()+e.getCenterY());return n.toDegrees(Math.atan2(-i,-t))}getXFromAngleAndDistance(e,t){return this.getDrawableX()+this.getCenterX()+t*Math.cos(n.toRad(e))}getYFromAngleAndDistance(e,t){return this.getDrawableY()+this.getCenterY()+t*Math.sin(n.toRad(e))}getAngleToPosition(e,t){const i=this.getDrawableX()+this.getCenterX()-e,s=this.getDrawableY()+this.getCenterY()-t;return n.toDegrees(Math.atan2(-s,-i))}putAround(e,t,i,s){const r=n.toRad(s);this.setCenterXInScene(e+Math.cos(r)*i),this.setCenterYInScene(t+Math.sin(r)*i)}putAroundObject(e,t,i){this.putAround(e.getDrawableX()+e.getCenterX(),e.getDrawableY()+e.getCenterY(),t,i)}separateObjectsWithoutForces(e){const t=n.staticArray(o.prototype.separateObjectsWithoutForces);t.length=0;const i=n.staticArray2(o.prototype.separateObjectsWithoutForces);e.values(i);for(let s=0,r=i.length;st[s].getDrawableX()+t[s].getWidth()&&this.setX(t[s].getDrawableX()+t[s].getWidth()),this.getDrawableY()t[s].getDrawableY()+t[s].getHeight()&&this.setY(t[s].getDrawableY()+t[s].getHeight()))}separateObjectsWithForces(e){const t=n.staticArray(o.prototype.separateObjectsWithForces);t.length=0;const i=n.staticArray2(o.prototype.separateObjectsWithForces);e.values(i);for(let s=0,r=i.length;sa+g)return!1;const b=e.getHitBoxesAround(u-g,B-g,u+g,B+g),p=t.getHitBoxesAround(f-a,h-a,f+a,h+a);for(const d of b)for(const x of p)if(n.Polygon.collisionTest(d,x,i).collision)return!0;return!1}raycastTest(e,t,i,s,r){const a=this.getCenterX(),l=this.getCenterY(),c=_(this.getWidth(),this.getHeight(),a,l),g=(e+i)/2,f=(t+s)/2,h=(i-e)*(i-e)+(s-t)*(s-t),u=this.getDrawableX()+a-g,B=this.getDrawableY()+l-f;let v=w.result;if(v.collision=!1,u*u+B*B>c+h+2*Math.sqrt(h*c))return v;if(r){let C=Number.MAX_VALUE;const b=this.getHitBoxesAround(e,t,i,s);for(const p of b){const d=n.Polygon.raycastTest(p,e,t,i,s);d.collision&&d.closeSqDistC&&d.farSqDist<=h&&(C=d.farSqDist,n.Polygon.copyRaycastTestResult(d,v))}}return v}insideObject(e,t){return this.hitBoxesDirty&&(this.updateHitBoxes(),this.updateAABB(),this.hitBoxesDirty=!1),this.aabb.min[0]<=e&&this.aabb.max[0]>=e&&this.aabb.min[1]<=t&&this.aabb.max[1]>=t}static distanceTest(e,t,i){return e.getSqDistanceToObject(t)<=i}cursorOnObject(e){const t=n.staticArray(o.prototype.cursorOnObject);t.length=2;const i=e.getGame().getInputManager(),s=e.getLayer(this.layer),r=s.convertCoords(i.getCursorX(),i.getCursorY(),0,t);if(this.insideObject(r[0],r[1]))return!0;const a=i.getAllTouchIdentifiers();for(let l=0;ln[2]||a.min[1]>n[3]||a.max[0]{const t=e.getBoundingClientRect();this.onResizeGameContainer(t.height)}),this._resizeObserver.observe(e))}updateFontSize(e){this._textFontSize=Math.max(.025*e,12)}updateLogoSize(e){this._logoWidth=Math.max(.06*e,25),this._logoHeight=Math.round(45/56*this._logoWidth)}updateBackgroundHeight(e){this._backgroundHeight=Math.max(.13*e,45)}updateMargin(e){this._margin=Math.max(.025*e,8)}onResizeGameContainer(e){this.updateFontSize(e),this._madeWithTextElement&&(this._madeWithTextElement.style.fontSize=`${this._textFontSize}px`),this._usernameTextElement&&(this._usernameTextElement.style.fontSize=`${this._textFontSize}px`),this.updateLogoSize(e),this._svgElement&&(this._svgElement.setAttribute("height",this._logoHeight.toString()),this._svgElement.setAttribute("width",this._logoWidth.toString())),this.updateBackgroundHeight(e),this._backgroundElement&&(this._backgroundElement.style.height=`${this._backgroundHeight}px`),this.updateMargin(e),this._linkElement&&this.updateElementMargins(this._linkElement)}addWatermarkToGameContainer(e){const t=e.getBoundingClientRect();this.updateFontSize(t.height),this.updateLogoSize(t.height),this.updateBackgroundHeight(t.height),this._containerElement=this.createDivContainer(),this.createBackground();const i=document.createElement("div");this.generateSVGLogo(t.height),this.createMadeWithTextElement(),this.createUsernameTextElement(),this._linkElement=this.createLinkElement(),this._svgElement&&this._containerElement.appendChild(this._svgElement),this._madeWithTextElement&&i.appendChild(this._madeWithTextElement),this._usernameTextElement&&i.appendChild(this._usernameTextElement),this._containerElement.appendChild(i),this._backgroundElement&&e.appendChild(this._backgroundElement),this._linkElement.append(this._containerElement),e.appendChild(this._linkElement),this.setupAnimations()}createBackground(){this._backgroundElement=document.createElement("div"),this._backgroundElement.setAttribute("id","watermark-background"),this._backgroundElement.style.height=`${this._backgroundHeight}px`,this._backgroundElement.style.opacity="0",this._placement.startsWith("top")?(this._backgroundElement.style.top="0",this._backgroundElement.style.backgroundImage="linear-gradient(180deg, rgba(38, 38, 38, .6) 0%, rgba(38, 38, 38, 0) 100% )"):(this._backgroundElement.style.bottom="0",this._backgroundElement.style.backgroundImage="linear-gradient(0deg, rgba(38, 38, 38, .6) 0%, rgba(38, 38, 38, 0) 100% )")}setupAnimations(){requestAnimationFrame(()=>{setTimeout(()=>{!this._containerElement||!this._backgroundElement||!this._linkElement||(this._containerElement.style.opacity="1",this._backgroundElement.style.opacity="1",this._linkElement.style.pointerEvents="all",this._svgElement&&this._svgElement.classList.add("spinning"))},this._fadeInDelayAfterGameLoaded*1e3)}),this._fadeOutTimeout=setTimeout(()=>{!this._containerElement||!this._backgroundElement||(this._containerElement.style.opacity="0",this._backgroundElement.style.opacity="0",this._hideTimeout=setTimeout(()=>{!this._containerElement||!this._backgroundElement||!this._linkElement||(this._linkElement.style.pointerEvents="none",this._containerElement.style.display="none",this._backgroundElement.style.display="none",this._resizeObserver&&this._resizeObserver.disconnect())},this._fadeDuration*1e3))},(this._fadeInDelayAfterGameLoaded+this._displayDuration)*1e3),this._fadeOutFirstTextTimeout=setTimeout(()=>{const{_madeWithTextElement:e,_usernameTextElement:t}=this;!e||t&&(e.style.opacity="0",this._fadeInSecondTextTimeout=setTimeout(()=>{t.style.lineHeight="normal",t.style.opacity="1",e.style.lineHeight="0"},this._fadeDuration*1e3))},(this._fadeInDelayAfterGameLoaded+this._changeTextDelay)*1e3)}createMadeWithTextElement(){this._madeWithTextElement=document.createElement("span"),this._madeWithTextElement.innerText="Made with GDevelop",this._madeWithTextElement.style.fontSize=`${this._textFontSize}px`}createUsernameTextElement(){!this._authorUsername||(this._usernameTextElement=document.createElement("span"),this._usernameTextElement.innerText=`@${this._authorUsername}`,this._usernameTextElement.style.fontSize=`${this._textFontSize}px`,this._usernameTextElement.style.opacity="0",this._usernameTextElement.style.lineHeight="0")}updateElementMargins(e){switch(this._placement){case"top-left":e.style.top=`${this._margin}px`,e.style.left=`${this._margin}px`;break;case"top-right":e.style.top=`${this._margin}px`,e.style.right=`${this._margin}px`;break;case"bottom-left":e.style.bottom=`${this._margin}px`,e.style.left=`${this._margin}px`;break;case"bottom-right":e.style.bottom=`${this._margin}px`,e.style.right=`${this._margin}px`;break;case"top":e.style.top=`${this._margin}px`,e.style.left="50%",e.style.transform="translate(-50%, 0)";break;case"bottom":default:e.style.bottom=`${this._margin}px`,e.style.left="50%",e.style.transform="translate(-50%, 0)";break}}createLinkElement(){const e=document.createElement("a");e.id="watermark-link";let t=this._authorUsername?new URL(`https://gd.games/${this._authorUsername}`):new URL("https://gd.games");return this._isDevEnvironment?t.searchParams.set("dev","true"):(t.searchParams.set("utm_source","gdevelop-game"),t.searchParams.set("utm_medium","game-watermark"),this._gameId&&t.searchParams.set("utm_campaign",this._gameId)),e.href=t.href,e.target="_blank",this.updateElementMargins(e),e}createDivContainer(){const e=document.createElement("div");return e.setAttribute("id","watermark"),e.style.opacity="0",e}generateSVGLogo(e){this._svgElement=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.updateLogoSize(e),this._svgElement.setAttribute("height",this._logoHeight.toString()),this._svgElement.setAttribute("width",this._logoWidth.toString()),this._svgElement.setAttribute("viewBox","-2 -2 59 48"),this._svgElement.setAttribute("fill","none");const t=document.createElementNS("http://www.w3.org/2000/svg","path"),i=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttribute("d","M29.3447 33C25.1061 33 21.0255 31.8475 17.4207 29.3381C14.9081 27.5897 12 23.6418 12 16.9488C12 4.53178 18.3074 0 30.9827 0H53.8027L56 7.07232H32.7217C24.3558 7.07232 19.3813 7.72835 19.3813 16.9488C19.3813 19.9944 20.2354 22.1618 21.9933 23.574C24.9642 25.9612 30.7388 26.0628 34.2673 25.7208C34.2673 25.7208 35.715 21.0394 35.9534 20.2794C36.2327 19.3888 36.1104 19.1763 35.2392 19.1763C33.9808 19.1763 31.7185 19.1763 29.3175 19.1763C27.6349 19.1763 25.9818 18.3247 25.9818 16.2793C25.9818 14.3039 27.5198 13.1573 29.6281 13.1573C33.2786 13.1573 40.7969 13.1573 42.2041 13.1573C44.0489 13.1573 45.9315 13.4233 44.971 16.3601L39.8842 31.8734C39.8845 31.8738 35.7287 33 29.3447 33Z"),i.setAttribute("d","M43.3039 35.3278C40.7894 37.1212 37.0648 38.1124 30.7449 38.1124C19.852 38.1124 11.8797 34.1251 8.62927 26.3952C7.0925 22.7415 7.24041 18.6005 7.24041 13H0.00129513C0.00129513 18.9056 -0.0984386 23.5361 1.45249 27.8011C5.51933 38.989 15.992 45 30.0606 45C43.6783 45 49.3213 41.0443 53 35.3278H43.3039Z"),this._svgElement.appendChild(t),this._svgElement.appendChild(i)}addStyle(){const e=document.createElement("style");e.innerHTML=` + @keyframes spin { + 0% { + transform: rotate(0deg); + } + + 5% { + transform: rotate(-10deg); + animation-timing-function: ease-out; + } + + 17% { + transform: rotate(370deg); + animation-timing-function: ease-in-out; + } + + 20% { + transform: rotate(360deg); + animation-timing-function: ease-in-out; + } + + 100% { + transform: rotate(360deg); + } + } + + #watermark-background { + position: absolute; + pointer-events: none; + width: 100%; + transition-property: opacity; + transition-duration: ${this._fadeDuration}s; + } + + #watermark-link { + all: unset; + position: absolute; + cursor: pointer; + pointer-events: none; + user-select: none; + + /* For Safari */ + -webkit-user-select: none; + } + + #watermark { + display: flex; + flex-direction: row; + align-items: center; + transition-property: opacity; + transition-duration: ${this._fadeDuration}s; + transition-timing-function: ease-out; + } + + #watermark > div { + display: flex; + flex-direction: column; + margin-left: 5px; + } + + #watermark span { + color: white; + font-family: 'Tahoma', 'Gill sans', 'Helvetica', 'Arial'; + font-size: ${this._textFontSize}px; + transition: opacity; + transition-duration: ${this._fadeDuration}s; + + /* For Safari */ + -webkit-transition: opacity; + -webkit-transition-duration: ${this._fadeDuration}s; + } + + #watermark svg.spinning { + animation-name: spin; + animation-direction: normal; + animation-duration: 5s; + animation-iteration-count: 3; + animation-delay: 1.5s; + } + + #watermark svg path { + fill: white; + } + + @media (hover: hover) { + #watermark span { + text-decoration: underline; + text-decoration-style: solid; + text-decoration-color: transparent; + } + + #watermark:hover span { + text-decoration-color: white; + + /* For Safari */ + -webkit-text-decoration-color: white; + } + } + `,document.head.appendChild(e)}}s.RuntimeWatermark=r})(a=n.watermark||(n.watermark={}))})(gdjs||(gdjs={})); +//# sourceMappingURL=runtimewatermark.js.map diff --git a/desktop/apps/dezunkrr/scenestack.js b/desktop/apps/dezunkrr/scenestack.js new file mode 100644 index 0000000..1d4b81f --- /dev/null +++ b/desktop/apps/dezunkrr/scenestack.js @@ -0,0 +1,2 @@ +var gdjs;(function(s){const r=new s.Logger("Scene stack");class a{constructor(e){this._stack=[];this._wasFirstSceneLoaded=!1;if(!e)throw"SceneStack must be constructed with a gdjs.RuntimeGame.";this._runtimeGame=e}onGameResolutionResized(){for(let e=0;e=this.customHitBoxes.length&&this.customHitBoxes.push(new s.Polygon);let a=0;for(const u=h.length;a=this.customHitBoxes[n].vertices.length&&this.customHitBoxes[n].vertices.push([0,0]),this.customHitBoxes[n].vertices[a][0]=l.x,this.customHitBoxes[n].vertices[a][1]=l.y}this.customHitBoxes[n].vertices.length=a}this.customHitBoxes.length=n}else this.customHitBoxes.length=0}getPoint(t){return t==="Centre"||t==="Center"?this.center:t==="Origin"?this.origin:this.points.containsKey(t)?this.points.get(t):this.origin}}s.SpriteAnimationFrame=g;class f{constructor(t,i){this.frames=[];this.timeBetweenFrames=i?i.timeBetweenFrames:1,this.loop=!!i.looping,this.reinitialize(t,i)}reinitialize(t,i){this.timeBetweenFrames=i?i.timeBetweenFrames:1,this.loop=!!i.looping;let e=0;for(const r=i.sprites.length;e=this._animations.length||this._currentDirection>=this._animations[this._currentAnimation].directions.length)return;const i=this._animations[this._currentAnimation].directions[this._currentDirection],e=this._currentFrame,r=this.getElapsedTime()/1e3;if(this._frameElapsedTime+=this._animationPaused?0:r*this._animationSpeedScale,!(!i.loop&&this._currentFrame>=i.frames.length-1&&this._frameElapsedTime>i.timeBetweenFrames)){if(this._frameElapsedTime>i.timeBetweenFrames){const n=Math.floor(this._frameElapsedTime/i.timeBetweenFrames);this._currentFrame+=n,this._frameElapsedTime=this._frameElapsedTime-n*i.timeBetweenFrames,this._frameElapsedTime<0&&(this._frameElapsedTime=0)}this._currentFrame>=i.frames.length&&(this._currentFrame=i.loop?this._currentFrame%i.frames.length:i.frames.length-1),this._currentFrame<0&&(this._currentFrame=0)}(e!==this._currentFrame||this._animationFrameDirty)&&this._updateAnimationFrame(),e!==this._currentFrame&&this.invalidateHitboxes(),this._renderer.ensureUpToDate()}updatePreRender(t){this._animationFrameDirty&&this._updateAnimationFrame(),this._renderer.ensureUpToDate()}_updateAnimationFrame(){if(this._animationFrameDirty=!1,this._currentAnimation=this.hitBoxes.length&&this.hitBoxes.push(new s.Polygon);for(let i=0;i=this.hitBoxes[t].vertices.length&&this.hitBoxes[t].vertices.push([0,0]),this._transformToGlobal(this._animationFrame.customHitBoxes[t].vertices[i][0],this._animationFrame.customHitBoxes[t].vertices[i][1],this.hitBoxes[t].vertices[i]);this.hitBoxes[t].vertices.length=this._animationFrame.customHitBoxes[t].vertices.length}this.hitBoxes.length=this._animationFrame.customHitBoxes.length}}setAnimation(t){t=t|0,t=0&&(this._currentAnimation=t,this._currentFrame=0,this._frameElapsedTime=0,this._renderer.update(),this._animationFrameDirty=!0,this.invalidateHitboxes())}setAnimationName(t){if(!!t){for(let i=0;i=this._animations.length?"":this._animations[this._currentAnimation].name}isCurrentAnimationName(t){return this.getAnimationName()===t}setDirectionOrAngle(t){if(this._currentAnimation>=this._animations.length)return;const i=this._animations[this._currentAnimation];if(i.hasMultipleDirections){if(t=t|0,t===this._currentDirection||t>=i.directions.length||i.directions[t].frames.length===0)return;this._currentDirection=t,this._currentFrame=0,this._frameElapsedTime=0,this.angle=0,this._renderer.update(),this._animationFrameDirty=!0,this.invalidateHitboxes()}else{if(this.angle===t)return;this.angle=t,this.invalidateHitboxes(),this._renderer.updateAngle()}}getDirectionOrAngle(){return this._currentAnimation>=this._animations.length?0:this._animations[this._currentAnimation].hasMultipleDirections?this._currentDirection:this.angle}setAnimationFrame(t){if(this._currentAnimation>=this._animations.length||this._currentDirection>=this._animations[this._currentAnimation].directions.length)return;const i=this._animations[this._currentAnimation].directions[this._currentDirection];t>=0&&t=this._animations.length)return 0;const t=this._animations[this._currentAnimation];return this._currentDirection>=t.directions.length?0:t.directions[this._currentDirection].frames.length}hasAnimationEnded(){if(this._currentAnimation>=this._animations.length||this._currentDirection>=this._animations[this._currentAnimation].directions.length)return!0;const t=this._animations[this._currentAnimation].directions[this._currentDirection];return t.loop?!1:this._currentFrame===t.frames.length-1}hasAnimationEnded2(){if(this._currentAnimation>=this._animations.length||this._currentDirection>=this._animations[this._currentAnimation].directions.length)return!0;const t=this._animations[this._currentAnimation].directions[this._currentDirection];return t.loop?!1:this._currentFrame===t.frames.length-1&&this._frameElapsedTime>t.timeBetweenFrames}animationPaused(){return this._animationPaused}pauseAnimation(){this._animationPaused=!0}playAnimation(){this._animationPaused=!1}getAnimationSpeedScale(){return this._animationSpeedScale}setAnimationSpeedScale(t){this._animationSpeedScale=t}getPointX(t){if(this._animationFrameDirty&&this._updateAnimationFrame(),t.length===0||this._animationFrame===null)return this.getX();const i=this._animationFrame.getPoint(t),e=s.staticArray(m.prototype.getPointX);return this._transformToGlobal(i.x,i.y,e),e[0]}getPointY(t){if(this._animationFrameDirty&&this._updateAnimationFrame(),t.length===0||this._animationFrame===null)return this.getY();const i=this._animationFrame.getPoint(t),e=s.staticArray(m.prototype.getPointY);return this._transformToGlobal(i.x,i.y,e),e[1]}getPointPosition(t){if(this._animationFrameDirty&&this._updateAnimationFrame(),t.length===0||this._animationFrame===null)return[this.getX(),this.getY()];const i=this._animationFrame.getPoint(t),e=s.staticArray(m.prototype.getPointX);return this._transformToGlobal(i.x,i.y,e),[e[0],e[1]]}_transformToGlobal(t,i,e){const r=this._animationFrame;let n=r.center.x,o=r.center.y;this._flippedX&&(t=t+(n-t)*2),this._flippedY&&(i=i+(o-i)*2);const h=Math.abs(this._scaleX),a=Math.abs(this._scaleY);t*=h,i*=a,n*=h,o*=a;const u=this.angle/180*Math.PI,l=Math.cos(u),_=Math.sin(u),d=t-n,p=i-o;t=n+l*d-_*p,i=o+_*d+l*p,e.length=2,e[0]=t+(this.x-r.origin.x*h),e[1]=i+(this.y-r.origin.y*a)}getDrawableX(){if(this._animationFrameDirty&&this._updateAnimationFrame(),this._animationFrame===null)return this.x;const t=Math.abs(this._scaleX);return this._flippedX?this.x+(-this._animationFrame.origin.x-this._renderer.getUnscaledWidth()+2*this._animationFrame.center.x)*t:this.x-this._animationFrame.origin.x*t}getDrawableY(){if(this._animationFrameDirty&&this._updateAnimationFrame(),this._animationFrame===null)return this.y;const t=Math.abs(this._scaleY);return this._flippedY?this.y+(-this._animationFrame.origin.y-this._renderer.getUnscaledHeight()+2*this._animationFrame.center.y)*t:this.y-this._animationFrame.origin.y*t}getCenterX(){return this._animationFrameDirty&&this._updateAnimationFrame(),this._animationFrame===null?0:this._flippedX?(this._renderer.getUnscaledWidth()-this._animationFrame.center.x)*Math.abs(this._scaleX):this._animationFrame.center.x*Math.abs(this._scaleX)}getCenterY(){return this._animationFrameDirty&&this._updateAnimationFrame(),this._animationFrame===null?0:this._flippedY?(this._renderer.getUnscaledHeight()-this._animationFrame.center.y)*Math.abs(this._scaleY):this._animationFrame.center.y*Math.abs(this._scaleY)}setX(t){t!==this.x&&(this.x=t,this._animationFrame!==null&&(this.invalidateHitboxes(),this._renderer.updateX()))}setY(t){t!==this.y&&(this.y=t,this._animationFrame!==null&&(this.invalidateHitboxes(),this._renderer.updateY()))}setAngle(t){if(!(this._currentAnimation>=this._animations.length))if(this._animations[this._currentAnimation].hasMultipleDirections)t=t%360,t<0&&(t+=360),this.setDirectionOrAngle(Math.round(t/45)%8);else{if(this.angle===t)return;this.angle=t,this._renderer.updateAngle(),this.invalidateHitboxes()}}getAngle(){return this._currentAnimation>=this._animations.length?0:this._animations[this._currentAnimation].hasMultipleDirections?this._currentDirection*45:this.angle}setBlendMode(t){this._blendMode!==t&&(this._blendMode=t,this._renderer.update())}getBlendMode(){return this._blendMode}setOpacity(t){t<0&&(t=0),t>255&&(t=255),this.opacity=t,this._renderer.updateOpacity()}getOpacity(){return this.opacity}hide(t){t===void 0&&(t=!0),this.hidden=t,this._renderer.updateVisibility()}setColor(t){this._renderer.setColor(t)}getColor(){return this._renderer.getColor()}flipX(t){t!==this._flippedX&&(this._scaleX*=-1,this._flippedX=t,this.invalidateHitboxes(),this._renderer.update())}flipY(t){t!==this._flippedY&&(this._scaleY*=-1,this._flippedY=t,this.invalidateHitboxes(),this._renderer.update())}isFlippedX(){return this._flippedX}isFlippedY(){return this._flippedY}getWidth(){return this._animationFrameDirty&&this._updateAnimationFrame(),this._renderer.getWidth()}getHeight(){return this._animationFrameDirty&&this._updateAnimationFrame(),this._renderer.getHeight()}setWidth(t){this._animationFrameDirty&&this._updateAnimationFrame();const i=this._renderer.getUnscaledWidth();i!==0&&this.setScaleX(t/i)}setHeight(t){this._animationFrameDirty&&this._updateAnimationFrame();const i=this._renderer.getUnscaledHeight();i!==0&&this.setScaleY(t/i)}setSize(t,i){this.setWidth(t),this.setHeight(i)}setScale(t){t<0&&(t=0),!(t===Math.abs(this._scaleX)&&t===Math.abs(this._scaleY))&&(this._scaleX=t*(this._flippedX?-1:1),this._scaleY=t*(this._flippedY?-1:1),this._renderer.update(),this.invalidateHitboxes())}setScaleX(t){t<0&&(t=0),t!==Math.abs(this._scaleX)&&(this._scaleX=t*(this._flippedX?-1:1),this._renderer.update(),this.invalidateHitboxes())}setScaleY(t){t<0&&(t=0),t!==Math.abs(this._scaleY)&&(this._scaleY=t*(this._flippedY?-1:1),this._renderer.update(),this.invalidateHitboxes())}getScale(){return(Math.abs(this._scaleX)+Math.abs(this._scaleY))/2}getScaleY(){return Math.abs(this._scaleY)}getScaleX(){return Math.abs(this._scaleX)}turnTowardObject(t,i){t!==null&&this.rotateTowardPosition(t.getDrawableX()+t.getCenterX(),t.getDrawableY()+t.getCenterY(),0,i)}}s.SpriteRuntimeObject=m,s.registerObject("Sprite",s.SpriteRuntimeObject),m.supportsReinitialization=!0})(gdjs||(gdjs={})); +//# sourceMappingURL=spriteruntimeobject.js.map diff --git a/desktop/apps/dezunkrr/sunburn_1.png b/desktop/apps/dezunkrr/sunburn_1.png new file mode 100644 index 0000000..84e3e9b Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_1.png differ diff --git a/desktop/apps/dezunkrr/sunburn_10.png b/desktop/apps/dezunkrr/sunburn_10.png new file mode 100644 index 0000000..6786033 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_10.png differ diff --git a/desktop/apps/dezunkrr/sunburn_11.png b/desktop/apps/dezunkrr/sunburn_11.png new file mode 100644 index 0000000..de1c103 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_11.png differ diff --git a/desktop/apps/dezunkrr/sunburn_12.png b/desktop/apps/dezunkrr/sunburn_12.png new file mode 100644 index 0000000..b1a963d Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_12.png differ diff --git a/desktop/apps/dezunkrr/sunburn_13.png b/desktop/apps/dezunkrr/sunburn_13.png new file mode 100644 index 0000000..cf5aaee Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_13.png differ diff --git a/desktop/apps/dezunkrr/sunburn_14.png b/desktop/apps/dezunkrr/sunburn_14.png new file mode 100644 index 0000000..a03ae5a Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_14.png differ diff --git a/desktop/apps/dezunkrr/sunburn_15.png b/desktop/apps/dezunkrr/sunburn_15.png new file mode 100644 index 0000000..aada2fa Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_15.png differ diff --git a/desktop/apps/dezunkrr/sunburn_16.png b/desktop/apps/dezunkrr/sunburn_16.png new file mode 100644 index 0000000..6bf1b42 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_16.png differ diff --git a/desktop/apps/dezunkrr/sunburn_17.png b/desktop/apps/dezunkrr/sunburn_17.png new file mode 100644 index 0000000..cf69d04 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_17.png differ diff --git a/desktop/apps/dezunkrr/sunburn_18.png b/desktop/apps/dezunkrr/sunburn_18.png new file mode 100644 index 0000000..16e504e Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_18.png differ diff --git a/desktop/apps/dezunkrr/sunburn_19.png b/desktop/apps/dezunkrr/sunburn_19.png new file mode 100644 index 0000000..4d70dcf Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_19.png differ diff --git a/desktop/apps/dezunkrr/sunburn_2.png b/desktop/apps/dezunkrr/sunburn_2.png new file mode 100644 index 0000000..6ab5a2e Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_2.png differ diff --git a/desktop/apps/dezunkrr/sunburn_20.png b/desktop/apps/dezunkrr/sunburn_20.png new file mode 100644 index 0000000..0a1b7b2 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_20.png differ diff --git a/desktop/apps/dezunkrr/sunburn_21.png b/desktop/apps/dezunkrr/sunburn_21.png new file mode 100644 index 0000000..ec22d2c Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_21.png differ diff --git a/desktop/apps/dezunkrr/sunburn_22.png b/desktop/apps/dezunkrr/sunburn_22.png new file mode 100644 index 0000000..8b2cc1c Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_22.png differ diff --git a/desktop/apps/dezunkrr/sunburn_23.png b/desktop/apps/dezunkrr/sunburn_23.png new file mode 100644 index 0000000..73a49b7 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_23.png differ diff --git a/desktop/apps/dezunkrr/sunburn_24.png b/desktop/apps/dezunkrr/sunburn_24.png new file mode 100644 index 0000000..4a05b6d Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_24.png differ diff --git a/desktop/apps/dezunkrr/sunburn_25.png b/desktop/apps/dezunkrr/sunburn_25.png new file mode 100644 index 0000000..5254947 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_25.png differ diff --git a/desktop/apps/dezunkrr/sunburn_26.png b/desktop/apps/dezunkrr/sunburn_26.png new file mode 100644 index 0000000..3e2c404 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_26.png differ diff --git a/desktop/apps/dezunkrr/sunburn_27.png b/desktop/apps/dezunkrr/sunburn_27.png new file mode 100644 index 0000000..2f98889 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_27.png differ diff --git a/desktop/apps/dezunkrr/sunburn_28.png b/desktop/apps/dezunkrr/sunburn_28.png new file mode 100644 index 0000000..a8f3b45 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_28.png differ diff --git a/desktop/apps/dezunkrr/sunburn_29.png b/desktop/apps/dezunkrr/sunburn_29.png new file mode 100644 index 0000000..8d32142 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_29.png differ diff --git a/desktop/apps/dezunkrr/sunburn_3.png b/desktop/apps/dezunkrr/sunburn_3.png new file mode 100644 index 0000000..c1a6102 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_3.png differ diff --git a/desktop/apps/dezunkrr/sunburn_30.png b/desktop/apps/dezunkrr/sunburn_30.png new file mode 100644 index 0000000..b81fc2c Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_30.png differ diff --git a/desktop/apps/dezunkrr/sunburn_31.png b/desktop/apps/dezunkrr/sunburn_31.png new file mode 100644 index 0000000..3dcdfe6 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_31.png differ diff --git a/desktop/apps/dezunkrr/sunburn_32.png b/desktop/apps/dezunkrr/sunburn_32.png new file mode 100644 index 0000000..d49226e Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_32.png differ diff --git a/desktop/apps/dezunkrr/sunburn_33.png b/desktop/apps/dezunkrr/sunburn_33.png new file mode 100644 index 0000000..24a9144 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_33.png differ diff --git a/desktop/apps/dezunkrr/sunburn_34.png b/desktop/apps/dezunkrr/sunburn_34.png new file mode 100644 index 0000000..9655c2e Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_34.png differ diff --git a/desktop/apps/dezunkrr/sunburn_35.png b/desktop/apps/dezunkrr/sunburn_35.png new file mode 100644 index 0000000..93d5a1b Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_35.png differ diff --git a/desktop/apps/dezunkrr/sunburn_36.png b/desktop/apps/dezunkrr/sunburn_36.png new file mode 100644 index 0000000..ab0f5f7 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_36.png differ diff --git a/desktop/apps/dezunkrr/sunburn_37.png b/desktop/apps/dezunkrr/sunburn_37.png new file mode 100644 index 0000000..e6e9486 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_37.png differ diff --git a/desktop/apps/dezunkrr/sunburn_38.png b/desktop/apps/dezunkrr/sunburn_38.png new file mode 100644 index 0000000..4c19395 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_38.png differ diff --git a/desktop/apps/dezunkrr/sunburn_39.png b/desktop/apps/dezunkrr/sunburn_39.png new file mode 100644 index 0000000..35d8ff2 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_39.png differ diff --git a/desktop/apps/dezunkrr/sunburn_4.png b/desktop/apps/dezunkrr/sunburn_4.png new file mode 100644 index 0000000..3b8b876 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_4.png differ diff --git a/desktop/apps/dezunkrr/sunburn_40.png b/desktop/apps/dezunkrr/sunburn_40.png new file mode 100644 index 0000000..a92e30b Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_40.png differ diff --git a/desktop/apps/dezunkrr/sunburn_41.png b/desktop/apps/dezunkrr/sunburn_41.png new file mode 100644 index 0000000..7c6f32c Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_41.png differ diff --git a/desktop/apps/dezunkrr/sunburn_42.png b/desktop/apps/dezunkrr/sunburn_42.png new file mode 100644 index 0000000..bc0bf72 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_42.png differ diff --git a/desktop/apps/dezunkrr/sunburn_43.png b/desktop/apps/dezunkrr/sunburn_43.png new file mode 100644 index 0000000..74a08ac Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_43.png differ diff --git a/desktop/apps/dezunkrr/sunburn_44.png b/desktop/apps/dezunkrr/sunburn_44.png new file mode 100644 index 0000000..4c876b7 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_44.png differ diff --git a/desktop/apps/dezunkrr/sunburn_45.png b/desktop/apps/dezunkrr/sunburn_45.png new file mode 100644 index 0000000..bad1e46 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_45.png differ diff --git a/desktop/apps/dezunkrr/sunburn_46.png b/desktop/apps/dezunkrr/sunburn_46.png new file mode 100644 index 0000000..c4033d7 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_46.png differ diff --git a/desktop/apps/dezunkrr/sunburn_47.png b/desktop/apps/dezunkrr/sunburn_47.png new file mode 100644 index 0000000..210096b Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_47.png differ diff --git a/desktop/apps/dezunkrr/sunburn_48.png b/desktop/apps/dezunkrr/sunburn_48.png new file mode 100644 index 0000000..5621426 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_48.png differ diff --git a/desktop/apps/dezunkrr/sunburn_49.png b/desktop/apps/dezunkrr/sunburn_49.png new file mode 100644 index 0000000..d9742d3 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_49.png differ diff --git a/desktop/apps/dezunkrr/sunburn_5.png b/desktop/apps/dezunkrr/sunburn_5.png new file mode 100644 index 0000000..5432f04 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_5.png differ diff --git a/desktop/apps/dezunkrr/sunburn_50.png b/desktop/apps/dezunkrr/sunburn_50.png new file mode 100644 index 0000000..a4b1161 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_50.png differ diff --git a/desktop/apps/dezunkrr/sunburn_51.png b/desktop/apps/dezunkrr/sunburn_51.png new file mode 100644 index 0000000..7043307 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_51.png differ diff --git a/desktop/apps/dezunkrr/sunburn_52.png b/desktop/apps/dezunkrr/sunburn_52.png new file mode 100644 index 0000000..f1f22c5 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_52.png differ diff --git a/desktop/apps/dezunkrr/sunburn_53.png b/desktop/apps/dezunkrr/sunburn_53.png new file mode 100644 index 0000000..15e06e6 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_53.png differ diff --git a/desktop/apps/dezunkrr/sunburn_54.png b/desktop/apps/dezunkrr/sunburn_54.png new file mode 100644 index 0000000..d2808ce Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_54.png differ diff --git a/desktop/apps/dezunkrr/sunburn_55.png b/desktop/apps/dezunkrr/sunburn_55.png new file mode 100644 index 0000000..9124f21 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_55.png differ diff --git a/desktop/apps/dezunkrr/sunburn_56.png b/desktop/apps/dezunkrr/sunburn_56.png new file mode 100644 index 0000000..e3db2f4 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_56.png differ diff --git a/desktop/apps/dezunkrr/sunburn_57.png b/desktop/apps/dezunkrr/sunburn_57.png new file mode 100644 index 0000000..2881152 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_57.png differ diff --git a/desktop/apps/dezunkrr/sunburn_58.png b/desktop/apps/dezunkrr/sunburn_58.png new file mode 100644 index 0000000..f1bddbc Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_58.png differ diff --git a/desktop/apps/dezunkrr/sunburn_59.png b/desktop/apps/dezunkrr/sunburn_59.png new file mode 100644 index 0000000..dfc530c Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_59.png differ diff --git a/desktop/apps/dezunkrr/sunburn_6.png b/desktop/apps/dezunkrr/sunburn_6.png new file mode 100644 index 0000000..8edd9e5 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_6.png differ diff --git a/desktop/apps/dezunkrr/sunburn_60.png b/desktop/apps/dezunkrr/sunburn_60.png new file mode 100644 index 0000000..69e18fb Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_60.png differ diff --git a/desktop/apps/dezunkrr/sunburn_61.png b/desktop/apps/dezunkrr/sunburn_61.png new file mode 100644 index 0000000..84e3e9b Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_61.png differ diff --git a/desktop/apps/dezunkrr/sunburn_7.png b/desktop/apps/dezunkrr/sunburn_7.png new file mode 100644 index 0000000..91db86e Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_7.png differ diff --git a/desktop/apps/dezunkrr/sunburn_8.png b/desktop/apps/dezunkrr/sunburn_8.png new file mode 100644 index 0000000..1078cc2 Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_8.png differ diff --git a/desktop/apps/dezunkrr/sunburn_9.png b/desktop/apps/dezunkrr/sunburn_9.png new file mode 100644 index 0000000..875090e Binary files /dev/null and b/desktop/apps/dezunkrr/sunburn_9.png differ diff --git a/desktop/apps/dezunkrr/texture_12.png b/desktop/apps/dezunkrr/texture_12.png new file mode 100644 index 0000000..32169db Binary files /dev/null and b/desktop/apps/dezunkrr/texture_12.png differ diff --git a/desktop/apps/dezunkrr/thumbnail.png b/desktop/apps/dezunkrr/thumbnail.png new file mode 100644 index 0000000..fc7d1e0 Binary files /dev/null and b/desktop/apps/dezunkrr/thumbnail.png differ diff --git a/desktop/apps/dezunkrr/tiled_dark purple space.png b/desktop/apps/dezunkrr/tiled_dark purple space.png new file mode 100644 index 0000000..d9c3fd4 Binary files /dev/null and b/desktop/apps/dezunkrr/tiled_dark purple space.png differ diff --git a/desktop/apps/dezunkrr/timemanager.js b/desktop/apps/dezunkrr/timemanager.js new file mode 100644 index 0000000..cbf8054 --- /dev/null +++ b/desktop/apps/dezunkrr/timemanager.js @@ -0,0 +1,2 @@ +var gdjs;(function(i){class r{constructor(){this._elapsedTime=0;this._timeScale=1;this._timeFromStart=0;this._firstFrame=!0;this._timers=new Hashtable;this._firstUpdateDone=!1;this.reset()}reset(){this._elapsedTime=0,this._timeScale=1,this._timeFromStart=0,this._firstFrame=!0,this._timers=new Hashtable}update(e,s){this._firstUpdateDone&&(this._firstFrame=!1),this._firstUpdateDone=!0,this._elapsedTime=Math.min(e,1e3/s),this._elapsedTime*=this._timeScale;for(const t in this._timers.items)this._timers.items.hasOwnProperty(t)&&this._timers.items[t].updateTime(this._elapsedTime);this._timeFromStart+=this._elapsedTime}setTimeScale(e){e>=0&&(this._timeScale=e)}getTimeScale(){return this._timeScale}getTimeFromStart(){return this._timeFromStart}isFirstFrame(){return this._firstFrame}getElapsedTime(){return this._elapsedTime}addTimer(e){this._timers.put(e,new i.Timer(e))}hasTimer(e){return this._timers.containsKey(e)}getTimer(e){return this._timers.get(e)}removeTimer(e){this._timers.containsKey(e)&&this._timers.remove(e)}}i.TimeManager=r})(gdjs||(gdjs={})); +//# sourceMappingURL=timemanager.js.map diff --git a/desktop/apps/dezunkrr/timer.js b/desktop/apps/dezunkrr/timer.js new file mode 100644 index 0000000..1517bb1 --- /dev/null +++ b/desktop/apps/dezunkrr/timer.js @@ -0,0 +1,2 @@ +var gdjs;(function(i){class t{constructor(e){this._time=0;this._paused=!1;this._name=e}getName(){return this._name}getTime(){return this._time}updateTime(e){this._paused||(this._time+=e)}setTime(e){this._time=e}reset(){this.setTime(0)}setPaused(e){this._paused=e}isPaused(){return this._paused}}i.Timer=t})(gdjs||(gdjs={})); +//# sourceMappingURL=timer.js.map diff --git a/desktop/apps/dezunkrr/variable.js b/desktop/apps/dezunkrr/variable.js new file mode 100644 index 0000000..4ab1211 --- /dev/null +++ b/desktop/apps/dezunkrr/variable.js @@ -0,0 +1,2 @@ +var gdjs;(function(i){const n=new i.Logger("Variables");class a{constructor(e){this._type="number";this._value=0;this._str="0";this._bool=!1;this._children={};this._childrenArray=[];this._undefinedInContainer=!1;this.reinitialize(e)}reinitialize(e){if(this._type="number",this._value=0,this._str="0",this._bool=!1,this._children={},this._childrenArray=[],this._undefinedInContainer=!1,e!==void 0){if(this._type=e.type||"number",this._type==="number")this._value=parseFloat(e.value||"0"),this._value!==this._value&&(this._value=0);else if(this._type==="string")this._str=""+e.value||"0";else if(this._type==="boolean")this._bool=!!e.value;else if(this._type==="structure"){if(e.children!==void 0)for(var t=0,r=e.children.length;tNumber.MAX_SAFE_INTEGER&&n.warn("Error while converting JS variable to GDevelop variable: Integers bigger than "+Number.MAX_SAFE_INTEGER+" aren't supported by GDevelop variables, it will be reduced to that size."),variable.setNumber(parseInt(e,10))):typeof e=="function"?n.error("Error while converting JS variable to GDevelop variable: Impossible to set variable value to a function."):n.error("Error while converting JS variable to GDevelop variable: Cannot identify type of object "+e);return this}fromJSON(e){try{var t=JSON.parse(e)}catch(r){return n.error("Unable to parse JSON: "+e+r),this}return this.fromJSObject(t),this}toJSObject(){switch(this._type){case"string":return this.getAsString();case"number":return this.getAsNumber();case"boolean":return this.getAsBoolean();case"structure":const e={};for(const r in this._children)e[r]=this._children[r].toJSObject();return e;case"array":const t=[];for(const r of this._childrenArray)t.push(r===void 0?void 0:r.toJSObject());return t}}isPrimitive(){return i.Variable.isPrimitive(this._type)}clone(){return i.Variable.copy(this,new i.Variable)}setUndefinedInContainer(){this._undefinedInContainer=!0}isUndefinedInContainer(){return this._undefinedInContainer}castTo(e){if(e==="string")this.setString(this.getAsString());else if(e==="number")this.setNumber(this.getAsNumber());else if(e==="boolean")this.setBoolean(this.getAsBoolean());else if(e==="structure"){if(this._type==="structure")return;this._children=this.getAllChildren(),this._type="structure"}else if(e==="array"){if(this._type==="array")return;this._childrenArray=this.getAllChildrenArray(),this._type="array"}}getChild(e){return this.isPrimitive()&&this.castTo("structure"),this._type==="array"?this.getChildAt(parseInt(e,10)||0):((this._children[e]===void 0||this._children[e]===null)&&(this._children[e]=new i.Variable),this._children[e])}addChild(e,t){return this.castTo("structure"),this._children[e]=t,this}hasChild(e){return this._type==="structure"&&this._children.hasOwnProperty(e)}removeChild(e){this._type==="structure"&&delete this._children[e]}clearChildren(){this._children={},this._childrenArray=[]}replaceChildren(e){this._type="structure",this._children=e}replaceChildrenArray(e){this._type="array",this._childrenArray=e}getAsNumber(){if(this._type!=="number"){let e=0;return this._type==="string"?e=parseFloat(this._str):this._type==="boolean"&&(e=this._bool?1:0),e===e?e:0}return this._value}setNumber(e){this._type="number",e=parseFloat(e),this._value=e===e?e:0}getAsString(){return this._type!=="string"?this._type==="number"?this._value.toString():this._type==="boolean"?this._bool?"true":"false":this._type==="structure"?"[Structure]":this._type==="array"?"[Array]":"":this._str}setString(e){this._type="string",this._str=""+e}getAsBoolean(){return this._type!=="boolean"?this._type==="number"?this._value!==0:this._type==="string"?this._str!=="0"&&this._str!==""&&this._str!=="false":!0:this._bool}setBoolean(e){this._type="boolean",this._bool=!!e}setValue(e){this._type==="string"?this.setString(e):this._type==="number"?this.setNumber(e):this._type==="boolean"&&this.setBoolean(e)}getValue(){return this._type==="number"?this.getAsNumber():this._type==="boolean"?this.getAsBoolean():this.getAsString()}isStructure(){return this._type==="structure"}isNumber(){return this._type==="number"}getType(){return this._type}getAllChildren(){return this._type==="structure"?this._children:this._type==="array"?Object.assign({},this._childrenArray):{}}getAllChildrenArray(){return this._type==="structure"?Object.values(this._children):this._type==="array"?this._childrenArray:[]}getChildrenCount(){return this._type==="structure"?Object.keys(this._children).length:this._type==="array"?this._childrenArray.length:0}add(e){this.setNumber(this.getAsNumber()+e)}sub(e){this.setNumber(this.getAsNumber()-e)}mul(e){this.setNumber(this.getAsNumber()*e)}div(e){this.setNumber(this.getAsNumber()/e)}concatenateString(e){this.setString(this.getAsString()+e)}concatenate(e){this.setString(this.getAsString()+e)}getChildAt(e){return this.castTo("array"),(this._childrenArray[e]===void 0||this._childrenArray[e]===null)&&(this._childrenArray[e]=new i.Variable),this._childrenArray[e]}removeAtIndex(e){this._type==="array"&&this._childrenArray.splice(e,1)}pushVariableCopy(e){this.castTo("array"),this._childrenArray.push(e.clone())}pushValue(e){this.castTo("array"),this._childrenArray.push(new i.Variable({type:typeof e,value:e}))}}i.Variable=a})(gdjs||(gdjs={})); +//# sourceMappingURL=variable.js.map diff --git a/desktop/apps/dezunkrr/variablescontainer.js b/desktop/apps/dezunkrr/variablescontainer.js new file mode 100644 index 0000000..4800413 --- /dev/null +++ b/desktop/apps/dezunkrr/variablescontainer.js @@ -0,0 +1,2 @@ +var gdjs;(function(t){const n=class{constructor(r){this._variablesArray=[];this._variables=new Hashtable,r!==void 0&&this.initFrom(r)}initFrom(r,e){e===void 0&&(e=!1),e||(n._deletedVars=n._deletedVars||[],this._variables.keys(n._deletedVars));const i=this;let a=0;for(let l=0;l=this._variablesArray.length){let e=new t.Variable;return this._variables.put("",e),e}else{let e=this._variablesArray[r];return e.isUndefinedInContainer()&&e.reinitialize(),e}}has(r){const e=this._variables.get(r);return e&&!e.isUndefinedInContainer()}};let o=n;o._deletedVars=[],o.badVariablesContainer={_variables:new Hashtable,_variablesArray:[],has:function(){return!1},getFromIndex:function(){return n.badVariable},get:function(){return n.badVariable},remove:function(){},add:function(){},initFrom:function(){}},o.badVariable={_type:"number",_bool:!1,_children:{},_childrenArray:[],_str:"",_undefinedInContainer:!0,_value:0,fromJSON:()=>t.VariablesContainer.badVariable,toJSObject:()=>0,fromJSObject:()=>t.VariablesContainer.badVariable,reinitialize:()=>{},addChild:()=>t.VariablesContainer.badVariable,castTo:()=>{},clearChildren:()=>{},clone:()=>t.VariablesContainer.badVariable,getChildrenCount:()=>0,replaceChildren:()=>{},replaceChildrenArray:()=>{},getType:function(){return"number"},isPrimitive:function(){return!0},setValue:()=>{},getValue:()=>0,getChild:()=>t.VariablesContainer.badVariable,getChildAt:()=>t.VariablesContainer.badVariable,hasChild:function(){return!1},isStructure:function(){return!1},isNumber:function(){return!0},removeChild:function(){},setNumber:function(){},setString:function(){},setBoolean:function(){},getAsString:function(){return"0"},getAsNumber:function(){return 0},getAsBoolean:function(){return!1},getAllChildren:function(){return{}},getAllChildrenArray:function(){return[]},pushVariableCopy:()=>{},pushValue:()=>{},removeAtIndex:function(){},add:function(){},sub:function(){},mul:function(){},div:function(){},concatenate:function(){},concatenateString:function(){},setUndefinedInContainer:function(){},isUndefinedInContainer:function(){return!0}},t.VariablesContainer=o})(gdjs||(gdjs={})); +//# sourceMappingURL=variablescontainer.js.map diff --git a/desktop/apps/dezunkrr/wideThumbnail.png b/desktop/apps/dezunkrr/wideThumbnail.png new file mode 100644 index 0000000..1008c81 Binary files /dev/null and b/desktop/apps/dezunkrr/wideThumbnail.png differ diff --git a/desktop/apps/dezunkrr/ztitle1.png b/desktop/apps/dezunkrr/ztitle1.png new file mode 100644 index 0000000..7007d16 Binary files /dev/null and b/desktop/apps/dezunkrr/ztitle1.png differ diff --git a/desktop/apps/dezunkrr/ztitle10.png b/desktop/apps/dezunkrr/ztitle10.png new file mode 100644 index 0000000..7cbcb24 Binary files /dev/null and b/desktop/apps/dezunkrr/ztitle10.png differ diff --git a/desktop/apps/dezunkrr/ztitle11.png b/desktop/apps/dezunkrr/ztitle11.png new file mode 100644 index 0000000..3cc6cd1 Binary files /dev/null and b/desktop/apps/dezunkrr/ztitle11.png differ diff --git a/desktop/apps/dezunkrr/ztitle12.png b/desktop/apps/dezunkrr/ztitle12.png new file mode 100644 index 0000000..ef78595 Binary files /dev/null and b/desktop/apps/dezunkrr/ztitle12.png differ diff --git a/desktop/apps/dezunkrr/ztitle13.png b/desktop/apps/dezunkrr/ztitle13.png new file mode 100644 index 0000000..01fb839 Binary files /dev/null and b/desktop/apps/dezunkrr/ztitle13.png differ diff --git a/desktop/apps/dezunkrr/ztitle14.png b/desktop/apps/dezunkrr/ztitle14.png new file mode 100644 index 0000000..f5a23db Binary files /dev/null and b/desktop/apps/dezunkrr/ztitle14.png differ diff --git a/desktop/apps/dezunkrr/ztitle15.png b/desktop/apps/dezunkrr/ztitle15.png new file mode 100644 index 0000000..b6922dc Binary files /dev/null and b/desktop/apps/dezunkrr/ztitle15.png differ diff --git a/desktop/apps/dezunkrr/ztitle16.png b/desktop/apps/dezunkrr/ztitle16.png new file mode 100644 index 0000000..75b9994 Binary files /dev/null and b/desktop/apps/dezunkrr/ztitle16.png differ diff --git a/desktop/apps/dezunkrr/ztitle17.png b/desktop/apps/dezunkrr/ztitle17.png new file mode 100644 index 0000000..0504dbc Binary files /dev/null and b/desktop/apps/dezunkrr/ztitle17.png differ diff --git a/desktop/apps/dezunkrr/ztitle2.png b/desktop/apps/dezunkrr/ztitle2.png new file mode 100644 index 0000000..8091b13 Binary files /dev/null and b/desktop/apps/dezunkrr/ztitle2.png differ diff --git a/desktop/apps/dezunkrr/ztitle3.png b/desktop/apps/dezunkrr/ztitle3.png new file mode 100644 index 0000000..2540586 Binary files /dev/null and b/desktop/apps/dezunkrr/ztitle3.png differ diff --git a/desktop/apps/dezunkrr/ztitle4.png b/desktop/apps/dezunkrr/ztitle4.png new file mode 100644 index 0000000..f245e10 Binary files /dev/null and b/desktop/apps/dezunkrr/ztitle4.png differ diff --git a/desktop/apps/dezunkrr/ztitle5.png b/desktop/apps/dezunkrr/ztitle5.png new file mode 100644 index 0000000..7c8ea7e Binary files /dev/null and b/desktop/apps/dezunkrr/ztitle5.png differ diff --git a/desktop/apps/dezunkrr/ztitle6.png b/desktop/apps/dezunkrr/ztitle6.png new file mode 100644 index 0000000..9e40179 Binary files /dev/null and b/desktop/apps/dezunkrr/ztitle6.png differ diff --git a/desktop/apps/dezunkrr/ztitle7.png b/desktop/apps/dezunkrr/ztitle7.png new file mode 100644 index 0000000..4119cc9 Binary files /dev/null and b/desktop/apps/dezunkrr/ztitle7.png differ diff --git a/desktop/apps/dezunkrr/ztitle8.png b/desktop/apps/dezunkrr/ztitle8.png new file mode 100644 index 0000000..32c02c1 Binary files /dev/null and b/desktop/apps/dezunkrr/ztitle8.png differ diff --git a/desktop/apps/dezunkrr/ztitle9.png b/desktop/apps/dezunkrr/ztitle9.png new file mode 100644 index 0000000..81491d5 Binary files /dev/null and b/desktop/apps/dezunkrr/ztitle9.png differ diff --git a/desktop/apps/shutdownDialog/index.html b/desktop/apps/shutdownDialog/index.html new file mode 100644 index 0000000..da4a84d --- /dev/null +++ b/desktop/apps/shutdownDialog/index.html @@ -0,0 +1,41 @@ + + + + Shutdown + + + + + + \ No newline at end of file diff --git a/desktop/apps/shutdownDialog/styles.css b/desktop/apps/shutdownDialog/styles.css new file mode 100644 index 0000000..6543105 --- /dev/null +++ b/desktop/apps/shutdownDialog/styles.css @@ -0,0 +1,70 @@ +@font-face { + font-family: 'Inter'; + src: url('../../assets/fonts/inter/Inter-Regular.ttf'); +} + +@font-face { + font-family: 'InterThin'; + src: url('../../assets/fonts/inter/Inter-Thin.ttf'); +} + +p, h1, h2, h3 { + font-family: inter; + color: white; +} + +/* center it */ +h1 { + margin-top: 50px; + margin-bottom: 10px; + align-items: center; + justify-content: center; + text-align: center; + +} + +.list { + background-color: #261838; + border-radius: 15px; + margin: auto; + margin-top: 0; + width: 80%; + padding: 5px; + padding-bottom: 10px; +} + +.listOption { + background-color: #311f47; + border-radius: 15px; + padding: 5px; + margin: auto; + margin-top: 10px; + width: 95%; + height: 48px; + display: flex; + box-shadow: 0px 0px 20px #00000030; + transition-duration: 0.2s; +} + +.listOptionText { + text-align: left; + margin-top: -10px; + margin-left: 5px; + display: flex; + flex-direction: column; +} + +.listOption:hover { + scale: 1.02; + background-color: #35224d; +} + +.listOption:active { + scale: 0.99; + background-color: #2e1d42; +} + +.mini { + margin-top: -12px; + font-size: 10px; +} \ No newline at end of file diff --git a/desktop/apps/wifipanel/index.html b/desktop/apps/wifipanel/index.html new file mode 100644 index 0000000..5941452 --- /dev/null +++ b/desktop/apps/wifipanel/index.html @@ -0,0 +1,23 @@ + + + + Shutdown + + + + + + \ No newline at end of file diff --git a/desktop/apps/wifipanel/styles.css b/desktop/apps/wifipanel/styles.css new file mode 100644 index 0000000..40b3640 --- /dev/null +++ b/desktop/apps/wifipanel/styles.css @@ -0,0 +1,70 @@ +@font-face { + font-family: 'Inter'; + src: url('../../assets/fonts/inter/Inter-Regular.ttf'); +} + +@font-face { + font-family: 'InterThin'; + src: url('../../assets/fonts/inter/Inter-Thin.ttf'); +} + +p, h1, h2, h3 { + font-family: inter; + color: white; +} + +/* center it */ +h2 { + margin-top: 50px; + margin-bottom: 10px; + align-items: center; + justify-content: center; + text-align: center; + +} + +.list { + background-color: #261838; + border-radius: 15px; + margin: auto; + margin-top: 0; + width: 80%; + padding: 5px; + padding-bottom: 10px; +} + +.listOption { + background-color: #311f47; + border-radius: 15px; + padding: 5px; + margin: auto; + margin-top: 10px; + width: 95%; + height: 48px; + display: flex; + box-shadow: 0px 0px 20px #00000030; + transition-duration: 0.2s; +} + +.listOptionText { + text-align: left; + margin-top: -10px; + margin-left: 5px; + display: flex; + flex-direction: column; +} + +.listOption:hover { + scale: 1.02; + background-color: #35224d; +} + +.listOption:active { + scale: 0.99; + background-color: #2e1d42; +} + +.mini { + margin-top: -12px; + font-size: 10px; +} \ No newline at end of file diff --git a/desktop/assets/icons/bluetooth.svg b/desktop/assets/icons/bluetooth.svg new file mode 100644 index 0000000..e69de29 diff --git a/desktop/assets/icons/clock.svg b/desktop/assets/icons/clock.svg new file mode 100644 index 0000000..e5c3789 --- /dev/null +++ b/desktop/assets/icons/clock.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/desktop/assets/icons/close.svg b/desktop/assets/icons/close.svg new file mode 100644 index 0000000..8c71124 --- /dev/null +++ b/desktop/assets/icons/close.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/desktop/assets/icons/code.svg b/desktop/assets/icons/code.svg new file mode 100644 index 0000000..8a2611a --- /dev/null +++ b/desktop/assets/icons/code.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/desktop/assets/icons/crescent moon.svg b/desktop/assets/icons/crescent moon.svg new file mode 100644 index 0000000..b5f45f6 --- /dev/null +++ b/desktop/assets/icons/crescent moon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/desktop/assets/icons/exclamation.svg b/desktop/assets/icons/exclamation.svg new file mode 100644 index 0000000..1a9d883 --- /dev/null +++ b/desktop/assets/icons/exclamation.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/desktop/assets/icons/refresh.svg b/desktop/assets/icons/refresh.svg new file mode 100644 index 0000000..697e3b9 --- /dev/null +++ b/desktop/assets/icons/refresh.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/desktop/assets/icons/wifi off.svg b/desktop/assets/icons/wifi off.svg new file mode 100644 index 0000000..3d0adfd --- /dev/null +++ b/desktop/assets/icons/wifi off.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/desktop/assets/icons/wifi.svg b/desktop/assets/icons/wifi.svg new file mode 100644 index 0000000..af9e285 --- /dev/null +++ b/desktop/assets/icons/wifi.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/desktop/assets/icons/window.svg b/desktop/assets/icons/window.svg new file mode 100644 index 0000000..e6e60fd --- /dev/null +++ b/desktop/assets/icons/window.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/desktop/index.css b/desktop/index.css index bec50c7..a4e7bba 100644 --- a/desktop/index.css +++ b/desktop/index.css @@ -25,7 +25,7 @@ body { src: url('../assets/fonts/inter/Inter-Thin.ttf'); } -p, h1, h2, h3, h4, h5, h6 { +p, h1, h2, h3, h4, h5, h6, .taskbartask { font-family: 'Inter'; color: white; } @@ -82,7 +82,7 @@ h1 { margin-right: auto; box-shadow: 0 0 28px 2px rgba(0, 0, 0, .41); display: flex; - z-index: 420; /* very funny numbr */ + z-index: 50; } .window { @@ -99,7 +99,6 @@ h1 { text-align: center; box-shadow: 0px 0px 30px #000000; transition-duration: 0.2s; - } .container { @@ -155,22 +154,25 @@ button:active { background-color: #170d21; } -.toolbarStart, .trayButton, .quickPanel-Button, .taskbarDate-Button, .power-button { +.toolbarStart, .trayButton, .quickPanel-Button, .taskbarDate-Button, .power-button, .wifi-Button { border: 0px; border-radius: 0px; width: 45px; height: 45px; padding: 5px; - padding-top: 7px; display: flex; + align-items: center; justify-content: center; + text-align: center; + z-index: 50; } .toolbarStart { box-shadow: 2px 0px 0px #2d1b40; } -.trayButton, .quickPanel-Button, .taskbarDate-Button { + +.trayButton, .quickPanel-Button, .taskbarDate-Button, .wifi-Button { box-shadow: -2px 0px 0px #2d1b40; } @@ -183,6 +185,8 @@ button:active { .toolbarTask { width: 100%; + display: flex; + flex-direction: row; } .mini { @@ -307,7 +311,7 @@ button:active { .power-button { position: absolute; - margin-left: 340px; + right: 10px; border-radius: 10px; display: flex; width: 40px; @@ -334,7 +338,6 @@ hr.menuhr { border-radius: 15px; padding: 5px; padding-left: 20px; - margin: 7px; margin-top: 10px; width: 90.7%; height: 48px; @@ -382,4 +385,115 @@ hr.menuhr { .taskDateText { margin-top: -9%; +} + +.welcome { + background-color: black; + width: 100%; + height: 100%; + position: fixed; + top: 0; + left: 0; + padding: 0px; + margin: auto; + inset: 0px; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + text-align: center; + z-index: 420; /* very funny numbr */ +} + +.welcometext { + font-size: 45px; + font-family: 'InterThin' +} + +@keyframes fadeout { + from { + opacity: 1; + pointer-events: all; + } + to { + opacity: 0; + pointer-events: none; + } +} + +.fadeout { + animation: fadeout 0.5s ease-in-out forwards; +} + +.startmenulist { + padding: 2px; + margin: 0px; +} + +@keyframes opentask { + from { + opacity: 0; + margin-left: -5px; + } + to { + opacity: 1; + margin-left: 0px; + } +} + +.opentask { + animation: opentask 0.2s ease-out forwards; +} + +@keyframes closetask { + from { + opacity: 1; + margin-left: 0px; + } + to { + opacity: 0; + margin-left: -5px; + } +} + +.closetask { + animation: closetask 0.2s ease-out forwards; +} + +.taskbartask { + margin: 0; + padding: 0; + box-shadow: 0px 0px 0px #2d1b40; + border: 0px solid #2d1b40; + border-right: 2px solid #2d1b40; + border-radius: 0px; + min-width: 45px; + max-width: 150px; + height: 45px; + padding: 20px; + padding-top: 0; + padding-bottom: 0; + display: flex; + align-items: center; + justify-content: center; + text-align: center; + opacity: 0; + margin-left: -5px; +} + +.taskbartask:hover { + background-color: #231433; +} + +.taskbartask:active { + background-color: #170d21; +} + +.sysver { + position: fixed; + top: 5px; + right: 15px; + opacity: 0.5; + text-align: right; + text-shadow: 0px 0px 25px #000000cc; } \ No newline at end of file diff --git a/desktop/index.html b/desktop/index.html index 0728f97..cf49c03 100644 --- a/desktop/index.html +++ b/desktop/index.html @@ -5,11 +5,16 @@ +
+ +

Welcome!

+
+

AzuOS Alpha 5
By AzuSystem

-

Test ISO

Not Implemented...

@@ -61,46 +77,48 @@

Pinned Apps

- -
- -
-

File Manager

+
- - -
- - - - -
- - - - -
@@ -112,12 +130,13 @@

00:00

-
-

test

-
+
+ diff --git a/desktop/scripts/welcome.js b/desktop/scripts/welcome.js new file mode 100644 index 0000000..068c1a7 --- /dev/null +++ b/desktop/scripts/welcome.js @@ -0,0 +1,5 @@ +var welcome = document.getElementById('welcome'); + +setTimeout(function() { + welcome.classList.add("fadeout"); +}, 2000); \ No newline at end of file diff --git a/desktop/scripts/window.js b/desktop/scripts/window.js index 93c3781..fdcc87b 100644 --- a/desktop/scripts/window.js +++ b/desktop/scripts/window.js @@ -1,11 +1,38 @@ +// Portions of this code is from TwinBox v10.0 +// (C) datkat21, Envy ISDX 2024 + function newWindow(title, maximized, url) { - new WinBox({ + let obj = {}; + + var winbox = new WinBox({ title: title, max: maximized, url: url, root: document.querySelector("desktop"), - overflow: true + overflow: true, + onclose: function(){ + this.g.classList.add("windowClose"); + document.getElementById(winbox.id).classList.remove("opentask"); + document.getElementById(winbox.id).classList.add("closetask"); + + setTimeout(() => { + this.onclose = null; + this.close(); + document.getElementById(winbox.id).remove(); + }, 200); + + return true; + } }); + const tbtask = document.createElement('a'); + tbtask.id = winbox.id; + tbtask.className = 'taskbartask opentask'; + tbtask.textContent = title; + tbtask.onclick = function() { + unminWindow(winbox.id); + }; + document.getElementById('tbtasks').appendChild(tbtask); + console.log("Window ID:", winbox.id); } function newWindowAZML(title, maximized, url) { @@ -22,10 +49,87 @@ function newWindowAZML(title, maximized, url) { max: maximized, root: document.querySelector("desktop"), html: htmlContent, - overflow: true + overflow: true, + onclose: function(){ + this.g.classList.add("windowClose"); + + setTimeout(() => { + this.onclose = null; + this.close(); + }, 500); + + return true; + } }); }) .catch(error => { console.error('Error fetching or creating WinBox:', error); }); -} \ No newline at end of file +} + +function AzuDialog(title, note, modal) { + new WinBox({ + title: title, + html: '

' + note + '

', + root: document.querySelector("desktop"), + overflow: true, + modal: modal, + class: 'azudialog', + onclose: function(){ + this.g.classList.add("windowClose"); + + setTimeout(() => { + this.onclose = null; + this.close(); + }, 200); + + return true; + } + }); +}; + +function powerDialog() { + new WinBox({ + title: 'Choose an Action', + url: 'apps/shutdownDialog/index.html', + root: document.querySelector("desktop"), + overflow: true, + modal: true, + class: 'poweroff', + width: 500, + height: 400, + onclose: function(){ + this.g.classList.add("windowClose"); + + setTimeout(() => { + this.onclose = null; + this.close(); + }, 200); + + return true; + } + }); +}; + +function wifiPanel() { + new WinBox({ + title: 'Find a Network', + url: 'apps/wifipanel/index.html', + root: document.querySelector("desktop"), + overflow: true, + modal: true, + class: 'wifipanel', + width: 500, + height: 400, + onclose: function(){ + this.g.classList.add("windowClose"); + + setTimeout(() => { + this.onclose = null; + this.close(); + }, 200); + + return true; + } + }); +}; \ No newline at end of file diff --git a/desktop/window.css b/desktop/window.css index 9859192..a5f7af8 100644 --- a/desktop/window.css +++ b/desktop/window.css @@ -1,28 +1,37 @@ /* fade in - fade out */ -@keyframes fadeIn { +@keyframes windowOpen { from { opacity: 0; scale: 0.95; + rotateX: -5; + perspective: 1000px; } - to { + to { opacity: 1; scale: 1; + rotateX: 0; + perspective: 1000px; } } -@keyframes fadeOut { +@keyframes windowClose { from { opacity: 1; scale: 1; + rotateX: 0; + perspective: 1000px; } to { opacity: 0; - scale: 1.05; + scale: 0.95; + rotateX: -5; + perspective: 1000px; } } -.fadeOut { - animation: fadeOut 0.5s ease-out forwards; +.windowClose { + animation: windowClose 0.2s ease forwards !important; + pointer-events: none !important; } .winbox { @@ -31,11 +40,13 @@ border: 2px solid #2d1b40; border-radius: 5px; box-shadow: 0px 0px 30px #000000; - animation: fadeIn 0.2s ease-out forwards; + animation: windowOpen 0.2s ease-out forwards; } .winbox.min { - border-radius: 0; + animation: windowClose 0.2s ease forwards !important; + opacity: .3 !important; +/* pointer-events: none !important;*/ } .wb-body { diff --git a/index.py b/index.py index 95391e3..b752b98 100644 --- a/index.py +++ b/index.py @@ -1,4 +1,11 @@ import webview +import subprocess -webview.create_window('AzuOS', url="desktop/index.html") +class Api: + def get_wifi_networks(self): + print('not implemented') + +print('Starting AzuOS...') + +webview.create_window('AzuOS', url="desktop/index.html", background_color='#000000', fullscreen=True) webview.start(private_mode=False) \ No newline at end of file diff --git a/login/index.css b/login/index.css index 608ec8c..670bf74 100644 --- a/login/index.css +++ b/login/index.css @@ -1,99 +1,18 @@ body { - background-image: url('../desktop/assets/wallpapers/blackGrid.jpg'); - background-size: cover; - background-attachment: fixed; + background-color: black; } -.screen { - background-image: url('../desktop/assets/wallpapers/blackGrid.jpg'); - background-size: cover; - background-attachment: fixed; - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - margin: 0; - padding: 0; - overflow: hidden; -} - -.window { - background-color: #1e112cee; - position: fixed; - width: 28%; - height: 20%; - padding: 0px; - padding-bottom: 92px; - border: 2px solid #2d1b40; - border-radius: 5px; - margin: auto; - inset: 0px; - text-align: center; - box-shadow: 0px 0px 30px #000000; - transition-duration: 0.2s; - z-index: 5; - opacity: 0; -} - -.login { - position: fixed; - background-color: #150d1fcc; - width: 30%; - height: 20%; - padding: 0px; - padding-top: 20px; - padding-bottom: 20px; -} - - @font-face { font-family: 'Inter'; src: url('../assets/fonts/inter/Inter-Regular.ttf'); } + p, h1, h2, h3, h4, h5, h6 { font-family: 'Inter'; color: white; } -.datetime { - position: fixed; - width: 40%; - height: 10%; - padding: 0px; - padding-top: 40px; - padding-bottom: 90px; - margin: auto; - inset: 0px; - display: flex; - align-items: center; - justify-content: center; - text-align: center; -} - -.time { - font-size: 100px; - margin: auto; - position: fixed; -} - -.date { - font-size: 50px; - margin: auto; - margin-top: 150px; - position: fixed; -} - -@keyframes loginDate { - from { - opacity: 1; - } - to { - opacity: 0; - } -} - -@keyframes noLoginDate { +@keyframes fadeIn { from { opacity: 0; } @@ -102,71 +21,44 @@ p, h1, h2, h3, h4, h5, h6 { } } -.loginDate { - animation: loginDate 0.2s ease-in-out forwards; -} - -.noLoginDate { - animation: noLoginDate 0.2s ease-in-out forwards; -} - -@keyframes blur { - from { - filter: blur(0px) brightness(1); - } - to { - filter: blur(5px) brightness(0.5); - } -} - -@keyframes noBlur { - from { - filter: blur(5px) brightness(0.5); - } - to { - filter: blur(0px) brightness(1); - } -} - -.blur { - animation: blur 0.5s ease-in-out forwards; -} - -.noBlur { - animation: noBlur 0.5s ease-in-out forwards; +.bootscreen { + position: fixed; + width: 100%; + height: 100%; + padding: 0px; + margin: auto; + inset: 0px; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + text-align: center; + z-index: 10; + background-color: black; + opacity: 0; + animation: fadeIn 0.5s ease-in-out forwards; } -/* fade in - fade out */ -@keyframes fadeIn { - from { - opacity: 0; - width: 28%; - height: 18%; - } - to { - opacity: 1; - width: 30%; - height: 20%; - } +.boottext { + font-size: 24px; + font-family: 'Inter'; } -.fadeIn { - animation: fadeIn 0.5s ease-out forwards; +.loading { + position: fixed; + left: 10px; + bottom: 0; } -@keyframes fadeOut { +@keyframes fadeout { from { opacity: 1; - width: 30%; - height: 20%; } to { opacity: 0; - width: 28%; - height: 18%; } } -.fadeOut { - animation: fadeOut 0.5s ease-out forwards; +.fadeout { + animation: fadeout 0.5s ease-in-out forwards; } \ No newline at end of file diff --git a/login/index.html b/login/index.html index 2b38689..068d372 100644 --- a/login/index.html +++ b/login/index.html @@ -5,19 +5,42 @@ -
-

Login

- -
-
- -
-

00:00

-

January 1, 2000

- +
+ +

AzuOS

+ + + + + +
+

Loading...

diff --git a/login/login.css b/login/login.css new file mode 100644 index 0000000..7bfa181 --- /dev/null +++ b/login/login.css @@ -0,0 +1,216 @@ +body { + background-image: url('../desktop/assets/wallpapers/blackGrid.jpg'); + background-size: cover; + background-attachment: fixed; +} + +.screen { + background-image: url('../desktop/assets/wallpapers/blackGrid.jpg'); + background-size: cover; + background-attachment: fixed; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + margin: 0; + padding: 0; + overflow: hidden; +} + +.window { + background-color: #1e112cee; + position: fixed; + width: 28%; + height: 20%; + padding: 0px; + padding-bottom: 92px; + border: 2px solid #2d1b40; + border-radius: 5px; + margin: auto; + inset: 0px; + text-align: center; + box-shadow: 0px 0px 30px #000000; + transition-duration: 0.2s; + z-index: 5; + opacity: 0; +} + +.login { + position: fixed; + background-color: #150d1fcc; + width: 30%; + height: 20%; + padding: 0px; + padding-top: 20px; + padding-bottom: 20px; +} + + +@font-face { + font-family: 'Inter'; + src: url('../assets/fonts/inter/Inter-Regular.ttf'); +} + +p, h1, h2, h3, h4, h5, h6 { + font-family: 'Inter'; + color: white; +} + +.datetime { + position: fixed; + width: 40%; + height: 10%; + padding: 0px; + padding-top: 40px; + padding-bottom: 90px; + margin: auto; + inset: 0px; + display: flex; + align-items: center; + justify-content: center; + text-align: center; +} + +.time { + font-size: 100px; + margin: auto; + position: fixed; +} + +.date { + font-size: 50px; + margin: auto; + margin-top: 150px; + position: fixed; +} + +@keyframes loginDate { + from { + opacity: 1; + } + to { + opacity: 0; + } +} + +@keyframes noLoginDate { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +.loginDate { + animation: loginDate 0.2s ease-in-out forwards; +} + +.noLoginDate { + animation: noLoginDate 0.2s ease-in-out forwards; +} + +@keyframes blur { + from { + filter: brightness(1); + } + to { + filter: brightness(0.5); + } +} + +@keyframes noBlur { + from { + filter: brightness(0.5); + } + to { + filter: brightness(1); + } +} + +.blur { + animation: blur 0.5s ease-in-out forwards; +} + +.noBlur { + animation: noBlur 0.5s ease-in-out forwards; +} + +/* fade in - fade out */ +@keyframes fadeIn { + from { + opacity: 0; + width: 28%; + height: 18%; + pointer-events: none; + } + to { + opacity: 1; + width: 30%; + height: 20%; + pointer-events: all; + } +} + +.fadeIn { + animation: fadeIn 0.5s ease-out forwards; +} + +@keyframes fadeOut { + from { + opacity: 1; + width: 30%; + height: 20%; + pointer-events: all; + } + to { + opacity: 0; + width: 28%; + height: 18%; + pointer-events: none; + } +} + +.fadeOut { + animation: fadeOut 0.5s ease-out forwards; +} + +@keyframes fadeOutBoot { + from { + opacity: 1; + pointer-events: all; + } + to { + opacity: 0; + pointer-events: none; + } +} + +.bootscreen { + position: fixed; + width: 100%; + height: 100%; + padding: 0px; + margin: auto; + inset: 0px; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + text-align: center; + z-index: 10; + background-color: black; + animation: fadeOutBoot 0.5s ease-in-out forwards; +} + +.boottext { + font-size: 24px; + font-family: 'Inter'; +} + +.loading { + position: fixed; + left: 10px; + bottom: 0; +} \ No newline at end of file diff --git a/login/login.html b/login/login.html new file mode 100644 index 0000000..b401e7e --- /dev/null +++ b/login/login.html @@ -0,0 +1,31 @@ + + + + AzuOS + + + +
+ +

AzuOS

+
+

Loading...

+
+
+
+

Login

+ +
+
+ +
+

00:00

+

January 1, 2000

+ +
+
+ + \ No newline at end of file diff --git a/login/scripts/boot.js b/login/scripts/boot.js new file mode 100644 index 0000000..307e23e --- /dev/null +++ b/login/scripts/boot.js @@ -0,0 +1,9 @@ +var spinner = document.getElementById("loading"); + +setTimeout(function() { + spinner.classList.add("fadeout"); +}, 2500); + +setTimeout(function() { + window.location.replace("login.html"); +}, 3000); \ No newline at end of file