add cloudflare deploy

This commit is contained in:
Brian Beck 2026-04-08 23:48:42 -07:00
parent e7315c043a
commit 5676aaf378
31 changed files with 82 additions and 41 deletions

39
.github/workflows/deploy-cloudflare.yml vendored Normal file
View file

@ -0,0 +1,39 @@
name: Deploy to Cloudflare Pages
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run build
env:
RELAY_URL: ${{ secrets.RELAY_URL }}
LOG_LEVEL: ${{ secrets.LOG_LEVEL }}
- uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages project create t2-mapper --production-branch=main
continue-on-error: true
- uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy docs --project-name=t2-mapper

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
import{s as e}from"./SettingsProvider-BdqQ2Cm4.js";import{a as t,c as n,i as r,l as i,n as a,o,r as s,s as c,t as l}from"./AudioEmitter-CJMuEzA2.js";export{l as AudioEmitter,a as audioBufferCache,s as getCachedAudioBuffer,e as getEffectiveSoundRate,r as getSoundGeneration,t as playOneShotSound,o as resolveAudioProfile,c as stopAllTrackedSounds,n as trackSound,i as untrackSound};
import{s as e}from"./SettingsProvider-BdqQ2Cm4.js";import{a as t,c as n,i as r,l as i,n as a,o,r as s,s as c,t as l}from"./AudioEmitter-3VHhCc7Y.js";export{l as AudioEmitter,a as audioBufferCache,s as getCachedAudioBuffer,e as getEffectiveSoundRate,r as getSoundGeneration,t as playOneShotSound,o as resolveAudioProfile,c as stopAllTrackedSounds,n as trackSound,i as untrackSound};

View file

@ -1 +1 @@
import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{k as i}from"./index-BnXbiEzA.js";var a=e(n(),1),o=t(),s={InputForm:`_InputForm_18kom_1`,Input:`_Input_18kom_1`},c=r();function l(){let e=(0,o.c)(8),[t,n]=(0,a.useState)(``),r;e[0]===t?r=e[1]:(r=e=>{e.preventDefault();let r=t.trim();r&&(i.getState().sendCommand(`messageSent`,r),n(``))},e[0]=t,e[1]=r);let l=r,f;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>n(e.target.value),e[2]=f):f=e[2];let p;e[3]===t?p=e[4]:(p=(0,c.jsx)(`input`,{className:s.Input,type:`text`,placeholder:`Say something…`,value:t,onChange:f,onKeyDown:d,onKeyUp:u,maxLength:255}),e[3]=t,e[4]=p);let m;return e[5]!==l||e[6]!==p?(m=(0,c.jsx)(`form`,{className:s.InputForm,onSubmit:l,children:p}),e[5]=l,e[6]=p,e[7]=m):m=e[7],m}function u(e){return e.stopPropagation()}function d(e){return e.stopPropagation()}export{l as ChatInput};
import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{k as i}from"./index-BZ0wFa-D.js";var a=e(n(),1),o=t(),s={InputForm:`_InputForm_18kom_1`,Input:`_Input_18kom_1`},c=r();function l(){let e=(0,o.c)(8),[t,n]=(0,a.useState)(``),r;e[0]===t?r=e[1]:(r=e=>{e.preventDefault();let r=t.trim();r&&(i.getState().sendCommand(`messageSent`,r),n(``))},e[0]=t,e[1]=r);let l=r,f;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>n(e.target.value),e[2]=f):f=e[2];let p;e[3]===t?p=e[4]:(p=(0,c.jsx)(`input`,{className:s.Input,type:`text`,placeholder:`Say something…`,value:t,onChange:f,onKeyDown:d,onKeyUp:u,maxLength:255}),e[3]=t,e[4]=p);let m;return e[5]!==l||e[6]!==p?(m=(0,c.jsx)(`form`,{className:s.InputForm,onSubmit:l,children:p}),e[5]=l,e[6]=p,e[7]=m):m=e[7],m}function u(e){return e.stopPropagation()}function d(e){return e.stopPropagation()}export{l as ChatInput};

View file

@ -1 +1 @@
import{r as e}from"./chunk-DECur_0Z.js";import{r as t}from"./jsx-runtime-BpGWiA-R.js";import{a as n,s as r}from"./SettingsProvider-BdqQ2Cm4.js";import{c as i}from"./three.module-DKAirPAO.js";import{r as a}from"./loaders-B4T775qz.js";import{i as o}from"./engineStore-B1KAgiiF.js";import{c as s,d as c,i as l,l as u,r as d}from"./AudioEmitter-CJMuEzA2.js";var f=e(t(),1);function p(){let{audioLoader:e,audioListener:t}=c(),{audioEnabled:p}=n(),m=o(e=>e.playback.streamSnapshot?.chatMessages),h=o(e=>e.playback.streamSnapshot?.timeSec),g=(0,f.useRef)(new WeakSet),_=(0,f.useRef)(new Map);return(0,f.useEffect)(()=>{if(!p||!e||!t||!m?.length||h==null)return;let n=g.current,o=_.current;for(let c of m)if(!n.has(c)&&(n.add(c),c.soundPath&&!(Math.abs(h-c.timeSec)>2)))try{let n=a(c.soundPath),f=c.soundPitch??1,p=c.sender,m=l();d(n,e,e=>{if(m!==l())return;if(p){let e=o.get(p);if(e){try{e.stop()}catch{}u(e);try{e.disconnect()}catch{}o.delete(p)}}let n=new i(t);n.setBuffer(e),n.setPlaybackRate(r(f)),s(n,f),p&&o.set(p,n),n.play(),n.source.onended=()=>{u(n);try{n.disconnect()}catch{}p&&o.get(p)===n&&o.delete(p)}})}catch{}},[p,e,t,m,h]),null}export{p as ChatSoundPlayer};
import{r as e}from"./chunk-DECur_0Z.js";import{r as t}from"./jsx-runtime-BpGWiA-R.js";import{a as n,s as r}from"./SettingsProvider-BdqQ2Cm4.js";import{c as i}from"./three.module-DKAirPAO.js";import{r as a}from"./loaders-5n1D4iOD.js";import{i as o}from"./engineStore-B1KAgiiF.js";import{c as s,d as c,i as l,l as u,r as d}from"./AudioEmitter-3VHhCc7Y.js";var f=e(t(),1);function p(){let{audioLoader:e,audioListener:t}=c(),{audioEnabled:p}=n(),m=o(e=>e.playback.streamSnapshot?.chatMessages),h=o(e=>e.playback.streamSnapshot?.timeSec),g=(0,f.useRef)(new WeakSet),_=(0,f.useRef)(new Map);return(0,f.useEffect)(()=>{if(!p||!e||!t||!m?.length||h==null)return;let n=g.current,o=_.current;for(let c of m)if(!n.has(c)&&(n.add(c),c.soundPath&&!(Math.abs(h-c.timeSec)>2)))try{let n=a(c.soundPath),f=c.soundPitch??1,p=c.sender,m=l();d(n,e,e=>{if(m!==l())return;if(p){let e=o.get(p);if(e){try{e.stop()}catch{}u(e);try{e.disconnect()}catch{}o.delete(p)}}let n=new i(t);n.setBuffer(e),n.setPlaybackRate(r(f)),s(n,f),p&&o.set(p,n),n.play(),n.source.onended=()=>{u(n);try{n.disconnect()}catch{}p&&o.get(p)===n&&o.delete(p)}})}catch{}},[p,e,t,m,h]),null}export{p as ChatSoundPlayer};

View file

@ -1 +1 @@
import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{C as i,D as a,E as o,O as s,S as c,T as l,u,w as d}from"./index-BnXbiEzA.js";import{n as f,t as p}from"./gr-DFj_ScyC.js";var m=e(n(),1),h=t(),g={Root:`_Root_flggk_1`,PlayPause:`_PlayPause_flggk_16 _Button_p0g82_2`,Time:`_Time_flggk_36`,Seek:`_Seek_flggk_54`,Speed:`_Speed_flggk_61`,CameraMode:`_CameraMode_flggk_62`,Field:`_Field_flggk_80`},_=r();function v(e){let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%60);return t>0?`${t}:${n.toString().padStart(2,`0`)}:${r.toString().padStart(2,`0`)}`:`${n}:${r.toString().padStart(2,`0`)}`}function y(){let e=(0,h.c)(42),t=a(),n=l(),r=i(),y=d(),x=s(),{play:S,pause:C,seek:w,setSpeed:T}=o(),E,D;e[0]!==n||e[1]!==C||e[2]!==S||e[3]!==t?(E=()=>{if(!t)return;let e=e=>{if(e.code!==`Space`)return;let t=e.target;t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.tagName===`SELECT`||t.tagName===`BUTTON`||t.isContentEditable||(e.preventDefault(),n?C():S())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},D=[t,n,S,C],e[0]=n,e[1]=C,e[2]=S,e[3]=t,e[4]=E,e[5]=D):(E=e[4],D=e[5]),(0,m.useEffect)(E,D);let O;e[6]!==T||e[7]!==x?(O=()=>{let e=c.indexOf(x);e>0&&T(c[e-1])},e[6]=T,e[7]=x,e[8]=O):O=e[8],u(`decreasePlaybackSpeed`,O);let k;e[9]!==T||e[10]!==x?(k=()=>{let e=c.indexOf(x);e<c.length-1&&T(c[e+1])},e[9]=T,e[10]=x,e[11]=k):k=e[11],u(`increasePlaybackSpeed`,k);let A;e[12]===w?A=e[13]:(A=e=>{w(parseFloat(e.target.value))},e[12]=w,e[13]=A);let j=A,M;e[14]===T?M=e[15]:(M=e=>{T(parseFloat(e.target.value))},e[14]=T,e[15]=M);let N=M;if(!t||!Number.isFinite(t.duration))return null;let P=n?C:S,F=n?`Pause`:`Play`,I;e[16]===n?I=e[17]:(I=n?(0,_.jsx)(p,{}):(0,_.jsx)(f,{}),e[16]=n,e[17]=I);let L;e[18]!==P||e[19]!==F||e[20]!==I?(L=(0,_.jsx)(`button`,{className:g.PlayPause,onClick:P,"aria-label":F,autoFocus:!0,children:I}),e[18]=P,e[19]=F,e[20]=I,e[21]=L):L=e[21];let R;e[22]===r?R=e[23]:(R=v(r),e[22]=r,e[23]=R);let z;e[24]===y?z=e[25]:(z=v(y),e[24]=y,e[25]=z);let B=`${R} / ${z}`,V;e[26]===B?V=e[27]:(V=(0,_.jsx)(`span`,{className:g.Time,children:B}),e[26]=B,e[27]=V);let H;e[28]!==r||e[29]!==y||e[30]!==j?(H=(0,_.jsx)(`input`,{className:g.Seek,type:`range`,min:0,max:y,step:.01,value:r,onChange:j}),e[28]=r,e[29]=y,e[30]=j,e[31]=H):H=e[31];let U;e[32]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,_.jsx)(`label`,{htmlFor:`playbackSpeed`,children:`Speed`}),e[32]=U):U=e[32];let W;e[33]===Symbol.for(`react.memo_cache_sentinel`)?(W=c.map(b),e[33]=W):W=e[33];let G;e[34]!==N||e[35]!==x?(G=(0,_.jsxs)(`div`,{className:g.Field,children:[U,(0,_.jsx)(`select`,{id:`playbackSpeed`,className:g.Speed,value:x,onChange:N,children:W})]}),e[34]=N,e[35]=x,e[36]=G):G=e[36];let K;return e[37]!==V||e[38]!==H||e[39]!==G||e[40]!==L?(K=(0,_.jsxs)(`div`,{className:g.Root,children:[L,V,H,G]}),e[37]=V,e[38]=H,e[39]=G,e[40]=L,e[41]=K):K=e[41],K}function b(e){return(0,_.jsxs)(`option`,{value:e,children:[e,`×`]},e)}export{y as DemoPlaybackControls};
import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{C as i,D as a,E as o,O as s,S as c,T as l,u,w as d}from"./index-BZ0wFa-D.js";import{n as f,t as p}from"./gr-DFj_ScyC.js";var m=e(n(),1),h=t(),g={Root:`_Root_flggk_1`,PlayPause:`_PlayPause_flggk_16 _Button_p0g82_2`,Time:`_Time_flggk_36`,Seek:`_Seek_flggk_54`,Speed:`_Speed_flggk_61`,CameraMode:`_CameraMode_flggk_62`,Field:`_Field_flggk_80`},_=r();function v(e){let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%60);return t>0?`${t}:${n.toString().padStart(2,`0`)}:${r.toString().padStart(2,`0`)}`:`${n}:${r.toString().padStart(2,`0`)}`}function y(){let e=(0,h.c)(42),t=a(),n=l(),r=i(),y=d(),x=s(),{play:S,pause:C,seek:w,setSpeed:T}=o(),E,D;e[0]!==n||e[1]!==C||e[2]!==S||e[3]!==t?(E=()=>{if(!t)return;let e=e=>{if(e.code!==`Space`)return;let t=e.target;t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.tagName===`SELECT`||t.tagName===`BUTTON`||t.isContentEditable||(e.preventDefault(),n?C():S())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},D=[t,n,S,C],e[0]=n,e[1]=C,e[2]=S,e[3]=t,e[4]=E,e[5]=D):(E=e[4],D=e[5]),(0,m.useEffect)(E,D);let O;e[6]!==T||e[7]!==x?(O=()=>{let e=c.indexOf(x);e>0&&T(c[e-1])},e[6]=T,e[7]=x,e[8]=O):O=e[8],u(`decreasePlaybackSpeed`,O);let k;e[9]!==T||e[10]!==x?(k=()=>{let e=c.indexOf(x);e<c.length-1&&T(c[e+1])},e[9]=T,e[10]=x,e[11]=k):k=e[11],u(`increasePlaybackSpeed`,k);let A;e[12]===w?A=e[13]:(A=e=>{w(parseFloat(e.target.value))},e[12]=w,e[13]=A);let j=A,M;e[14]===T?M=e[15]:(M=e=>{T(parseFloat(e.target.value))},e[14]=T,e[15]=M);let N=M;if(!t||!Number.isFinite(t.duration))return null;let P=n?C:S,F=n?`Pause`:`Play`,I;e[16]===n?I=e[17]:(I=n?(0,_.jsx)(p,{}):(0,_.jsx)(f,{}),e[16]=n,e[17]=I);let L;e[18]!==P||e[19]!==F||e[20]!==I?(L=(0,_.jsx)(`button`,{className:g.PlayPause,onClick:P,"aria-label":F,autoFocus:!0,children:I}),e[18]=P,e[19]=F,e[20]=I,e[21]=L):L=e[21];let R;e[22]===r?R=e[23]:(R=v(r),e[22]=r,e[23]=R);let z;e[24]===y?z=e[25]:(z=v(y),e[24]=y,e[25]=z);let B=`${R} / ${z}`,V;e[26]===B?V=e[27]:(V=(0,_.jsx)(`span`,{className:g.Time,children:B}),e[26]=B,e[27]=V);let H;e[28]!==r||e[29]!==y||e[30]!==j?(H=(0,_.jsx)(`input`,{className:g.Seek,type:`range`,min:0,max:y,step:.01,value:r,onChange:j}),e[28]=r,e[29]=y,e[30]=j,e[31]=H):H=e[31];let U;e[32]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,_.jsx)(`label`,{htmlFor:`playbackSpeed`,children:`Speed`}),e[32]=U):U=e[32];let W;e[33]===Symbol.for(`react.memo_cache_sentinel`)?(W=c.map(b),e[33]=W):W=e[33];let G;e[34]!==N||e[35]!==x?(G=(0,_.jsxs)(`div`,{className:g.Field,children:[U,(0,_.jsx)(`select`,{id:`playbackSpeed`,className:g.Speed,value:x,onChange:N,children:W})]}),e[34]=N,e[35]=x,e[36]=G):G=e[36];let K;return e[37]!==V||e[38]!==H||e[39]!==G||e[40]!==L?(K=(0,_.jsxs)(`div`,{className:g.Root,children:[L,V,H,G]}),e[37]=V,e[38]=H,e[39]=G,e[40]=L,e[41]=K):K=e[41],K}function b(e){return(0,_.jsxs)(`option`,{value:e,children:[e,`×`]},e)}export{y as DemoPlaybackControls};

View file

@ -1 +1 @@
import{r as e}from"./chunk-DECur_0Z.js";import{r as t,t as n}from"./jsx-runtime-BpGWiA-R.js";import{a as r}from"./react-three-fiber.esm-El6vNTZj.js";import{$ as i,o as a}from"./three.module-DKAirPAO.js";import{c as o,f as s}from"./PlayerModel-D8NLwrT8.js";import{_ as c,a as l,g as u,h as d,l as f}from"./playbackUtils-DjmjN4tv.js";import{n as p,r as m}from"./engineStore-B1KAgiiF.js";import{t as h}from"./useAnisotropy-D9othEmk.js";import{n as g}from"./streamPlaybackStore-D5ldcfU5.js";var _=e(t(),1),v=n();function y(e){let t=e.sizes,n=e.times;if(!Array.isArray(t)||t.length===0)return{times:[0,1],sizes:[[1,1,1],[1,1,1]]};let r=t.map(e=>[e.x/100,e.y/100,e.z/100]);return{times:Array.isArray(n)?n:r.map((e,t)=>t/Math.max(r.length-1,1)),sizes:r}}function b(e,t){let{times:n,sizes:r}=e;if(n.length===0)return[1,1,1];if(t<=n[0])return r[0];if(t>=n[n.length-1])return r[r.length-1];for(let e=0;e<n.length-1;e++)if(t>=n[e]&&t<=n[e+1]){let i=(t-n[e])/(n[e+1]-n[e]);return[r[e][0]+(r[e+1][0]-r[e][0])*i,r[e][1]+(r[e+1][1]-r[e][1])*i,r[e][2]+(r[e+1][2]-r[e][2])*i]}return r[r.length-1]}function x({entity:e}){let t=g.getState().playback,n=o(e.shapeName),x=h(),S=(0,_.useRef)(null),C=(0,_.useRef)(p()),w=(0,_.useRef)(Math.random()*Math.PI*2),T=(0,_.useRef)([]),E=(0,_.useMemo)(()=>{if(e.explosionDataBlockId)return t.getDataBlockData(e.explosionDataBlockId)},[e.explosionDataBlockId,t]),D=(0,_.useMemo)(()=>E?y(E):void 0,[E]),O=(0,_.useMemo)(()=>{let e=E?.explosionScale;return e?[e.x/100,e.y/100,e.z/100]:[1,1,1]},[E]),k=(E?.lifetimeMS??31)*32,A=e.faceViewer!==!1,{scene:j,mixer:M,visNodes:N,iflInfos:P,materials:F}=(0,_.useMemo)(()=>{let t=s(n.scene),r=[];t.traverse(e=>{if(!e.isMesh||!e.material)return;let t=Array.isArray(e.material)?e.material[0]:e.material;if(!t?.userData)return;let n=new Set(t.userData.flag_names??[]),i=t.userData.resource_path;if(n.has(`IflMaterial`)&&i){let t=e.userData;r.push({mesh:e,iflPath:`textures/${i}.ifl`,sequenceName:t?.ifl_sequence?String(t.ifl_sequence).toLowerCase():void 0,duration:t?.ifl_duration?Number(t.ifl_duration):void 0,cyclic:t?.ifl_sequence?!!t.ifl_cyclic:void 0,toolBegin:t?.ifl_tool_begin==null?void 0:Number(t.ifl_tool_begin)})}}),f(t,e.shapeName,{anisotropy:x});let o=[];t.traverse(e=>{if(!e.isMesh)return;let t=e.userData;if(!t)return;let n=t.vis_keyframes,r=t.vis_duration,i=(t.vis_sequence??``).toLowerCase();!i||!Array.isArray(n)||n.length<=1||!r||r<=0||i===`ambient`&&o.push({mesh:e,keyframes:n,duration:r,cyclic:!!t.vis_cyclic})});for(let e of o)e.mesh.visible=!0,e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.transparent=!0,e.mesh.material.depthWrite=!1);for(let e of r)e.mesh.userData?.vis_sequence||(e.mesh.visible=!0);let c=new Map;for(let e of n.animations)c.set(e.name.toLowerCase(),e);let l=c.get(`ambient`),u=null;if(l){u=new a(t);let e=u.clipAction(l);e.setLoop(i,1),e.clampWhenFinished=!0,e.timeScale=(E?.playSpeed??20)/20,e.play()}let d=[];return t.traverse(e=>{e.isMesh&&(Array.isArray(e.material)?d.push(...e.material):e.material&&d.push(e.material))}),t.traverse(e=>{e.frustumCulled=!1}),{scene:t,mixer:u,visNodes:o,iflInfos:r,materials:d}},[n,E,x]);return(0,_.useEffect)(()=>()=>{l(j),M?.uncacheRoot(j)},[j,M]),(0,_.useEffect)(()=>{T.current=[];for(let e of P)u(e.iflPath).then(t=>{let n=Array.isArray(e.mesh.material)?e.mesh.material[0]:e.mesh.material;n&&(n.map=t.texture,n.needsUpdate=!0),T.current.push({atlas:t,info:e})}).catch(()=>{})},[P]),r((e,t)=>{let n=S.current;if(!n)return;let r=m.getState().playback,i=r.status===`playing`?t*r.rate:0,a=p()-C.current,o=Math.min(a/k,1),s=a/1e3;M&&M.update(i);let l=o>.8?1-(o-.8)/.2:1;for(let{mesh:e,keyframes:t,duration:n,cyclic:r}of N){let i=e.material;if(!i||Array.isArray(i))continue;let a=s/n,o=r?a%1:Math.min(a,1),c=t.length,u=o*c,d=Math.floor(u)%c,f=(d+1)%c,p=u-Math.floor(u);i.opacity=(t[d]+(t[f]-t[d])*p)*l}if(l<1)for(let e of F)`opacity`in e&&(e.transparent=!0,e.opacity*=l);for(let{atlas:e,info:t}of T.current){let n;n=t.sequenceName&&t.duration?(t.cyclic?s/t.duration%1:Math.min(s/t.duration,1))*t.duration+(t.toolBegin??0):s,c(e,d(e,n))}if(D){let e=b(D,o);n.scale.set(e[0]*O[0],e[1]*O[1],e[2]*O[2])}A&&(n.lookAt(e.camera.position),n.rotateZ(w.current))}),(0,v.jsx)(`group`,{ref:S,children:(0,v.jsx)(`group`,{rotation:[0,Math.PI,0],children:(0,v.jsx)(`primitive`,{object:j})})})}export{x as ExplosionShape};
import{r as e}from"./chunk-DECur_0Z.js";import{r as t,t as n}from"./jsx-runtime-BpGWiA-R.js";import{a as r}from"./react-three-fiber.esm-El6vNTZj.js";import{$ as i,o as a}from"./three.module-DKAirPAO.js";import{c as o,f as s}from"./PlayerModel-D6m6HpJF.js";import{_ as c,a as l,g as u,h as d,l as f}from"./playbackUtils-DuS6opSR.js";import{n as p,r as m}from"./engineStore-B1KAgiiF.js";import{t as h}from"./useAnisotropy-D9othEmk.js";import{n as g}from"./streamPlaybackStore-D5ldcfU5.js";var _=e(t(),1),v=n();function y(e){let t=e.sizes,n=e.times;if(!Array.isArray(t)||t.length===0)return{times:[0,1],sizes:[[1,1,1],[1,1,1]]};let r=t.map(e=>[e.x/100,e.y/100,e.z/100]);return{times:Array.isArray(n)?n:r.map((e,t)=>t/Math.max(r.length-1,1)),sizes:r}}function b(e,t){let{times:n,sizes:r}=e;if(n.length===0)return[1,1,1];if(t<=n[0])return r[0];if(t>=n[n.length-1])return r[r.length-1];for(let e=0;e<n.length-1;e++)if(t>=n[e]&&t<=n[e+1]){let i=(t-n[e])/(n[e+1]-n[e]);return[r[e][0]+(r[e+1][0]-r[e][0])*i,r[e][1]+(r[e+1][1]-r[e][1])*i,r[e][2]+(r[e+1][2]-r[e][2])*i]}return r[r.length-1]}function x({entity:e}){let t=g.getState().playback,n=o(e.shapeName),x=h(),S=(0,_.useRef)(null),C=(0,_.useRef)(p()),w=(0,_.useRef)(Math.random()*Math.PI*2),T=(0,_.useRef)([]),E=(0,_.useMemo)(()=>{if(e.explosionDataBlockId)return t.getDataBlockData(e.explosionDataBlockId)},[e.explosionDataBlockId,t]),D=(0,_.useMemo)(()=>E?y(E):void 0,[E]),O=(0,_.useMemo)(()=>{let e=E?.explosionScale;return e?[e.x/100,e.y/100,e.z/100]:[1,1,1]},[E]),k=(E?.lifetimeMS??31)*32,A=e.faceViewer!==!1,{scene:j,mixer:M,visNodes:N,iflInfos:P,materials:F}=(0,_.useMemo)(()=>{let t=s(n.scene),r=[];t.traverse(e=>{if(!e.isMesh||!e.material)return;let t=Array.isArray(e.material)?e.material[0]:e.material;if(!t?.userData)return;let n=new Set(t.userData.flag_names??[]),i=t.userData.resource_path;if(n.has(`IflMaterial`)&&i){let t=e.userData;r.push({mesh:e,iflPath:`textures/${i}.ifl`,sequenceName:t?.ifl_sequence?String(t.ifl_sequence).toLowerCase():void 0,duration:t?.ifl_duration?Number(t.ifl_duration):void 0,cyclic:t?.ifl_sequence?!!t.ifl_cyclic:void 0,toolBegin:t?.ifl_tool_begin==null?void 0:Number(t.ifl_tool_begin)})}}),f(t,e.shapeName,{anisotropy:x});let o=[];t.traverse(e=>{if(!e.isMesh)return;let t=e.userData;if(!t)return;let n=t.vis_keyframes,r=t.vis_duration,i=(t.vis_sequence??``).toLowerCase();!i||!Array.isArray(n)||n.length<=1||!r||r<=0||i===`ambient`&&o.push({mesh:e,keyframes:n,duration:r,cyclic:!!t.vis_cyclic})});for(let e of o)e.mesh.visible=!0,e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.transparent=!0,e.mesh.material.depthWrite=!1);for(let e of r)e.mesh.userData?.vis_sequence||(e.mesh.visible=!0);let c=new Map;for(let e of n.animations)c.set(e.name.toLowerCase(),e);let l=c.get(`ambient`),u=null;if(l){u=new a(t);let e=u.clipAction(l);e.setLoop(i,1),e.clampWhenFinished=!0,e.timeScale=(E?.playSpeed??20)/20,e.play()}let d=[];return t.traverse(e=>{e.isMesh&&(Array.isArray(e.material)?d.push(...e.material):e.material&&d.push(e.material))}),t.traverse(e=>{e.frustumCulled=!1}),{scene:t,mixer:u,visNodes:o,iflInfos:r,materials:d}},[n,E,x]);return(0,_.useEffect)(()=>()=>{l(j),M?.uncacheRoot(j)},[j,M]),(0,_.useEffect)(()=>{T.current=[];for(let e of P)u(e.iflPath).then(t=>{let n=Array.isArray(e.mesh.material)?e.mesh.material[0]:e.mesh.material;n&&(n.map=t.texture,n.needsUpdate=!0),T.current.push({atlas:t,info:e})}).catch(()=>{})},[P]),r((e,t)=>{let n=S.current;if(!n)return;let r=m.getState().playback,i=r.status===`playing`?t*r.rate:0,a=p()-C.current,o=Math.min(a/k,1),s=a/1e3;M&&M.update(i);let l=o>.8?1-(o-.8)/.2:1;for(let{mesh:e,keyframes:t,duration:n,cyclic:r}of N){let i=e.material;if(!i||Array.isArray(i))continue;let a=s/n,o=r?a%1:Math.min(a,1),c=t.length,u=o*c,d=Math.floor(u)%c,f=(d+1)%c,p=u-Math.floor(u);i.opacity=(t[d]+(t[f]-t[d])*p)*l}if(l<1)for(let e of F)`opacity`in e&&(e.transparent=!0,e.opacity*=l);for(let{atlas:e,info:t}of T.current){let n;n=t.sequenceName&&t.duration?(t.cyclic?s/t.duration%1:Math.min(s/t.duration,1))*t.duration+(t.toolBegin??0):s,c(e,d(e,n))}if(D){let e=b(D,o);n.scale.set(e[0]*O[0],e[1]*O[1],e[2]*O[2])}A&&(n.lookAt(e.camera.position),n.rotateZ(w.current))}),(0,v.jsx)(`group`,{ref:S,children:(0,v.jsx)(`group`,{rotation:[0,Math.PI,0],children:(0,v.jsx)(`primitive`,{object:j})})})}export{x as ExplosionShape};

View file

@ -1,4 +1,4 @@
import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{a as i}from"./react-three-fiber.esm-El6vNTZj.js";import{a}from"./SettingsProvider-BdqQ2Cm4.js";import{Ot as o,Ut as s,b as c,jt as l,p as u}from"./three.module-DKAirPAO.js";import{p as d}from"./loaders-B4T775qz.js";import{t as f}from"./Texture-BYh0PjzP.js";import{r as p}from"./cameraTourStore-CtH3IrnD.js";import{t as m}from"./DebugBounds-CZKrvsAw.js";import{t as h}from"./DebugSuspense-ChOWTvws.js";var g=e(n(),1),_=t(),v=`
import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{a as i}from"./react-three-fiber.esm-El6vNTZj.js";import{a}from"./SettingsProvider-BdqQ2Cm4.js";import{Ot as o,Ut as s,b as c,jt as l,p as u}from"./three.module-DKAirPAO.js";import{p as d}from"./loaders-5n1D4iOD.js";import{t as f}from"./Texture-BYh0PjzP.js";import{r as p}from"./cameraTourStore-CtH3IrnD.js";import{t as m}from"./DebugBounds-CZKrvsAw.js";import{t as h}from"./DebugSuspense-ChOWTvws.js";var g=e(n(),1),_=t(),v=`
#include <fog_pars_vertex>
varying vec2 vUv;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,4 +1,4 @@
import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{t as i}from"./useQuery-6REtM5HO.js";import{i as a,l as o,n as s}from"./loaders-B4T775qz.js";import{c}from"./manifest-BIDT_vSa.js";import{U as l,W as u}from"./index-BnXbiEzA.js";var d=e(n(),1),f=t(),p={GuiMarkup:`_GuiMarkup_jg4va_1`,Bullet:`_Bullet_jg4va_12`},m=r(),h=new Set([`spop`,`spush`,`lmargin`,`font`,`color`,`bitmap`,`a`,`/a`]);function g(e){return e.split(/<([^><]+)>/g).map((e,t)=>{if(t%2==0)return e?{type:`text`,value:e}:null;{let[t,...n]=e.split(`:`);return h.has(t.toLowerCase())?{type:`tag`,name:t,args:n}:{type:`text`,value:`<${e}>`}}}).filter(e=>e!=null)}function _(e){let[t,n]=e;return{fontDescription:t,fontSize:n?Math.max(11,Math.min(parseInt(n.trim(),10),16)):void 0}}function v(e){let t=g(e),n={type:`span`,source:`root`,style:{},children:[]},r=n,i=[r],a=e=>e.children!=null&&e.children.some(e=>typeof e==`string`||a(e));for(let e of t)switch(e.type){case`text`:r.children.push(e.value);break;case`tag`:switch(e.name){case`spush`:{let e={type:`span`,source:`spush`,style:{},children:[]};r.children.push(e),r=e,i.push(r);break}case`spop`:if(r.source!==`root`){let e=i.pop();for(;e.source!==`spush`;)e=i.pop();r=i[i.length-1]}break;case`lmargin`:break;case`font`:{let t=_(e.args).fontSize;if(!a(r))r.style.fontSize=t;else{let e={type:`span`,source:`spush`,style:{fontSize:t},children:[]};r.children.push(e),r=e,i.push(r)}break}case`color`:if(!a(r))r.style.color=`#${e.args[0].trim()}`;else{let t={type:`span`,source:`spush`,style:{color:`#${e.args[0].trim()}`},children:[]};r.children.push(t),r=t,i.push(r)}break;case`bitmap`:{let t={type:`bitmap`,value:e.args[0]};r.children.push(t);break}case`a`:{let t=e.args[0].trim().split(` `),n={type:`a`,source:`a`,value:`http://${t.length===2&&t[0]===`wwwlink`?t[1]:t[0]}`,style:{},children:[]};r.children.push(n),r=n,i.push(r);break}case`/a`:{let e=i.pop();for(;e.source!==`a`;)e=i.pop();r=i[i.length-1];break}}}return y(n)}function y(e){switch(e.type){case`span`:return d.createElement(`span`,{style:Object.keys(e.style).length===0?void 0:e.style},...e.children.map(e=>typeof e==`string`?e:y(e)));case`a`:return d.createElement(`a`,{href:e.value,style:Object.keys(e.style).length===0?void 0:e.style,rel:`noopener noreferrer`,target:`_blank`},...e.children.map(e=>typeof e==`string`?e:y(e)));case`bitmap`:return(0,m.jsx)(S,{name:e.value})}}var b=new Map;function x(e){if(b.has(e))return b.get(e);let t;try{t=a(c(`textures/gui/${e}`))}catch{t=null}return b.set(e,t),t}function S(e){let t=(0,f.c)(5),{name:n}=e,r;t[0]===n?r=t[1]:(r=x(n),t[0]=n,t[1]=r);let i=r;if(i){let e;return t[2]===i?e=t[3]:(e=(0,m.jsx)(`img`,{src:i,alt:``,className:p.Bitmap}),t[2]=i,t[3]=e),e}if(/bullet/i.test(n)){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,m.jsx)(`span`,{className:p.Bullet,children:``}),t[4]=e):e=t[4],e}return null}var C=/<(?:font|color|bitmap|just|lmargin|a):/i;function w(e){return C.test(e)}function T(e,t){let n=t.toUpperCase();return e.split(`
import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{t as i}from"./useQuery-6REtM5HO.js";import{i as a,l as o,n as s}from"./loaders-5n1D4iOD.js";import{c}from"./manifest-BIDT_vSa.js";import{U as l,W as u}from"./index-BZ0wFa-D.js";var d=e(n(),1),f=t(),p={GuiMarkup:`_GuiMarkup_jg4va_1`,Bullet:`_Bullet_jg4va_12`},m=r(),h=new Set([`spop`,`spush`,`lmargin`,`font`,`color`,`bitmap`,`a`,`/a`]);function g(e){return e.split(/<([^><]+)>/g).map((e,t)=>{if(t%2==0)return e?{type:`text`,value:e}:null;{let[t,...n]=e.split(`:`);return h.has(t.toLowerCase())?{type:`tag`,name:t,args:n}:{type:`text`,value:`<${e}>`}}}).filter(e=>e!=null)}function _(e){let[t,n]=e;return{fontDescription:t,fontSize:n?Math.max(11,Math.min(parseInt(n.trim(),10),16)):void 0}}function v(e){let t=g(e),n={type:`span`,source:`root`,style:{},children:[]},r=n,i=[r],a=e=>e.children!=null&&e.children.some(e=>typeof e==`string`||a(e));for(let e of t)switch(e.type){case`text`:r.children.push(e.value);break;case`tag`:switch(e.name){case`spush`:{let e={type:`span`,source:`spush`,style:{},children:[]};r.children.push(e),r=e,i.push(r);break}case`spop`:if(r.source!==`root`){let e=i.pop();for(;e.source!==`spush`;)e=i.pop();r=i[i.length-1]}break;case`lmargin`:break;case`font`:{let t=_(e.args).fontSize;if(!a(r))r.style.fontSize=t;else{let e={type:`span`,source:`spush`,style:{fontSize:t},children:[]};r.children.push(e),r=e,i.push(r)}break}case`color`:if(!a(r))r.style.color=`#${e.args[0].trim()}`;else{let t={type:`span`,source:`spush`,style:{color:`#${e.args[0].trim()}`},children:[]};r.children.push(t),r=t,i.push(r)}break;case`bitmap`:{let t={type:`bitmap`,value:e.args[0]};r.children.push(t);break}case`a`:{let t=e.args[0].trim().split(` `),n={type:`a`,source:`a`,value:`http://${t.length===2&&t[0]===`wwwlink`?t[1]:t[0]}`,style:{},children:[]};r.children.push(n),r=n,i.push(r);break}case`/a`:{let e=i.pop();for(;e.source!==`a`;)e=i.pop();r=i[i.length-1];break}}}return y(n)}function y(e){switch(e.type){case`span`:return d.createElement(`span`,{style:Object.keys(e.style).length===0?void 0:e.style},...e.children.map(e=>typeof e==`string`?e:y(e)));case`a`:return d.createElement(`a`,{href:e.value,style:Object.keys(e.style).length===0?void 0:e.style,rel:`noopener noreferrer`,target:`_blank`},...e.children.map(e=>typeof e==`string`?e:y(e)));case`bitmap`:return(0,m.jsx)(S,{name:e.value})}}var b=new Map;function x(e){if(b.has(e))return b.get(e);let t;try{t=a(c(`textures/gui/${e}`))}catch{t=null}return b.set(e,t),t}function S(e){let t=(0,f.c)(5),{name:n}=e,r;t[0]===n?r=t[1]:(r=x(n),t[0]=n,t[1]=r);let i=r;if(i){let e;return t[2]===i?e=t[3]:(e=(0,m.jsx)(`img`,{src:i,alt:``,className:p.Bitmap}),t[2]=i,t[3]=e),e}if(/bullet/i.test(n)){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,m.jsx)(`span`,{className:p.Bullet,children:``}),t[4]=e):e=t[4],e}return null}var C=/<(?:font|color|bitmap|just|lmargin|a):/i;function w(e){return C.test(e)}function T(e,t){let n=t.toUpperCase();return e.split(`
`).flatMap(e=>{let t=e.match(/^\[([^\]]+)\]/);return t&&!t[1].toUpperCase().split(/\s+/).includes(n)?[]:[e.replace(/^\[[^\]]+\]/,``)]}).join(`
`)}function E(e){let t=(0,f.c)(4),{markup:n}=e,r;t[0]===n?r=t[1]:(r=v(n),t[0]=n,t[1]=r);let i=r,a;return t[2]===i?a=t[3]:(a=(0,m.jsx)(`div`,{className:p.GuiMarkup,children:i}),t[2]=i,t[3]=a),a}var D={Dialog:`_Dialog_tbn5d_1 _Dialog_1t9wa_1`,Overlay:`_Overlay_tbn5d_10 _Overlay_1t9wa_22`,Body:`_Body_tbn5d_14`,Left:`_Left_tbn5d_22`,PreviewImage:`_PreviewImage_tbn5d_29`,PreviewImageFloating:`_PreviewImageFloating_tbn5d_35`,Title:`_Title_tbn5d_45`,MapMeta:`_MapMeta_tbn5d_53`,MapPlanet:`_MapPlanet_tbn5d_63`,MapQuote:`_MapQuote_tbn5d_67`,MapBlurb:`_MapBlurb_tbn5d_86`,Section:`_Section_tbn5d_91`,SectionTitle:`_SectionTitle_tbn5d_95`,MusicTrack:`_MusicTrack_tbn5d_105`,MusicButton:`_MusicButton_tbn5d_119`,Footer:`_Footer_tbn5d_146`,CloseButton:`_CloseButton_tbn5d_158 _DialogButton_1t9wa_33`,Hint:`_Hint_tbn5d_162`,MusicTrackName:`_MusicTrackName_tbn5d_168`};function ee(e){let t=(0,f.c)(2),n;return t[0]===e?n=t[1]:(n={queryKey:[`parsedMission`,e],queryFn:()=>o(e)},t[0]=e,t[1]=n),i(n)}function te(e){for(let t of e.body){if(t.type!==`ObjectDeclaration`)continue;let{instanceName:e,body:n}=t;if(e&&e.type===`Identifier`&&e.name.toLowerCase()===`missiongroup`){let e={};for(let t of n){if(t.type!==`Assignment`)continue;let{target:n,value:r}=t;n.type===`Identifier`&&r.type===`StringLiteral`&&(e[n.name.toLowerCase()]=r.value)}return e}}return{}}function ne(e,t){if(e)try{return a(c(`textures/gui/${e}`))}catch{}try{return a(c(`textures/gui/Load_${t}`))}catch{}return null}function re(e){let t=(0,f.c)(7),{src:n,alt:r,className:i}=e,a=i===void 0?D.PreviewImage:i,[o,s]=(0,d.useState)(null),c,l;if(t[0]===n?(c=t[1],l=t[2]):(c=()=>{let e=!1,t;return fetch(n).then(j).then(A).then(k).then(n=>{e||!n||(t=URL.createObjectURL(n),s(t))}).catch(O),()=>{e=!0,t&&URL.revokeObjectURL(t)}},l=[n],t[0]=n,t[1]=c,t[2]=l),(0,d.useEffect)(c,l),!o)return null;let u;return t[3]!==r||t[4]!==a||t[5]!==o?(u=(0,m.jsx)(`img`,{src:o,alt:r,className:a}),t[3]=r,t[4]=a,t[5]=o,t[6]=u):u=t[6],u}function O(){}function k(e){return new Promise(t=>{let n=document.createElement(`canvas`);n.width=e.width,n.height=e.height,n.getContext(`2d`)?.drawImage(e,0,0),e.close(),n.toBlob(t)})}function A(e){return createImageBitmap(e,{colorSpaceConversion:`none`})}function j(e){return e.blob()}function ie(e){let t=(0,f.c)(22),{track:n}=e,[r,i]=(0,d.useState)(!1),[a,o]=(0,d.useState)(!0),c=(0,d.useRef)(null),p;t[0]===n?p=t[1]:(p=n.toLowerCase(),t[0]=n,t[1]=p);let h=`${s}music/${p}.mp3`,g,_;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{let e=c.current;if(e)return()=>{e.pause()}},_=[],t[2]=g,t[3]=_):(g=t[2],_=t[3]),(0,d.useEffect)(g,_);let v;t[4]===r?v=t[5]:(v=()=>{let e=c.current;e&&(r?e.pause():e.play().catch(()=>o(!1)))},t[4]=r,t[5]=v);let y=v,b,x,S;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(b=()=>i(!0),x=()=>i(!1),S=()=>o(!1),t[6]=b,t[7]=x,t[8]=S):(b=t[6],x=t[7],S=t[8]);let C;t[9]===h?C=t[10]:(C=(0,m.jsx)(`audio`,{ref:c,src:h,loop:!0,onPlay:b,onPause:x,onError:S}),t[9]=h,t[10]=C);let w;t[11]===n?w=t[12]:(w=(0,m.jsx)(`span`,{className:D.MusicTrackName,children:n}),t[11]=n,t[12]=w);let T;t[13]!==a||t[14]!==r||t[15]!==y?(T=a&&(0,m.jsx)(`button`,{className:D.MusicButton,onClick:y,"aria-label":r?`Pause music`:`Play music`,children:r?(0,m.jsx)(u,{}):(0,m.jsx)(l,{})}),t[13]=a,t[14]=r,t[15]=y,t[16]=T):T=t[16];let E;return t[17]!==r||t[18]!==T||t[19]!==C||t[20]!==w?(E=(0,m.jsxs)(`div`,{className:D.MusicTrack,"data-playing":r,children:[C,w,T]}),t[17]=r,t[18]=T,t[19]=C,t[20]=w,t[21]=E):E=t[21],E}function M(e){let t=(0,f.c)(100),{onClose:n,missionName:r,missionType:i}=e,{data:a}=ee(r),o=(0,d.useRef)(null),s,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{o.current?.focus();try{document.exitPointerLock()}catch{}},c=[],t[0]=s,t[1]=c):(s=t[0],c=t[1]),(0,d.useEffect)(s,c);let l,u;t[2]===n?(l=t[3],u=t[4]):(l=()=>{let e=e=>{if(e.key===`Escape`)n();else if(e.key===`k`&&(e.metaKey||e.ctrlKey)){n();return}e.stopImmediatePropagation()},t=se;return window.addEventListener(`keydown`,e,{capture:!0}),window.addEventListener(`keyup`,t,{capture:!0}),()=>{window.removeEventListener(`keydown`,e,{capture:!0}),window.removeEventListener(`keyup`,t,{capture:!0})}},u=[n],t[2]=n,t[3]=l,t[4]=u),(0,d.useEffect)(l,u);let p;t[5]===a?p=t[6]:(p=a?te(a.ast):{},t[5]=a,t[6]=p);let h=p,g;t[7]!==r||t[8]!==a?(g=a?ne(a.bitmap,r):null,t[7]=r,t[8]=a,t[9]=g):g=t[9];let _=g,v=a?.displayName??r,y;t[10]===i?y=t[11]:(y=i.toLowerCase(),t[10]=i,t[11]=y);let b=y===`singleplayer`,x=h.musictrack,S,C,O,k,A,j,M,N,P,F,I,L,R,z,B,V,H,U;if(t[12]!==_||t[13]!==v||t[14]!==b||t[15]!==i||t[16]!==n||t[17]!==a){let e=a?.missionString?T(a.missionString,i):null,r,s,c,l;if(t[36]!==a?.missionQuote){if(l=a?.missionQuote?.trim()??``,s=w(l),c=``,r=``,!s)for(let e of l.split(`
`)){let t=e.trim();t.match(/^--[^-]/)?r=t.replace(/^-+\s*/,``).trim():t&&(c+=(c?`

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
import{i as e,n as t,r as n,t as r}from"./PlayerModel-D8NLwrT8.js";export{r as PlayerModel,t as fetchSkinManifest,n as playerEyePositions,e as skinManifestQueryKey};
import{i as e,n as t,r as n,t as r}from"./PlayerModel-D6m6HpJF.js";export{r as PlayerModel,t as fetchSkinManifest,n as playerEyePositions,e as skinManifestQueryKey};

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{a as i}from"./react-three-fiber.esm-El6vNTZj.js";import{Ct as a,Wt as o,b as s,kt as c}from"./three.module-DKAirPAO.js";import{d as l,f as u,m as d}from"./playbackUtils-DjmjN4tv.js";import{p as f}from"./loaders-B4T775qz.js";import{t as p}from"./Texture-BYh0PjzP.js";var m=t(),h=e(n(),1),g=r(),_=new o,v=new o,y=new o,b=new o,x=new o,S=new o,C=new o(0,1,0);function w(e){let t=(0,m.c)(14),{entity:n}=e,{visual:r}=n,i;t[0]===r.texture?i=t[1]:(i=f(r.texture),t[0]=r.texture,t[1]=i);let a=p(i,T),o=Array.isArray(a)?a[0]:a,l;t[2]!==r.color.b||t[3]!==r.color.g||t[4]!==r.color.r?(l=new s().setRGB(r.color.r,r.color.g,r.color.b,c),t[2]=r.color.b,t[3]=r.color.g,t[4]=r.color.r,t[5]=l):l=t[5];let u=l,d;t[6]===r.size?d=t[7]:(d=[r.size,r.size,1],t[6]=r.size,t[7]=d);let h;t[8]!==u||t[9]!==o?(h=(0,g.jsx)(`spriteMaterial`,{map:o,color:u,transparent:!0,blending:2,depthWrite:!1,toneMapped:!1}),t[8]=u,t[9]=o,t[10]=h):h=t[10];let _;return t[11]!==d||t[12]!==h?(_=(0,g.jsx)(`sprite`,{scale:d,children:h}),t[11]=d,t[12]=h,t[13]=_):_=t[13],_}function T(e){u(Array.isArray(e)?e[0]:e)}function E(e){let t=(0,m.c)(29),{entity:n}=e,{visual:r}=n,o=(0,h.useRef)(null),s=(0,h.useRef)(null),c=(0,h.useRef)(null),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=new a,t[0]=u):u=t[0];let w=(0,h.useRef)(u),T;t[1]===r.texture?T=t[2]:(T=f(r.texture),t[1]=r.texture,t[2]=T);let E=r.crossTexture??r.texture,O;t[3]===E?O=t[4]:(O=f(E),t[3]=E,t[4]=O);let k;t[5]!==T||t[6]!==O?(k=[T,O],t[5]=T,t[6]=O,t[7]=k):k=t[7];let A=p(k,D),j;t[8]===A?j=t[9]:(j=Array.isArray(A)?A:[A,A],t[8]=A,t[9]=j);let[M,N]=j,P;t[10]!==n.direction||t[11]!==n.keyframes?.[0]||t[12]!==r.crossSize||t[13]!==r.crossViewAng||t[14]!==r.renderCross||t[15]!==r.tracerLength||t[16]!==r.tracerWidth?(P=e=>{let{camera:t}=e,i=o.current,a=s.current;if(!i||!a)return;let u=n.keyframes?.[0],f=u?.position,p=n.direction??u?.velocity;if(!f||!p){i.visible=!1,c.current&&(c.current.visible=!1);return}if(d(p,_),_.lengthSq()<1e-8){i.visible=!1,c.current&&(c.current.visible=!1);return}_.normalize(),i.visible=!0,d(f,S),v.copy(S).sub(t.position),y.crossVectors(v,_),y.lengthSq()<1e-8&&(y.crossVectors(C,_),y.lengthSq()<1e-8&&y.set(1,0,0)),y.normalize().multiplyScalar(r.tracerWidth);let m=r.tracerLength*.5;b.copy(_).multiplyScalar(-m),x.copy(_).multiplyScalar(m);let h=a.array;h[0]=b.x+y.x,h[1]=b.y+y.y,h[2]=b.z+y.z,h[3]=b.x-y.x,h[4]=b.y-y.y,h[5]=b.z-y.z,h[6]=x.x-y.x,h[7]=x.y-y.y,h[8]=x.z-y.z,h[9]=x.x+y.x,h[10]=x.y+y.y,h[11]=x.z+y.z,a.needsUpdate=!0;let g=c.current;if(!g)return;if(!r.renderCross){g.visible=!1;return}v.normalize();let T=_.dot(v);if(T>-r.crossViewAng&&T<r.crossViewAng){g.visible=!1;return}g.visible=!0,l(_,w.current),g.quaternion.copy(w.current),g.scale.setScalar(r.crossSize)},t[10]=n.direction,t[11]=n.keyframes?.[0],t[12]=r.crossSize,t[13]=r.crossViewAng,t[14]=r.renderCross,t[15]=r.tracerLength,t[16]=r.tracerWidth,t[17]=P):P=t[17],i(P);let F;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,g.jsx)(`bufferAttribute`,{ref:s,attach:`attributes-position`,args:[new Float32Array(12),3]}),t[18]=F):F=t[18];let I;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,g.jsx)(`bufferAttribute`,{attach:`attributes-uv`,args:[new Float32Array([0,0,0,1,1,1,1,0]),2]}),t[19]=I):I=t[19];let L;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,g.jsxs)(`bufferGeometry`,{children:[F,I,(0,g.jsx)(`bufferAttribute`,{attach:`index`,args:[new Uint16Array([0,1,2,0,2,3]),1]})]}),t[20]=L):L=t[20];let R;t[21]===M?R=t[22]:(R=(0,g.jsxs)(`mesh`,{ref:o,children:[L,(0,g.jsx)(`meshBasicMaterial`,{map:M,transparent:!0,blending:2,side:2,depthWrite:!1,toneMapped:!1})]}),t[21]=M,t[22]=R);let z;t[23]!==N||t[24]!==r.renderCross?(z=r.renderCross?(0,g.jsxs)(`mesh`,{ref:c,children:[(0,g.jsxs)(`bufferGeometry`,{children:[(0,g.jsx)(`bufferAttribute`,{attach:`attributes-position`,args:[new Float32Array([-.5,0,-.5,.5,0,-.5,.5,0,.5,-.5,0,.5]),3]}),(0,g.jsx)(`bufferAttribute`,{attach:`attributes-uv`,args:[new Float32Array([0,0,0,1,1,1,1,0]),2]}),(0,g.jsx)(`bufferAttribute`,{attach:`index`,args:[new Uint16Array([0,1,2,0,2,3]),1]})]}),(0,g.jsx)(`meshBasicMaterial`,{map:N,transparent:!0,blending:2,side:2,depthWrite:!1,toneMapped:!1})]}):null,t[23]=N,t[24]=r.renderCross,t[25]=z):z=t[25];let B;return t[26]!==R||t[27]!==z?(B=(0,g.jsxs)(g.Fragment,{children:[R,z]}),t[26]=R,t[27]=z,t[28]=B):B=t[28],B}function D(e){let t=Array.isArray(e)?e:[e];for(let e of t)u(e)}export{w as SpriteProjectile,E as TracerProjectile};
import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{a as i}from"./react-three-fiber.esm-El6vNTZj.js";import{Ct as a,Wt as o,b as s,kt as c}from"./three.module-DKAirPAO.js";import{d as l,f as u,m as d}from"./playbackUtils-DuS6opSR.js";import{p as f}from"./loaders-5n1D4iOD.js";import{t as p}from"./Texture-BYh0PjzP.js";var m=t(),h=e(n(),1),g=r(),_=new o,v=new o,y=new o,b=new o,x=new o,S=new o,C=new o(0,1,0);function w(e){let t=(0,m.c)(14),{entity:n}=e,{visual:r}=n,i;t[0]===r.texture?i=t[1]:(i=f(r.texture),t[0]=r.texture,t[1]=i);let a=p(i,T),o=Array.isArray(a)?a[0]:a,l;t[2]!==r.color.b||t[3]!==r.color.g||t[4]!==r.color.r?(l=new s().setRGB(r.color.r,r.color.g,r.color.b,c),t[2]=r.color.b,t[3]=r.color.g,t[4]=r.color.r,t[5]=l):l=t[5];let u=l,d;t[6]===r.size?d=t[7]:(d=[r.size,r.size,1],t[6]=r.size,t[7]=d);let h;t[8]!==u||t[9]!==o?(h=(0,g.jsx)(`spriteMaterial`,{map:o,color:u,transparent:!0,blending:2,depthWrite:!1,toneMapped:!1}),t[8]=u,t[9]=o,t[10]=h):h=t[10];let _;return t[11]!==d||t[12]!==h?(_=(0,g.jsx)(`sprite`,{scale:d,children:h}),t[11]=d,t[12]=h,t[13]=_):_=t[13],_}function T(e){u(Array.isArray(e)?e[0]:e)}function E(e){let t=(0,m.c)(29),{entity:n}=e,{visual:r}=n,o=(0,h.useRef)(null),s=(0,h.useRef)(null),c=(0,h.useRef)(null),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=new a,t[0]=u):u=t[0];let w=(0,h.useRef)(u),T;t[1]===r.texture?T=t[2]:(T=f(r.texture),t[1]=r.texture,t[2]=T);let E=r.crossTexture??r.texture,O;t[3]===E?O=t[4]:(O=f(E),t[3]=E,t[4]=O);let k;t[5]!==T||t[6]!==O?(k=[T,O],t[5]=T,t[6]=O,t[7]=k):k=t[7];let A=p(k,D),j;t[8]===A?j=t[9]:(j=Array.isArray(A)?A:[A,A],t[8]=A,t[9]=j);let[M,N]=j,P;t[10]!==n.direction||t[11]!==n.keyframes?.[0]||t[12]!==r.crossSize||t[13]!==r.crossViewAng||t[14]!==r.renderCross||t[15]!==r.tracerLength||t[16]!==r.tracerWidth?(P=e=>{let{camera:t}=e,i=o.current,a=s.current;if(!i||!a)return;let u=n.keyframes?.[0],f=u?.position,p=n.direction??u?.velocity;if(!f||!p){i.visible=!1,c.current&&(c.current.visible=!1);return}if(d(p,_),_.lengthSq()<1e-8){i.visible=!1,c.current&&(c.current.visible=!1);return}_.normalize(),i.visible=!0,d(f,S),v.copy(S).sub(t.position),y.crossVectors(v,_),y.lengthSq()<1e-8&&(y.crossVectors(C,_),y.lengthSq()<1e-8&&y.set(1,0,0)),y.normalize().multiplyScalar(r.tracerWidth);let m=r.tracerLength*.5;b.copy(_).multiplyScalar(-m),x.copy(_).multiplyScalar(m);let h=a.array;h[0]=b.x+y.x,h[1]=b.y+y.y,h[2]=b.z+y.z,h[3]=b.x-y.x,h[4]=b.y-y.y,h[5]=b.z-y.z,h[6]=x.x-y.x,h[7]=x.y-y.y,h[8]=x.z-y.z,h[9]=x.x+y.x,h[10]=x.y+y.y,h[11]=x.z+y.z,a.needsUpdate=!0;let g=c.current;if(!g)return;if(!r.renderCross){g.visible=!1;return}v.normalize();let T=_.dot(v);if(T>-r.crossViewAng&&T<r.crossViewAng){g.visible=!1;return}g.visible=!0,l(_,w.current),g.quaternion.copy(w.current),g.scale.setScalar(r.crossSize)},t[10]=n.direction,t[11]=n.keyframes?.[0],t[12]=r.crossSize,t[13]=r.crossViewAng,t[14]=r.renderCross,t[15]=r.tracerLength,t[16]=r.tracerWidth,t[17]=P):P=t[17],i(P);let F;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,g.jsx)(`bufferAttribute`,{ref:s,attach:`attributes-position`,args:[new Float32Array(12),3]}),t[18]=F):F=t[18];let I;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,g.jsx)(`bufferAttribute`,{attach:`attributes-uv`,args:[new Float32Array([0,0,0,1,1,1,1,0]),2]}),t[19]=I):I=t[19];let L;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,g.jsxs)(`bufferGeometry`,{children:[F,I,(0,g.jsx)(`bufferAttribute`,{attach:`index`,args:[new Uint16Array([0,1,2,0,2,3]),1]})]}),t[20]=L):L=t[20];let R;t[21]===M?R=t[22]:(R=(0,g.jsxs)(`mesh`,{ref:o,children:[L,(0,g.jsx)(`meshBasicMaterial`,{map:M,transparent:!0,blending:2,side:2,depthWrite:!1,toneMapped:!1})]}),t[21]=M,t[22]=R);let z;t[23]!==N||t[24]!==r.renderCross?(z=r.renderCross?(0,g.jsxs)(`mesh`,{ref:c,children:[(0,g.jsxs)(`bufferGeometry`,{children:[(0,g.jsx)(`bufferAttribute`,{attach:`attributes-position`,args:[new Float32Array([-.5,0,-.5,.5,0,-.5,.5,0,.5,-.5,0,.5]),3]}),(0,g.jsx)(`bufferAttribute`,{attach:`attributes-uv`,args:[new Float32Array([0,0,0,1,1,1,1,0]),2]}),(0,g.jsx)(`bufferAttribute`,{attach:`index`,args:[new Uint16Array([0,1,2,0,2,3]),1]})]}),(0,g.jsx)(`meshBasicMaterial`,{map:N,transparent:!0,blending:2,side:2,depthWrite:!1,toneMapped:!1})]}):null,t[23]=N,t[24]=r.renderCross,t[25]=z):z=t[25];let B;return t[26]!==R||t[27]!==z?(B=(0,g.jsxs)(g.Fragment,{children:[R,z]}),t[26]=R,t[27]=z,t[28]=B):B=t[28],B}function D(e){let t=Array.isArray(e)?e:[e];for(let e of t)u(e)}export{w as SpriteProjectile,E as TracerProjectile};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
import{n as e}from"./jsx-runtime-BpGWiA-R.js";import{a as t}from"./react-three-fiber.esm-El6vNTZj.js";import{r as n}from"./SettingsProvider-BdqQ2Cm4.js";import{n as r}from"./JoystickContext-B2sO9eYx.js";import{f as i,h as a}from"./index-BnXbiEzA.js";var o=e(),s=.004,c=2.5,l=.08,u=.15,d=.15;function f(){let e=(0,o.c)(9),{speedMultiplier:f,touchMode:p,invertDrag:m,invertJoystick:h}=n(),{moveState:g,lookState:_}=r(),v=a(),[,y]=i(),b;return e[0]!==y||e[1]!==m||e[2]!==h||e[3]!==_.current||e[4]!==g.current||e[5]!==v||e[6]!==f||e[7]!==p?(b=(e,t)=>{let{force:n,angle:r}=g.current,{force:i,angle:a}=_.current,o=y().touchLook,b=m?1:-1,x=0,S=0;p===`moveLookStick`&&o&&o.dragging&&(x=b*o.deltaX*s,S=b*o.deltaY*s);let C=0,w=0;if(p===`dualStick`){if(i>u){let e=(i-u)/(1-u),n=Math.cos(a),r=Math.sin(a),o=h?1:-1;x-=o*n*e*c*t,S+=o*r*e*c*t}if(n>l){let e=(n-l)/(1-l),t=Math.cos(r),i=Math.sin(r);C=Math.max(-1,Math.min(1,t*e*(.8*f+.05))),w=Math.max(-1,Math.min(1,i*e*(.8*f+.05)))}}else if(p===`moveLookStick`&&n>0&&(w=Math.min(1,.5*f+.05),n>=d)){let e=Math.cos(r),i=Math.sin(r),a=(n-d)/(1-d),o=h?1:-1;x-=o*e*a*c*.5*t,S+=o*i*a*c*.5*t}!(x!==0||S!==0)&&!(C!==0||w!==0)||v({deltaYaw:x,deltaPitch:S,x:C,y:w,z:0,triggers:[],delta:t})},e[0]=y,e[1]=m,e[2]=h,e[3]=_.current,e[4]=g.current,e[5]=v,e[6]=f,e[7]=p,e[8]=b):b=e[8],t(b),null}export{f as TouchHandler};
import{n as e}from"./jsx-runtime-BpGWiA-R.js";import{a as t}from"./react-three-fiber.esm-El6vNTZj.js";import{r as n}from"./SettingsProvider-BdqQ2Cm4.js";import{n as r}from"./JoystickContext-B2sO9eYx.js";import{f as i,h as a}from"./index-BZ0wFa-D.js";var o=e(),s=.004,c=2.5,l=.08,u=.15,d=.15;function f(){let e=(0,o.c)(9),{speedMultiplier:f,touchMode:p,invertDrag:m,invertJoystick:h}=n(),{moveState:g,lookState:_}=r(),v=a(),[,y]=i(),b;return e[0]!==y||e[1]!==m||e[2]!==h||e[3]!==_.current||e[4]!==g.current||e[5]!==v||e[6]!==f||e[7]!==p?(b=(e,t)=>{let{force:n,angle:r}=g.current,{force:i,angle:a}=_.current,o=y().touchLook,b=m?1:-1,x=0,S=0;p===`moveLookStick`&&o&&o.dragging&&(x=b*o.deltaX*s,S=b*o.deltaY*s);let C=0,w=0;if(p===`dualStick`){if(i>u){let e=(i-u)/(1-u),n=Math.cos(a),r=Math.sin(a),o=h?1:-1;x-=o*n*e*c*t,S+=o*r*e*c*t}if(n>l){let e=(n-l)/(1-l),t=Math.cos(r),i=Math.sin(r);C=Math.max(-1,Math.min(1,t*e*(.8*f+.05))),w=Math.max(-1,Math.min(1,i*e*(.8*f+.05)))}}else if(p===`moveLookStick`&&n>0&&(w=Math.min(1,.5*f+.05),n>=d)){let e=Math.cos(r),i=Math.sin(r),a=(n-d)/(1-d),o=h?1:-1;x-=o*e*a*c*.5*t,S+=o*i*a*c*.5*t}!(x!==0||S!==0)&&!(C!==0||w!==0)||v({deltaYaw:x,deltaPitch:S,x:C,y:w,z:0,triggers:[],delta:t})},e[0]=y,e[1]=m,e[2]=h,e[3]=_.current,e[4]=g.current,e[5]=v,e[6]=f,e[7]=p,e[8]=b):b=e[8],t(b),null}export{f as TouchHandler};

View file

@ -1,4 +1,4 @@
import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{a as i,s as a}from"./react-three-fiber.esm-El6vNTZj.js";import{a as o,i as s}from"./SettingsProvider-BdqQ2Cm4.js";import{Ot as c,_t as l,b as u,jt as d,rt as f}from"./three.module-DKAirPAO.js";import{a as p,i as m,l as h}from"./textureUtils-Bk_jPZib.js";import{p as g}from"./loaders-B4T775qz.js";import{t as _}from"./extends-lXRikpl0.js";import{t as v}from"./Texture-BYh0PjzP.js";import{t as y}from"./useAnisotropy-D9othEmk.js";import{r as ee}from"./cameraTourStore-CtH3IrnD.js";import{t as te}from"./DebugBounds-CZKrvsAw.js";import{n as b,r as x,t as S}from"./scene-C20n9V3Y.js";var C=e(n());function w(e,t){let n=e+`Geometry`;return C.forwardRef(({args:e,children:r,...i},a)=>{let o=C.useRef(null);return C.useImperativeHandle(a,()=>o.current),C.useLayoutEffect(()=>void t?.(o.current)),C.createElement(`mesh`,_({ref:o},i),C.createElement(n,{attach:`geometry`,args:e}),r)})}var T=w(`box`),E=t(),D=`
import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{a as i,s as a}from"./react-three-fiber.esm-El6vNTZj.js";import{a as o,i as s}from"./SettingsProvider-BdqQ2Cm4.js";import{Ot as c,_t as l,b as u,jt as d,rt as f}from"./three.module-DKAirPAO.js";import{a as p,i as m,l as h}from"./textureUtils-Bk_jPZib.js";import{p as g}from"./loaders-5n1D4iOD.js";import{t as _}from"./extends-lXRikpl0.js";import{t as v}from"./Texture-BYh0PjzP.js";import{t as y}from"./useAnisotropy-D9othEmk.js";import{r as ee}from"./cameraTourStore-CtH3IrnD.js";import{t as te}from"./DebugBounds-CZKrvsAw.js";import{n as b,r as x,t as S}from"./scene-C20n9V3Y.js";var C=e(n());function w(e,t){let n=e+`Geometry`;return C.forwardRef(({args:e,children:r,...i},a)=>{let o=C.useRef(null);return C.useImperativeHandle(a,()=>o.current),C.useLayoutEffect(()=>void t?.(o.current)),C.createElement(`mesh`,_({ref:o},i),C.createElement(n,{attach:`geometry`,args:e}),r)})}var T=w(`box`),E=t(),D=`
#include <fog_pars_vertex>
#ifdef USE_FOG

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
import{t as e}from"./logger-B058WGzf.js";import{c as t,n,s as r,t as i}from"./manifest-BIDT_vSa.js";import{a}from"./stringUtils-1MyeFdQ_.js";import{a as o}from"./mission-yeigCtfF.js";function s(e){return e.split(/(?:\r\n|\r|\n)/g).map(e=>e.trim()).filter(Boolean).filter(e=>!e.startsWith(`;`)).map(e=>{let t=e.match(/^(.+)\s(\d+)$/);if(t){let e=parseInt(t[2],10);return{name:t[1],frameCount:e}}else return{name:e,frameCount:1}})}var c=256;function l(e){let t=new DataView(e),n=0,r=t.getUint8(n++),i=new Uint16Array(c*c),a=[],o=e=>{let r=``;for(let i=0;i<e;i++){let e=t.getUint8(n+i);if(e===0)break;r+=String.fromCharCode(e)}return n+=e,r};for(let e=0;e<c*c;e++){let r=t.getUint16(n,!0);n+=2,i[e]=r}n+=256*256;let s=i;for(let e=0;e<8;e++){let r=t.getUint8(n++),i=o(r);e<6&&r>0&&a.push(i)}let l=[];for(let e of a){let e=new Uint8Array(c*c);for(let r=0;r<c*c;r++)e[r]=t.getUint8(n++);l.push(e)}return{version:r,textureNames:a,heightMap:s,alphaMaps:l}}var u=e(`loaders`),d=`/t2-mapper/base/`,f=`/t2-mapper/white.png`;function p(e,t){let n;try{n=i(e)}catch(n){if(t)return u.warn(`Resource "%s" not found — rendering fallback`,e),t;throw n}let[a,o]=r(n);return a?`${d}@vl2/${a}/${o}`:`${d}${o}`}function m(e){return p(`interiors/${e}`).replace(/\.dif$/i,`.glb`)}function h(e){return p(`shapes/${e}`).replace(/\.dts$/i,`.glb`)}function g(e){return e=e.replace(/^terrain\./,``),p(t(`textures/terrain/${e}`),f)}function _(e,n){let r=a(n).split(`/`);return p(t(`${r.length>1?r.slice(0,-1).join(`/`)+`/`:``}${e}`),f)}function v(e,n=f){return p(t(`textures/${e}`),n??void 0)}function y(e){return p(`audio/${/\.\w+$/.test(e)?e:`${e}.wav`}`).replace(/\.wav$/i,`.m4a`)}async function b(e){let t=p(`textures/${e}`);return(await(await fetch(t)).text()).split(/(?:\r\n|\r|\n)/).map(e=>{if(e=e.trim(),!e.startsWith(`;`))return e}).filter(Boolean)}async function x(e){let t=n(e),r=await(await fetch(p(t.resourcePath))).arrayBuffer(),i;try{i=new TextDecoder(`utf-8`,{fatal:!0}).decode(r)}catch{i=new TextDecoder(`windows-1252`).decode(r)}return i=i.replaceAll(`<EFBFBD>`,`'`),o(i)}async function S(e){let t=p(`terrains/${e}`);u.debug(`Fetching terrain: %s`,t);let n=await fetch(t);if(!n.ok)throw Error(`[loadTerrain] Failed to fetch ${t}: ${n.status} ${n.statusText}`);let r=await n.arrayBuffer();return u.debug(`Loaded terrain %s: %d bytes`,e,r.byteLength),l(r)}async function C(e){let t=p(e);return s(await(await fetch(t)).text())}export{_ as a,C as c,h as d,g as f,p as i,x as l,d as n,m as o,v as p,y as r,b as s,f as t,S as u};

View file

@ -1 +0,0 @@
import{t as e}from"./logger-B058WGzf.js";import{c as t,n,s as r,t as i}from"./manifest-BIDT_vSa.js";import{a}from"./stringUtils-1MyeFdQ_.js";import{a as o}from"./mission-yeigCtfF.js";function s(e){return e.split(/(?:\r\n|\r|\n)/g).map(e=>e.trim()).filter(Boolean).filter(e=>!e.startsWith(`;`)).map(e=>{let t=e.match(/^(.+)\s(\d+)$/);if(t){let e=parseInt(t[2],10);return{name:t[1],frameCount:e}}else return{name:e,frameCount:1}})}var c=256;function l(e){let t=new DataView(e),n=0,r=t.getUint8(n++),i=new Uint16Array(c*c),a=[],o=e=>{let r=``;for(let i=0;i<e;i++){let e=t.getUint8(n+i);if(e===0)break;r+=String.fromCharCode(e)}return n+=e,r};for(let e=0;e<c*c;e++){let r=t.getUint16(n,!0);n+=2,i[e]=r}n+=256*256;let s=i;for(let e=0;e<8;e++){let r=t.getUint8(n++),i=o(r);e<6&&r>0&&a.push(i)}let l=[];for(let e of a){let e=new Uint8Array(c*c);for(let r=0;r<c*c;r++)e[r]=t.getUint8(n++);l.push(e)}return{version:r,textureNames:a,heightMap:s,alphaMaps:l}}var u=e(`loaders`),d=`/t2-mapper`,f=`${d}/base/`,p=`${d}/white.png`;function m(e,t){let n;try{n=i(e)}catch(n){if(t)return u.warn(`Resource "%s" not found — rendering fallback`,e),t;throw n}let[a,o]=r(n);return a?`${f}@vl2/${a}/${o}`:`${f}${o}`}function h(e){return m(`interiors/${e}`).replace(/\.dif$/i,`.glb`)}function g(e){return m(`shapes/${e}`).replace(/\.dts$/i,`.glb`)}function _(e){return e=e.replace(/^terrain\./,``),m(t(`textures/terrain/${e}`),p)}function v(e,n){let r=a(n).split(`/`);return m(t(`${r.length>1?r.slice(0,-1).join(`/`)+`/`:``}${e}`),p)}function y(e,n=p){return m(t(`textures/${e}`),n??void 0)}function b(e){return m(`audio/${/\.\w+$/.test(e)?e:`${e}.wav`}`).replace(/\.wav$/i,`.m4a`)}async function x(e){let t=m(`textures/${e}`);return(await(await fetch(t)).text()).split(/(?:\r\n|\r|\n)/).map(e=>{if(e=e.trim(),!e.startsWith(`;`))return e}).filter(Boolean)}async function S(e){let t=n(e),r=await(await fetch(m(t.resourcePath))).arrayBuffer(),i;try{i=new TextDecoder(`utf-8`,{fatal:!0}).decode(r)}catch{i=new TextDecoder(`windows-1252`).decode(r)}return i=i.replaceAll(`<EFBFBD>`,`'`),o(i)}async function C(e){let t=m(`terrains/${e}`);u.debug(`Fetching terrain: %s`,t);let n=await fetch(t);if(!n.ok)throw Error(`[loadTerrain] Failed to fetch ${t}: ${n.status} ${n.statusText}`);let r=await n.arrayBuffer();return u.debug(`Loaded terrain %s: %d bytes`,e,r.byteLength),l(r)}async function w(e){let t=m(e);return s(await(await fetch(t)).text())}export{v as a,w as c,g as d,_ as f,m as i,S as l,f as n,h as o,y as p,b as r,x as s,p as t,C as u};

View file

@ -1,4 +1,4 @@
import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{Ct as i,Gt as a,Ot as o,Wt as s,a as c,at as l,g as u,kt as d,o as f,ot as p,q as m,rt as ee,ut as h,v as g,wt as _}from"./three.module-DKAirPAO.js";import{a as v,i as y,n as te,t as b,u as x}from"./textureUtils-Bk_jPZib.js";import{a as S,c as ne,p as C}from"./loaders-B4T775qz.js";var w={directional:1,ambient:1.5};function T(e){e.uniforms.shapeDirectionalFactor={value:w.directional},e.uniforms.shapeAmbientFactor={value:w.ambient},e.fragmentShader=e.fragmentShader.replace(`#include <common>`,`#include <common>
import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";import{Ct as i,Gt as a,Ot as o,Wt as s,a as c,at as l,g as u,kt as d,o as f,ot as p,q as m,rt as ee,ut as h,v as g,wt as _}from"./three.module-DKAirPAO.js";import{a as v,i as y,n as te,t as b,u as x}from"./textureUtils-Bk_jPZib.js";import{a as S,c as ne,p as C}from"./loaders-5n1D4iOD.js";var w={directional:1,ambient:1.5};function T(e){e.uniforms.shapeDirectionalFactor={value:w.directional},e.uniforms.shapeAmbientFactor={value:w.ambient},e.fragmentShader=e.fragmentShader.replace(`#include <common>`,`#include <common>
uniform float shapeDirectionalFactor;
uniform float shapeAmbientFactor;
`),e.fragmentShader=e.fragmentShader.replace(`#include <lights_fragment_end>`,`#include <lights_fragment_end>

View file

@ -19,7 +19,7 @@
<link rel="apple-touch-icon" href="/t2-mapper/icon-512.png" />
<meta name="theme-color" content="#067272" />
<link rel="preconnect" href="https://www.gstatic.com" crossorigin />
<script type="module" crossorigin src="/t2-mapper/assets/index-BnXbiEzA.js"></script>
<script type="module" crossorigin src="/t2-mapper/assets/index-BZ0wFa-D.js"></script>
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/chunk-DECur_0Z.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/preload-helper-BPkniflS.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/logger-B058WGzf.js">
@ -36,15 +36,15 @@
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/manifest-BIDT_vSa.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/SettingsProvider-BdqQ2Cm4.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/DebugBounds-CZKrvsAw.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/loaders-B4T775qz.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/loaders-5n1D4iOD.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/cameraTourStore-CtH3IrnD.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/AudioEmitter-CJMuEzA2.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/AudioEmitter-3VHhCc7Y.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/DebugSuspense-ChOWTvws.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/textureUtils-Bk_jPZib.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/playbackUtils-DjmjN4tv.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/playbackUtils-DuS6opSR.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/useAnisotropy-D9othEmk.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/streamPlaybackStore-D5ldcfU5.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/PlayerModel-D8NLwrT8.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/PlayerModel-D6m6HpJF.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/streamHelpers-CYLk-lCT.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/iconBase-DZ3jidsI.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/JoystickContext-B2sO9eYx.js">

View file

@ -11,6 +11,7 @@
"build:manifest": "tsx --tsconfig tsconfig.node.json scripts/generate-manifest.ts -o src/manifest.json",
"build:parser": "peggy TorqueScript.pegjs -o generated/TorqueScript.js --format es",
"build": "vite build",
"build:gh-pages": "BASE_PATH=/t2-mapper/ npm run build",
"copy-public": "cpy --dot 'public/*' '!(public/docs)' docs",
"format": "prettier --write .",
"lint": "eslint .",

View file

@ -71,8 +71,8 @@ import type { PlayerEntity } from "../state/gameEntityTypes";
*/
export const playerEyePositions = new Map<string, Vector3>();
const SKIN_BASE_URL = "https://exogen.github.io/t2-skins/skins/";
const SKIN_MANIFEST_URL = "https://exogen.github.io/t2-skins/skins.json";
const SKIN_BASE_URL = "https://assets.tribes2.online/skins/files/";
const SKIN_MANIFEST_URL = "https://assets.tribes2.online/skins/manifest.json";
/** Map shape DTS name to skin texture suffix. */
const SKIN_SUFFIXES: Record<string, string> = {

View file

@ -14,9 +14,8 @@ const log = createLogger("loaders");
export type { TerrainFile };
export const BASE_URL = "/t2-mapper";
export const RESOURCE_ROOT_URL = `${BASE_URL}/base/`;
export const FALLBACK_TEXTURE_URL = `${BASE_URL}/white.png`;
export const RESOURCE_ROOT_URL = `${process.env.BASE_PATH}base/`;
export const FALLBACK_TEXTURE_URL = `${process.env.BASE_PATH}white.png`;
export function getUrlForPath(resourcePath: string, fallbackUrl?: string) {
let resourceKey;

View file

@ -7,13 +7,15 @@ export default defineConfig(({ mode }) => {
// Only expose specific env vars to the client bundle — loadEnv requires a
// prefix, so we load with each var's own prefix and pick the value out.
const allEnv = loadEnv(mode, process.cwd(), "");
const basePath = allEnv.BASE_PATH || "/";
const publicEnvKeys = ["LOG_LEVEL", "RELAY_URL"];
const define: Record<string, string> = {};
for (const key of publicEnvKeys) {
define[`process.env.${key}`] = JSON.stringify(allEnv[key] ?? "");
}
define["process.env.BASE_PATH"] = JSON.stringify(basePath);
return {
base: "/t2-mapper/",
base: basePath,
server: { port: 3000 },
define,
build: {