add reticles, more sounds, improve tours

This commit is contained in:
Brian Beck 2026-03-20 22:19:54 -07:00
parent fc51095776
commit fe90146e1e
57 changed files with 887 additions and 635 deletions

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{o as i}from"./react-three-fiber.esm-dhSWjERg.js";import{a}from"./SettingsProvider-2cUUftaX.js";import{l as o,u as s}from"./three.module-CwgFV8Kd.js";import{r as c}from"./engineStore-Cio8vU1L.js";var l=t(),u=e(n(),1),d=r(),f=(0,u.createContext)(void 0);function p(e){let t=(0,l.c)(11),{children:n}=e,r=i(g),{audioVolume:p}=a(),_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_={audioLoader:null,audioListener:null},t[0]=_):_=t[0];let[v,y]=(0,u.useState)(_),b,x;t[1]===r?(b=t[2],x=t[3]):(b=()=>{let e=new s,t=r.children.find(h);t||(t=new o,r.add(t)),y({audioLoader:e,audioListener:t});let n=()=>{let e=t.context;!e||e.state!==`suspended`||e.resume().finally(()=>{document.removeEventListener(`click`,n),document.removeEventListener(`keydown`,n),document.removeEventListener(`touchend`,n)})};document.addEventListener(`click`,n),document.addEventListener(`keydown`,n),document.addEventListener(`touchend`,n);let i=c.subscribe(m,e=>{let n=t.context;n&&(e===`paused`?n.suspend():n.state===`suspended`&&n.resume())});return()=>{document.removeEventListener(`click`,n),document.removeEventListener(`keydown`,n),document.removeEventListener(`touchend`,n),i(),t&&r.remove(t)}},x=[r],t[1]=r,t[2]=b,t[3]=x),(0,u.useEffect)(b,x);let S,C;t[4]!==v.audioListener||t[5]!==p?(S=()=>{v.audioListener?.setMasterVolume(p)},C=[p,v.audioListener],t[4]=v.audioListener,t[5]=p,t[6]=S,t[7]=C):(S=t[6],C=t[7]),(0,u.useEffect)(S,C);let w;return t[8]!==v||t[9]!==n?(w=(0,d.jsx)(f.Provider,{value:v,children:n}),t[8]=v,t[9]=n,t[10]=w):w=t[10],w}function m(e){return e.playback.status}function h(e){return e instanceof o}function g(e){return e.camera}function _(){let e=(0,u.useContext)(f);if(e===void 0)throw Error(`useAudio must be used within AudioProvider`);return e}export{_ as n,p as t}; 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{o as i}from"./react-three-fiber.esm-dhSWjERg.js";import{a}from"./SettingsProvider-xrmxG700.js";import{l as o,u as s}from"./three.module-CwgFV8Kd.js";import{r as c}from"./engineStore-Cio8vU1L.js";var l=t(),u=e(n(),1),d=r(),f=(0,u.createContext)(void 0);function p(e){let t=(0,l.c)(11),{children:n}=e,r=i(g),{audioVolume:p}=a(),_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_={audioLoader:null,audioListener:null},t[0]=_):_=t[0];let[v,y]=(0,u.useState)(_),b,x;t[1]===r?(b=t[2],x=t[3]):(b=()=>{let e=new s,t=r.children.find(h);t||(t=new o,r.add(t)),y({audioLoader:e,audioListener:t});let n=()=>{let e=t.context;!e||e.state!==`suspended`||e.resume().finally(()=>{document.removeEventListener(`click`,n),document.removeEventListener(`keydown`,n),document.removeEventListener(`touchend`,n)})};document.addEventListener(`click`,n),document.addEventListener(`keydown`,n),document.addEventListener(`touchend`,n);let i=c.subscribe(m,e=>{let n=t.context;n&&(e===`paused`?n.suspend():n.state===`suspended`&&n.resume())});return()=>{document.removeEventListener(`click`,n),document.removeEventListener(`keydown`,n),document.removeEventListener(`touchend`,n),i(),t&&r.remove(t)}},x=[r],t[1]=r,t[2]=b,t[3]=x),(0,u.useEffect)(b,x);let S,C;t[4]!==v.audioListener||t[5]!==p?(S=()=>{v.audioListener?.setMasterVolume(p)},C=[p,v.audioListener],t[4]=v.audioListener,t[5]=p,t[6]=S,t[7]=C):(S=t[6],C=t[7]),(0,u.useEffect)(S,C);let w;return t[8]!==v||t[9]!==n?(w=(0,d.jsx)(f.Provider,{value:v,children:n}),t[8]=v,t[9]=n,t[10]=w):w=t[10],w}function m(e){return e.playback.status}function h(e){return e instanceof o}function g(e){return e.camera}function _(){let e=(0,u.useContext)(f);if(e===void 0)throw Error(`useAudio must be used within AudioProvider`);return e}export{_ as n,p as t};

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{i as r,o as i}from"./react-three-fiber.esm-dhSWjERg.js";import{a,i as o}from"./SettingsProvider-2cUUftaX.js";import{t as s}from"./logger-zy3b0zcG.js";import"./traditional-BTL5qX2E.js";import{Ut as c,bt as l,c as u}from"./three.module-CwgFV8Kd.js";import"./mission-CFLOK_Oy.js";import{r as d}from"./engineStore-Cio8vU1L.js";import{r as f}from"./loaders-BRV0t4WA.js";import{n as p}from"./AudioContext-BCDmeKrq.js";import{t as m}from"./FloatingLabel-DQhfapoY.js";var h=e(t(),1),g=n(),_=s(`AudioEmitter`),v=new Map,y=new Map;function b(e,t=1){y.set(e,t)}function x(e){y.delete(e)}var S=0;function C(){return S}function w(){S++;for(let[e]of y){try{e.stop()}catch{}try{e.disconnect()}catch{}}y.clear()}d.subscribe(e=>e.playback.rate,e=>{for(let[t,n]of y)try{t.setPlaybackRate(n*e)}catch{}});function T(e,t){let n=t(e),r=n?.filename;if(!r)return null;let i=r.endsWith(`.wav`)?r:`${r}.wav`,a=n.description,o=a==null?void 0:t(a);return{filename:i,is3D:o?.is3D??!0,isLooping:o?.isLooping??!1,refDist:o?.referenceDistance??20,maxDist:o?.maxDistance??100,volume:o?.volume??1}}function E(e,t,n,r,i){let a;try{a=f(e.filename)}catch{return}let o=d.getState().playback.rate,s=S;D(a,n,n=>{if(s===S)try{if(e.is3D&&i){let a=new l(t);a.setBuffer(n),a.setDistanceModel(`inverse`),a.setRefDistance(e.refDist),a.setMaxDistance(e.maxDist),a.setRolloffFactor(1),a.setVolume(e.volume),a.setPlaybackRate(o),r&&a.position.copy(r),i.add(a),y.set(a,1),a.play(),a.source.onended=()=>{y.delete(a);try{a.disconnect()}catch{}i.remove(a)}}else{let r=new u(t);r.setBuffer(n),r.setVolume(e.volume),r.setPlaybackRate(o),y.set(r,1),r.play(),r.source.onended=()=>{y.delete(r);try{r.disconnect()}catch{}}}}catch{}})}function D(e,t,n){v.has(e)?n(v.get(e)):t.load(e,t=>{v.set(e,t),n(t)},void 0,t=>{_.error(`Audio load error %s: %o`,e,t)})}var O=(0,h.memo)(function({entity:e}){let{debugMode:t}=o(),n=e.audioFileName??``,s=e.audioVolume??1,d=e.audioMinDistance??1,_=e.audioMaxDistance??1,v=e.audioMinLoopGap??0,y=e.audioMaxLoopGap??0,b=e.audioIs3D??!0?1:0,x=e.audioIsLooping??!0,[S,C,w]=e.position??[0,0,0],T=i(e=>e.scene),E=i(e=>e.camera),{audioLoader:O,audioListener:k}=p(),{audioEnabled:A}=a(),j=(0,h.useRef)(null),M=(0,h.useRef)(null),N=(0,h.useRef)(null),P=(0,h.useRef)(!1),F=(0,h.useRef)(!1),I=(0,h.useRef)(new c(S,C,w)),L=(0,h.useRef)(0),R=()=>{M.current!=null&&(clearTimeout(M.current),M.current=null),N.current!=null&&(clearTimeout(N.current),N.current=null)},[z]=(0,h.useState)(()=>Math.random());(0,h.useEffect)(()=>{if(!O||!k)return;L.current++;let e;if(b){let t=new l(k);t.position.copy(I.current),t.setDistanceModel(`inverse`),t.setRefDistance(d),t.setMaxDistance(_),t.setRolloffFactor(1),t.setVolume(s),e=t,T.add(e)}else e=new u(k),e.setVolume(s);return j.current=e,()=>{R();try{e.stop()}catch{}try{e.disconnect()}catch{}b&&T.remove(e),j.current=null,P.current=!1,F.current=!1}},[O,k,b,d,_,s,T]);let B=(e,t)=>{if(x)if(v>0||y>0){let n=Math.max(0,v),r=Math.max(n,y),i=n===r?n:z*(r-n)+n;e.loop=!1;let a=()=>{t===L.current&&(e.isPlaying===!1?M.current=setTimeout(()=>{if(t===L.current)try{e.play(),B(e,t)}catch{}},i):N.current=setTimeout(a,100))};N.current=setTimeout(a,100)}else e.setLoop(!0)},V=(0,h.useEffectEvent)(e=>{if(!O)return;let t=L.current;if(P.current)try{e.isPlaying||(e.play(),B(e,t))}catch{}else{let r;try{r=f(n)}catch{return}D(r,O,n=>{if(t===L.current&&!e.buffer){e.setBuffer(n),P.current=!0;try{e.play(),B(e,t)}catch{}}})}});return(0,h.useEffect)(()=>{let e=j.current;!e||b||!A||!n||V(e)},[A,b,n,O,k]),r(()=>{let e=j.current;if(!e||!b||!A||!n)return;let t=E.position.distanceTo(I.current),r=F.current,i=t<=_;if(i&&!r)F.current=!0,V(e);else if(!i&&r){F.current=!1,R();try{e.stop()}catch{}}}),(0,h.useEffect)(()=>{let e=j.current;if(e&&!A){R();try{e.stop()}catch{}F.current=!1}},[A]),t?(0,g.jsxs)(`mesh`,{position:I.current,children:[(0,g.jsx)(`sphereGeometry`,{args:[d,12,12]}),(0,g.jsx)(`meshBasicMaterial`,{color:`#00ff00`,wireframe:!0,opacity:.05,transparent:!0,toneMapped:!1}),(0,g.jsx)(m,{color:`#00ff00`,position:[0,d+1,0],children:n})]}):null});export{O as AudioEmitter,v as audioBufferCache,D as getCachedAudioBuffer,C as getSoundGeneration,E as playOneShotSound,T as resolveAudioProfile,w as stopAllTrackedSounds,b as trackSound,x as untrackSound}; import{r as e}from"./chunk-DECur_0Z.js";import{r as t,t as n}from"./jsx-runtime-BpGWiA-R.js";import{i as r,o as i}from"./react-three-fiber.esm-dhSWjERg.js";import{a,i as o}from"./SettingsProvider-xrmxG700.js";import{t as s}from"./logger-z_EpIdIa.js";import"./traditional-BTL5qX2E.js";import{Ut as c,bt as l,c as u}from"./three.module-CwgFV8Kd.js";import"./mission-C2iDKeMo.js";import{r as d}from"./engineStore-Cio8vU1L.js";import{r as f}from"./loaders-0nekNxyt.js";import{n as p}from"./AudioContext-Dn9ry4KA.js";import{t as m}from"./FloatingLabel-D3hPNzZS.js";var h=e(t(),1),g=n(),_=s(`AudioEmitter`),v=new Map,y=new Map;function b(e,t=1){y.set(e,t)}function x(e){y.delete(e)}var S=0;function C(){return S}function w(){S++;for(let[e]of y){try{e.stop()}catch{}try{e.disconnect()}catch{}}y.clear()}d.subscribe(e=>e.playback.rate,e=>{for(let[t,n]of y)try{t.setPlaybackRate(n*e)}catch{}});function T(e,t){let n=t(e),r=n?.filename;if(!r)return null;let i=r.endsWith(`.wav`)?r:`${r}.wav`,a=n.description,o=a==null?void 0:t(a);return{filename:i,is3D:o?.is3D??!0,isLooping:o?.isLooping??!1,refDist:o?.referenceDistance??20,maxDist:o?.maxDistance??100,volume:o?.volume??1}}function E(e,t,n,r,i){let a;try{a=f(e.filename)}catch{return}let o=d.getState().playback.rate,s=S;D(a,n,n=>{if(s===S)try{if(e.is3D&&i){let a=new l(t);a.setBuffer(n),a.setDistanceModel(`inverse`),a.setRefDistance(e.refDist),a.setMaxDistance(e.maxDist),a.setRolloffFactor(1),a.setVolume(e.volume),a.setPlaybackRate(o),r&&a.position.copy(r),i.add(a),y.set(a,1),a.play(),a.source.onended=()=>{y.delete(a);try{a.disconnect()}catch{}i.remove(a)}}else{let r=new u(t);r.setBuffer(n),r.setVolume(e.volume),r.setPlaybackRate(o),y.set(r,1),r.play(),r.source.onended=()=>{y.delete(r);try{r.disconnect()}catch{}}}}catch{}})}function D(e,t,n){v.has(e)?n(v.get(e)):t.load(e,t=>{v.set(e,t),n(t)},void 0,t=>{_.error(`Audio load error %s: %o`,e,t)})}var O=(0,h.memo)(function({entity:e}){let{debugMode:t}=o(),n=e.audioFileName??``,s=e.audioVolume??1,d=e.audioMinDistance??1,_=e.audioMaxDistance??1,v=e.audioMinLoopGap??0,y=e.audioMaxLoopGap??0,b=e.audioIs3D??!0?1:0,x=e.audioIsLooping??!0,[S,C,w]=e.position??[0,0,0],T=i(e=>e.scene),E=i(e=>e.camera),{audioLoader:O,audioListener:k}=p(),{audioEnabled:A}=a(),j=(0,h.useRef)(null),M=(0,h.useRef)(null),N=(0,h.useRef)(null),P=(0,h.useRef)(!1),F=(0,h.useRef)(!1),I=(0,h.useRef)(new c(S,C,w)),L=(0,h.useRef)(0),R=()=>{M.current!=null&&(clearTimeout(M.current),M.current=null),N.current!=null&&(clearTimeout(N.current),N.current=null)},[z]=(0,h.useState)(()=>Math.random());(0,h.useEffect)(()=>{if(!O||!k)return;L.current++;let e;if(b){let t=new l(k);t.position.copy(I.current),t.setDistanceModel(`inverse`),t.setRefDistance(d),t.setMaxDistance(_),t.setRolloffFactor(1),t.setVolume(s),e=t,T.add(e)}else e=new u(k),e.setVolume(s);return j.current=e,()=>{R();try{e.stop()}catch{}try{e.disconnect()}catch{}b&&T.remove(e),j.current=null,P.current=!1,F.current=!1}},[O,k,b,d,_,s,T]);let B=(e,t)=>{if(x)if(v>0||y>0){let n=Math.max(0,v),r=Math.max(n,y),i=n===r?n:z*(r-n)+n;e.loop=!1;let a=()=>{t===L.current&&(e.isPlaying===!1?M.current=setTimeout(()=>{if(t===L.current)try{e.play(),B(e,t)}catch{}},i):N.current=setTimeout(a,100))};N.current=setTimeout(a,100)}else e.setLoop(!0)},V=(0,h.useEffectEvent)(e=>{if(!O)return;let t=L.current;if(P.current)try{e.isPlaying||(e.play(),B(e,t))}catch{}else{let r;try{r=f(n)}catch{return}D(r,O,n=>{if(t===L.current&&!e.buffer){e.setBuffer(n),P.current=!0;try{e.play(),B(e,t)}catch{}}})}});return(0,h.useEffect)(()=>{let e=j.current;!e||b||!A||!n||V(e)},[A,b,n,O,k]),r(()=>{let e=j.current;if(!e||!b||!A||!n)return;let t=E.position.distanceTo(I.current),r=F.current,i=t<=_;if(i&&!r)F.current=!0,V(e);else if(!i&&r){F.current=!1,R();try{e.stop()}catch{}}}),(0,h.useEffect)(()=>{let e=j.current;if(e&&!A){R();try{e.stop()}catch{}F.current=!1}},[A]),t?(0,g.jsxs)(`mesh`,{position:I.current,children:[(0,g.jsx)(`sphereGeometry`,{args:[d,12,12]}),(0,g.jsx)(`meshBasicMaterial`,{color:`#00ff00`,wireframe:!0,opacity:.05,transparent:!0,toneMapped:!1}),(0,g.jsx)(m,{color:`#00ff00`,position:[0,d+1,0],children:n})]}):null});export{O as AudioEmitter,v as audioBufferCache,D as getCachedAudioBuffer,C as getSoundGeneration,E as playOneShotSound,T as resolveAudioProfile,w as stopAllTrackedSounds,b as trackSound,x 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"./logger-zy3b0zcG.js";import"./traditional-BTL5qX2E.js";import"./streamHelpers-Be29sBCp.js";import"./scene-B1EyKjda.js";import"./mission-CFLOK_Oy.js";import{g as i}from"./index-DTbogAPB.js";var a=t(),o=e(n(),1),s={InputForm:`_InputForm_18kom_1`,Input:`_Input_18kom_1`},c=r();function l(){let e=(0,a.c)(8),[t,n]=(0,o.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"./logger-z_EpIdIa.js";import"./traditional-BTL5qX2E.js";import"./streamHelpers-Be29sBCp.js";import"./scene-C7IIl-c0.js";import"./mission-C2iDKeMo.js";import{g as i}from"./index-BMiY1uIn.js";var a=t(),o=e(n(),1),s={InputForm:`_InputForm_18kom_1`,Input:`_Input_18kom_1`},c=r();function l(){let e=(0,a.c)(8),[t,n]=(0,o.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"./react-three-fiber.esm-dhSWjERg.js";import{a as n}from"./SettingsProvider-2cUUftaX.js";import"./logger-zy3b0zcG.js";import"./traditional-BTL5qX2E.js";import{c as r}from"./three.module-CwgFV8Kd.js";import"./mission-CFLOK_Oy.js";import{i,r as a}from"./engineStore-Cio8vU1L.js";import{r as o}from"./loaders-BRV0t4WA.js";import{n as s}from"./AudioContext-BCDmeKrq.js";import"./FloatingLabel-DQhfapoY.js";import{getCachedAudioBuffer as c,getSoundGeneration as l,trackSound as u,untrackSound as d}from"./AudioEmitter-hB2GkXDk.js";var f=e(t(),1);function p(){let{audioLoader:e,audioListener:t}=s(),{audioEnabled:p}=n(),m=i(e=>e.playback.streamSnapshot?.chatMessages),h=i(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,i=_.current;for(let s of m)if(!n.has(s)&&(n.add(s),s.soundPath&&!(Math.abs(h-s.timeSec)>2)))try{let n=o(s.soundPath),f=s.soundPitch??1,p=a.getState().playback.rate,m=s.sender,h=l();c(n,e,e=>{if(h!==l())return;if(m){let e=i.get(m);if(e){try{e.stop()}catch{}d(e);try{e.disconnect()}catch{}i.delete(m)}}let n=new r(t);n.setBuffer(e),n.setPlaybackRate(f*p),u(n,f),m&&i.set(m,n),n.play(),n.source.onended=()=>{d(n);try{n.disconnect()}catch{}m&&i.get(m)===n&&i.delete(m)}})}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"./react-three-fiber.esm-dhSWjERg.js";import{a as n}from"./SettingsProvider-xrmxG700.js";import"./logger-z_EpIdIa.js";import"./traditional-BTL5qX2E.js";import{c as r}from"./three.module-CwgFV8Kd.js";import"./mission-C2iDKeMo.js";import{i,r as a}from"./engineStore-Cio8vU1L.js";import{r as o}from"./loaders-0nekNxyt.js";import{n as s}from"./AudioContext-Dn9ry4KA.js";import"./FloatingLabel-D3hPNzZS.js";import{getCachedAudioBuffer as c,getSoundGeneration as l,trackSound as u,untrackSound as d}from"./AudioEmitter-_djhBYQd.js";var f=e(t(),1);function p(){let{audioLoader:e,audioListener:t}=s(),{audioEnabled:p}=n(),m=i(e=>e.playback.streamSnapshot?.chatMessages),h=i(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,i=_.current;for(let s of m)if(!n.has(s)&&(n.add(s),s.soundPath&&!(Math.abs(h-s.timeSec)>2)))try{let n=o(s.soundPath),f=s.soundPitch??1,p=a.getState().playback.rate,m=s.sender,h=l();c(n,e,e=>{if(h!==l())return;if(m){let e=i.get(m);if(e){try{e.stop()}catch{}d(e);try{e.disconnect()}catch{}i.delete(m)}}let n=new r(t);n.setBuffer(e),n.setPlaybackRate(f*p),u(n,f),m&&i.set(m,n),n.play(),n.source.onended=()=>{d(n);try{n.disconnect()}catch{}m&&i.get(m)===n&&i.delete(m)}})}catch{}},[p,e,t,m,h]),null}export{p as ChatSoundPlayer};

View file

@ -1 +1 @@
import{r as e,t}from"./chunk-DECur_0Z.js";import{n,r,t as i}from"./jsx-runtime-BpGWiA-R.js";import{n as a,r as o}from"./react-three-fiber.esm-dhSWjERg.js";import"./traditional-BTL5qX2E.js";import{t as s}from"./Html-C_UFFta4.js";var c=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):n.Stats=r()})(e,function(){var e=function(){function t(e){return i.appendChild(e.dom),e}function n(e){for(var t=0;t<i.children.length;t++)i.children[t].style.display=t===e?`block`:`none`;r=e}var r=0,i=document.createElement(`div`);i.style.cssText=`position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000`,i.addEventListener(`click`,function(e){e.preventDefault(),n(++r%i.children.length)},!1);var a=(performance||Date).now(),o=a,s=0,c=t(new e.Panel(`FPS`,`#0ff`,`#002`)),l=t(new e.Panel(`MS`,`#0f0`,`#020`));if(self.performance&&self.performance.memory)var u=t(new e.Panel(`MB`,`#f08`,`#201`));return n(0),{REVISION:16,dom:i,addPanel:t,showPanel:n,begin:function(){a=(performance||Date).now()},end:function(){s++;var e=(performance||Date).now();if(l.update(e-a,200),e>o+1e3&&(c.update(1e3*s/(e-o),100),o=e,s=0,u)){var t=performance.memory;u.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:i,setMode:n}};return e.Panel=function(e,t,n){var r=1/0,i=0,a=Math.round,o=a(window.devicePixelRatio||1),s=80*o,c=48*o,l=3*o,u=2*o,d=3*o,f=15*o,p=74*o,m=30*o,h=document.createElement(`canvas`);h.width=s,h.height=c,h.style.cssText=`width:80px;height:48px`;var g=h.getContext(`2d`);return g.font=`bold `+9*o+`px Helvetica,Arial,sans-serif`,g.textBaseline=`top`,g.fillStyle=n,g.fillRect(0,0,s,c),g.fillStyle=t,g.fillText(e,l,u),g.fillRect(d,f,p,m),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(d,f,p,m),{dom:h,update:function(c,_){r=Math.min(r,c),i=Math.max(i,c),g.fillStyle=n,g.globalAlpha=1,g.fillRect(0,0,s,f),g.fillStyle=t,g.fillText(a(c)+` `+e+` (`+a(r)+`-`+a(i)+`)`,l,u),g.drawImage(h,d+o,f,p-o,m,d,f,p-o,m),g.fillRect(d+p-o,f,o,m),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(d+p-o,f,o,a((1-c/_)*m))}}},e})})),l=e(r());function u(e,t){typeof e==`function`?e(t):e!=null&&(e.current=t)}function d(e,t=[],n){let[r,i]=l.useState();return l.useLayoutEffect(()=>{let t=e();return i(t),u(n,t),()=>u(n,null)},t),r}var f=e(c());function p({showPanel:e=0,className:t,parent:n}){let r=d(()=>new f.default,[]);return l.useEffect(()=>{if(r){let i=n&&n.current||document.body;r.showPanel(e),i?.appendChild(r.dom);let s=(t??``).split(` `).filter(e=>e);s.length&&r.dom.classList.add(...s);let c=o(()=>r.begin()),l=a(()=>r.end());return()=>{s.length&&r.dom.classList.remove(...s),i?.removeChild(r.dom),c(),l()}}},[n,r,t,e]),null}var m=n(),h={StatsPanel:`_StatsPanel_10m5i_1`,AxisLabel:`_AxisLabel_10m5i_8`},g=i();function _(){let e=(0,m.c)(10),t=(0,l.useRef)(null),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=()=>{let e=t.current;e&&e.setColors(`rgb(153, 255, 0)`,`rgb(0, 153, 255)`,`rgb(255, 153, 0)`)},e[0]=n):n=e[0],(0,l.useEffect)(n);let r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,g.jsx)(p,{className:h.StatsPanel}),e[1]=r):r=e[1];let i;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=[70],e[2]=i):i=e[2];let a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,g.jsx)(`axesHelper`,{ref:t,args:i,renderOrder:999,children:(0,g.jsx)(`lineBasicMaterial`,{depthTest:!1,depthWrite:!1,fog:!1,vertexColors:!0})}),e[3]=a):a=e[3];let o;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=[80,0,0],e[4]=o):o=e[4];let c;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,g.jsx)(s,{position:o,center:!0,children:(0,g.jsx)(`span`,{className:h.AxisLabel,"data-axis":`y`,children:`Y`})}),e[5]=c):c=e[5];let u;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=[0,80,0],e[6]=u):u=e[6];let d;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,g.jsx)(s,{position:u,center:!0,children:(0,g.jsx)(`span`,{className:h.AxisLabel,"data-axis":`z`,children:`Z`})}),e[7]=d):d=e[7];let f;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(f=[0,0,80],e[8]=f):f=e[8];let _;return e[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,g.jsxs)(g.Fragment,{children:[r,a,c,d,(0,g.jsx)(s,{position:f,center:!0,children:(0,g.jsx)(`span`,{className:h.AxisLabel,"data-axis":`x`,children:`X`})})]}),e[9]=_):_=e[9],_}export{_ as DebugElements}; import{r as e,t}from"./chunk-DECur_0Z.js";import{n,r,t as i}from"./jsx-runtime-BpGWiA-R.js";import{n as a,r as o}from"./react-three-fiber.esm-dhSWjERg.js";import"./traditional-BTL5qX2E.js";import{t as s}from"./Html-B3dXZ0LN.js";var c=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):n.Stats=r()})(e,function(){var e=function(){function t(e){return i.appendChild(e.dom),e}function n(e){for(var t=0;t<i.children.length;t++)i.children[t].style.display=t===e?`block`:`none`;r=e}var r=0,i=document.createElement(`div`);i.style.cssText=`position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000`,i.addEventListener(`click`,function(e){e.preventDefault(),n(++r%i.children.length)},!1);var a=(performance||Date).now(),o=a,s=0,c=t(new e.Panel(`FPS`,`#0ff`,`#002`)),l=t(new e.Panel(`MS`,`#0f0`,`#020`));if(self.performance&&self.performance.memory)var u=t(new e.Panel(`MB`,`#f08`,`#201`));return n(0),{REVISION:16,dom:i,addPanel:t,showPanel:n,begin:function(){a=(performance||Date).now()},end:function(){s++;var e=(performance||Date).now();if(l.update(e-a,200),e>o+1e3&&(c.update(1e3*s/(e-o),100),o=e,s=0,u)){var t=performance.memory;u.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:i,setMode:n}};return e.Panel=function(e,t,n){var r=1/0,i=0,a=Math.round,o=a(window.devicePixelRatio||1),s=80*o,c=48*o,l=3*o,u=2*o,d=3*o,f=15*o,p=74*o,m=30*o,h=document.createElement(`canvas`);h.width=s,h.height=c,h.style.cssText=`width:80px;height:48px`;var g=h.getContext(`2d`);return g.font=`bold `+9*o+`px Helvetica,Arial,sans-serif`,g.textBaseline=`top`,g.fillStyle=n,g.fillRect(0,0,s,c),g.fillStyle=t,g.fillText(e,l,u),g.fillRect(d,f,p,m),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(d,f,p,m),{dom:h,update:function(c,_){r=Math.min(r,c),i=Math.max(i,c),g.fillStyle=n,g.globalAlpha=1,g.fillRect(0,0,s,f),g.fillStyle=t,g.fillText(a(c)+` `+e+` (`+a(r)+`-`+a(i)+`)`,l,u),g.drawImage(h,d+o,f,p-o,m,d,f,p-o,m),g.fillRect(d+p-o,f,o,m),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(d+p-o,f,o,a((1-c/_)*m))}}},e})})),l=e(r());function u(e,t){typeof e==`function`?e(t):e!=null&&(e.current=t)}function d(e,t=[],n){let[r,i]=l.useState();return l.useLayoutEffect(()=>{let t=e();return i(t),u(n,t),()=>u(n,null)},t),r}var f=e(c());function p({showPanel:e=0,className:t,parent:n}){let r=d(()=>new f.default,[]);return l.useEffect(()=>{if(r){let i=n&&n.current||document.body;r.showPanel(e),i?.appendChild(r.dom);let s=(t??``).split(` `).filter(e=>e);s.length&&r.dom.classList.add(...s);let c=o(()=>r.begin()),l=a(()=>r.end());return()=>{s.length&&r.dom.classList.remove(...s),i?.removeChild(r.dom),c(),l()}}},[n,r,t,e]),null}var m=n(),h={StatsPanel:`_StatsPanel_10m5i_1`,AxisLabel:`_AxisLabel_10m5i_8`},g=i();function _(){let e=(0,m.c)(10),t=(0,l.useRef)(null),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=()=>{let e=t.current;e&&e.setColors(`rgb(153, 255, 0)`,`rgb(0, 153, 255)`,`rgb(255, 153, 0)`)},e[0]=n):n=e[0],(0,l.useEffect)(n);let r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,g.jsx)(p,{className:h.StatsPanel}),e[1]=r):r=e[1];let i;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=[70],e[2]=i):i=e[2];let a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,g.jsx)(`axesHelper`,{ref:t,args:i,renderOrder:999,children:(0,g.jsx)(`lineBasicMaterial`,{depthTest:!1,depthWrite:!1,fog:!1,vertexColors:!0})}),e[3]=a):a=e[3];let o;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=[80,0,0],e[4]=o):o=e[4];let c;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,g.jsx)(s,{position:o,center:!0,children:(0,g.jsx)(`span`,{className:h.AxisLabel,"data-axis":`y`,children:`Y`})}),e[5]=c):c=e[5];let u;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=[0,80,0],e[6]=u):u=e[6];let d;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,g.jsx)(s,{position:u,center:!0,children:(0,g.jsx)(`span`,{className:h.AxisLabel,"data-axis":`z`,children:`Z`})}),e[7]=d):d=e[7];let f;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(f=[0,0,80],e[8]=f):f=e[8];let _;return e[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,g.jsxs)(g.Fragment,{children:[r,a,c,d,(0,g.jsx)(s,{position:f,center:!0,children:(0,g.jsx)(`span`,{className:h.AxisLabel,"data-axis":`x`,children:`X`})})]}),e[9]=_):_=e[9],_}export{_ as DebugElements};

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{t as i}from"./logger-zy3b0zcG.js";var a=t(),o=e(n(),1),s=r(),c=i(`DebugSuspense`);function l(e){let t=(0,a.c)(10),{name:n,fallback:r,children:i}=e,c=r===void 0?null:r,l;t[0]!==c||t[1]!==n?(l=(0,s.jsx)(u,{name:n,children:c}),t[0]=c,t[1]=n,t[2]=l):l=t[2];let f;t[3]===n?f=t[4]:(f=(0,s.jsx)(d,{name:n}),t[3]=n,t[4]=f);let p;return t[5]!==i||t[6]!==n||t[7]!==l||t[8]!==f?(p=(0,s.jsxs)(o.Suspense,{name:n,fallback:l,children:[f,i]}),t[5]=i,t[6]=n,t[7]=l,t[8]=f,t[9]=p):p=t[9],p}function u(e){let t=(0,a.c)(3),{name:n,children:r}=e,i,s;return t[0]===n?(i=t[1],s=t[2]):(i=()=>{c.debug(`🛑 SUSPENDED: %s`,n)},s=[n],t[0]=n,t[1]=i,t[2]=s),(0,o.useEffect)(i,s),r}function d(e){let t=(0,a.c)(3),{name:n}=e,r,i;return t[0]===n?(r=t[1],i=t[2]):(r=()=>{c.debug(`✅ RESOLVED: %s`,n)},i=[n],t[0]=n,t[1]=r,t[2]=i),(0,o.useEffect)(r,i),null}export{l as t}; 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"./logger-z_EpIdIa.js";var a=t(),o=e(n(),1),s=r(),c=i(`DebugSuspense`);function l(e){let t=(0,a.c)(10),{name:n,fallback:r,children:i}=e,c=r===void 0?null:r,l;t[0]!==c||t[1]!==n?(l=(0,s.jsx)(u,{name:n,children:c}),t[0]=c,t[1]=n,t[2]=l):l=t[2];let f;t[3]===n?f=t[4]:(f=(0,s.jsx)(d,{name:n}),t[3]=n,t[4]=f);let p;return t[5]!==i||t[6]!==n||t[7]!==l||t[8]!==f?(p=(0,s.jsxs)(o.Suspense,{name:n,fallback:l,children:[f,i]}),t[5]=i,t[6]=n,t[7]=l,t[8]=f,t[9]=p):p=t[9],p}function u(e){let t=(0,a.c)(3),{name:n,children:r}=e,i,s;return t[0]===n?(i=t[1],s=t[2]):(i=()=>{c.debug(`🛑 SUSPENDED: %s`,n)},s=[n],t[0]=n,t[1]=i,t[2]=s),(0,o.useEffect)(i,s),r}function d(e){let t=(0,a.c)(3),{name:n}=e,r,i;return t[0]===n?(r=t[1],i=t[2]):(r=()=>{c.debug(`✅ RESOLVED: %s`,n)},i=[n],t[0]=n,t[1]=r,t[2]=i),(0,o.useEffect)(r,i),null}export{l as t};

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"./traditional-BTL5qX2E.js";import"./engineStore-Cio8vU1L.js";import{d as i,f as a,h as o,m as s,p as c,u as l}from"./index-DTbogAPB.js";var u=t(),d=e(n(),1),f={Root:`_Root_16j0q_1`,PlayPause:`_PlayPause_16j0q_10`,Time:`_Time_16j0q_32`,Seek:`_Seek_16j0q_38`,Speed:`_Speed_16j0q_44`},p=r(),m=[.25,.5,1,2,4];function h(e){return`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,`0`)}`}function g(){let e=(0,u.c)(33),t=s(),n=a(),r=l(),g=i(),x=o(),{play:S,pause:C,seek:w,setSpeed:T}=c(),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,d.useEffect)(E,D);let O;e[6]===w?O=e[7]:(O=e=>{w(parseFloat(e.target.value))},e[6]=w,e[7]=O);let k=O,A;e[8]===T?A=e[9]:(A=e=>{T(parseFloat(e.target.value))},e[8]=T,e[9]=A);let j=A;if(!t||!Number.isFinite(t.duration))return null;let M=n?C:S,N=n?`Pause`:`Play`,P=n?`❚❚`:``,F;e[10]!==M||e[11]!==N||e[12]!==P?(F=(0,p.jsx)(`button`,{className:f.PlayPause,onClick:M,"aria-label":N,autoFocus:!0,children:P}),e[10]=M,e[11]=N,e[12]=P,e[13]=F):F=e[13];let I;e[14]===r?I=e[15]:(I=h(r),e[14]=r,e[15]=I);let L;e[16]===g?L=e[17]:(L=h(g),e[16]=g,e[17]=L);let R=`${I} / ${L}`,z;e[18]===R?z=e[19]:(z=(0,p.jsx)(`span`,{className:f.Time,children:R}),e[18]=R,e[19]=z);let B;e[20]!==r||e[21]!==g||e[22]!==k?(B=(0,p.jsx)(`input`,{className:f.Seek,type:`range`,min:0,max:g,step:.01,value:r,onChange:k}),e[20]=r,e[21]=g,e[22]=k,e[23]=B):B=e[23];let V;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(V=m.map(_),e[24]=V):V=e[24];let H;e[25]!==j||e[26]!==x?(H=(0,p.jsx)(`select`,{className:f.Speed,value:x,onChange:j,children:V}),e[25]=j,e[26]=x,e[27]=H):H=e[27];let U;return e[28]!==z||e[29]!==B||e[30]!==H||e[31]!==F?(U=(0,p.jsxs)(`div`,{className:f.Root,onKeyDown:b,onPointerDown:y,onClick:v,children:[F,z,B,H]}),e[28]=z,e[29]=B,e[30]=H,e[31]=F,e[32]=U):U=e[32],U}function _(e){return(0,p.jsxs)(`option`,{value:e,children:[e,`x`]},e)}function v(e){return e.stopPropagation()}function y(e){return e.stopPropagation()}function b(e){return e.stopPropagation()}export{g 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"./traditional-BTL5qX2E.js";import"./engineStore-Cio8vU1L.js";import{d as i,f as a,h as o,m as s,p as c,u as l}from"./index-BMiY1uIn.js";var u=t(),d=e(n(),1),f={Root:`_Root_16j0q_1`,PlayPause:`_PlayPause_16j0q_10`,Time:`_Time_16j0q_32`,Seek:`_Seek_16j0q_38`,Speed:`_Speed_16j0q_44`},p=r(),m=[.25,.5,1,2,4];function h(e){return`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,`0`)}`}function g(){let e=(0,u.c)(33),t=s(),n=a(),r=l(),g=i(),x=o(),{play:S,pause:C,seek:w,setSpeed:T}=c(),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,d.useEffect)(E,D);let O;e[6]===w?O=e[7]:(O=e=>{w(parseFloat(e.target.value))},e[6]=w,e[7]=O);let k=O,A;e[8]===T?A=e[9]:(A=e=>{T(parseFloat(e.target.value))},e[8]=T,e[9]=A);let j=A;if(!t||!Number.isFinite(t.duration))return null;let M=n?C:S,N=n?`Pause`:`Play`,P=n?`❚❚`:``,F;e[10]!==M||e[11]!==N||e[12]!==P?(F=(0,p.jsx)(`button`,{className:f.PlayPause,onClick:M,"aria-label":N,autoFocus:!0,children:P}),e[10]=M,e[11]=N,e[12]=P,e[13]=F):F=e[13];let I;e[14]===r?I=e[15]:(I=h(r),e[14]=r,e[15]=I);let L;e[16]===g?L=e[17]:(L=h(g),e[16]=g,e[17]=L);let R=`${I} / ${L}`,z;e[18]===R?z=e[19]:(z=(0,p.jsx)(`span`,{className:f.Time,children:R}),e[18]=R,e[19]=z);let B;e[20]!==r||e[21]!==g||e[22]!==k?(B=(0,p.jsx)(`input`,{className:f.Seek,type:`range`,min:0,max:g,step:.01,value:r,onChange:k}),e[20]=r,e[21]=g,e[22]=k,e[23]=B):B=e[23];let V;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(V=m.map(_),e[24]=V):V=e[24];let H;e[25]!==j||e[26]!==x?(H=(0,p.jsx)(`select`,{className:f.Speed,value:x,onChange:j,children:V}),e[25]=j,e[26]=x,e[27]=H):H=e[27];let U;return e[28]!==z||e[29]!==B||e[30]!==H||e[31]!==F?(U=(0,p.jsxs)(`div`,{className:f.Root,onKeyDown:b,onPointerDown:y,onClick:v,children:[F,z,B,H]}),e[28]=z,e[29]=B,e[30]=H,e[31]=F,e[32]=U):U=e[32],U}function _(e){return(0,p.jsxs)(`option`,{value:e,children:[e,`x`]},e)}function v(e){return e.stopPropagation()}function y(e){return e.stopPropagation()}function b(e){return e.stopPropagation()}export{g as DemoPlaybackControls};

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{i}from"./react-three-fiber.esm-dhSWjERg.js";import{Ut as a}from"./three.module-CwgFV8Kd.js";import{t as o}from"./Html-C_UFFta4.js";var s={Label:`_Label_8rn2m_1`},c=t(),l=e(n(),1),u=r(),d=[0,0,0],f=new a;function p(e,t,n,r){let i=e.matrixWorld.elements;return(t-i[12])*-i[8]+(n-i[13])*-i[9]+(r-i[14])*-i[10]<0}var m=(0,l.memo)(function(e){let t=(0,c.c)(11),{children:n,color:r,position:a,opacity:m}=e,h=r===void 0?`white`:r,g=a===void 0?d:a,_=m===void 0?`fadeWithDistance`:m,v=_===`fadeWithDistance`,y=(0,l.useRef)(null),[b,x]=(0,l.useState)(_!==0),S=(0,l.useRef)(null),C;t[0]!==v||t[1]!==b||t[2]!==_?(C=e=>{let{camera:t}=e,n=y.current;if(!n)return;n.getWorldPosition(f);let r=p(t,f.x,f.y,f.z);if(v){let e=r?1/0:t.position.distanceTo(f),n=e<200;if(b!==n&&x(n),S.current&&n){let t=Math.max(0,Math.min(1,1-e/200));S.current.style.opacity=t.toString()}}else{let e=!r&&_!==0;b!==e&&x(e),S.current&&(S.current.style.opacity=_.toString())}},t[0]=v,t[1]=b,t[2]=_,t[3]=C):C=t[3],i(C);let w;t[4]!==n||t[5]!==h||t[6]!==b||t[7]!==g?(w=b?(0,u.jsx)(o,{position:g,center:!0,children:(0,u.jsx)(`div`,{ref:S,className:s.Label,style:{color:h},children:n})}):null,t[4]=n,t[5]=h,t[6]=b,t[7]=g,t[8]=w):w=t[8];let T;return t[9]===w?T=t[10]:(T=(0,u.jsx)(`group`,{ref:y,children:w}),t[9]=w,t[10]=T),T});export{m as t}; 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{i}from"./react-three-fiber.esm-dhSWjERg.js";import{Ut as a}from"./three.module-CwgFV8Kd.js";import{t as o}from"./Html-B3dXZ0LN.js";var s={Label:`_Label_8rn2m_1`},c=t(),l=e(n(),1),u=r(),d=[0,0,0],f=new a;function p(e,t,n,r){let i=e.matrixWorld.elements;return(t-i[12])*-i[8]+(n-i[13])*-i[9]+(r-i[14])*-i[10]<0}var m=(0,l.memo)(function(e){let t=(0,c.c)(11),{children:n,color:r,position:a,opacity:m}=e,h=r===void 0?`white`:r,g=a===void 0?d:a,_=m===void 0?`fadeWithDistance`:m,v=_===`fadeWithDistance`,y=(0,l.useRef)(null),[b,x]=(0,l.useState)(_!==0),S=(0,l.useRef)(null),C;t[0]!==v||t[1]!==b||t[2]!==_?(C=e=>{let{camera:t}=e,n=y.current;if(!n)return;n.getWorldPosition(f);let r=p(t,f.x,f.y,f.z);if(v){let e=r?1/0:t.position.distanceTo(f),n=e<200;if(b!==n&&x(n),S.current&&n){let t=Math.max(0,Math.min(1,1-e/200));S.current.style.opacity=t.toString()}}else{let e=!r&&_!==0;b!==e&&x(e),S.current&&(S.current.style.opacity=_.toString())}},t[0]=v,t[1]=b,t[2]=_,t[3]=C):C=t[3],i(C);let w;t[4]!==n||t[5]!==h||t[6]!==b||t[7]!==g?(w=b?(0,u.jsx)(o,{position:g,center:!0,children:(0,u.jsx)(`div`,{ref:S,className:s.Label,style:{color:h},children:n})}):null,t[4]=n,t[5]=h,t[6]=b,t[7]=g,t[8]=w):w=t[8];let T;return t[9]===w?T=t[10]:(T=(0,u.jsx)(`group`,{ref:y,children:w}),t[9]=w,t[10]=T),T});export{m as t};

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{i}from"./react-three-fiber.esm-dhSWjERg.js";import{a}from"./SettingsProvider-2cUUftaX.js";import"./logger-zy3b0zcG.js";import"./traditional-BTL5qX2E.js";import{At as o,Dt as s,Ht as c,b as l,p as u}from"./three.module-CwgFV8Kd.js";import"./mission-CFLOK_Oy.js";import{t as d}from"./Texture-CUOilM1U.js";import{p as f}from"./loaders-BRV0t4WA.js";import{t as p}from"./DebugSuspense-qtqhYC4y.js";var m=t(),h=e(n(),1),g=` 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{i}from"./react-three-fiber.esm-dhSWjERg.js";import{a}from"./SettingsProvider-xrmxG700.js";import"./logger-z_EpIdIa.js";import"./traditional-BTL5qX2E.js";import{At as o,Dt as s,Ht as c,b as l,p as u}from"./three.module-CwgFV8Kd.js";import"./mission-C2iDKeMo.js";import{t as d}from"./Texture-CUOilM1U.js";import{p as f}from"./loaders-0nekNxyt.js";import{t as p}from"./DebugSuspense-evFO3StN.js";var m=t(),h=e(n(),1),g=`
#include <fog_pars_vertex> #include <fog_pars_vertex>
varying vec2 vUv; 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

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,t}from"./jsx-runtime-BpGWiA-R.js";import"./logger-zy3b0zcG.js";import"./traditional-BTL5qX2E.js";import"./streamHelpers-Be29sBCp.js";import"./scene-B1EyKjda.js";import"./mission-CFLOK_Oy.js";import"./engineStore-Cio8vU1L.js";import{_ as n,m as r,s as i}from"./index-DTbogAPB.js";var a=e(),o={Root:`_Root_uktvs_1`,Column:`_Column_uktvs_13`,Row:`_Row_uktvs_20`,Spacer:`_Spacer_uktvs_26`,Key:`_Key_uktvs_30`,Arrow:`_Arrow_uktvs_53`},s=t();function c(){let e=(0,a.c)(51),t=r(),c=n(y),b=i(v),x=i(_),S=i(g),C=i(h),w=i(m),T=i(p),E=i(f),D=i(d),O=i(u),k=i(l);if(t&&t.source!==`live`||t?.source===`live`&&!c)return null;let A;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,s.jsx)(`div`,{className:o.Spacer}),e[0]=A):A=e[0];let j;e[1]===b?j=e[2]:(j=(0,s.jsx)(`div`,{className:o.Key,"data-pressed":b,children:`W`}),e[1]=b,e[2]=j);let M;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,s.jsx)(`div`,{className:o.Spacer}),e[3]=M):M=e[3];let N;e[4]===j?N=e[5]:(N=(0,s.jsxs)(`div`,{className:o.Row,children:[A,j,M]}),e[4]=j,e[5]=N);let P;e[6]===S?P=e[7]:(P=(0,s.jsx)(`div`,{className:o.Key,"data-pressed":S,children:`A`}),e[6]=S,e[7]=P);let F;e[8]===x?F=e[9]:(F=(0,s.jsx)(`div`,{className:o.Key,"data-pressed":x,children:`S`}),e[8]=x,e[9]=F);let I;e[10]===C?I=e[11]:(I=(0,s.jsx)(`div`,{className:o.Key,"data-pressed":C,children:`D`}),e[10]=C,e[11]=I);let L;e[12]!==P||e[13]!==F||e[14]!==I?(L=(0,s.jsxs)(`div`,{className:o.Row,children:[P,F,I]}),e[12]=P,e[13]=F,e[14]=I,e[15]=L):L=e[15];let R;e[16]!==N||e[17]!==L?(R=(0,s.jsxs)(`div`,{className:o.Column,children:[N,L]}),e[16]=N,e[17]=L,e[18]=R):R=e[18];let z;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,s.jsx)(`span`,{className:o.Arrow,children:``}),e[19]=z):z=e[19];let B;e[20]===w?B=e[21]:(B=(0,s.jsx)(`div`,{className:o.Row,children:(0,s.jsxs)(`div`,{className:o.Key,"data-pressed":w,children:[z,` Space`]})}),e[20]=w,e[21]=B);let V;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,s.jsx)(`span`,{className:o.Arrow,children:``}),e[22]=V):V=e[22];let H;e[23]===T?H=e[24]:(H=(0,s.jsx)(`div`,{className:o.Row,children:(0,s.jsxs)(`div`,{className:o.Key,"data-pressed":T,children:[V,` Shift`]})}),e[23]=T,e[24]=H);let U;e[25]!==B||e[26]!==H?(U=(0,s.jsxs)(`div`,{className:o.Column,children:[B,H]}),e[25]=B,e[26]=H,e[27]=U):U=e[27];let W;e[28]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,s.jsx)(`div`,{className:o.Spacer}),e[28]=W):W=e[28];let G;e[29]===E?G=e[30]:(G=(0,s.jsx)(`div`,{className:o.Key,"data-pressed":E,children:``}),e[29]=E,e[30]=G);let K;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,s.jsx)(`div`,{className:o.Spacer}),e[31]=K):K=e[31];let q;e[32]===G?q=e[33]:(q=(0,s.jsxs)(`div`,{className:o.Row,children:[W,G,K]}),e[32]=G,e[33]=q);let J;e[34]===O?J=e[35]:(J=(0,s.jsx)(`div`,{className:o.Key,"data-pressed":O,children:``}),e[34]=O,e[35]=J);let Y;e[36]===D?Y=e[37]:(Y=(0,s.jsx)(`div`,{className:o.Key,"data-pressed":D,children:``}),e[36]=D,e[37]=Y);let X;e[38]===k?X=e[39]:(X=(0,s.jsx)(`div`,{className:o.Key,"data-pressed":k,children:``}),e[38]=k,e[39]=X);let Z;e[40]!==J||e[41]!==Y||e[42]!==X?(Z=(0,s.jsxs)(`div`,{className:o.Row,children:[J,Y,X]}),e[40]=J,e[41]=Y,e[42]=X,e[43]=Z):Z=e[43];let Q;e[44]!==q||e[45]!==Z?(Q=(0,s.jsxs)(`div`,{className:o.Column,children:[q,Z]}),e[44]=q,e[45]=Z,e[46]=Q):Q=e[46];let $;return e[47]!==U||e[48]!==Q||e[49]!==R?($=(0,s.jsxs)(`div`,{className:o.Root,children:[R,U,Q]}),e[47]=U,e[48]=Q,e[49]=R,e[50]=$):$=e[50],$}function l(e){return e.lookRight}function u(e){return e.lookLeft}function d(e){return e.lookDown}function f(e){return e.lookUp}function p(e){return e.down}function m(e){return e.up}function h(e){return e.right}function g(e){return e.left}function _(e){return e.backward}function v(e){return e.forward}function y(e){return e.liveReady}export{c as KeyboardOverlay}; import{n as e,t}from"./jsx-runtime-BpGWiA-R.js";import"./logger-z_EpIdIa.js";import"./traditional-BTL5qX2E.js";import"./streamHelpers-Be29sBCp.js";import"./scene-C7IIl-c0.js";import"./mission-C2iDKeMo.js";import"./engineStore-Cio8vU1L.js";import{_ as n,m as r,s as i}from"./index-BMiY1uIn.js";var a=e(),o={Root:`_Root_uktvs_1`,Column:`_Column_uktvs_13`,Row:`_Row_uktvs_20`,Spacer:`_Spacer_uktvs_26`,Key:`_Key_uktvs_30`,Arrow:`_Arrow_uktvs_53`},s=t();function c(){let e=(0,a.c)(51),t=r(),c=n(y),b=i(v),x=i(_),S=i(g),C=i(h),w=i(m),T=i(p),E=i(f),D=i(d),O=i(u),k=i(l);if(t&&t.source!==`live`||t?.source===`live`&&!c)return null;let A;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,s.jsx)(`div`,{className:o.Spacer}),e[0]=A):A=e[0];let j;e[1]===b?j=e[2]:(j=(0,s.jsx)(`div`,{className:o.Key,"data-pressed":b,children:`W`}),e[1]=b,e[2]=j);let M;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,s.jsx)(`div`,{className:o.Spacer}),e[3]=M):M=e[3];let N;e[4]===j?N=e[5]:(N=(0,s.jsxs)(`div`,{className:o.Row,children:[A,j,M]}),e[4]=j,e[5]=N);let P;e[6]===S?P=e[7]:(P=(0,s.jsx)(`div`,{className:o.Key,"data-pressed":S,children:`A`}),e[6]=S,e[7]=P);let F;e[8]===x?F=e[9]:(F=(0,s.jsx)(`div`,{className:o.Key,"data-pressed":x,children:`S`}),e[8]=x,e[9]=F);let I;e[10]===C?I=e[11]:(I=(0,s.jsx)(`div`,{className:o.Key,"data-pressed":C,children:`D`}),e[10]=C,e[11]=I);let L;e[12]!==P||e[13]!==F||e[14]!==I?(L=(0,s.jsxs)(`div`,{className:o.Row,children:[P,F,I]}),e[12]=P,e[13]=F,e[14]=I,e[15]=L):L=e[15];let R;e[16]!==N||e[17]!==L?(R=(0,s.jsxs)(`div`,{className:o.Column,children:[N,L]}),e[16]=N,e[17]=L,e[18]=R):R=e[18];let z;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,s.jsx)(`span`,{className:o.Arrow,children:``}),e[19]=z):z=e[19];let B;e[20]===w?B=e[21]:(B=(0,s.jsx)(`div`,{className:o.Row,children:(0,s.jsxs)(`div`,{className:o.Key,"data-pressed":w,children:[z,` Space`]})}),e[20]=w,e[21]=B);let V;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,s.jsx)(`span`,{className:o.Arrow,children:``}),e[22]=V):V=e[22];let H;e[23]===T?H=e[24]:(H=(0,s.jsx)(`div`,{className:o.Row,children:(0,s.jsxs)(`div`,{className:o.Key,"data-pressed":T,children:[V,` Shift`]})}),e[23]=T,e[24]=H);let U;e[25]!==B||e[26]!==H?(U=(0,s.jsxs)(`div`,{className:o.Column,children:[B,H]}),e[25]=B,e[26]=H,e[27]=U):U=e[27];let W;e[28]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,s.jsx)(`div`,{className:o.Spacer}),e[28]=W):W=e[28];let G;e[29]===E?G=e[30]:(G=(0,s.jsx)(`div`,{className:o.Key,"data-pressed":E,children:``}),e[29]=E,e[30]=G);let K;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,s.jsx)(`div`,{className:o.Spacer}),e[31]=K):K=e[31];let q;e[32]===G?q=e[33]:(q=(0,s.jsxs)(`div`,{className:o.Row,children:[W,G,K]}),e[32]=G,e[33]=q);let J;e[34]===O?J=e[35]:(J=(0,s.jsx)(`div`,{className:o.Key,"data-pressed":O,children:``}),e[34]=O,e[35]=J);let Y;e[36]===D?Y=e[37]:(Y=(0,s.jsx)(`div`,{className:o.Key,"data-pressed":D,children:``}),e[36]=D,e[37]=Y);let X;e[38]===k?X=e[39]:(X=(0,s.jsx)(`div`,{className:o.Key,"data-pressed":k,children:``}),e[38]=k,e[39]=X);let Z;e[40]!==J||e[41]!==Y||e[42]!==X?(Z=(0,s.jsxs)(`div`,{className:o.Row,children:[J,Y,X]}),e[40]=J,e[41]=Y,e[42]=X,e[43]=Z):Z=e[43];let Q;e[44]!==q||e[45]!==Z?(Q=(0,s.jsxs)(`div`,{className:o.Column,children:[q,Z]}),e[44]=q,e[45]=Z,e[46]=Q):Q=e[46];let $;return e[47]!==U||e[48]!==Q||e[49]!==R?($=(0,s.jsxs)(`div`,{className:o.Root,children:[R,U,Q]}),e[47]=U,e[48]=Q,e[49]=R,e[50]=$):$=e[50],$}function l(e){return e.lookRight}function u(e){return e.lookLeft}function d(e){return e.lookDown}function f(e){return e.lookUp}function p(e){return e.down}function m(e){return e.up}function h(e){return e.right}function g(e){return e.left}function _(e){return e.backward}function v(e){return e.forward}function y(e){return e.liveReady}export{c as KeyboardOverlay};

View file

@ -1,5 +1,5 @@
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-DIe1NTM1.js";import{c as a}from"./manifest-CmJ-OiDc.js";import"./logger-zy3b0zcG.js";import"./mission-CFLOK_Oy.js";import{E as o,T as s}from"./index-DTbogAPB.js";import{i as c,l,n as u}from"./loaders-BRV0t4WA.js";var d=t(),f=e(n(),1),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 f.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 f.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=c(a(`textures/gui/${e}`))}catch{t=null}return b.set(e,t),t}function S(e){let t=(0,d.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-BgNfxBEt.js";import{c as a}from"./manifest-CirqV3Ls.js";import"./logger-z_EpIdIa.js";import"./mission-C2iDKeMo.js";import{D as o,O as s}from"./index-BMiY1uIn.js";import{i as c,l,n as u}from"./loaders-0nekNxyt.js";var d=t(),f=e(n(),1),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 f.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 f.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=c(a(`textures/gui/${e}`))}catch{t=null}return b.set(e,t),t}function S(e){let t=(0,d.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(` `).flatMap(e=>{let t=e.match(/^\[([^\]]+)\]/);return t&&!t[1].toUpperCase().split(/\s+/).includes(n)?[]:[e.replace(/^\[[^\]]+\]/,``)]}).join(`
`)}function E(e){let t=(0,d.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_6c89x_1`,Overlay:`_Overlay_tbn5d_10 _Overlay_6c89x_20`,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_6c89x_31`,Hint:`_Hint_tbn5d_162`,MusicTrackName:`_MusicTrackName_tbn5d_168`};function ee(e){let t=(0,d.c)(2),n;return t[0]===e?n=t[1]:(n={queryKey:[`parsedMission`,e],queryFn:()=>l(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 c(a(`textures/gui/${e}`))}catch{}try{return c(a(`textures/gui/Load_${t}`))}catch{}return null}function re(e){let t=(0,d.c)(7),{src:n,alt:r,className:i}=e,a=i===void 0?D.PreviewImage:i,[o,s]=(0,f.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,f.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,d.c)(22),{track:n}=e,[r,i]=(0,f.useState)(!1),[a,c]=(0,f.useState)(!0),l=(0,f.useRef)(null),p;t[0]===n?p=t[1]:(p=n.toLowerCase(),t[0]=n,t[1]=p);let h=`${u}music/${p}.mp3`,g,_;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{let e=l.current;if(e)return()=>{e.pause()}},_=[],t[2]=g,t[3]=_):(g=t[2],_=t[3]),(0,f.useEffect)(g,_);let v;t[4]===r?v=t[5]:(v=()=>{let e=l.current;e&&(r?e.pause():e.play().catch(()=>c(!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=()=>c(!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:l,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)(o,{}):(0,m.jsx)(s,{})}),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,d.c)(100),{onClose:n,missionName:r,missionType:i}=e,{data:a}=ee(r),o=(0,f.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,f.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,f.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(` `)}function E(e){let t=(0,d.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_6c89x_1`,Overlay:`_Overlay_tbn5d_10 _Overlay_6c89x_20`,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_6c89x_31`,Hint:`_Hint_tbn5d_162`,MusicTrackName:`_MusicTrackName_tbn5d_168`};function ee(e){let t=(0,d.c)(2),n;return t[0]===e?n=t[1]:(n={queryKey:[`parsedMission`,e],queryFn:()=>l(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 c(a(`textures/gui/${e}`))}catch{}try{return c(a(`textures/gui/Load_${t}`))}catch{}return null}function re(e){let t=(0,d.c)(7),{src:n,alt:r,className:i}=e,a=i===void 0?D.PreviewImage:i,[o,s]=(0,f.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,f.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,d.c)(22),{track:n}=e,[r,i]=(0,f.useState)(!1),[a,c]=(0,f.useState)(!0),l=(0,f.useRef)(null),p;t[0]===n?p=t[1]:(p=n.toLowerCase(),t[0]=n,t[1]=p);let h=`${u}music/${p}.mp3`,g,_;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{let e=l.current;if(e)return()=>{e.pause()}},_=[],t[2]=g,t[3]=_):(g=t[2],_=t[3]),(0,f.useEffect)(g,_);let v;t[4]===r?v=t[5]:(v=()=>{let e=l.current;e&&(r?e.pause():e.play().catch(()=>c(!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=()=>c(!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:l,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)(s,{}):(0,m.jsx)(o,{})}),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,d.c)(100),{onClose:n,missionName:r,missionType:i}=e,{data:a}=ee(r),o=(0,f.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,f.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,f.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?` `)){let t=e.trim();t.match(/^--[^-]/)?r=t.replace(/^-+\s*/,``).trim():t&&(c+=(c?`
`:``)+t)}t[36]=a?.missionQuote,t[37]=r,t[38]=s,t[39]=c,t[40]=l}else r=t[37],s=t[38],c=t[39],l=t[40];B=D.Overlay,V=n,M=o,N=D.Dialog,P=oe,F=ae,I=`dialog`,L=`true`,R=`Map Information`,z=-1,j=D.Body,H=D.Left,t[41]!==_||t[42]!==v||t[43]!==b?(U=_&&b&&(0,m.jsx)(re,{className:D.PreviewImageFloating,src:_,alt:`${v} preview`},_),t[41]=_,t[42]=v,t[43]=b,t[44]=U):U=t[44],t[45]===v?S=t[46]:(S=(0,m.jsx)(`h1`,{className:D.Title,children:v}),t[45]=v,t[46]=S);let u;t[47]===a?u=t[48]:(u=a?.planetName&&(0,m.jsx)(`span`,{className:D.MapPlanet,children:a.planetName}),t[47]=a,t[48]=u),t[49]===u?C=t[50]:(C=(0,m.jsx)(`div`,{className:D.MapMeta,children:u}),t[49]=u,t[50]=C),t[51]!==r||t[52]!==s||t[53]!==c||t[54]!==l?(O=s?(0,m.jsx)(`blockquote`,{className:D.MapQuote,children:(0,m.jsx)(E,{markup:l})}):c?(0,m.jsxs)(`blockquote`,{className:D.MapQuote,children:[(0,m.jsx)(`p`,{children:c}),r&&(0,m.jsxs)(`cite`,{children:[` `,r]})]}):null,t[51]=r,t[52]=s,t[53]=c,t[54]=l,t[55]=O):O=t[55],t[56]===a?k=t[57]:(k=a?.missionBlurb&&(0,m.jsx)(`div`,{className:D.MapBlurb,children:w(a.missionBlurb)?(0,m.jsx)(E,{markup:a.missionBlurb.trim()}):a.missionBlurb.trim()}),t[56]=a,t[57]=k),A=e&&e.trim()&&(0,m.jsx)(`div`,{className:D.Section,children:(0,m.jsx)(E,{markup:e})}),t[12]=_,t[13]=v,t[14]=b,t[15]=i,t[16]=n,t[17]=a,t[18]=S,t[19]=C,t[20]=O,t[21]=k,t[22]=A,t[23]=j,t[24]=M,t[25]=N,t[26]=P,t[27]=F,t[28]=I,t[29]=L,t[30]=R,t[31]=z,t[32]=B,t[33]=V,t[34]=H,t[35]=U}else S=t[18],C=t[19],O=t[20],k=t[21],A=t[22],j=t[23],M=t[24],N=t[25],P=t[26],F=t[27],I=t[28],L=t[29],R=t[30],z=t[31],B=t[32],V=t[33],H=t[34],U=t[35];let W;t[58]===a?W=t[59]:(W=a?.missionBriefing&&(0,m.jsxs)(`div`,{className:D.Section,children:[(0,m.jsx)(`h2`,{className:D.SectionTitle,children:`Mission Briefing`}),(0,m.jsx)(E,{markup:a.missionBriefing})]}),t[58]=a,t[59]=W);let G;t[60]===x?G=t[61]:(G=x&&(0,m.jsx)(ie,{track:x}),t[60]=x,t[61]=G);let K;t[62]!==S||t[63]!==C||t[64]!==O||t[65]!==k||t[66]!==A||t[67]!==W||t[68]!==G||t[69]!==H||t[70]!==U?(K=(0,m.jsxs)(`div`,{className:H,children:[U,S,C,O,k,A,W,G]}),t[62]=S,t[63]=C,t[64]=O,t[65]=k,t[66]=A,t[67]=W,t[68]=G,t[69]=H,t[70]=U,t[71]=K):K=t[71];let q;t[72]!==_||t[73]!==v||t[74]!==b?(q=_&&!b&&(0,m.jsx)(re,{src:_,alt:`${v} preview`},_),t[72]=_,t[73]=v,t[74]=b,t[75]=q):q=t[75];let J;t[76]!==j||t[77]!==K||t[78]!==q?(J=(0,m.jsxs)(`div`,{className:j,children:[K,q]}),t[76]=j,t[77]=K,t[78]=q,t[79]=J):J=t[79];let Y;t[80]===n?Y=t[81]:(Y=(0,m.jsx)(`button`,{className:D.CloseButton,onClick:n,children:`Close`}),t[80]=n,t[81]=Y);let X;t[82]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,m.jsx)(`span`,{className:D.Hint,children:`Esc to close`}),t[82]=X):X=t[82];let Z;t[83]===Y?Z=t[84]:(Z=(0,m.jsxs)(`div`,{className:D.Footer,children:[Y,X]}),t[83]=Y,t[84]=Z);let Q;t[85]!==M||t[86]!==N||t[87]!==P||t[88]!==F||t[89]!==I||t[90]!==L||t[91]!==R||t[92]!==z||t[93]!==J||t[94]!==Z?(Q=(0,m.jsxs)(`div`,{ref:M,className:N,onClick:P,onKeyDown:F,role:I,"aria-modal":L,"aria-label":R,tabIndex:z,children:[J,Z]}),t[85]=M,t[86]=N,t[87]=P,t[88]=F,t[89]=I,t[90]=L,t[91]=R,t[92]=z,t[93]=J,t[94]=Z,t[95]=Q):Q=t[95];let $;return t[96]!==B||t[97]!==V||t[98]!==Q?($=(0,m.jsx)(`div`,{className:B,onClick:V,children:Q}),t[96]=B,t[97]=V,t[98]=Q,t[99]=$):$=t[99],$}function ae(e){return e.stopPropagation()}function oe(e){return e.stopPropagation()}function se(e){e.stopImmediatePropagation()}export{M as MapInfoDialog}; `:``)+t)}t[36]=a?.missionQuote,t[37]=r,t[38]=s,t[39]=c,t[40]=l}else r=t[37],s=t[38],c=t[39],l=t[40];B=D.Overlay,V=n,M=o,N=D.Dialog,P=oe,F=ae,I=`dialog`,L=`true`,R=`Map Information`,z=-1,j=D.Body,H=D.Left,t[41]!==_||t[42]!==v||t[43]!==b?(U=_&&b&&(0,m.jsx)(re,{className:D.PreviewImageFloating,src:_,alt:`${v} preview`},_),t[41]=_,t[42]=v,t[43]=b,t[44]=U):U=t[44],t[45]===v?S=t[46]:(S=(0,m.jsx)(`h1`,{className:D.Title,children:v}),t[45]=v,t[46]=S);let u;t[47]===a?u=t[48]:(u=a?.planetName&&(0,m.jsx)(`span`,{className:D.MapPlanet,children:a.planetName}),t[47]=a,t[48]=u),t[49]===u?C=t[50]:(C=(0,m.jsx)(`div`,{className:D.MapMeta,children:u}),t[49]=u,t[50]=C),t[51]!==r||t[52]!==s||t[53]!==c||t[54]!==l?(O=s?(0,m.jsx)(`blockquote`,{className:D.MapQuote,children:(0,m.jsx)(E,{markup:l})}):c?(0,m.jsxs)(`blockquote`,{className:D.MapQuote,children:[(0,m.jsx)(`p`,{children:c}),r&&(0,m.jsxs)(`cite`,{children:[` `,r]})]}):null,t[51]=r,t[52]=s,t[53]=c,t[54]=l,t[55]=O):O=t[55],t[56]===a?k=t[57]:(k=a?.missionBlurb&&(0,m.jsx)(`div`,{className:D.MapBlurb,children:w(a.missionBlurb)?(0,m.jsx)(E,{markup:a.missionBlurb.trim()}):a.missionBlurb.trim()}),t[56]=a,t[57]=k),A=e&&e.trim()&&(0,m.jsx)(`div`,{className:D.Section,children:(0,m.jsx)(E,{markup:e})}),t[12]=_,t[13]=v,t[14]=b,t[15]=i,t[16]=n,t[17]=a,t[18]=S,t[19]=C,t[20]=O,t[21]=k,t[22]=A,t[23]=j,t[24]=M,t[25]=N,t[26]=P,t[27]=F,t[28]=I,t[29]=L,t[30]=R,t[31]=z,t[32]=B,t[33]=V,t[34]=H,t[35]=U}else S=t[18],C=t[19],O=t[20],k=t[21],A=t[22],j=t[23],M=t[24],N=t[25],P=t[26],F=t[27],I=t[28],L=t[29],R=t[30],z=t[31],B=t[32],V=t[33],H=t[34],U=t[35];let W;t[58]===a?W=t[59]:(W=a?.missionBriefing&&(0,m.jsxs)(`div`,{className:D.Section,children:[(0,m.jsx)(`h2`,{className:D.SectionTitle,children:`Mission Briefing`}),(0,m.jsx)(E,{markup:a.missionBriefing})]}),t[58]=a,t[59]=W);let G;t[60]===x?G=t[61]:(G=x&&(0,m.jsx)(ie,{track:x}),t[60]=x,t[61]=G);let K;t[62]!==S||t[63]!==C||t[64]!==O||t[65]!==k||t[66]!==A||t[67]!==W||t[68]!==G||t[69]!==H||t[70]!==U?(K=(0,m.jsxs)(`div`,{className:H,children:[U,S,C,O,k,A,W,G]}),t[62]=S,t[63]=C,t[64]=O,t[65]=k,t[66]=A,t[67]=W,t[68]=G,t[69]=H,t[70]=U,t[71]=K):K=t[71];let q;t[72]!==_||t[73]!==v||t[74]!==b?(q=_&&!b&&(0,m.jsx)(re,{src:_,alt:`${v} preview`},_),t[72]=_,t[73]=v,t[74]=b,t[75]=q):q=t[75];let J;t[76]!==j||t[77]!==K||t[78]!==q?(J=(0,m.jsxs)(`div`,{className:j,children:[K,q]}),t[76]=j,t[77]=K,t[78]=q,t[79]=J):J=t[79];let Y;t[80]===n?Y=t[81]:(Y=(0,m.jsx)(`button`,{className:D.CloseButton,onClick:n,children:`Close`}),t[80]=n,t[81]=Y);let X;t[82]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,m.jsx)(`span`,{className:D.Hint,children:`Esc to close`}),t[82]=X):X=t[82];let Z;t[83]===Y?Z=t[84]:(Z=(0,m.jsxs)(`div`,{className:D.Footer,children:[Y,X]}),t[83]=Y,t[84]=Z);let Q;t[85]!==M||t[86]!==N||t[87]!==P||t[88]!==F||t[89]!==I||t[90]!==L||t[91]!==R||t[92]!==z||t[93]!==J||t[94]!==Z?(Q=(0,m.jsxs)(`div`,{ref:M,className:N,onClick:P,onKeyDown:F,role:I,"aria-modal":L,"aria-label":R,tabIndex:z,children:[J,Z]}),t[85]=M,t[86]=N,t[87]=P,t[88]=F,t[89]=I,t[90]=L,t[91]=R,t[92]=z,t[93]=J,t[94]=Z,t[95]=Q):Q=t[95];let $;return t[96]!==B||t[97]!==V||t[98]!==Q?($=(0,m.jsx)(`div`,{className:B,onClick:V,children:Q}),t[96]=B,t[97]=V,t[98]=Q,t[99]=$):$=t[99],$}function ae(e){return e.stopPropagation()}function oe(e){return e.stopPropagation()}function se(e){e.stopImmediatePropagation()}export{M as MapInfoDialog};

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
._PlayerHUD_5937t_1{z-index:1;pointer-events:none;position:absolute;inset:0}._Compass_5937t_11{flex-shrink:0;width:64px;height:64px;position:absolute;top:10px;right:10px}._CompassRing_5937t_20{image-rendering:auto;width:100%;height:100%;position:absolute;top:0;left:0}._CompassNSEW_5937t_29{width:100%;height:100%;image-rendering:pixelated;position:absolute;top:0;left:0}._CompassClock_5937t_38{color:#c8f0e6e6;text-shadow:0 0 4px #000c;pointer-events:none;white-space:nowrap;font-size:10px;font-weight:600;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}._Bars_5937t_51{flex-direction:column;align-items:flex-end;gap:3px;width:120px;max-width:20%;display:flex;position:absolute;top:20px;right:82px}._BarTrack_5937t_63{background:#00000080;border:1px solid #ffffff26;width:100%;height:10px;overflow:hidden}._BarFillHealth_5937t_71{background:#2ecc40;height:100%;transition:width .15s ease-out}._BarFillEnergy_5937t_77{background:#0af;height:100%;transition:width .15s ease-out}._WeaponHUD_5937t_85{flex-direction:column;gap:2px;display:flex;position:absolute;top:50%;right:6px;transform:translateY(-50%)}._WeaponHUD_5937t_85 ._PackInvItem_5937t_95[data-active=false]{opacity:.6}@media (height<=699px){._WeaponHUD_5937t_85 ._PackInvItem_5937t_95[data-active=false]{display:none}}._WeaponSeparator_5937t_105{height:6px}._TeamScores_5937t_111{border-collapse:collapse;border:1px solid #80ffc826;font-size:12px;position:absolute;bottom:6px;left:6px}@media (width<=499px),(pointer:coarse){._TeamScores_5937t_111{display:none}}._ObserverCount_5937t_126{color:#c1e4d8;text-shadow:0 0 2px #0009;padding:4px 6px;font-size:10px;display:block;position:absolute;bottom:100%}._TeamRow_5937t_136{background:#00323ca6;flex:1 0 auto}._TeamRow_5937t_136+._TeamRow_5937t_136{border-top:1px solid #80ffc826}._TeamName_5937t_145{min-width:6em;padding:5px 6px;font-size:12px;font-weight:500}._TeamNameFriendly_5937t_152{color:#2de46a}._TeamNameEnemy_5937t_157{color:#79cbd4}._TeamScore_5937t_111{color:#fff;text-align:center;border-left:1px solid #80ffc826;padding:0 10px;font-weight:500}._TeamCount_5937t_170{color:#7d9b96;text-align:center;padding:0 6px;font-size:11px}._PackInventoryHUD_5937t_179{align-items:center;gap:4px;display:flex;position:absolute;bottom:6px;right:6px}@media (width<=499px),(pointer:coarse){._PackInventoryHUD_5937t_179{display:none}}._PackInvItem_5937t_95{background:#00323ca6;border:1px solid #80ffc826;flex-direction:column;justify-content:center;align-items:center;gap:1px;padding:4px;display:flex}._PackInvItem_5937t_95[data-active=true]{border-color:#80ffc899;box-shadow:0 0 8px #80ffc866}._PackInvIcon_5937t_210{image-rendering:pixelated;display:block}._PackInvCount_5937t_215{color:#bfe;text-align:center;min-width:12px;font-size:11px}._PackInvInfinity_5937t_222{image-rendering:pixelated;opacity:.8;display:block}._Reticle_5937t_230{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}._ReticleImage_5937t_237{opacity:.85;width:64px;height:64px;image-rendering:pixelated}._ReticleDot_5937t_244{background:#2ecc40b3;border-radius:50%;width:4px;height:4px;box-shadow:0 0 4px #2ecc4080}._ChatContainer_qc3qt_1{pointer-events:auto;border:1px solid #2cacb566;flex-direction:column;width:400px;max-width:50%;max-height:25%;display:flex;position:absolute;top:6px;left:6px}._ChatWindow_qc3qt_14{scrollbar-width:thin;scrollbar-color:#2cacb566 transparent;background:#00323ca6;min-height:4em;max-height:12.5em;padding:6px;font-size:12px;line-height:1.25;overflow-y:auto}@media (pointer:fine){._ChatWindow_qc3qt_14{-webkit-user-select:text;user-select:text}}@media (width<=699px){._ChatWindow_qc3qt_14{font-size:11px}}._ChatMessage_qc3qt_39{color:#2cacb5;padding:2px 0}._ChatColor0_qc3qt_46{color:#2cacb5}._ChatColor1_qc3qt_49{color:#04eb69}._ChatColor2_qc3qt_52{color:#dbc880}._ChatColor3_qc3qt_55{color:#4dfd5f}._ChatColor4_qc3qt_58{color:#28e7f0}._ChatColor5_qc3qt_61{color:#c8c832}._ChatColor6_qc3qt_64{color:#c8c8c8}._ChatColor7_qc3qt_67{color:#dcdc14}._ChatColor8_qc3qt_70{color:#9696fa}._ChatColor9_qc3qt_73{color:#3cdc96}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
._PlayerHUD_13ssv_1{z-index:1;pointer-events:none;position:absolute;inset:0}._Compass_13ssv_11{flex-shrink:0;width:64px;height:64px;position:absolute;top:10px;right:10px}._CompassRing_13ssv_20{image-rendering:auto;width:100%;height:100%;position:absolute;top:0;left:0}._CompassNSEW_13ssv_29{width:100%;height:100%;image-rendering:pixelated;position:absolute;top:0;left:0}._CompassClock_13ssv_38{color:#c8f0e6e6;text-shadow:0 0 4px #000c;pointer-events:none;white-space:nowrap;font-size:10px;font-weight:600;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}._Bars_13ssv_51{flex-direction:column;align-items:flex-end;gap:3px;width:120px;max-width:20%;display:flex;position:absolute;top:20px;right:82px}._BarTrack_13ssv_63{background:#00000080;border:1px solid #ffffff26;width:100%;height:10px;overflow:hidden}._BarFillHealth_13ssv_71{background:#2ecc40;height:100%;transition:width .15s ease-out}._BarFillEnergy_13ssv_77{background:#0af;height:100%;transition:width .15s ease-out}._WeaponHUD_13ssv_85{flex-direction:column;gap:2px;display:flex;position:absolute;top:50%;right:6px;transform:translateY(-50%)}._WeaponHUD_13ssv_85 ._PackInvItem_13ssv_95[data-active=false]{opacity:.6}@media (height<=699px){._WeaponHUD_13ssv_85 ._PackInvItem_13ssv_95[data-active=false]{display:none}}._WeaponSeparator_13ssv_105{height:6px}._TeamScores_13ssv_111{border-collapse:collapse;border:1px solid #80ffc826;font-size:12px;position:absolute;bottom:6px;left:6px}@media (width<=499px),(pointer:coarse){._TeamScores_13ssv_111{display:none}}._ObserverCount_13ssv_126{color:#c1e4d8;text-shadow:0 0 2px #0009;padding:4px 6px;font-size:10px;display:block;position:absolute;bottom:100%}._TeamRow_13ssv_136{background:#00323ca6;flex:1 0 auto}._TeamRow_13ssv_136+._TeamRow_13ssv_136{border-top:1px solid #80ffc826}._TeamName_13ssv_145{min-width:6em;padding:5px 6px;font-size:12px;font-weight:500}._TeamNameFriendly_13ssv_152{color:#2de46a}._TeamNameEnemy_13ssv_157{color:#79cbd4}._TeamScore_13ssv_111{color:#fff;text-align:center;border-left:1px solid #80ffc826;padding:0 10px;font-weight:500}._TeamCount_13ssv_170{color:#7d9b96;text-align:center;padding:0 6px;font-size:11px}._PackInventoryHUD_13ssv_179{align-items:center;gap:4px;display:flex;position:absolute;bottom:6px;right:6px}@media (width<=499px),(pointer:coarse){._PackInventoryHUD_13ssv_179{display:none}}._PackInvItem_13ssv_95{background:#00323ca6;border:1px solid #80ffc826;flex-direction:column;justify-content:center;align-items:center;gap:1px;padding:4px;display:flex}._PackInvItem_13ssv_95[data-active=true]{border-color:#80ffc899;box-shadow:0 0 8px #80ffc866}._PackInvIcon_13ssv_210{image-rendering:pixelated;display:block}._PackInvCount_13ssv_215{color:#bfe;text-align:center;min-width:12px;font-size:11px}._PackInvInfinity_13ssv_222{image-rendering:pixelated;opacity:.8;display:block}._Reticle_13ssv_230{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}._ReticleImage_13ssv_237{opacity:.6;image-rendering:pixelated}._ReticleDot_13ssv_242{background:#2ecc40b3;border-radius:50%;width:4px;height:4px;box-shadow:0 0 4px #2ecc4080}._ChatContainer_qc3qt_1{pointer-events:auto;border:1px solid #2cacb566;flex-direction:column;width:400px;max-width:50%;max-height:25%;display:flex;position:absolute;top:6px;left:6px}._ChatWindow_qc3qt_14{scrollbar-width:thin;scrollbar-color:#2cacb566 transparent;background:#00323ca6;min-height:4em;max-height:12.5em;padding:6px;font-size:12px;line-height:1.25;overflow-y:auto}@media (pointer:fine){._ChatWindow_qc3qt_14{-webkit-user-select:text;user-select:text}}@media (width<=699px){._ChatWindow_qc3qt_14{font-size:11px}}._ChatMessage_qc3qt_39{color:#2cacb5;padding:2px 0}._ChatColor0_qc3qt_46{color:#2cacb5}._ChatColor1_qc3qt_49{color:#04eb69}._ChatColor2_qc3qt_52{color:#dbc880}._ChatColor3_qc3qt_55{color:#4dfd5f}._ChatColor4_qc3qt_58{color:#28e7f0}._ChatColor5_qc3qt_61{color:#c8c832}._ChatColor6_qc3qt_64{color:#c8c8c8}._ChatColor7_qc3qt_67{color:#dcdc14}._ChatColor8_qc3qt_70{color:#9696fa}._ChatColor9_qc3qt_73{color:#3cdc96}

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{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{i}from"./react-three-fiber.esm-dhSWjERg.js";import"./SettingsProvider-2cUUftaX.js";import{_ as a,h as o,m as s}from"./GenericShape-Bmdiv07u.js";import"./logger-zy3b0zcG.js";import"./traditional-BTL5qX2E.js";import{Ot as c,St as l,Ut as u,b as d}from"./three.module-CwgFV8Kd.js";import"./mission-CFLOK_Oy.js";import"./engineStore-Cio8vU1L.js";import{t as f}from"./Texture-CUOilM1U.js";import{p}from"./loaders-BRV0t4WA.js";import"./FloatingLabel-DQhfapoY.js";import"./globalFogUniforms-CaAkHfiE.js";var m=t(),h=e(n(),1),g=r(),_=new u,v=new u,y=new u,b=new u,x=new u,S=new u,C=new u(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=p(r.texture),t[0]=r.texture,t[1]=i);let a=f(i,T),o=Array.isArray(a)?a[0]:a,s;t[2]!==r.color.b||t[3]!==r.color.g||t[4]!==r.color.r?(s=new d().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]=s):s=t[5];let l=s,u;t[6]===r.size?u=t[7]:(u=[r.size,r.size,1],t[6]=r.size,t[7]=u);let h;t[8]!==l||t[9]!==o?(h=(0,g.jsx)(`spriteMaterial`,{map:o,color:l,transparent:!0,blending:2,depthWrite:!1,toneMapped:!1}),t[8]=l,t[9]=o,t[10]=h):h=t[10];let _;return t[11]!==u||t[12]!==h?(_=(0,g.jsx)(`sprite`,{scale:u,children:h}),t[11]=u,t[12]=h,t[13]=_):_=t[13],_}function T(e){o(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),c=(0,h.useRef)(null),u=(0,h.useRef)(null),d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=new l,t[0]=d):d=t[0];let w=(0,h.useRef)(d),T;t[1]===r.texture?T=t[2]:(T=p(r.texture),t[1]=r.texture,t[2]=T);let E=r.crossTexture??r.texture,O;t[3]===E?O=t[4]:(O=p(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=f(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,l=c.current;if(!i||!l)return;let d=n.keyframes?.[0],f=d?.position,p=n.direction??d?.velocity;if(!f||!p){i.visible=!1,u.current&&(u.current.visible=!1);return}if(a(p,_),_.lengthSq()<1e-8){i.visible=!1,u.current&&(u.current.visible=!1);return}_.normalize(),i.visible=!0,a(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=l.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,l.needsUpdate=!0;let g=u.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,s(_,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:c,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:u,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)o(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{i}from"./react-three-fiber.esm-dhSWjERg.js";import"./SettingsProvider-xrmxG700.js";import{_ as a,h as o,m as s}from"./GenericShape-C-0r5jzJ.js";import"./logger-z_EpIdIa.js";import"./traditional-BTL5qX2E.js";import{Ot as c,St as l,Ut as u,b as d}from"./three.module-CwgFV8Kd.js";import"./mission-C2iDKeMo.js";import"./engineStore-Cio8vU1L.js";import{t as f}from"./Texture-CUOilM1U.js";import{p}from"./loaders-0nekNxyt.js";import"./FloatingLabel-D3hPNzZS.js";import"./globalFogUniforms-CaAkHfiE.js";var m=t(),h=e(n(),1),g=r(),_=new u,v=new u,y=new u,b=new u,x=new u,S=new u,C=new u(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=p(r.texture),t[0]=r.texture,t[1]=i);let a=f(i,T),o=Array.isArray(a)?a[0]:a,s;t[2]!==r.color.b||t[3]!==r.color.g||t[4]!==r.color.r?(s=new d().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]=s):s=t[5];let l=s,u;t[6]===r.size?u=t[7]:(u=[r.size,r.size,1],t[6]=r.size,t[7]=u);let h;t[8]!==l||t[9]!==o?(h=(0,g.jsx)(`spriteMaterial`,{map:o,color:l,transparent:!0,blending:2,depthWrite:!1,toneMapped:!1}),t[8]=l,t[9]=o,t[10]=h):h=t[10];let _;return t[11]!==u||t[12]!==h?(_=(0,g.jsx)(`sprite`,{scale:u,children:h}),t[11]=u,t[12]=h,t[13]=_):_=t[13],_}function T(e){o(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),c=(0,h.useRef)(null),u=(0,h.useRef)(null),d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=new l,t[0]=d):d=t[0];let w=(0,h.useRef)(d),T;t[1]===r.texture?T=t[2]:(T=p(r.texture),t[1]=r.texture,t[2]=T);let E=r.crossTexture??r.texture,O;t[3]===E?O=t[4]:(O=p(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=f(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,l=c.current;if(!i||!l)return;let d=n.keyframes?.[0],f=d?.position,p=n.direction??d?.velocity;if(!f||!p){i.visible=!1,u.current&&(u.current.visible=!1);return}if(a(p,_),_.lengthSq()<1e-8){i.visible=!1,u.current&&(u.current.visible=!1);return}_.normalize(),i.visible=!0,a(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=l.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,l.needsUpdate=!0;let g=u.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,s(_,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:c,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:u,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)o(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

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{r as e}from"./chunk-DECur_0Z.js";import{r as t}from"./jsx-runtime-BpGWiA-R.js";import{t as n}from"./logger-zy3b0zcG.js";var r=e(t(),1),i=n(`ShapeErrorBoundary`),a=class extends r.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){i.error(`Shape load failed: %s %s`,e.message,t.componentStack)}render(){return this.state.hasError?this.props.fallback:this.props.children}};export{a as t}; import{r as e}from"./chunk-DECur_0Z.js";import{r as t}from"./jsx-runtime-BpGWiA-R.js";import{t as n}from"./logger-z_EpIdIa.js";var r=e(t(),1),i=n(`ShapeErrorBoundary`),a=class extends r.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){i.error(`Shape load failed: %s %s`,e.message,t.componentStack)}render(){return this.state.hasError?this.props.fallback:this.props.children}};export{a as t};

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}from"./jsx-runtime-BpGWiA-R.js";import{i as r,o as i}from"./react-three-fiber.esm-dhSWjERg.js";import{r as a}from"./SettingsProvider-2cUUftaX.js";import"./traditional-BTL5qX2E.js";import{o,r as s}from"./index-DTbogAPB.js";var c=t(),l=e(n(),1),u=.004,d=2.5,f=.08,p=.15,m=.15;function h(){let e=(0,c.c)(17),{speedMultiplier:t,touchMode:n,invertDrag:h,invertJoystick:_}=a(),v=i(g),{moveState:y,lookState:b}=o(),x=s(),S=(0,l.useRef)(null),C;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(C={x:0,y:0},e[0]=C):C=e[0];let w=(0,l.useRef)(C),T;e[1]===h?T=e[2]:(T=()=>h,e[1]=h,e[2]=T);let E=(0,l.useEffectEvent)(T),D=(0,l.useRef)(0),O=(0,l.useRef)(0),k;e[3]!==E||e[4]!==v.domElement||e[5]!==n?(k=()=>{if(n!==`moveLookStick`)return;let e=v.domElement,t=e=>{if(S.current===null)for(;0<e.changedTouches.length;){let t=e.changedTouches[0];S.current=t.identifier,w.current={x:t.clientX,y:t.clientY};break}},r=e=>{if(S.current!==null)for(let t=0;t<e.changedTouches.length;t++){let n=e.changedTouches[t];if(n.identifier===S.current){let e=n.clientX-w.current.x,t=n.clientY-w.current.y;w.current={x:n.clientX,y:n.clientY};let r=E()?1:-1;D.current+=r*e*u,O.current+=r*t*u;break}}},i=e=>{for(let t=0;t<e.changedTouches.length;t++)if(e.changedTouches[t].identifier===S.current){S.current=null;break}};return e.addEventListener(`touchstart`,t,{passive:!0}),e.addEventListener(`touchmove`,r,{passive:!0}),e.addEventListener(`touchend`,i,{passive:!0}),e.addEventListener(`touchcancel`,i,{passive:!0}),()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchmove`,r),e.removeEventListener(`touchend`,i),e.removeEventListener(`touchcancel`,i),S.current=null}},e[3]=E,e[4]=v.domElement,e[5]=n,e[6]=k):k=e[6];let A;e[7]!==v.domElement||e[8]!==n?(A=[v.domElement,n],e[7]=v.domElement,e[8]=n,e[9]=A):A=e[9],(0,l.useEffect)(k,A);let j;return e[10]!==_||e[11]!==b.current||e[12]!==y.current||e[13]!==x||e[14]!==t||e[15]!==n?(j=(e,r)=>{let{force:i,angle:a}=y.current,{force:o,angle:s}=b.current,c=D.current,l=O.current;D.current=0,O.current=0;let u=0,h=0;if(n===`dualStick`){if(o>p){let e=(o-p)/(1-p),t=Math.cos(s),n=Math.sin(s),i=_?1:-1;c-=i*t*e*d*r,l+=i*n*e*d*r}if(i>f){let e=(i-f)/(1-f),n=Math.cos(a),r=Math.sin(a);u=Math.max(-1,Math.min(1,n*e*t)),h=Math.max(-1,Math.min(1,r*e*t))}}else if(n===`moveLookStick`&&i>0&&(h=Math.max(-1,Math.min(1,.5*t)),i>=m)){let e=Math.cos(a),t=Math.sin(a),n=(i-m)/(1-m),o=_?1:-1;c-=o*e*n*d*.5*r,l+=o*t*n*d*.5*r}!(c!==0||l!==0)&&!(u!==0||h!==0)||x({deltaYaw:c,deltaPitch:l,x:u,y:h,z:0,triggers:[],delta:r})},e[10]=_,e[11]=b.current,e[12]=y.current,e[13]=x,e[14]=t,e[15]=n,e[16]=j):j=e[16],r(j),null}function g(e){return e.gl}export{h as TouchHandler}; import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n}from"./jsx-runtime-BpGWiA-R.js";import{i as r,o as i}from"./react-three-fiber.esm-dhSWjERg.js";import{r as a}from"./SettingsProvider-xrmxG700.js";import"./traditional-BTL5qX2E.js";import{o,r as s}from"./index-BMiY1uIn.js";var c=t(),l=e(n(),1),u=.004,d=2.5,f=.08,p=.15,m=.15;function h(){let e=(0,c.c)(17),{speedMultiplier:t,touchMode:n,invertDrag:h,invertJoystick:_}=a(),v=i(g),{moveState:y,lookState:b}=o(),x=s(),S=(0,l.useRef)(null),C;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(C={x:0,y:0},e[0]=C):C=e[0];let w=(0,l.useRef)(C),T;e[1]===h?T=e[2]:(T=()=>h,e[1]=h,e[2]=T);let E=(0,l.useEffectEvent)(T),D=(0,l.useRef)(0),O=(0,l.useRef)(0),k;e[3]!==E||e[4]!==v.domElement||e[5]!==n?(k=()=>{if(n!==`moveLookStick`)return;let e=v.domElement,t=e=>{if(S.current===null)for(;0<e.changedTouches.length;){let t=e.changedTouches[0];S.current=t.identifier,w.current={x:t.clientX,y:t.clientY};break}},r=e=>{if(S.current!==null)for(let t=0;t<e.changedTouches.length;t++){let n=e.changedTouches[t];if(n.identifier===S.current){let e=n.clientX-w.current.x,t=n.clientY-w.current.y;w.current={x:n.clientX,y:n.clientY};let r=E()?1:-1;D.current+=r*e*u,O.current+=r*t*u;break}}},i=e=>{for(let t=0;t<e.changedTouches.length;t++)if(e.changedTouches[t].identifier===S.current){S.current=null;break}};return e.addEventListener(`touchstart`,t,{passive:!0}),e.addEventListener(`touchmove`,r,{passive:!0}),e.addEventListener(`touchend`,i,{passive:!0}),e.addEventListener(`touchcancel`,i,{passive:!0}),()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchmove`,r),e.removeEventListener(`touchend`,i),e.removeEventListener(`touchcancel`,i),S.current=null}},e[3]=E,e[4]=v.domElement,e[5]=n,e[6]=k):k=e[6];let A;e[7]!==v.domElement||e[8]!==n?(A=[v.domElement,n],e[7]=v.domElement,e[8]=n,e[9]=A):A=e[9],(0,l.useEffect)(k,A);let j;return e[10]!==_||e[11]!==b.current||e[12]!==y.current||e[13]!==x||e[14]!==t||e[15]!==n?(j=(e,r)=>{let{force:i,angle:a}=y.current,{force:o,angle:s}=b.current,c=D.current,l=O.current;D.current=0,O.current=0;let u=0,h=0;if(n===`dualStick`){if(o>p){let e=(o-p)/(1-p),t=Math.cos(s),n=Math.sin(s),i=_?1:-1;c-=i*t*e*d*r,l+=i*n*e*d*r}if(i>f){let e=(i-f)/(1-f),n=Math.cos(a),r=Math.sin(a);u=Math.max(-1,Math.min(1,n*e*t)),h=Math.max(-1,Math.min(1,r*e*t))}}else if(n===`moveLookStick`&&i>0&&(h=Math.max(-1,Math.min(1,.5*t)),i>=m)){let e=Math.cos(a),t=Math.sin(a),n=(i-m)/(1-m),o=_?1:-1;c-=o*e*n*d*.5*r,l+=o*t*n*d*.5*r}!(c!==0||l!==0)&&!(u!==0||h!==0)||x({deltaYaw:c,deltaPitch:l,x:u,y:h,z:0,triggers:[],delta:r})},e[10]=_,e[11]=b.current,e[12]=y.current,e[13]=x,e[14]=t,e[15]=n,e[16]=j):j=e[16],r(j),null}function g(e){return e.gl}export{h as TouchHandler};

View file

@ -1,2 +1,2 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/nipplejs-TUj5E3G4.js","assets/chunk-DECur_0Z.js"])))=>i.map(i=>d[i]); const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/nipplejs-TUj5E3G4.js","assets/chunk-DECur_0Z.js"])))=>i.map(i=>d[i]);
import{r as e}from"./chunk-DECur_0Z.js";import{r as t,t as n}from"./jsx-runtime-BpGWiA-R.js";import{r}from"./SettingsProvider-2cUUftaX.js";import{l as i,o as a}from"./index-DTbogAPB.js";var o=e(t(),1),s={Joystick:`_Joystick_155b9_1`,Left:`_Left_155b9_11 _Joystick_155b9_1`,Right:`_Right_155b9_17 _Joystick_155b9_1`},c=n();function l(e){let t=e.querySelector(`.back`);t&&(t.style.background=`rgba(3, 79, 76, 0.6)`,t.style.border=`1px solid rgba(0, 219, 223, 0.5)`,t.style.boxShadow=`inset 0 0 10px rgba(0, 0, 0, 0.7)`);let n=e.querySelector(`.front`);n&&(n.style.background=`radial-gradient(circle at 50% 50%, rgba(23, 247, 198, 0.9) 0%, rgba(9, 184, 170, 0.95) 100%)`,n.style.border=`2px solid rgba(255, 255, 255, 0.4)`,n.style.boxShadow=`0 2px 4px rgba(0, 0, 0, 0.5), 0 1px 1px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15), inset 0 -1px 2px rgba(0, 0, 0, 0.3)`)}function u(){let{touchMode:t}=r(),[n,u]=(0,o.useState)(null),[d,f]=(0,o.useState)(null),{moveState:p,lookState:m,setMoveState:h,setLookState:g}=a();(0,o.useEffect)(()=>{if(!n)return;let t=null,r=!1;return i(()=>import(`./nipplejs-TUj5E3G4.js`).then(t=>e(t.default,1)).then(e=>{r||(t=e.default.create({zone:n,mode:`static`,position:{left:`70px`,bottom:`70px`},size:120,restOpacity:.9,dynamicPage:!0}),l(n),t.on(`move`,(e,t)=>{h({angle:t.angle.radian,force:Math.min(1,t.force)})}),t.on(`end`,()=>{h({force:0})}))}),__vite__mapDeps([0,1])),()=>{r=!0,t?.destroy()}},[p,n,h]),(0,o.useEffect)(()=>{if(!d)return;let t=null,n=!1;return i(()=>import(`./nipplejs-TUj5E3G4.js`).then(t=>e(t.default,1)).then(e=>{n||(t=e.default.create({zone:d,mode:`static`,position:{right:`70px`,bottom:`70px`},size:120,restOpacity:.9,dynamicPage:!0}),l(d),t.on(`move`,(e,t)=>{g({angle:t.angle.radian,force:Math.min(1,t.force)})}),t.on(`end`,()=>{g({force:0})}))}),__vite__mapDeps([0,1])),()=>{n=!0,t?.destroy()}},[m,d,g]);let _=()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur()};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`div`,{ref:u,className:t===`dualStick`?s.Left:s.Joystick,onContextMenu:e=>e.preventDefault(),onTouchStart:_},t),t===`dualStick`?(0,c.jsx)(`div`,{ref:f,className:s.Right,onContextMenu:e=>e.preventDefault(),onTouchStart:_}):null]})}export{u as TouchJoystick}; import{r as e}from"./chunk-DECur_0Z.js";import{r as t,t as n}from"./jsx-runtime-BpGWiA-R.js";import{r}from"./SettingsProvider-xrmxG700.js";import{l as i,o as a}from"./index-BMiY1uIn.js";var o=e(t(),1),s={Joystick:`_Joystick_155b9_1`,Left:`_Left_155b9_11 _Joystick_155b9_1`,Right:`_Right_155b9_17 _Joystick_155b9_1`},c=n();function l(e){let t=e.querySelector(`.back`);t&&(t.style.background=`rgba(3, 79, 76, 0.6)`,t.style.border=`1px solid rgba(0, 219, 223, 0.5)`,t.style.boxShadow=`inset 0 0 10px rgba(0, 0, 0, 0.7)`);let n=e.querySelector(`.front`);n&&(n.style.background=`radial-gradient(circle at 50% 50%, rgba(23, 247, 198, 0.9) 0%, rgba(9, 184, 170, 0.95) 100%)`,n.style.border=`2px solid rgba(255, 255, 255, 0.4)`,n.style.boxShadow=`0 2px 4px rgba(0, 0, 0, 0.5), 0 1px 1px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15), inset 0 -1px 2px rgba(0, 0, 0, 0.3)`)}function u(){let{touchMode:t}=r(),[n,u]=(0,o.useState)(null),[d,f]=(0,o.useState)(null),{moveState:p,lookState:m,setMoveState:h,setLookState:g}=a();(0,o.useEffect)(()=>{if(!n)return;let t=null,r=!1;return i(()=>import(`./nipplejs-TUj5E3G4.js`).then(t=>e(t.default,1)).then(e=>{r||(t=e.default.create({zone:n,mode:`static`,position:{left:`70px`,bottom:`70px`},size:120,restOpacity:.9,dynamicPage:!0}),l(n),t.on(`move`,(e,t)=>{h({angle:t.angle.radian,force:Math.min(1,t.force)})}),t.on(`end`,()=>{h({force:0})}))}),__vite__mapDeps([0,1])),()=>{r=!0,t?.destroy()}},[p,n,h]),(0,o.useEffect)(()=>{if(!d)return;let t=null,n=!1;return i(()=>import(`./nipplejs-TUj5E3G4.js`).then(t=>e(t.default,1)).then(e=>{n||(t=e.default.create({zone:d,mode:`static`,position:{right:`70px`,bottom:`70px`},size:120,restOpacity:.9,dynamicPage:!0}),l(d),t.on(`move`,(e,t)=>{g({angle:t.angle.radian,force:Math.min(1,t.force)})}),t.on(`end`,()=>{g({force:0})}))}),__vite__mapDeps([0,1])),()=>{n=!0,t?.destroy()}},[m,d,g]);let _=()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur()};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`div`,{ref:u,className:t===`dualStick`?s.Left:s.Joystick,onContextMenu:e=>e.preventDefault(),onTouchStart:_},t),t===`dualStick`?(0,c.jsx)(`div`,{ref:f,className:s.Right,onContextMenu:e=>e.preventDefault(),onTouchStart:_}):null]})}export{u as TouchJoystick};

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{i,o as a}from"./react-three-fiber.esm-dhSWjERg.js";import{a as o,i as s}from"./SettingsProvider-2cUUftaX.js";import"./logger-zy3b0zcG.js";import"./traditional-BTL5qX2E.js";import{At as c,Dt as l,b as u,gt as ee,nt as d}from"./three.module-CwgFV8Kd.js";import{n as te,r as ne,t as re}from"./scene-B1EyKjda.js";import"./mission-CFLOK_Oy.js";import{t as f}from"./extends-Cu_B6L18.js";import{t as p}from"./Texture-CUOilM1U.js";import{p as m}from"./loaders-BRV0t4WA.js";import{a as h,c as g,f as _,t as v}from"./globalFogUniforms-CaAkHfiE.js";var y=e(n());function b(e,t){let n=e+`Geometry`;return y.forwardRef(({args:e,children:r,...i},a)=>{let o=y.useRef(null);return y.useImperativeHandle(a,()=>o.current),y.useLayoutEffect(()=>void t?.(o.current)),y.createElement(`mesh`,f({ref:o},i),y.createElement(n,{attach:`geometry`,args:e}),r)})}var x=b(`box`),S=t(),C=` 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{i,o as a}from"./react-three-fiber.esm-dhSWjERg.js";import{a as o,i as s}from"./SettingsProvider-xrmxG700.js";import"./logger-z_EpIdIa.js";import"./traditional-BTL5qX2E.js";import{At as c,Dt as l,b as u,gt as ee,nt as d}from"./three.module-CwgFV8Kd.js";import{n as te,r as ne,t as re}from"./scene-C7IIl-c0.js";import"./mission-C2iDKeMo.js";import{t as f}from"./extends-Cu_B6L18.js";import{t as p}from"./Texture-CUOilM1U.js";import{p as m}from"./loaders-0nekNxyt.js";import{a as h,c as g,f as _,t as v}from"./globalFogUniforms-CaAkHfiE.js";var y=e(n());function b(e,t){let n=e+`Geometry`;return y.forwardRef(({args:e,children:r,...i},a)=>{let o=y.useRef(null);return y.useImperativeHandle(a,()=>o.current),y.useLayoutEffect(()=>void t?.(o.current)),y.createElement(`mesh`,f({ref:o},i),y.createElement(n,{attach:`geometry`,args:e}),r)})}var x=b(`box`),S=t(),C=`
#include <fog_pars_vertex> #include <fog_pars_vertex>
#ifdef USE_FOG #ifdef USE_FOG

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
import{t as e}from"./logger-zy3b0zcG.js";import{A as t,_ as n}from"./streamHelpers-Be29sBCp.js";var r=e(`demoTimelineScanner`),i=500,a=new Set([`msglegitkill`,`msgheadshotkill`,`msgteamkill`,`msgselfkill`,`msgexplosionkill`,`msgvehiclekill`,`msgvehiclecrash`,`msgvehiclespawnkill`,`msgturretkill`,`msgcturretkill`,`msgturretselfkill`,`msgoobkill`,`msgcampkill`,`msgrogueminekill`,`msglavakill`,`msglightningkill`]),o=new Set([`msgselfkill`,`msgturretselfkill`,`msgoobkill`,`msglavakill`,`msglightningkill`,`msgcampkill`]);function s(e,t){if(e.length>=2&&e.charCodeAt(0)===1){let n=parseInt(e.slice(1),10);if(Number.isFinite(n))return t.get(n)??e}return e}function c(e,t,r){let i=s(e,r);for(let e=0;e<t.length;e++){let a=`%${e+1}`;i.includes(a)&&(i=i.replaceAll(a,n(s(t[e],r))))}return i=i.replace(/%\d+/g,``),n(i)}async function l(e,l,u,d){let f=new t(new Uint8Array(e)),{initialBlock:p}=await f.load(),m=new Map;for(let[e,t]of p.taggedStrings)m.set(e,t);let h=f.getRegistry(),g=l?n(l).trim().toLowerCase():null,_=null,v=null;for(let e=0;e<p.demoValues.length;e++){if(p.demoValues[e]!==`readplayerinfo`)continue;let t=p.demoValues[e+1];if(t?.startsWith(`1 `)){let e=t.split(` `),n=parseInt(e[1],10);Number.isFinite(n)&&(_=n);break}}if(_!=null){let e=p.demoValues,t=parseInt(e[1]===`<BLANK>`?`0`:e[1]??`0`,10)||0;for(let n=0;n<t;n++){let t=(e[2+n]??``).split(` `);if(parseInt(t[2],10)===_){let e=parseInt(t[4],10);isNaN(e)||(v=e);break}}}let y=[],b=0,x=!1,S=0,C=f.blockCount;for(;!d?.aborted;){let e;try{e=f.nextBlock()}catch(e){r.warn(`Stopping scan at block %d due to read error: %o`,S,e);break}if(!e)break;if(S++,e.type===2){b++;continue}if(e.type!==0||!e.parsed)continue;let t=e.parsed;if(!t.events)continue;let l=32/1e3*b;for(let e of t.events)try{if(!e.parsedData)continue;let t=e.parsedData.type;if(t===`NetStringEvent`){let t=e.parsedData.id,n=e.parsedData.value;n!=null&&m.set(t,n);continue}let r=h.getEventParser(e.classId)?.name;if(t!==`RemoteCommandEvent`&&r!==`RemoteCommandEvent`||s(e.parsedData.funcName,m)!==`ServerMessage`)continue;let i=e.parsedData.args;if(!i||i.length<2)continue;let u=s(i[0],m).toLowerCase();if(u===`msgclientjointeam`&&_!=null&&i.length>=6&&parseInt(s(i[4],m),10)===_){let e=parseInt(s(i[5],m),10);isNaN(e)||(v=e)}if(u===`msgmissionstart`&&!x){x=!0,y.push({timeSec:l,type:`match-start`,description:`Match started`});continue}if(u===`msggameover`){y.push({timeSec:l,type:`match-end`,description:`Match ended`});continue}if(u===`msgctfflagcapped`&&i.length>=2){let e=c(i[1],i.slice(2),m),t=i.length>=3?n(s(i[2],m)).trim():void 0,r=i.length>=4?n(s(i[3],m)).trim():void 0,a=`neutral`;if(v!=null&&v>0&&i.length>=6){let e=parseInt(s(i[5],m),10);e===v?a=`friendly`:isNaN(e)||(a=`enemy`)}y.push({timeSec:l,type:`flag-cap`,description:e||`Flag captured`,teamAffinity:a,capturer:t,flagTeamName:r||void 0});continue}if(a.has(u)&&i.length>=6){if(o.has(u))continue;let e=n(s(i[5],m)).trim(),t=n(s(i[2],m)).trim(),r=i.length>=10?n(s(i[9],m)).trim():void 0;if(g&&e.toLowerCase()===g){let n=c(i[1],i.slice(2),m);y.push({timeSec:l,type:`kill`,description:n||`${e} got a kill`,killer:e,victim:t,weapon:r||void 0})}}}catch(e){r.warn(`Skipping malformed event in block %d: %o`,S,e)}S%i===0&&(C&&u&&u(Math.min(S/C,1)),await new Promise(e=>setTimeout(e,0)))}return r.info(`Scanned %d blocks, found %d events`,S,y.length),y}export{l as scanDemoTimeline}; import{t as e}from"./logger-z_EpIdIa.js";import{A as t,_ as n}from"./streamHelpers-Be29sBCp.js";var r=e(`demoTimelineScanner`),i=500,a=new Set([`msglegitkill`,`msgheadshotkill`,`msgteamkill`,`msgselfkill`,`msgexplosionkill`,`msgvehiclekill`,`msgvehiclecrash`,`msgvehiclespawnkill`,`msgturretkill`,`msgcturretkill`,`msgturretselfkill`,`msgoobkill`,`msgcampkill`,`msgrogueminekill`,`msglavakill`,`msglightningkill`]),o=new Set([`msgselfkill`,`msgturretselfkill`,`msgoobkill`,`msglavakill`,`msglightningkill`,`msgcampkill`]);function s(e,t){if(e.length>=2&&e.charCodeAt(0)===1){let n=parseInt(e.slice(1),10);if(Number.isFinite(n))return t.get(n)??e}return e}function c(e,t,r){let i=s(e,r);for(let e=0;e<t.length;e++){let a=`%${e+1}`;i.includes(a)&&(i=i.replaceAll(a,n(s(t[e],r))))}return i=i.replace(/%\d+/g,``),n(i)}async function l(e,l,u,d){let f=new t(new Uint8Array(e)),{initialBlock:p}=await f.load(),m=new Map;for(let[e,t]of p.taggedStrings)m.set(e,t);let h=f.getRegistry(),g=l?n(l).trim().toLowerCase():null,_=null,v=null;for(let e=0;e<p.demoValues.length;e++){if(p.demoValues[e]!==`readplayerinfo`)continue;let t=p.demoValues[e+1];if(t?.startsWith(`1 `)){let e=t.split(` `),n=parseInt(e[1],10);Number.isFinite(n)&&(_=n);break}}if(_!=null){let e=p.demoValues,t=parseInt(e[1]===`<BLANK>`?`0`:e[1]??`0`,10)||0;for(let n=0;n<t;n++){let t=(e[2+n]??``).split(` `);if(parseInt(t[2],10)===_){let e=parseInt(t[4],10);isNaN(e)||(v=e);break}}}let y=[],b=0,x=!1,S=0,C=f.blockCount;for(;!d?.aborted;){let e;try{e=f.nextBlock()}catch(e){r.warn(`Stopping scan at block %d due to read error: %o`,S,e);break}if(!e)break;if(S++,e.type===2){b++;continue}if(e.type!==0||!e.parsed)continue;let t=e.parsed;if(!t.events)continue;let l=32/1e3*b;for(let e of t.events)try{if(!e.parsedData)continue;let t=e.parsedData.type;if(t===`NetStringEvent`){let t=e.parsedData.id,n=e.parsedData.value;n!=null&&m.set(t,n);continue}let r=h.getEventParser(e.classId)?.name;if(t!==`RemoteCommandEvent`&&r!==`RemoteCommandEvent`||s(e.parsedData.funcName,m)!==`ServerMessage`)continue;let i=e.parsedData.args;if(!i||i.length<2)continue;let u=s(i[0],m).toLowerCase();if(u===`msgclientjointeam`&&_!=null&&i.length>=6&&parseInt(s(i[4],m),10)===_){let e=parseInt(s(i[5],m),10);isNaN(e)||(v=e)}if(u===`msgmissionstart`&&!x){x=!0,y.push({timeSec:l,type:`match-start`,description:`Match started`});continue}if(u===`msggameover`){y.push({timeSec:l,type:`match-end`,description:`Match ended`});continue}if(u===`msgctfflagcapped`&&i.length>=2){let e=c(i[1],i.slice(2),m),t=i.length>=3?n(s(i[2],m)).trim():void 0,r=i.length>=4?n(s(i[3],m)).trim():void 0,a=`neutral`;if(v!=null&&v>0&&i.length>=6){let e=parseInt(s(i[5],m),10);e===v?a=`friendly`:isNaN(e)||(a=`enemy`)}y.push({timeSec:l,type:`flag-cap`,description:e||`Flag captured`,teamAffinity:a,capturer:t,flagTeamName:r||void 0});continue}if(a.has(u)&&i.length>=6){if(o.has(u))continue;let e=n(s(i[5],m)).trim(),t=n(s(i[2],m)).trim(),r=i.length>=10?n(s(i[9],m)).trim():void 0;if(g&&e.toLowerCase()===g){let n=c(i[1],i.slice(2),m);y.push({timeSec:l,type:`kill`,description:n||`${e} got a kill`,killer:e,victim:t,weapon:r||void 0})}}}catch(e){r.warn(`Skipping malformed event in block %d: %o`,S,e)}S%i===0&&(C&&u&&u(Math.min(S/C,1)),await new Promise(e=>setTimeout(e,0)))}return r.info(`Scanned %d blocks, found %d events`,S,y.length),y}export{l as scanDemoTimeline};

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{c as e,n as t,s as n,t as r}from"./manifest-CmJ-OiDc.js";import{i}from"./stringUtils-BfUKbRCH.js";import{t as a}from"./logger-zy3b0zcG.js";import{a as o}from"./mission-CFLOK_Oy.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=a(`loaders`),d=`/t2-mapper`,f=`${d}/base/`,p=`${d}/magenta.png`;function m(e,t){let i;try{i=r(e)}catch(n){if(t)return u.warn(`Resource "%s" not found — rendering fallback`,e),t;throw n}let[a,o]=n(i);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 _(t){return t=t.replace(/^terrain\./,``),m(e(`textures/terrain/${t}`),p)}function v(t,n){let r=i(n).split(`/`);return m(e(`${r.length>1?r.slice(0,-1).join(`/`)+`/`:``}${t}`),p)}function y(t){return m(e(`textures/${t}`),p)}function b(e){return m(`audio/${e}`).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 n=t(e),r=await(await fetch(m(n.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}; import{c as e,n as t,s as n,t as r}from"./manifest-CirqV3Ls.js";import{i}from"./stringUtils-EmGsjr9D.js";import{t as a}from"./logger-z_EpIdIa.js";import{a as o}from"./mission-C2iDKeMo.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=a(`loaders`),d=`/t2-mapper`,f=`${d}/base/`,p=`${d}/magenta.png`;function m(e,t){let i;try{i=r(e)}catch(n){if(t)return u.warn(`Resource "%s" not found — rendering fallback`,e),t;throw n}let[a,o]=n(i);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 _(t){return t=t.replace(/^terrain\./,``),m(e(`textures/terrain/${t}`),p)}function v(t,n){let r=i(n).split(`/`);return m(e(`${r.length>1?r.slice(0,-1).join(`/`)+`/`:``}${t}`),p)}function y(t){return m(e(`textures/${t}`),p)}function b(e){return m(`audio/${e}`).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 n=t(e),r=await(await fetch(m(n.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};

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,t}from"./chunk-DECur_0Z.js";import{t as n}from"./logger-zy3b0zcG.js";var r,i;function a(e,t){return t.reduce((e,[t,n])=>({type:`BinaryExpression`,operator:t,left:e,right:n}),e)}function o(e,t){return{type:`UnaryExpression`,operator:e,argument:t}}function s(e,t){return e.type===`Identifier`&&e.name.toLowerCase()===`exec`&&(t.length>0&&t[0].type===`StringLiteral`?r.add(t[0].value):i=!0),{type:`CallExpression`,callee:e,arguments:t}}function c(){return Array.from(r)}var l=class extends SyntaxError{constructor(e,t,n,r){super(e),this.expected=t,this.found=n,this.location=r,this.name=`SyntaxError`}format(e){let t=`Error: `+this.message;if(this.location){let n=null,r=e.find(e=>e.source===this.location.source);r&&(n=r.text.split(/\r\n|\n|\r/g));let i=this.location.start,a=this.location.source&&typeof this.location.source.offset==`function`?this.location.source.offset(i):i,o=this.location.source+`:`+a.line+`:`+a.column;if(n){let e=this.location.end,r=``.padEnd(a.line.toString().length,` `),s=n[i.line-1],c=(i.line===e.line?e.column:s.length+1)-i.column||1;t+=` import{r as e,t}from"./chunk-DECur_0Z.js";import{t as n}from"./logger-z_EpIdIa.js";var r,i;function a(e,t){return t.reduce((e,[t,n])=>({type:`BinaryExpression`,operator:t,left:e,right:n}),e)}function o(e,t){return{type:`UnaryExpression`,operator:e,argument:t}}function s(e,t){return e.type===`Identifier`&&e.name.toLowerCase()===`exec`&&(t.length>0&&t[0].type===`StringLiteral`?r.add(t[0].value):i=!0),{type:`CallExpression`,callee:e,arguments:t}}function c(){return Array.from(r)}var l=class extends SyntaxError{constructor(e,t,n,r){super(e),this.expected=t,this.found=n,this.location=r,this.name=`SyntaxError`}format(e){let t=`Error: `+this.message;if(this.location){let n=null,r=e.find(e=>e.source===this.location.source);r&&(n=r.text.split(/\r\n|\n|\r/g));let i=this.location.start,a=this.location.source&&typeof this.location.source.offset==`function`?this.location.source.offset(i):i,o=this.location.source+`:`+a.line+`:`+a.column;if(n){let e=this.location.end,r=``.padEnd(a.line.toString().length,` `),s=n[i.line-1],c=(i.line===e.line?e.column:s.length+1)-i.column||1;t+=`
--> `+o+` --> `+o+`
`+r+` | `+r+` |
`+a.line+` | `+s+` `+a.line+` | `+s+`

View file

@ -1 +1 @@
import{t as e}from"./logger-zy3b0zcG.js";import{St as t,nt as n}from"./three.module-CwgFV8Kd.js";var r=e(`ghostToScene`);function i(e,t={x:0,y:0,z:0}){return e&&typeof e==`object`&&`x`in e?e:t}function a(e,t={r:0,g:0,b:0}){return e&&typeof e==`object`&&`r`in e?e:t}function o(e,t={r:.5,g:.5,b:.5,a:1}){return e&&typeof e==`object`&&`r`in e?e:t}function s(e){if(e&&typeof e==`object`&&`elements`in e&&Array.isArray(e.elements))return e;if(e&&typeof e==`object`&&`position`in e&&`rotation`in e){let{position:t,rotation:n}=e,r=n.x*n.x,i=n.y*n.y,a=n.z*n.z,o=n.x*n.y,s=n.x*n.z,c=n.y*n.z,l=n.w*n.x,u=n.w*n.y,d=n.w*n.z;return{elements:[1-2*(i+a),2*(o+d),2*(s-u),0,2*(o-d),1-2*(r+a),2*(c+l),0,2*(s+u),2*(c-l),1-2*(r+i),0,t.x,t.y,t.z,1],position:{x:t.x,y:t.y,z:t.z}}}return{elements:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],position:{x:0,y:0,z:0}}}function c(e,t){return{className:`TerrainBlock`,ghostIndex:e,terrFileName:t.terrFileName??``,detailTextureName:t.detailTextureName??``,squareSize:t.squareSize??8,emptySquareRuns:t.emptySquareRuns}}function l(e,t){return{className:`InteriorInstance`,ghostIndex:e,interiorFile:t.interiorFile??``,transform:s(t.transform),scale:i(t.scale,{x:1,y:1,z:1}),showTerrainInside:t.showTerrainInside??!1,skinBase:t.skinBase??``,alarmState:t.alarmState??!1}}function u(e,t){return{className:`TSStatic`,ghostIndex:e,shapeName:t.shapeName??``,transform:s(t.transform),scale:i(t.scale,{x:1,y:1,z:1})}}function d(e,t){let n=Array.isArray(t.fogVolumes)?t.fogVolumes.map(e=>({visibleDistance:e.visibleDistance??0,minHeight:e.minHeight??0,maxHeight:e.maxHeight??0,color:a(e.color)})):[],r=Array.isArray(t.cloudLayers)?t.cloudLayers.map(e=>({texture:e.texture??``,heightPercent:e.heightPercent??0,speed:e.speed??0})):[];return{className:`Sky`,ghostIndex:e,materialList:t.materialList??``,fogColor:a(t.fogColor),visibleDistance:t.visibleDistance??1e3,fogDistance:t.fogDistance??0,skySolidColor:a(t.skySolidColor),useSkyTextures:t.useSkyTextures??!0,fogVolumes:n,cloudLayers:r,windVelocity:i(t.windVelocity)}}function f(e,t){return{className:`Sun`,ghostIndex:e,direction:i(t.direction,{x:.57735,y:.57735,z:-.57735}),color:o(t.color,{r:.7,g:.7,b:.7,a:1}),ambient:o(t.ambient,{r:.5,g:.5,b:.5,a:1}),textures:Array.isArray(t.textures)?t.textures:void 0}}function p(e,t){return{className:`MissionArea`,ghostIndex:e,area:t.area??{x:-512,y:-512,w:1024,h:1024},flightCeiling:t.flightCeiling??2e3,flightCeilingRange:t.flightCeilingRange??50}}function m(e,t){return{className:`WaterBlock`,ghostIndex:e,transform:s(t.transform),scale:i(t.scale,{x:1,y:1,z:1}),surfaceName:t.surfaceName??``,envMapName:t.envMapName??``,surfaceOpacity:t.surfaceOpacity??.75,waveMagnitude:t.waveMagnitude??1,envMapIntensity:t.envMapIntensity??1}}function h(e,t,n){let i;switch(e){case`TerrainBlock`:return i=c(t,n),r.debug(`TerrainBlock #%d: terrFileName=%s`,t,i.terrFileName),i;case`InteriorInstance`:return i=l(t,n),r.debug(`InteriorInstance #%d: interiorFile=%s`,t,i.interiorFile),i;case`TSStatic`:return u(t,n);case`Sky`:{i=d(t,n);let e=i;return r.debug(`Sky #%d: materialList=%s fogColor=(%s, %s, %s) visibleDist=%d fogDist=%d useSkyTextures=%s`,t,e.materialList,e.fogColor.r.toFixed(3),e.fogColor.g.toFixed(3),e.fogColor.b.toFixed(3),e.visibleDistance,e.fogDistance,e.useSkyTextures),i}case`Sun`:{i=f(t,n);let e=i;return r.debug(`Sun #%d: dir=(%s, %s, %s) color=(%s, %s, %s) ambient=(%s, %s, %s)`,t,e.direction.x.toFixed(3),e.direction.y.toFixed(3),e.direction.z.toFixed(3),e.color.r.toFixed(3),e.color.g.toFixed(3),e.color.b.toFixed(3),e.ambient.r.toFixed(3),e.ambient.g.toFixed(3),e.ambient.b.toFixed(3)),i}case`MissionArea`:return p(t,n);case`WaterBlock`:return m(t,n);default:return null}}function g(e){return[e.y,e.z,e.x]}function _(e){return[e.y,e.z,e.x]}function v(e){let r=e.elements,i=new n,a=i.elements;a[0]=r[5],a[1]=r[6],a[2]=r[4],a[3]=0,a[4]=r[9],a[5]=r[10],a[6]=r[8],a[7]=0,a[8]=r[1],a[9]=r[2],a[10]=r[0],a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1;let o=new t;return o.setFromRotationMatrix(i),o.conjugate(),o}export{h as i,_ as n,g as r,v as t}; import{t as e}from"./logger-z_EpIdIa.js";import{St as t,nt as n}from"./three.module-CwgFV8Kd.js";var r=e(`ghostToScene`);function i(e,t={x:0,y:0,z:0}){return e&&typeof e==`object`&&`x`in e?e:t}function a(e,t={r:0,g:0,b:0}){return e&&typeof e==`object`&&`r`in e?e:t}function o(e,t={r:.5,g:.5,b:.5,a:1}){return e&&typeof e==`object`&&`r`in e?e:t}function s(e){if(e&&typeof e==`object`&&`elements`in e&&Array.isArray(e.elements))return e;if(e&&typeof e==`object`&&`position`in e&&`rotation`in e){let{position:t,rotation:n}=e,r=n.x*n.x,i=n.y*n.y,a=n.z*n.z,o=n.x*n.y,s=n.x*n.z,c=n.y*n.z,l=n.w*n.x,u=n.w*n.y,d=n.w*n.z;return{elements:[1-2*(i+a),2*(o+d),2*(s-u),0,2*(o-d),1-2*(r+a),2*(c+l),0,2*(s+u),2*(c-l),1-2*(r+i),0,t.x,t.y,t.z,1],position:{x:t.x,y:t.y,z:t.z}}}return{elements:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],position:{x:0,y:0,z:0}}}function c(e,t){return{className:`TerrainBlock`,ghostIndex:e,terrFileName:t.terrFileName??``,detailTextureName:t.detailTextureName??``,squareSize:t.squareSize??8,emptySquareRuns:t.emptySquareRuns}}function l(e,t){return{className:`InteriorInstance`,ghostIndex:e,interiorFile:t.interiorFile??``,transform:s(t.transform),scale:i(t.scale,{x:1,y:1,z:1}),showTerrainInside:t.showTerrainInside??!1,skinBase:t.skinBase??``,alarmState:t.alarmState??!1}}function u(e,t){return{className:`TSStatic`,ghostIndex:e,shapeName:t.shapeName??``,transform:s(t.transform),scale:i(t.scale,{x:1,y:1,z:1})}}function d(e,t){let n=Array.isArray(t.fogVolumes)?t.fogVolumes.map(e=>({visibleDistance:e.visibleDistance??0,minHeight:e.minHeight??0,maxHeight:e.maxHeight??0,color:a(e.color)})):[],r=Array.isArray(t.cloudLayers)?t.cloudLayers.map(e=>({texture:e.texture??``,heightPercent:e.heightPercent??0,speed:e.speed??0})):[];return{className:`Sky`,ghostIndex:e,materialList:t.materialList??``,fogColor:a(t.fogColor),visibleDistance:t.visibleDistance??1e3,fogDistance:t.fogDistance??0,skySolidColor:a(t.skySolidColor),useSkyTextures:t.useSkyTextures??!0,fogVolumes:n,cloudLayers:r,windVelocity:i(t.windVelocity)}}function f(e,t){return{className:`Sun`,ghostIndex:e,direction:i(t.direction,{x:.57735,y:.57735,z:-.57735}),color:o(t.color,{r:.7,g:.7,b:.7,a:1}),ambient:o(t.ambient,{r:.5,g:.5,b:.5,a:1}),textures:Array.isArray(t.textures)?t.textures:void 0}}function p(e,t){return{className:`MissionArea`,ghostIndex:e,area:t.area??{x:-512,y:-512,w:1024,h:1024},flightCeiling:t.flightCeiling??2e3,flightCeilingRange:t.flightCeilingRange??50}}function m(e,t){return{className:`WaterBlock`,ghostIndex:e,transform:s(t.transform),scale:i(t.scale,{x:1,y:1,z:1}),surfaceName:t.surfaceName??``,envMapName:t.envMapName??``,surfaceOpacity:t.surfaceOpacity??.75,waveMagnitude:t.waveMagnitude??1,envMapIntensity:t.envMapIntensity??1}}function h(e,t,n){let i;switch(e){case`TerrainBlock`:return i=c(t,n),r.debug(`TerrainBlock #%d: terrFileName=%s`,t,i.terrFileName),i;case`InteriorInstance`:return i=l(t,n),r.debug(`InteriorInstance #%d: interiorFile=%s`,t,i.interiorFile),i;case`TSStatic`:return u(t,n);case`Sky`:{i=d(t,n);let e=i;return r.debug(`Sky #%d: materialList=%s fogColor=(%s, %s, %s) visibleDist=%d fogDist=%d useSkyTextures=%s`,t,e.materialList,e.fogColor.r.toFixed(3),e.fogColor.g.toFixed(3),e.fogColor.b.toFixed(3),e.visibleDistance,e.fogDistance,e.useSkyTextures),i}case`Sun`:{i=f(t,n);let e=i;return r.debug(`Sun #%d: dir=(%s, %s, %s) color=(%s, %s, %s) ambient=(%s, %s, %s)`,t,e.direction.x.toFixed(3),e.direction.y.toFixed(3),e.direction.z.toFixed(3),e.color.r.toFixed(3),e.color.g.toFixed(3),e.color.b.toFixed(3),e.ambient.r.toFixed(3),e.ambient.g.toFixed(3),e.ambient.b.toFixed(3)),i}case`MissionArea`:return p(t,n);case`WaterBlock`:return m(t,n);default:return null}}function g(e){return[e.y,e.z,e.x]}function _(e){return[e.y,e.z,e.x]}function v(e){let r=e.elements,i=new n,a=i.elements;a[0]=r[5],a[1]=r[6],a[2]=r[4],a[3]=0,a[4]=r[9],a[5]=r[10],a[6]=r[8],a[7]=0,a[8]=r[1],a[9]=r[2],a[10]=r[0],a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1;let o=new t;return o.setFromRotationMatrix(i),o.conjugate(),o}export{h as i,_ as n,g as r,v as t};

View file

@ -1 +0,0 @@
function e(e){return e.replace(/\\/g,`/`).replace(/\/+/g,`/`)}function t(e){return`${e.toLocaleString()} ms`}var n={1:`Storm`,2:`Inferno`,3:`Starwolf`,4:`Diamond Sword`,5:`Blood Eagle`,6:`Phoenix`};function r(e,t){let n=``,r=e.datablock,a=r?t.get(String(r)):void 0;if(e.nametag!=null&&String(e.nametag)!==``)n=String(e.nametag);else if(a){let e=a.targetnametag==null?``:String(a.targetnametag);e!==``&&!e.startsWith(`_`)&&(n=e)}if(a){let e=a.targettypetag==null?``:String(a.targettypetag);if(e!==``&&!e.startsWith(`_`))return n!==``&&n.toLowerCase()!==e.toLowerCase()?`${n} ${e}`:e}if(!n&&a){let e=a.pickupname==null?``:String(a.pickupname);if(e)return i(e)}return n}function i(e){let t=e.replace(/^(an?\s+|some\s+)/i,``);return t?t.split(` `).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `):e}export{e as i,t as n,r,n as t};

View file

@ -0,0 +1 @@
function e(e){return e.replace(/\\/g,`/`).replace(/\/+/g,`/`)}function t(e){return`${e.toLocaleString()} ms`}var n={1:`Storm`,2:`Inferno`,3:`Starwolf`,4:`Diamond Sword`,5:`Blood Eagle`,6:`Phoenix`};function r(e,t){let n=``,r=e.datablock,o=r?t.get(String(r)):void 0;if(e.nametag!=null&&String(e.nametag)!==``)n=String(e.nametag);else if(o){let e=o.targetnametag==null?``:String(o.targetnametag);e!==``&&!e.startsWith(`_`)&&(n=e)}if(o){let e=o.targettypetag==null?``:String(o.targettypetag);if(e!==``&&!e.startsWith(`_`))return n!==``&&n.toLowerCase()!==e.toLowerCase()?i(`${n} ${e}`):i(e)}if(!n&&o){let e=o.pickupname==null?``:String(o.pickupname);if(e)return a(e)}return i(n)}function i(e){return e.replace(/\x01(\d+)/g,`<#$1>`)}function a(e){let t=e.replace(/^(an?\s+|some\s+)/i,``);return t?t.split(` `).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `):e}export{e as i,t as n,r,n as t};

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
import{r as e,t}from"./useBaseQuery-BIpPgzSS.js";function n(n,r){return t(n,e,r)}export{n as t};

View file

@ -1 +0,0 @@
import{r as e,t}from"./useBaseQuery-C5oaEEv1.js";function n(n,r){return t(n,e,r)}export{n as t};

View file

@ -19,21 +19,21 @@
<link rel="apple-touch-icon" href="/t2-mapper/icon-512.png" /> <link rel="apple-touch-icon" href="/t2-mapper/icon-512.png" />
<meta name="theme-color" content="#067272" /> <meta name="theme-color" content="#067272" />
<link rel="preconnect" href="https://www.gstatic.com" crossorigin /> <link rel="preconnect" href="https://www.gstatic.com" crossorigin />
<script type="module" crossorigin src="/t2-mapper/assets/index-DTbogAPB.js"></script> <script type="module" crossorigin src="/t2-mapper/assets/index-BMiY1uIn.js"></script>
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/chunk-DECur_0Z.js"> <link rel="modulepreload" crossorigin href="/t2-mapper/assets/chunk-DECur_0Z.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/three.module-CwgFV8Kd.js"> <link rel="modulepreload" crossorigin href="/t2-mapper/assets/three.module-CwgFV8Kd.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/streamHelpers-Be29sBCp.js"> <link rel="modulepreload" crossorigin href="/t2-mapper/assets/streamHelpers-Be29sBCp.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/logger-zy3b0zcG.js"> <link rel="modulepreload" crossorigin href="/t2-mapper/assets/logger-z_EpIdIa.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/mission-CFLOK_Oy.js"> <link rel="modulepreload" crossorigin href="/t2-mapper/assets/mission-C2iDKeMo.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/jsx-runtime-BpGWiA-R.js"> <link rel="modulepreload" crossorigin href="/t2-mapper/assets/jsx-runtime-BpGWiA-R.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/traditional-BTL5qX2E.js"> <link rel="modulepreload" crossorigin href="/t2-mapper/assets/traditional-BTL5qX2E.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/react-three-fiber.esm-dhSWjERg.js"> <link rel="modulepreload" crossorigin href="/t2-mapper/assets/react-three-fiber.esm-dhSWjERg.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/stringUtils-BfUKbRCH.js"> <link rel="modulepreload" crossorigin href="/t2-mapper/assets/stringUtils-EmGsjr9D.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/manifest-CmJ-OiDc.js"> <link rel="modulepreload" crossorigin href="/t2-mapper/assets/manifest-CirqV3Ls.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/SettingsProvider-2cUUftaX.js"> <link rel="modulepreload" crossorigin href="/t2-mapper/assets/SettingsProvider-xrmxG700.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/iconBase-BCRUFbxq.js"> <link rel="modulepreload" crossorigin href="/t2-mapper/assets/iconBase-BCRUFbxq.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/engineStore-Cio8vU1L.js"> <link rel="modulepreload" crossorigin href="/t2-mapper/assets/engineStore-Cio8vU1L.js">
<link rel="modulepreload" crossorigin href="/t2-mapper/assets/scene-B1EyKjda.js"> <link rel="modulepreload" crossorigin href="/t2-mapper/assets/scene-C7IIl-c0.js">
<link rel="stylesheet" crossorigin href="/t2-mapper/assets/index-UOHJQQT_.css"> <link rel="stylesheet" crossorigin href="/t2-mapper/assets/index-UOHJQQT_.css">
</head> </head>
<body> <body>

2
env.d.ts vendored
View file

@ -1,6 +1,6 @@
/** Vite-style import.meta.env, shared across app and node tsconfigs. */ /** Vite-style import.meta.env, shared across app and node tsconfigs. */
interface ImportMetaEnv { interface ImportMetaEnv {
readonly VITE_PUBLIC_LOG?: string; readonly VITE_LOG?: string;
} }
interface ImportMeta { interface ImportMeta {

View file

@ -13,15 +13,21 @@ import {
import { cameraTourStore } from "../state/cameraTourStore"; import { cameraTourStore } from "../state/cameraTourStore";
import type { TourAnimation } from "../state/cameraTourStore"; import type { TourAnimation } from "../state/cameraTourStore";
import type { TourTarget } from "./mapTourCategories"; import type { TourTarget } from "./mapTourCategories";
import { createLogger } from "../logger";
const log = createLogger("CameraTourConsumer");
function easeInOutCubic(t: number): number { function easeInOutCubic(t: number): number {
return t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2; return t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2;
} }
const DEFAULT_ORBIT_RADIUS = 4; const FALLBACK_ORBIT_RADIUS = 3;
const DEFAULT_ORBIT_HEIGHT = 2; const DEFAULT_ORBIT_HEIGHT = 2;
const MIN_ORBIT_RADIUS = 2.75; const MIN_ORBIT_RADIUS = 1.5;
const ORBIT_RADIUS_SCALE = 1.5; // multiplier on bounding sphere radius /** Extra orbit radius added beyond half the object's height. */
const ORBIT_PAD_VERTICAL = 1.6;
/** Extra orbit radius added beyond half the object's spread (width/length). */
const ORBIT_PAD_HORIZONTAL = 1.2;
const ORBIT_ANGULAR_SPEED = 0.6; // rad/s const ORBIT_ANGULAR_SPEED = 0.6; // rad/s
const ORBIT_SWEEP = (3 / 4) * (2 * Math.PI); // 270 degrees const ORBIT_SWEEP = (3 / 4) * (2 * Math.PI); // 270 degrees
const ORBIT_CONSTANT_DURATION = ORBIT_SWEEP / ORBIT_ANGULAR_SPEED; const ORBIT_CONSTANT_DURATION = ORBIT_SWEEP / ORBIT_ANGULAR_SPEED;
@ -34,6 +40,9 @@ const LOOK_LEAD = 1.4;
// Reusable temp objects to avoid GC pressure. // Reusable temp objects to avoid GC pressure.
const _box = new Box3(); const _box = new Box3();
const _localBox = new Box3();
const _childBox = new Box3();
const _childMat = new Matrix4();
const _center = new Vector3(); const _center = new Vector3();
const _size = new Vector3(); const _size = new Vector3();
const _v = new Vector3(); const _v = new Vector3();
@ -54,16 +63,20 @@ function orbitFocus(animation: TourAnimation): Vector3 {
); );
} }
const target = animation.targets[animation.currentIndex]; const target = animation.targets[animation.currentIndex];
return _vFocus.set(target.position[0], target.position[1], target.position[2]); return _vFocus.set(
target.position[0],
target.position[1],
target.position[2],
);
} }
function getOrbitRadius(animation: TourAnimation): number { function getOrbitRadius(animation: TourAnimation): number {
return animation.orbitRadius ?? DEFAULT_ORBIT_RADIUS; return animation.orbitRadius ?? FALLBACK_ORBIT_RADIUS;
} }
function getOrbitHeight(animation: TourAnimation): number { function getOrbitHeight(animation: TourAnimation): number {
const r = getOrbitRadius(animation); const r = getOrbitRadius(animation);
return r * (DEFAULT_ORBIT_HEIGHT / DEFAULT_ORBIT_RADIUS); return r * (DEFAULT_ORBIT_HEIGHT / FALLBACK_ORBIT_RADIUS);
} }
function orbitPoint( function orbitPoint(
@ -89,18 +102,54 @@ function resolveTargetBounds(
): void { ): void {
const obj = scene.getObjectByName(target.entityId); const obj = scene.getObjectByName(target.entityId);
if (obj) { if (obj) {
// World-space AABB center for the orbit focus (where the camera looks).
_box.setFromObject(obj); _box.setFromObject(obj);
_box.getCenter(_center); _box.getCenter(_center);
_box.getSize(_size);
animation.orbitCenter = [_center.x, _center.y, _center.z]; animation.orbitCenter = [_center.x, _center.y, _center.z];
const sphereRadius = _size.length() / 2;
animation.orbitRadius = Math.max( // Local-space AABB for sizing. World-space boxes inflate with rotation,
MIN_ORBIT_RADIUS, // giving different sizes for identical models at different orientations.
sphereRadius * ORBIT_RADIUS_SCALE, // Instead, transform each child geometry's box into the root object's
// local frame so the size is rotation-independent.
const invWorld = _mat.copy(obj.matrixWorld).invert();
_localBox.makeEmpty();
obj.traverse((child: any) => {
if (!child.geometry) return;
if (!child.geometry.boundingBox) child.geometry.computeBoundingBox();
_childBox.copy(child.geometry.boundingBox);
_childMat.multiplyMatrices(invWorld, child.matrixWorld);
_childBox.applyMatrix4(_childMat);
_localBox.union(_childBox);
});
_localBox.getSize(_size);
// Pad each dimension's half-extent, then take the larger result.
// This gives a consistent standoff distance regardless of object size.
const height = _size.y; // Three.js Y-up
const spread = Math.max(_size.x, _size.z);
const fromHeight = height / 2 + ORBIT_PAD_VERTICAL;
const fromSpread = spread / 2 + ORBIT_PAD_HORIZONTAL;
const computed = Math.max(fromHeight, fromSpread);
animation.orbitRadius = Math.max(MIN_ORBIT_RADIUS, computed);
const driver = fromHeight >= fromSpread ? "height" : "spread";
const clamp = computed < MIN_ORBIT_RADIUS ? " (clamped)" : "";
log.debug(
"%s: size=%s height→%s spread→%s driven by %s → radius=%d%s",
target.label,
`${_size.x.toFixed(1)}×${_size.y.toFixed(1)}×${_size.z.toFixed(1)}`,
fromHeight.toFixed(1),
fromSpread.toFixed(1),
driver,
animation.orbitRadius,
clamp,
); );
} else { } else {
animation.orbitCenter = null; animation.orbitCenter = null;
animation.orbitRadius = null; animation.orbitRadius = null;
log.debug(
"%s: no scene object, fallback radius=%d",
target.label,
FALLBACK_ORBIT_RADIUS,
);
} }
} }

View file

@ -235,9 +235,7 @@
} }
.ReticleImage { .ReticleImage {
width: 64px; opacity: 0.6;
height: 64px;
opacity: 0.85;
image-rendering: pixelated; image-rendering: pixelated;
} }

View file

@ -73,10 +73,19 @@ function EnergyBar() {
); );
} }
/** Maps normalized weapon shape names to reticle textures from $WeaponsHudData. */
const RETICLE_TEXTURES: Record<string, string> = { const RETICLE_TEXTURES: Record<string, string> = {
weapon_energy: "gui/ret_blaster",
weapon_plasma: "gui/ret_plasma",
weapon_chaingun: "gui/ret_chaingun",
weapon_disc: "gui/ret_disc",
weapon_grenade_launcher: "gui/ret_grenade",
weapon_sniper: "gui/hud_ret_sniper", weapon_sniper: "gui/hud_ret_sniper",
weapon_shocklance: "gui/hud_ret_shocklance", weapon_elf: "gui/ret_elf",
weapon_mortar: "gui/ret_mortor",
weapon_missile: "gui/ret_missile",
weapon_targeting: "gui/hud_ret_targlaser", weapon_targeting: "gui/hud_ret_targlaser",
weapon_shocklance: "gui/hud_ret_shocklance",
}; };
function normalizeWeaponName(shape: string | undefined): string { function normalizeWeaponName(shape: string | undefined): string {

View file

@ -10,6 +10,7 @@ import {
LoopOnce, LoopOnce,
LoopRepeat, LoopRepeat,
Object3D, Object3D,
Audio as ThreeAudio,
PositionalAudio, PositionalAudio,
Vector3, Vector3,
} from "three"; } from "three";
@ -40,8 +41,12 @@ import {
trackSound, trackSound,
untrackSound, untrackSound,
} from "./AudioEmitter"; } from "./AudioEmitter";
import type { ResolvedAudioProfile } from "./AudioEmitter";
import { audioToUrl } from "../loaders"; import { audioToUrl } from "../loaders";
import { createLogger } from "../logger";
import { useSettings } from "./SettingsProvider"; import { useSettings } from "./SettingsProvider";
const log = createLogger("PlayerModel");
import { useEngineStoreApi, useEngineSelector } from "../state/engineStore"; import { useEngineStoreApi, useEngineSelector } from "../state/engineStore";
import { streamPlaybackStore } from "../state/streamPlaybackStore"; import { streamPlaybackStore } from "../state/streamPlaybackStore";
import type { PlayerEntity } from "../state/gameEntityTypes"; import type { PlayerEntity } from "../state/gameEntityTypes";
@ -453,6 +458,67 @@ export function PlayerModel({ entity }: { entity: PlayerEntity }) {
const flagShapeRef = useRef(entity.flagShape); const flagShapeRef = useRef(entity.flagShape);
const [currentFlagShape, setCurrentFlagShape] = useState(entity.flagShape); const [currentFlagShape, setCurrentFlagShape] = useState(entity.flagShape);
// Jet thrust looping sound. Managed imperatively in useFrame based on
// entity.jetting — plays while jetting, stops when jetting ends.
// Sound parameters come from the player's datablock chain:
// PlayerData.sounds[30] (jetSound) → AudioProfile → AudioDescription
const { audioLoader, audioListener } = useAudio();
const audioSettings = useSettings();
const audioEnabled = audioSettings?.audioEnabled ?? false;
const jetSoundRef = useRef<PositionalAudio | null>(null);
const jetBufferRef = useRef<AudioBuffer | null>(null);
const jetProfileRef = useRef<ResolvedAudioProfile | null>(null);
/** PlayerData.Sounds enum index for jetSound. Tribes 2 reordered the
* open-source Torque Sounds enum to put jet sounds first (0-1). */
const JET_SOUND_INDEX = 0;
// Resolve and preload the jet sound from the player's datablock.
useEffect(() => {
if (!audioLoader) return;
const playback = engineStore.getState().playback;
const sp = playback.recording?.streamingPlayback;
if (!sp || !entity.dataBlockId) return;
const getDb = sp.getDataBlockData.bind(sp);
const playerDb = getDb(entity.dataBlockId);
const sounds = playerDb?.sounds as (number | null)[] | undefined;
const jetSoundId = sounds?.[JET_SOUND_INDEX];
if (jetSoundId == null) return;
const resolved = resolveAudioProfile(jetSoundId, getDb);
if (!resolved) return;
jetProfileRef.current = resolved;
try {
const url = audioToUrl(resolved.filename);
getCachedAudioBuffer(url, audioLoader, (buffer) => {
jetBufferRef.current = buffer;
});
} catch {
// File not in manifest.
}
}, [audioLoader, entity.dataBlockId]);
// Cleanup jet sound on unmount.
useEffect(() => {
return () => {
const sound = jetSoundRef.current;
if (sound) {
untrackSound(sound);
try {
sound.stop();
} catch {
/* already stopped */
}
try {
sound.disconnect();
} catch {
/* already disconnected */
}
sound.parent?.remove(sound);
jetSoundRef.current = null;
}
};
}, []);
// Per-frame animation selection and mixer update. // Per-frame animation selection and mixer update.
useFrame((_, delta) => { useFrame((_, delta) => {
if (entity.weaponShape !== weaponShapeRef.current) { if (entity.weaponShape !== weaponShapeRef.current) {
@ -663,6 +729,55 @@ export function PlayerModel({ entity }: { entity: PlayerEntity }) {
headside.weight = blendWeight; headside.weight = blendWeight;
} }
// Jet thrust sound: start/stop a looping positional audio based on
// entity.jetting. The engine plays ArmorJetSound (CloseLooping3d) while
// mJetting is true and stops it when false.
const isJetting = !!entity.jetting && !isDead;
const jetProfile = jetProfileRef.current;
// Check both our ref AND isPlaying — the sound can be externally stopped
// by stopAllTrackedSounds() (on seek/recording change) without our ref
// knowing about it.
const jetSound = jetSoundRef.current;
const soundActuallyPlaying = jetSound?.isPlaying ?? false;
if (isJetting && !soundActuallyPlaying) {
if (
audioEnabled &&
audioListener &&
jetBufferRef.current &&
jetProfile
) {
let sound = jetSound;
if (!sound) {
sound = new PositionalAudio(audioListener);
sound.setDistanceModel("inverse");
sound.setRefDistance(jetProfile.refDist);
sound.setMaxDistance(jetProfile.maxDist);
sound.setRolloffFactor(1);
sound.setVolume(jetProfile.volume);
clonedScene.add(sound);
jetSoundRef.current = sound;
}
try {
sound.setBuffer(jetBufferRef.current);
sound.setLoop(true);
sound.setPlaybackRate(playback.rate);
sound.play();
trackSound(sound, 1);
} catch {
/* AudioContext suspended */
}
}
} else if (!isJetting && soundActuallyPlaying) {
if (jetSound) {
untrackSound(jetSound);
try {
jetSound.stop();
} catch {
/* already stopped */
}
}
}
// Advance or evaluate the body animation mixer. // Advance or evaluate the body animation mixer.
if (isPlaying) { if (isPlaying) {
mixer.update(delta * playback.rate); mixer.update(delta * playback.rate);

View file

@ -95,7 +95,10 @@ export function StreamingMissionInfo() {
<span className={styles.RecordingDate}> <span className={styles.RecordingDate}>
{datePart!.replace(/-/g, " ")} {datePart!.replace(/-/g, " ")}
</span>{" "} </span>{" "}
at <span className={styles.RecordingDate}>{timePart}</span> at{" "}
<span className={styles.RecordingDate}>
{(timePart ?? "").replace(/(AM|PM)$/, " $1")}
</span>
</div> </div>
) : null} ) : null}
{serverName ? ( {serverName ? (

View file

@ -27,12 +27,12 @@ const PINO_LEVELS = new Set([
"silent", "silent",
]); ]);
/** Parse VITE_PUBLIC_LOG into a global default and per-module overrides. */ /** Parse VITE_LOG into a global default and per-module overrides. */
function parseLogConfig(): { function parseLogConfig(): {
globalLevel: string; globalLevel: string;
modules: Map<string, string>; modules: Map<string, string>;
} { } {
const raw = import.meta.env.VITE_PUBLIC_LOG?.trim(); const raw = import.meta.env.VITE_LOG?.trim();
if (!raw) return { globalLevel: "info", modules: new Map() }; if (!raw) return { globalLevel: "info", modules: new Map() };
let globalLevel: string | null = null; let globalLevel: string | null = null;

View file

@ -1,4 +1,5 @@
import { ghostToSceneObject } from "../scene"; import { ghostToSceneObject } from "../scene";
import { getTerrainHeightAt } from "../terrainHeight";
import type { SceneObject } from "../scene/types"; import type { SceneObject } from "../scene/types";
import { import {
linearProjectileClassNames, linearProjectileClassNames,
@ -1136,17 +1137,29 @@ export abstract class StreamEngine implements StreamingPlayback {
if (typeof data.moveFlag0 === "boolean") entity.falling = data.moveFlag0; if (typeof data.moveFlag0 === "boolean") entity.falling = data.moveFlag0;
if (typeof data.moveFlag1 === "boolean") entity.jetting = data.moveFlag1; if (typeof data.moveFlag1 === "boolean") entity.jetting = data.moveFlag1;
// Item velocity interpolation: the Tribes 2 client does NOT simulate // Item velocity interpolation.
// physics (gravity/collision) for items. It interpolates position using
// server-sent velocity until the next server update or atRest=true.
if (entity.type === "Item") { if (entity.type === "Item") {
const atRest = data.atRest as boolean | undefined; const atRest = data.atRest as boolean | undefined;
if (atRest === false && isVec3Like(data.velocity)) { if (atRest === false && isVec3Like(data.velocity)) {
const vel = data.velocity as Vec3;
entity.itemPhysics = { entity.itemPhysics = {
velocity: [data.velocity.x, data.velocity.y, data.velocity.z], velocity: [vel.x, vel.y, vel.z],
atRest: false, atRest: false,
}; };
log.debug(
"Item %s (%s): atRest=false pos=%s vel=%s",
entity.id,
entity.shapeName ?? entity.dataBlock ?? `db#${entity.dataBlockId}`,
data.position ? `${(data.position as Vec3).x.toFixed(1)},${(data.position as Vec3).y.toFixed(1)},${(data.position as Vec3).z.toFixed(1)}` : "none",
`${vel.x.toFixed(1)},${vel.y.toFixed(1)},${vel.z.toFixed(1)}`,
);
} else if (atRest === true) { } else if (atRest === true) {
log.debug(
"Item %s (%s): atRest=true pos=%s",
entity.id,
entity.shapeName ?? entity.dataBlock ?? `db#${entity.dataBlockId}`,
entity.position ? `${entity.position[0].toFixed(1)},${entity.position[1].toFixed(1)},${entity.position[2].toFixed(1)}` : "none",
);
entity.itemPhysics = undefined; entity.itemPhysics = undefined;
} }
} }
@ -1501,9 +1514,18 @@ export abstract class StreamEngine implements StreamingPlayback {
} }
} }
/** Advance dropped item physics (gravity, terrain collision, friction). */ /** Advance item positions using server-sent velocity.
/** Advance item positions using server-sent velocity (no gravity/collision). *
* The real Tribes 2 client just interpolates; physics runs server-side. */ * Verified against Tribes2.exe (build 25034): Item does NOT override
* GameBase::processTick the vtable at offset 0x50 points to the
* inherited FUN_00586050 which does no physics. All item physics
* (gravity, collision, friction) run SERVER-SIDE only. The client just
* interpolates using velocity until the next ghost update.
*
* As a practical fallback for demo playback (where ghost updates can be
* sparse), we apply basic gravity after a few ticks without a server
* update to prevent items from flying upward indefinitely.
*/
protected advanceItems(): void { protected advanceItems(): void {
const dt = TICK_DURATION_MS / 1000; const dt = TICK_DURATION_MS / 1000;
for (const entity of this.entities.values()) { for (const entity of this.entities.values()) {
@ -1511,9 +1533,44 @@ export abstract class StreamEngine implements StreamingPlayback {
if (!phys || phys.atRest || !entity.position) continue; if (!phys || phys.atRest || !entity.position) continue;
const v = phys.velocity; const v = phys.velocity;
const p = entity.position; const p = entity.position;
// Gravity: Item::mGravity = -20 (verified from Torque source item.cc:35).
v[2] += -20 * dt;
// Integrate position.
p[0] += v[0] * dt; p[0] += v[0] * dt;
p[1] += v[1] * dt; p[1] += v[1] * dt;
p[2] += v[2] * dt; p[2] += v[2] * dt;
// Terrain collision: bounce with elasticity/friction matching
// typical Tribes 2 ItemData values (elasticity=0.2, friction=0.6).
const groundZ = getTerrainHeightAt(p[0], p[1]);
if (groundZ != null && p[2] < groundZ) {
p[2] = groundZ;
// Flat-normal collision response (normal = [0,0,1]).
const bd = Math.abs(v[2]);
// Friction: reduce horizontal velocity.
const friction = bd * 0.6;
const hSpeed = Math.sqrt(v[0] * v[0] + v[1] * v[1]);
if (hSpeed > 0) {
const scale = Math.max(0, 1 - friction / hSpeed);
v[0] *= scale;
v[1] *= scale;
}
// Elasticity: bounce.
v[2] = bd * 0.2;
// At-rest check (sAtRestVelocity = 0.15).
const speed = Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
if (speed < 0.15) {
v[0] = v[1] = v[2] = 0;
phys.atRest = true;
}
}
// Clamp items that fall far below the map.
if (p[2] < -1000) {
phys.atRest = true;
}
} }
} }
@ -1729,18 +1786,14 @@ export abstract class StreamEngine implements StreamingPlayback {
]; ];
ghostEntity.rotation = playerYawToQuaternion(yaw); ghostEntity.rotation = playerYawToQuaternion(yaw);
ghostEntity.headPitch = this.getControlPlayerHeadPitch(pitch); ghostEntity.headPitch = this.getControlPlayerHeadPitch(pitch);
// Sync velocity from controlObjectData. Ghost updates skip the // Sync velocity from controlObjectData. The authoritative
// control player (MoveMask is not read), so velocity and state // falling/jetting flags come from the ghost's MoveMask update
// flags must come from here for movement animation selection. // (processed earlier in applyGhostData) — don't overwrite them.
const vel = data?.velocity as const vel = data?.velocity as
| { x: number; y: number; z: number } | { x: number; y: number; z: number }
| undefined; | undefined;
if (isVec3Like(vel)) { if (isVec3Like(vel)) {
ghostEntity.velocity = [vel.x, vel.y, vel.z]; ghostEntity.velocity = [vel.x, vel.y, vel.z];
// Approximate mFalling: engine sets it when no ground contact
// and vz < sFallingThreshold (-10). controlObjectData lacks
// the explicit flag, so use the velocity heuristic.
ghostEntity.falling = vel.z < -10;
} }
} }
} }

View file

@ -10,6 +10,14 @@
/** Minimum velocity dot product to count as intentional movement. */ /** Minimum velocity dot product to count as intentional movement. */
const MOVE_THRESHOLD = 0.1; const MOVE_THRESHOLD = 0.1;
/**
* Horizontal speed above which the player cannot be running on the ground.
* In the engine, grounded players are speed-capped by PlayerData::maxForwardSpeed
* (light=15, medium=12, heavy=7). We use 20 to provide margin for brief
* overshoots from slopes, momentum, and framerate-dependent speed variations.
*/
const MAX_GROUND_SPEED = 20;
export interface MoveAnimationResult { export interface MoveAnimationResult {
/** Engine alias name (e.g. "root", "run", "back", "side", "fall", "jet"). */ /** Engine alias name (e.g. "root", "run", "back", "side", "fall", "jet"). */
animation: string; animation: string;
@ -31,15 +39,18 @@ function quaternionToBodyYaw(q: [number, number, number, number]): number {
* Pick the movement animation for a player based on their velocity, body * Pick the movement animation for a player based on their velocity, body
* orientation, and movement state flags. * orientation, and movement state flags.
* *
* Matches the Tribes2.exe binary (build 25034) pickActionAnimation at * Replicates the Tribes2.exe binary (build 25034) pickActionAnimation at
* 0x005d6210. The engine checks in order: * 0x005d6210. The engine checks in order:
* 1. mFalling FallAnim * 1. mFalling FallAnim
* 2. contactTimer >= 30 (airborne) jetting ? JetAnim : RootAnim * 2. contactTimer >= 30 (airborne) jetting ? JetAnim : RootAnim
* 3. contactTimer < 30 (on ground) velocity-based (run/back/side/root) * 3. contactTimer < 30 (on ground) velocity-based (run/back/side/root)
* *
* We don't have contactTimer, so we approximate airborne detection: jetting * We don't have contactTimer directly, so we approximate the airborne check
* implies airborne, and significant vertical velocity without the falling flag * using two heuristics:
* suggests the player left the ground (jumped, launched, etc.). * - Significant vertical velocity (|vz| > 2) implies not on the ground.
* - Horizontal speed exceeding the max ground running speed implies the
* player is skiing or otherwise airborne, since the engine caps grounded
* movement speed at maxForwardSpeed.
*/ */
export function pickMoveAnimation( export function pickMoveAnimation(
velocity: [number, number, number] | undefined, velocity: [number, number, number] | undefined,
@ -52,23 +63,28 @@ export function pickMoveAnimation(
return { animation: "fall", timeScale: 1 }; return { animation: "fall", timeScale: 1 };
} }
// 2. Jetting always shows the jet animation (engine: contactTimer >= 30
// && mJetting → JetAnim). Jetting implies airborne.
if (jetting) {
return { animation: "jet", timeScale: 1 };
}
if (!velocity) { if (!velocity) {
return { animation: "root", timeScale: 1 }; return { animation: "root", timeScale: 1 };
} }
const [vx, vy, vz] = velocity; const [vx, vy, vz] = velocity;
// Approximate the engine's contactTimer check: if the player has // 2. Airborne detection (approximates contactTimer >= 30).
// significant vertical velocity, they're likely airborne (jumped, launched). // The engine uses contactTimer to distinguish grounded from airborne.
// The engine would show root in this case (contactTimer >= 30, not jetting). // We approximate this with two checks:
// Use a threshold above the falling threshold (-10) to catch the gap. // a) Vertical velocity indicates the player left the ground.
if (Math.abs(vz) > 2) { // b) Horizontal speed exceeds the ground movement cap — the player must
// be skiing/airborne since the engine limits grounded speed.
const horizontalSpeedSq = vx * vx + vy * vy;
const airborne =
Math.abs(vz) > 2 ||
horizontalSpeedSq > MAX_GROUND_SPEED * MAX_GROUND_SPEED;
if (airborne) {
// Tribes2.exe checks mJetting here: jetting → JetAnim, else → RootAnim.
if (jetting) {
return { animation: "jet", timeScale: 1 };
}
return { animation: "root", timeScale: 1 }; return { animation: "root", timeScale: 1 };
} }

View file

@ -57,9 +57,9 @@ export function getGameName(
// Avoid duplication when nameTag matches typeTag (e.g. nameTag="Flag" // Avoid duplication when nameTag matches typeTag (e.g. nameTag="Flag"
// with targetTypeTag="Flag" would otherwise produce "Flag Flag"). // with targetTypeTag="Flag" would otherwise produce "Flag Flag").
if (name !== "" && name.toLowerCase() !== typeTag.toLowerCase()) { if (name !== "" && name.toLowerCase() !== typeTag.toLowerCase()) {
return `${name} ${typeTag}`; return formatTaggedStrings(`${name} ${typeTag}`);
} }
return typeTag; return formatTaggedStrings(typeTag);
} }
} }
@ -72,7 +72,16 @@ export function getGameName(
} }
} }
return name; return formatTaggedStrings(name);
}
/**
* Replace unresolved tagged string references (`\x01` + numeric ID) with a
* readable placeholder. These appear in missions saved from a running server
* where the original text was replaced by its string table ID.
*/
function formatTaggedStrings(s: string): string {
return s.replace(/\x01(\d+)/g, "<#$1>");
} }
/** Strip leading article ("a ", "an ", "some ") and title-case the rest. */ /** Strip leading article ("a ", "an ", "some ") and title-case the rest. */