screeps-client 0.7.1 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/dist/embedded/_client/{CodePanel-DO2hyS2G.js → CodePanel-D9_QoSKt.js} +1 -1
  2. package/dist/{standalone/_client/MapViewer-BiHm7Kr7.js → embedded/_client/MapViewer-B9YQqu-y.js} +1 -1
  3. package/dist/embedded/_client/index-CiIFojZ8.js +19 -0
  4. package/dist/embedded/_client/{vendor-pixi-DseA5gVO.js → vendor-pixi-Df5Nob1b.js} +1 -1
  5. package/dist/embedded/index.html +2 -2
  6. package/dist/embedded/themes/default/test.json +154 -19
  7. package/dist/embedded/themes/default/test.png +0 -0
  8. package/dist/standalone/_client/{CodePanel-C8RTG3vJ.js → CodePanel-BVffzTP9.js} +1 -1
  9. package/dist/{embedded/_client/MapViewer-Dqw2wHym.js → standalone/_client/MapViewer-BZFlOYMm.js} +1 -1
  10. package/dist/standalone/_client/index-B34meIT0.js +19 -0
  11. package/dist/standalone/_client/{vendor-pixi-_F6CfCZH.js → vendor-pixi-NbxvK8iu.js} +1 -1
  12. package/dist/standalone/index.html +2 -2
  13. package/dist/standalone/themes/default/test.json +154 -19
  14. package/dist/standalone/themes/default/test.png +0 -0
  15. package/dist/xxscreeps-mod/_client/{CodePanel-BZu7VAIW.js → CodePanel-rvH6VDdF.js} +1 -1
  16. package/dist/xxscreeps-mod/_client/{MapViewer-CPabtKpI.js → MapViewer-DKem8ATA.js} +1 -1
  17. package/dist/xxscreeps-mod/_client/index-l6aLrGf1.js +19 -0
  18. package/dist/xxscreeps-mod/_client/{vendor-pixi-DoK_ycfH.js → vendor-pixi-DCKL8Yf2.js} +1 -1
  19. package/dist/xxscreeps-mod/index.html +2 -2
  20. package/dist/xxscreeps-mod/themes/default/test.json +154 -19
  21. package/dist/xxscreeps-mod/themes/default/test.png +0 -0
  22. package/package.json +1 -1
  23. package/dist/embedded/_client/index-JclKthA6.js +0 -19
  24. package/dist/standalone/_client/index-D734lRxH.js +0 -19
  25. package/dist/xxscreeps-mod/_client/index-BtJ1eq9i.js +0 -19
@@ -1271,4 +1271,4 @@ fn mainFragment(
1271
1271
  fn fragmentMain(@location(0) texCoord : vec2<f32>) -> @location(0) vec4<f32> {
1272
1272
  return textureSample(img, imgSampler, texCoord);
1273
1273
  }
1274
- `}),t=this.device.createRenderPipeline({layout:`auto`,vertex:{module:this.mipmapShaderModule,entryPoint:`vertexMain`},fragment:{module:this.mipmapShaderModule,entryPoint:`fragmentMain`,targets:[{format:e}]}}),this.pipelines[e]=t),t}generateMipmap(e){let t=this._getMipmapPipeline(e.format);if(e.dimension===`3d`||e.dimension===`1d`)throw Error(`Generating mipmaps for non-2d textures is currently unsupported!`);let n=e,r=e.depthOrArrayLayers||1,i=e.usage&GPUTextureUsage.RENDER_ATTACHMENT;if(!i){let t={size:{width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:r},format:e.format,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.RENDER_ATTACHMENT,mipLevelCount:e.mipLevelCount-1};n=this.device.createTexture(t)}let a=this.device.createCommandEncoder({}),o=t.getBindGroupLayout(0);for(let s=0;s<r;++s){let r=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:`2d`,baseArrayLayer:s,arrayLayerCount:1}),c=+!!i;for(let i=1;i<e.mipLevelCount;++i){let e=n.createView({baseMipLevel:c++,mipLevelCount:1,dimension:`2d`,baseArrayLayer:s,arrayLayerCount:1}),i=a.beginRenderPass({colorAttachments:[{view:e,storeOp:`store`,loadOp:`clear`,clearValue:{r:0,g:0,b:0,a:0}}]}),l=this.device.createBindGroup({layout:o,entries:[{binding:0,resource:this.sampler},{binding:1,resource:r}]});i.setPipeline(t),i.setBindGroup(0,l),i.draw(3,1,0,0),i.end(),r=e}}if(!i){let t={width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:r};for(let r=1;r<e.mipLevelCount;++r)a.copyTextureToTexture({texture:n,mipLevel:r-1},{texture:e,mipLevel:r},t),t.width=Math.ceil(t.width/2),t.height=Math.ceil(t.height/2)}return this.device.queue.submit([a.finish()]),i||n.destroy(),e}},qg=class{constructor(e){this.textureView=null,this.gpuTexture=e}destroy(){this.gpuTexture.destroy(),this.textureView=null,this.gpuTexture=null}},Jg=class{constructor(e){this._gpuSamplers=Object.create(null),this._bindGroupHash=Object.create(null),this._renderer=e,e.gc.addCollection(this,`_bindGroupHash`,`hash`),this._managedTextures=new hs({renderer:e,type:`resource`,onUnload:this.onSourceUnload.bind(this),name:`gpuTextureSource`});let t={image:Wg,buffer:Rg,video:Gg,compressed:Vg};this._uploads={...t,cube:Ug(t)}}get managedTextures(){return Object.values(this._managedTextures.items)}contextChange(e){this._gpu=e}initSource(e){return e._gpuData[this._renderer.uid]?.gpuTexture||this._initSource(e)}_initSource(e){if(e.autoGenerateMipmaps){let t=Math.max(e.pixelWidth,e.pixelHeight);e.mipLevelCount=Math.floor(Math.log2(t))+1}let t=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST;e.uploadMethodId!==`compressed`&&(t|=GPUTextureUsage.RENDER_ATTACHMENT,t|=GPUTextureUsage.COPY_SRC);let n=zg[e.format]||{blockBytes:4,blockWidth:1,blockHeight:1},r=Math.ceil(e.pixelWidth/n.blockWidth)*n.blockWidth,i=Math.ceil(e.pixelHeight/n.blockHeight)*n.blockHeight,a={label:e.label,size:{width:r,height:i,depthOrArrayLayers:e.arrayLayerCount},format:e.format,sampleCount:e.sampleCount,mipLevelCount:e.mipLevelCount,dimension:e.dimension,usage:t},o=this._gpu.device.createTexture(a);return e._gpuData[this._renderer.uid]=new qg(o),this._managedTextures.add(e)&&(e.on(`update`,this.onSourceUpdate,this),e.on(`resize`,this.onSourceResize,this),e.on(`updateMipmaps`,this.onUpdateMipmaps,this)),this.onSourceUpdate(e),o}onSourceUpdate(e){let t=this.getGpuSource(e);t&&(this._uploads[e.uploadMethodId]&&this._uploads[e.uploadMethodId].upload(e,t,this._gpu),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e))}onUpdateMipmaps(e){this._mipmapGenerator||=new Kg(this._gpu.device);let t=this.getGpuSource(e);this._mipmapGenerator.generateMipmap(t)}onSourceUnload(e){e.off(`update`,this.onSourceUpdate,this),e.off(`resize`,this.onSourceResize,this),e.off(`updateMipmaps`,this.onUpdateMipmaps,this)}onSourceResize(e){e._gcLastUsed=this._renderer.gc.now;let t=e._gpuData[this._renderer.uid],n=t?.gpuTexture;n?(n.width!==e.pixelWidth||n.height!==e.pixelHeight)&&(t.destroy(),this._bindGroupHash[e.uid]=null,e._gpuData[this._renderer.uid]=null,this.initSource(e)):this.initSource(e)}_initSampler(e){return this._gpuSamplers[e._resourceId]=this._gpu.device.createSampler(e),this._gpuSamplers[e._resourceId]}getGpuSampler(e){return this._gpuSamplers[e._resourceId]||this._initSampler(e)}getGpuSource(e){return e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.uid]?.gpuTexture||this.initSource(e)}getTextureBindGroup(e){return this._bindGroupHash[e.uid]||this._createTextureBindGroup(e)}_createTextureBindGroup(e){let t=e.source;return this._bindGroupHash[e.uid]=new Ur({0:t,1:t.style,2:new Hr({uTextureMatrix:{type:`mat3x3<f32>`,value:e.textureMatrix.mapCoord}})}),this._bindGroupHash[e.uid]}getTextureView(e){let t=e.source;t._gcLastUsed=this._renderer.gc.now;let n=t._gpuData[this._renderer.uid];return n||=(this.initSource(t),t._gpuData[this._renderer.uid]),n.textureView||=n.gpuTexture.createView({dimension:t.viewDimension}),n.textureView}generateCanvas(e){let t=this._renderer,n=t.gpu.device.createCommandEncoder(),r=G.get().createCanvas();r.width=e.source.pixelWidth,r.height=e.source.pixelHeight;let i=r.getContext(`webgpu`);return i.configure({device:t.gpu.device,usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC,format:G.get().getNavigator().gpu.getPreferredCanvasFormat(),alphaMode:`premultiplied`}),n.copyTextureToTexture({texture:t.texture.getGpuSource(e.source),origin:{x:0,y:0}},{texture:i.getCurrentTexture()},{width:r.width,height:r.height}),t.gpu.device.queue.submit([n.finish()]),r}getPixels(e){let t=this.generateCanvas(e),n=tu.getOptimalCanvasAndContext(t.width,t.height),r=n.context;r.drawImage(t,0,0);let{width:i,height:a}=t,o=r.getImageData(0,0,i,a),s=new Uint8ClampedArray(o.data.buffer);return tu.returnCanvasAndContext(n),{pixels:s,width:i,height:a}}destroy(){this._managedTextures.destroy();for(let e of Object.keys(this._bindGroupHash)){let t=Number(e);this._bindGroupHash[t]?.destroy()}this._renderer=null,this._gpu=null,this._mipmapGenerator=null,this._gpuSamplers=null,this._bindGroupHash=null}};Jg.extension={type:[s.WebGPUSystem],name:`texture`};var Yg=class{constructor(){this._maxTextures=0}contextChange(e){let t=new Hr({uTransformMatrix:{value:new b,type:`mat3x3<f32>`},uColor:{value:new Float32Array([1,1,1,1]),type:`vec4<f32>`},uRound:{value:0,type:`f32`}});this._maxTextures=e.limits.maxBatchableTextures;let n=Xo({name:`graphics`,bits:[Qo,rs(this._maxTextures),ed,ss]});this.shader=new Gr({gpuProgram:n,resources:{localUniforms:t}})}execute(e,t){let n=t.context,r=n.customShader||this.shader,i=e.renderer,{batcher:a,instructions:o}=i.graphicsContext.getContextRenderData(n),s=i.encoder;s.setGeometry(a.geometry,r.gpuProgram);let c=i.globalUniforms.bindGroup;s.setBindGroup(0,c,r.gpuProgram);let l=i.renderPipes.uniformBatch.getUniformBindGroup(r.resources.localUniforms,!0);s.setBindGroup(2,l,r.gpuProgram);let u=o.instructions,d=null;for(let t=0;t<o.instructionSize;t++){let n=u[t];if(n.topology!==d&&(d=n.topology,s.setPipelineFromGeometryProgramAndState(a.geometry,r.gpuProgram,e.state,n.topology)),r.groups[1]=n.bindGroup,!n.gpuBindGroup){let e=n.textures;n.bindGroup=Za(e.textures,e.count,this._maxTextures),n.gpuBindGroup=i.bindGroup.getBindGroup(n.bindGroup,r.gpuProgram,1)}s.setBindGroup(1,n.bindGroup,r.gpuProgram),s.renderPassEncoder.drawIndexed(n.size,1,n.start)}}destroy(){this.shader.destroy(!0),this.shader=null}};Yg.extension={type:[s.WebGPUPipesAdaptor],name:`graphics`};var Xg=class{init(){let e=Xo({name:`mesh`,bits:[$u,Rf,ss]});this._shader=new Gr({gpuProgram:e,resources:{uTexture:R.EMPTY._source,uSampler:R.EMPTY._source.style,textureUniforms:{uTextureMatrix:{type:`mat3x3<f32>`,value:new b}}}})}execute(e,t){let n=e.renderer,r=t._shader;if(!r)r=this._shader,r.groups[2]=n.texture.getTextureBindGroup(t.texture);else if(!r.gpuProgram){H(`Mesh shader has no gpuProgram`,t.shader);return}let i=r.gpuProgram;if(i.autoAssignGlobalUniforms&&(r.groups[0]=n.globalUniforms.bindGroup),i.autoAssignLocalUniforms){let t=e.localUniforms;r.groups[1]=n.renderPipes.uniformBatch.getUniformBindGroup(t,!0)}n.encoder.draw({geometry:t._geometry,shader:r,state:t.state})}destroy(){this._shader.destroy(!0),this._shader=null}};Xg.extension={type:[s.WebGPUPipesAdaptor],name:`mesh`};var Zg=e({WebGPURenderer:()=>i_}),Qg=[...im,Tg,vg,_g,yg,mg,Jg,Pg,Fg,Lg,jg,gg,bg,fg],$g=[...am,Dg],e_=[Ff,Xg,Yg],t_=[],n_=[],r_=[];u.handleByNamedList(s.WebGPUSystem,t_),u.handleByNamedList(s.WebGPUPipes,n_),u.handleByNamedList(s.WebGPUPipesAdaptor,r_),u.add(...Qg,...$g,...e_);var i_=class extends Wi{constructor(){let e={name:`webgpu`,type:Wr.WEBGPU,systems:t_,renderPipes:n_,renderPipeAdaptors:r_};super(e)}},a_=e({BitmapFont:()=>o_}),o_=class extends bf{constructor(e,t){super();let{textures:n,data:r}=e;Object.keys(r.pages).forEach(e=>{let t=n[r.pages[parseInt(e,10)].id];this.pages.push({texture:t})}),Object.keys(r.chars).forEach(e=>{let t=r.chars[e],{frame:i,source:a,rotate:o}=n[t.page],s=new R({frame:j.transformRectCoords(t,i,o,new M),orig:new M(0,0,t.width,t.height),source:a,rotate:o});this.chars[e]={id:e.codePointAt(0),xOffset:t.xOffset,yOffset:t.yOffset,xAdvance:t.xAdvance,kerning:t.kerning??{},texture:s}}),this.baseRenderedFontSize=r.fontSize,this.baseMeasurementFontSize=r.fontSize,this.fontMetrics={ascent:0,descent:0,fontSize:r.fontSize},this.baseLineOffset=r.baseLineOffset,this.lineHeight=r.lineHeight,this.fontFamily=r.fontFamily,this.distanceField=r.distanceField??{type:`none`,range:0},this.url=t}destroy(){super.destroy();for(let e=0;e<this.pages.length;e++){let{texture:t}=this.pages[e];t.destroy(!0)}this.pages=null}static install(e){kf.install(e)}static uninstall(e){kf.uninstall(e)}};u.add(d,f),u.add(ir),u.mixin(It,ar),u.add(Rl),u.add(Xl),u.mixin(It,Zl),u.add(ju,cu),u.add(Ou);var s_=e({}),c_=e({});export{wu as a,ra as c,R as d,M as f,Wu as i,Rt as l,o as m,uf as n,bu as o,v as p,hd as r,Il as s,yf as t,It as u};
1274
+ `}),t=this.device.createRenderPipeline({layout:`auto`,vertex:{module:this.mipmapShaderModule,entryPoint:`vertexMain`},fragment:{module:this.mipmapShaderModule,entryPoint:`fragmentMain`,targets:[{format:e}]}}),this.pipelines[e]=t),t}generateMipmap(e){let t=this._getMipmapPipeline(e.format);if(e.dimension===`3d`||e.dimension===`1d`)throw Error(`Generating mipmaps for non-2d textures is currently unsupported!`);let n=e,r=e.depthOrArrayLayers||1,i=e.usage&GPUTextureUsage.RENDER_ATTACHMENT;if(!i){let t={size:{width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:r},format:e.format,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.RENDER_ATTACHMENT,mipLevelCount:e.mipLevelCount-1};n=this.device.createTexture(t)}let a=this.device.createCommandEncoder({}),o=t.getBindGroupLayout(0);for(let s=0;s<r;++s){let r=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:`2d`,baseArrayLayer:s,arrayLayerCount:1}),c=+!!i;for(let i=1;i<e.mipLevelCount;++i){let e=n.createView({baseMipLevel:c++,mipLevelCount:1,dimension:`2d`,baseArrayLayer:s,arrayLayerCount:1}),i=a.beginRenderPass({colorAttachments:[{view:e,storeOp:`store`,loadOp:`clear`,clearValue:{r:0,g:0,b:0,a:0}}]}),l=this.device.createBindGroup({layout:o,entries:[{binding:0,resource:this.sampler},{binding:1,resource:r}]});i.setPipeline(t),i.setBindGroup(0,l),i.draw(3,1,0,0),i.end(),r=e}}if(!i){let t={width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:r};for(let r=1;r<e.mipLevelCount;++r)a.copyTextureToTexture({texture:n,mipLevel:r-1},{texture:e,mipLevel:r},t),t.width=Math.ceil(t.width/2),t.height=Math.ceil(t.height/2)}return this.device.queue.submit([a.finish()]),i||n.destroy(),e}},qg=class{constructor(e){this.textureView=null,this.gpuTexture=e}destroy(){this.gpuTexture.destroy(),this.textureView=null,this.gpuTexture=null}},Jg=class{constructor(e){this._gpuSamplers=Object.create(null),this._bindGroupHash=Object.create(null),this._renderer=e,e.gc.addCollection(this,`_bindGroupHash`,`hash`),this._managedTextures=new hs({renderer:e,type:`resource`,onUnload:this.onSourceUnload.bind(this),name:`gpuTextureSource`});let t={image:Wg,buffer:Rg,video:Gg,compressed:Vg};this._uploads={...t,cube:Ug(t)}}get managedTextures(){return Object.values(this._managedTextures.items)}contextChange(e){this._gpu=e}initSource(e){return e._gpuData[this._renderer.uid]?.gpuTexture||this._initSource(e)}_initSource(e){if(e.autoGenerateMipmaps){let t=Math.max(e.pixelWidth,e.pixelHeight);e.mipLevelCount=Math.floor(Math.log2(t))+1}let t=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST;e.uploadMethodId!==`compressed`&&(t|=GPUTextureUsage.RENDER_ATTACHMENT,t|=GPUTextureUsage.COPY_SRC);let n=zg[e.format]||{blockBytes:4,blockWidth:1,blockHeight:1},r=Math.ceil(e.pixelWidth/n.blockWidth)*n.blockWidth,i=Math.ceil(e.pixelHeight/n.blockHeight)*n.blockHeight,a={label:e.label,size:{width:r,height:i,depthOrArrayLayers:e.arrayLayerCount},format:e.format,sampleCount:e.sampleCount,mipLevelCount:e.mipLevelCount,dimension:e.dimension,usage:t},o=this._gpu.device.createTexture(a);return e._gpuData[this._renderer.uid]=new qg(o),this._managedTextures.add(e)&&(e.on(`update`,this.onSourceUpdate,this),e.on(`resize`,this.onSourceResize,this),e.on(`updateMipmaps`,this.onUpdateMipmaps,this)),this.onSourceUpdate(e),o}onSourceUpdate(e){let t=this.getGpuSource(e);t&&(this._uploads[e.uploadMethodId]&&this._uploads[e.uploadMethodId].upload(e,t,this._gpu),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e))}onUpdateMipmaps(e){this._mipmapGenerator||=new Kg(this._gpu.device);let t=this.getGpuSource(e);this._mipmapGenerator.generateMipmap(t)}onSourceUnload(e){e.off(`update`,this.onSourceUpdate,this),e.off(`resize`,this.onSourceResize,this),e.off(`updateMipmaps`,this.onUpdateMipmaps,this)}onSourceResize(e){e._gcLastUsed=this._renderer.gc.now;let t=e._gpuData[this._renderer.uid],n=t?.gpuTexture;n?(n.width!==e.pixelWidth||n.height!==e.pixelHeight)&&(t.destroy(),this._bindGroupHash[e.uid]=null,e._gpuData[this._renderer.uid]=null,this.initSource(e)):this.initSource(e)}_initSampler(e){return this._gpuSamplers[e._resourceId]=this._gpu.device.createSampler(e),this._gpuSamplers[e._resourceId]}getGpuSampler(e){return this._gpuSamplers[e._resourceId]||this._initSampler(e)}getGpuSource(e){return e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.uid]?.gpuTexture||this.initSource(e)}getTextureBindGroup(e){return this._bindGroupHash[e.uid]||this._createTextureBindGroup(e)}_createTextureBindGroup(e){let t=e.source;return this._bindGroupHash[e.uid]=new Ur({0:t,1:t.style,2:new Hr({uTextureMatrix:{type:`mat3x3<f32>`,value:e.textureMatrix.mapCoord}})}),this._bindGroupHash[e.uid]}getTextureView(e){let t=e.source;t._gcLastUsed=this._renderer.gc.now;let n=t._gpuData[this._renderer.uid];return n||=(this.initSource(t),t._gpuData[this._renderer.uid]),n.textureView||=n.gpuTexture.createView({dimension:t.viewDimension}),n.textureView}generateCanvas(e){let t=this._renderer,n=t.gpu.device.createCommandEncoder(),r=G.get().createCanvas();r.width=e.source.pixelWidth,r.height=e.source.pixelHeight;let i=r.getContext(`webgpu`);return i.configure({device:t.gpu.device,usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC,format:G.get().getNavigator().gpu.getPreferredCanvasFormat(),alphaMode:`premultiplied`}),n.copyTextureToTexture({texture:t.texture.getGpuSource(e.source),origin:{x:0,y:0}},{texture:i.getCurrentTexture()},{width:r.width,height:r.height}),t.gpu.device.queue.submit([n.finish()]),r}getPixels(e){let t=this.generateCanvas(e),n=tu.getOptimalCanvasAndContext(t.width,t.height),r=n.context;r.drawImage(t,0,0);let{width:i,height:a}=t,o=r.getImageData(0,0,i,a),s=new Uint8ClampedArray(o.data.buffer);return tu.returnCanvasAndContext(n),{pixels:s,width:i,height:a}}destroy(){this._managedTextures.destroy();for(let e of Object.keys(this._bindGroupHash)){let t=Number(e);this._bindGroupHash[t]?.destroy()}this._renderer=null,this._gpu=null,this._mipmapGenerator=null,this._gpuSamplers=null,this._bindGroupHash=null}};Jg.extension={type:[s.WebGPUSystem],name:`texture`};var Yg=class{constructor(){this._maxTextures=0}contextChange(e){let t=new Hr({uTransformMatrix:{value:new b,type:`mat3x3<f32>`},uColor:{value:new Float32Array([1,1,1,1]),type:`vec4<f32>`},uRound:{value:0,type:`f32`}});this._maxTextures=e.limits.maxBatchableTextures;let n=Xo({name:`graphics`,bits:[Qo,rs(this._maxTextures),ed,ss]});this.shader=new Gr({gpuProgram:n,resources:{localUniforms:t}})}execute(e,t){let n=t.context,r=n.customShader||this.shader,i=e.renderer,{batcher:a,instructions:o}=i.graphicsContext.getContextRenderData(n),s=i.encoder;s.setGeometry(a.geometry,r.gpuProgram);let c=i.globalUniforms.bindGroup;s.setBindGroup(0,c,r.gpuProgram);let l=i.renderPipes.uniformBatch.getUniformBindGroup(r.resources.localUniforms,!0);s.setBindGroup(2,l,r.gpuProgram);let u=o.instructions,d=null;for(let t=0;t<o.instructionSize;t++){let n=u[t];if(n.topology!==d&&(d=n.topology,s.setPipelineFromGeometryProgramAndState(a.geometry,r.gpuProgram,e.state,n.topology)),r.groups[1]=n.bindGroup,!n.gpuBindGroup){let e=n.textures;n.bindGroup=Za(e.textures,e.count,this._maxTextures),n.gpuBindGroup=i.bindGroup.getBindGroup(n.bindGroup,r.gpuProgram,1)}s.setBindGroup(1,n.bindGroup,r.gpuProgram),s.renderPassEncoder.drawIndexed(n.size,1,n.start)}}destroy(){this.shader.destroy(!0),this.shader=null}};Yg.extension={type:[s.WebGPUPipesAdaptor],name:`graphics`};var Xg=class{init(){let e=Xo({name:`mesh`,bits:[$u,Rf,ss]});this._shader=new Gr({gpuProgram:e,resources:{uTexture:R.EMPTY._source,uSampler:R.EMPTY._source.style,textureUniforms:{uTextureMatrix:{type:`mat3x3<f32>`,value:new b}}}})}execute(e,t){let n=e.renderer,r=t._shader;if(!r)r=this._shader,r.groups[2]=n.texture.getTextureBindGroup(t.texture);else if(!r.gpuProgram){H(`Mesh shader has no gpuProgram`,t.shader);return}let i=r.gpuProgram;if(i.autoAssignGlobalUniforms&&(r.groups[0]=n.globalUniforms.bindGroup),i.autoAssignLocalUniforms){let t=e.localUniforms;r.groups[1]=n.renderPipes.uniformBatch.getUniformBindGroup(t,!0)}n.encoder.draw({geometry:t._geometry,shader:r,state:t.state})}destroy(){this._shader.destroy(!0),this._shader=null}};Xg.extension={type:[s.WebGPUPipesAdaptor],name:`mesh`};var Zg=e({WebGPURenderer:()=>i_}),Qg=[...im,Tg,vg,_g,yg,mg,Jg,Pg,Fg,Lg,jg,gg,bg,fg],$g=[...am,Dg],e_=[Ff,Xg,Yg],t_=[],n_=[],r_=[];u.handleByNamedList(s.WebGPUSystem,t_),u.handleByNamedList(s.WebGPUPipes,n_),u.handleByNamedList(s.WebGPUPipesAdaptor,r_),u.add(...Qg,...$g,...e_);var i_=class extends Wi{constructor(){let e={name:`webgpu`,type:Wr.WEBGPU,systems:t_,renderPipes:n_,renderPipeAdaptors:r_};super(e)}},a_=e({BitmapFont:()=>o_}),o_=class extends bf{constructor(e,t){super();let{textures:n,data:r}=e;Object.keys(r.pages).forEach(e=>{let t=n[r.pages[parseInt(e,10)].id];this.pages.push({texture:t})}),Object.keys(r.chars).forEach(e=>{let t=r.chars[e],{frame:i,source:a,rotate:o}=n[t.page],s=new R({frame:j.transformRectCoords(t,i,o,new M),orig:new M(0,0,t.width,t.height),source:a,rotate:o});this.chars[e]={id:e.codePointAt(0),xOffset:t.xOffset,yOffset:t.yOffset,xAdvance:t.xAdvance,kerning:t.kerning??{},texture:s}}),this.baseRenderedFontSize=r.fontSize,this.baseMeasurementFontSize=r.fontSize,this.fontMetrics={ascent:0,descent:0,fontSize:r.fontSize},this.baseLineOffset=r.baseLineOffset,this.lineHeight=r.lineHeight,this.fontFamily=r.fontFamily,this.distanceField=r.distanceField??{type:`none`,range:0},this.url=t}destroy(){super.destroy();for(let e=0;e<this.pages.length;e++){let{texture:t}=this.pages[e];t.destroy(!0)}this.pages=null}static install(e){kf.install(e)}static uninstall(e){kf.uninstall(e)}};u.add(d,f),u.add(ir),u.mixin(It,ar),u.add(Rl),u.add(Xl),u.mixin(It,Zl),u.add(ju,cu),u.add(Ou);var s_=e({}),c_=e({});export{Wu as a,Il as c,It as d,R as f,o as h,hd as i,ra as l,v as m,yf as n,wu as o,M as p,uf as r,bu as s,Pp as t,Rt as u};
@@ -26,9 +26,9 @@
26
26
  to { opacity: 1; transform: translate(-50%, -50%); }
27
27
  }
28
28
  </style>
29
- <script type="module" crossorigin src="./_client/index-BtJ1eq9i.js"></script>
29
+ <script type="module" crossorigin src="./_client/index-l6aLrGf1.js"></script>
30
30
  <link rel="modulepreload" crossorigin href="./_client/rolldown-runtime-QTnfLwEv.js">
31
- <link rel="modulepreload" crossorigin href="./_client/vendor-pixi-DoK_ycfH.js">
31
+ <link rel="modulepreload" crossorigin href="./_client/vendor-pixi-DCKL8Yf2.js">
32
32
  <link rel="modulepreload" crossorigin href="./_client/vendor-codemirror-B_kaIH0M.js">
33
33
  <link rel="modulepreload" crossorigin href="./_client/decompress-DIM550rx.js">
34
34
  </head>
@@ -2,35 +2,107 @@
2
2
 
3
3
  "controller/background":
4
4
  {
5
- "frame": {"x":1,"y":1,"w":300,"h":300},
5
+ "frame": {"x":1,"y":1,"w":180,"h":180},
6
6
  "rotated": false,
7
7
  "trimmed": false,
8
- "spriteSourceSize": {"x":0,"y":0,"w":300,"h":300},
9
- "sourceSize": {"w":300,"h":300},
8
+ "spriteSourceSize": {"x":0,"y":0,"w":180,"h":180},
9
+ "sourceSize": {"w":180,"h":180},
10
10
  "anchor": {"x":0.5,"y":0.5}
11
11
  },
12
12
  "controller/segment":
13
13
  {
14
- "frame": {"x":303,"y":1,"w":158,"h":74},
14
+ "frame": {"x":408,"y":284,"w":158,"h":74},
15
15
  "rotated": true,
16
16
  "trimmed": true,
17
17
  "spriteSourceSize": {"x":221,"y":86,"w":158,"h":74},
18
18
  "sourceSize": {"w":600,"h":600},
19
19
  "anchor": {"x":0.5,"y":0.5}
20
20
  },
21
- "flag/main":
21
+ "deposit/biomass/fill":
22
+ {
23
+ "frame": {"x":331,"y":612,"w":62,"h":57},
24
+ "rotated": false,
25
+ "trimmed": true,
26
+ "spriteSourceSize": {"x":1,"y":5,"w":62,"h":57},
27
+ "sourceSize": {"w":64,"h":64},
28
+ "anchor": {"x":0.5,"y":0.5}
29
+ },
30
+ "deposit/biomass/shape":
31
+ {
32
+ "frame": {"x":139,"y":394,"w":128,"h":128},
33
+ "rotated": false,
34
+ "trimmed": false,
35
+ "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128},
36
+ "sourceSize": {"w":128,"h":128},
37
+ "anchor": {"x":0.5,"y":0.5}
38
+ },
39
+ "deposit/metal/fill":
22
40
  {
23
- "frame": {"x":303,"y":161,"w":73,"h":68},
41
+ "frame": {"x":395,"y":607,"w":54,"h":60},
24
42
  "rotated": false,
25
43
  "trimmed": true,
44
+ "spriteSourceSize": {"x":4,"y":3,"w":54,"h":60},
45
+ "sourceSize": {"w":64,"h":64},
46
+ "anchor": {"x":0.5,"y":0.5}
47
+ },
48
+ "deposit/metal/shape":
49
+ {
50
+ "frame": {"x":1,"y":437,"w":128,"h":128},
51
+ "rotated": false,
52
+ "trimmed": false,
53
+ "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128},
54
+ "sourceSize": {"w":128,"h":128},
55
+ "anchor": {"x":0.5,"y":0.5}
56
+ },
57
+ "deposit/mist/fill":
58
+ {
59
+ "frame": {"x":261,"y":615,"w":64,"h":55},
60
+ "rotated": false,
61
+ "trimmed": true,
62
+ "spriteSourceSize": {"x":0,"y":0,"w":64,"h":55},
63
+ "sourceSize": {"w":64,"h":64},
64
+ "anchor": {"x":0.5,"y":0.5}
65
+ },
66
+ "deposit/mist/shape":
67
+ {
68
+ "frame": {"x":269,"y":410,"w":128,"h":128},
69
+ "rotated": false,
70
+ "trimmed": false,
71
+ "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128},
72
+ "sourceSize": {"w":128,"h":128},
73
+ "anchor": {"x":0.5,"y":0.5}
74
+ },
75
+ "deposit/silicon/fill":
76
+ {
77
+ "frame": {"x":1,"y":567,"w":94,"h":94},
78
+ "rotated": false,
79
+ "trimmed": true,
80
+ "spriteSourceSize": {"x":17,"y":17,"w":94,"h":94},
81
+ "sourceSize": {"w":128,"h":128},
82
+ "anchor": {"x":0.5,"y":0.5}
83
+ },
84
+ "deposit/silicon/shape":
85
+ {
86
+ "frame": {"x":131,"y":524,"w":128,"h":128},
87
+ "rotated": false,
88
+ "trimmed": false,
89
+ "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128},
90
+ "sourceSize": {"w":128,"h":128},
91
+ "anchor": {"x":0.5,"y":0.5}
92
+ },
93
+ "flag/main":
94
+ {
95
+ "frame": {"x":261,"y":540,"w":73,"h":68},
96
+ "rotated": true,
97
+ "trimmed": true,
26
98
  "spriteSourceSize": {"x":78,"y":36,"w":73,"h":68},
27
99
  "sourceSize": {"w":200,"h":200},
28
100
  "anchor": {"x":0.5,"y":0.5}
29
101
  },
30
102
  "flag/second":
31
103
  {
32
- "frame": {"x":365,"y":231,"w":34,"h":28},
33
- "rotated": true,
104
+ "frame": {"x":139,"y":183,"w":34,"h":28},
105
+ "rotated": false,
34
106
  "trimmed": true,
35
107
  "spriteSourceSize": {"x":114,"y":48,"w":34,"h":28},
36
108
  "sourceSize": {"w":200,"h":200},
@@ -38,7 +110,7 @@
38
110
  },
39
111
  "grave/cross":
40
112
  {
41
- "frame": {"x":335,"y":303,"w":59,"h":58},
113
+ "frame": {"x":393,"y":546,"w":59,"h":58},
42
114
  "rotated": true,
43
115
  "trimmed": true,
44
116
  "spriteSourceSize": {"x":72,"y":76,"w":59,"h":58},
@@ -47,16 +119,79 @@
47
119
  },
48
120
  "grave/shell":
49
121
  {
50
- "frame": {"x":203,"y":303,"w":130,"h":153},
51
- "rotated": false,
122
+ "frame": {"x":183,"y":1,"w":130,"h":153},
123
+ "rotated": true,
52
124
  "trimmed": true,
53
125
  "spriteSourceSize": {"x":36,"y":22,"w":130,"h":153},
54
126
  "sourceSize": {"w":200,"h":200},
55
127
  "anchor": {"x":0.5,"y":0.5}
56
128
  },
129
+ "mineral/H":
130
+ {
131
+ "frame": {"x":328,"y":160,"w":143,"h":122},
132
+ "rotated": false,
133
+ "trimmed": true,
134
+ "spriteSourceSize": {"x":33,"y":42,"w":143,"h":122},
135
+ "sourceSize": {"w":192,"h":192},
136
+ "anchor": {"x":0.5,"y":0.5}
137
+ },
138
+ "mineral/K":
139
+ {
140
+ "frame": {"x":338,"y":1,"w":157,"h":124},
141
+ "rotated": true,
142
+ "trimmed": true,
143
+ "spriteSourceSize": {"x":7,"y":37,"w":157,"h":124},
144
+ "sourceSize": {"w":192,"h":192},
145
+ "anchor": {"x":0.5,"y":0.5}
146
+ },
147
+ "mineral/L":
148
+ {
149
+ "frame": {"x":139,"y":264,"w":132,"h":128},
150
+ "rotated": false,
151
+ "trimmed": true,
152
+ "spriteSourceSize": {"x":24,"y":37,"w":132,"h":128},
153
+ "sourceSize": {"w":192,"h":192},
154
+ "anchor": {"x":0.5,"y":0.5}
155
+ },
156
+ "mineral/O":
157
+ {
158
+ "frame": {"x":273,"y":284,"w":133,"h":124},
159
+ "rotated": false,
160
+ "trimmed": true,
161
+ "spriteSourceSize": {"x":32,"y":43,"w":133,"h":124},
162
+ "sourceSize": {"w":192,"h":192},
163
+ "anchor": {"x":0.5,"y":0.5}
164
+ },
165
+ "mineral/U":
166
+ {
167
+ "frame": {"x":183,"y":133,"w":143,"h":129},
168
+ "rotated": false,
169
+ "trimmed": true,
170
+ "spriteSourceSize": {"x":19,"y":39,"w":143,"h":129},
171
+ "sourceSize": {"w":192,"h":192},
172
+ "anchor": {"x":0.5,"y":0.5}
173
+ },
174
+ "mineral/X":
175
+ {
176
+ "frame": {"x":1,"y":313,"w":136,"h":122},
177
+ "rotated": false,
178
+ "trimmed": true,
179
+ "spriteSourceSize": {"x":25,"y":39,"w":136,"h":122},
180
+ "sourceSize": {"w":192,"h":192},
181
+ "anchor": {"x":0.5,"y":0.5}
182
+ },
183
+ "mineral/Z":
184
+ {
185
+ "frame": {"x":1,"y":183,"w":136,"h":128},
186
+ "rotated": false,
187
+ "trimmed": true,
188
+ "spriteSourceSize": {"x":28,"y":34,"w":136,"h":128},
189
+ "sourceSize": {"w":192,"h":192},
190
+ "anchor": {"x":0.5,"y":0.5}
191
+ },
57
192
  "storage/fill":
58
193
  {
59
- "frame": {"x":303,"y":231,"w":60,"h":70},
194
+ "frame": {"x":331,"y":540,"w":60,"h":70},
60
195
  "rotated": false,
61
196
  "trimmed": true,
62
197
  "spriteSourceSize": {"x":20,"y":15,"w":60,"h":70},
@@ -65,20 +200,20 @@
65
200
  },
66
201
  "storage/shell":
67
202
  {
68
- "frame": {"x":1,"y":303,"w":166,"h":200},
69
- "rotated": true,
203
+ "frame": {"x":399,"y":444,"w":84,"h":100},
204
+ "rotated": false,
70
205
  "trimmed": true,
71
- "spriteSourceSize": {"x":17,"y":0,"w":166,"h":200},
72
- "sourceSize": {"w":200,"h":200},
206
+ "spriteSourceSize": {"x":8,"y":0,"w":84,"h":100},
207
+ "sourceSize": {"w":100,"h":100},
73
208
  "anchor": {"x":0.5,"y":0.5}
74
209
  }},
75
210
  "meta": {
76
211
  "app": "https://www.codeandweb.com/texturepacker",
77
212
  "version": "1.1",
78
- "image": "test.png?v=13f37bdc55de",
213
+ "image": "test.png?v=46dcd48d738a",
79
214
  "format": "RGBA8888",
80
- "size": {"w":394,"h":470},
215
+ "size": {"w":484,"h":671},
81
216
  "scale": "1",
82
- "smartupdate": "$TexturePacker:SmartUpdate:2dddd7a1f745873582470928e5cee344:3c4c3a8033ac9b6e844817234caeb825:02ab132358d6d8b512e80119463a8329$"
217
+ "smartupdate": "$TexturePacker:SmartUpdate:9fed4eb6cc4f2f9926dd68070e0cafcb:0bd497ed383f23f5b5a1e19577a2e079:02ab132358d6d8b512e80119463a8329$"
83
218
  }
84
219
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screeps-client",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "repository": {