@cimplify/sdk 0.108.0 → 0.110.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/advanced.d.mts +4 -3
- package/dist/advanced.d.ts +4 -3
- package/dist/advanced.js +24 -24
- package/dist/advanced.mjs +5 -5
- package/dist/animation-4EXBXRVX.js +27 -0
- package/dist/animation-6DICNWUP.mjs +6 -0
- package/dist/audio-DhvyjqdA.d.mts +249 -0
- package/dist/audio-m0w8cnxq.d.ts +249 -0
- package/dist/avatars.d.mts +110 -0
- package/dist/avatars.d.ts +110 -0
- package/dist/avatars.js +82 -0
- package/dist/avatars.mjs +5 -0
- package/dist/backend-gUCzs5Kg.d.mts +3866 -0
- package/dist/backend-gUCzs5Kg.d.ts +3866 -0
- package/dist/{catalogue-B4eLL8Mi.d.ts → catalogue-CPTMyBUz.d.mts} +109 -221
- package/dist/catalogue-DzrTXP3v.d.mts +541 -0
- package/dist/catalogue-DzrTXP3v.d.ts +541 -0
- package/dist/{catalogue-OT89_Ifs.d.mts → catalogue-OTuS5zp-.d.ts} +109 -221
- package/dist/chunk-22BD3RHN.mjs +1809 -0
- package/dist/chunk-25T4JHEA.mjs +21 -0
- package/dist/chunk-2AQ237Y4.js +508 -0
- package/dist/chunk-2IC4H6OV.mjs +48 -0
- package/dist/chunk-2LHLG4OB.mjs +71 -0
- package/dist/chunk-2O2CG465.js +1709 -0
- package/dist/chunk-2Q4DTHXK.js +316 -0
- package/dist/chunk-2QTQ6BUH.mjs +46 -0
- package/dist/chunk-2UN4SFLR.mjs +100 -0
- package/dist/chunk-2V75I7K3.js +454 -0
- package/dist/chunk-2V7IL4HC.js +10 -0
- package/dist/chunk-34XBXUMW.js +296 -0
- package/dist/chunk-3C4C654I.js +71 -0
- package/dist/chunk-3DAD2LDF.mjs +72 -0
- package/dist/chunk-3GXH2NFD.mjs +4 -0
- package/dist/chunk-3O47ZFW3.js +961 -0
- package/dist/chunk-3OY3VYNF.mjs +11 -0
- package/dist/chunk-3S6WPBZL.js +2936 -0
- package/dist/chunk-3TUOUP5T.js +399 -0
- package/dist/chunk-3VEH23I5.mjs +1380 -0
- package/dist/chunk-3ZYSAW2T.mjs +263 -0
- package/dist/chunk-4ANVF274.js +103 -0
- package/dist/chunk-4C7I3ELN.js +388 -0
- package/dist/chunk-4DYKAYFO.mjs +8 -0
- package/dist/chunk-4ZDR72SG.js +329 -0
- package/dist/chunk-52YS45RR.js +1066 -0
- package/dist/chunk-5325XSCH.js +107 -0
- package/dist/chunk-5AD5X6AV.js +13 -0
- package/dist/chunk-5BYDGGWO.mjs +197 -0
- package/dist/chunk-5C3C7VDM.mjs +55 -0
- package/dist/chunk-5HFMY3D7.js +660 -0
- package/dist/chunk-5LH2QN3T.js +1862 -0
- package/dist/chunk-5PJEXSOW.js +44 -0
- package/dist/chunk-5SXDH3Y7.js +90 -0
- package/dist/chunk-5YFBGGCK.mjs +502 -0
- package/dist/chunk-5YWN6H5Q.mjs +133 -0
- package/dist/chunk-66QP3SMN.js +402 -0
- package/dist/chunk-6DAEZKIG.mjs +385 -0
- package/dist/chunk-6DATW7TB.mjs +420 -0
- package/dist/{chunk-JRGK3NXR.mjs → chunk-6ETDAU62.mjs} +72 -212
- package/dist/chunk-6H254EVP.mjs +178 -0
- package/dist/chunk-6PFNJPBJ.mjs +820 -0
- package/dist/chunk-6PJWXIFX.mjs +357 -0
- package/dist/chunk-6SWKWCMS.js +80 -0
- package/dist/chunk-6VVXXX7S.js +808 -0
- package/dist/chunk-6WUBSMTX.js +1403 -0
- package/dist/chunk-73SGZLAQ.mjs +35 -0
- package/dist/chunk-76L2V6KD.mjs +4 -0
- package/dist/chunk-7AAIAVAA.js +1531 -0
- package/dist/chunk-7ARSJPV3.mjs +93 -0
- package/dist/chunk-7BHW5GTC.mjs +1234 -0
- package/dist/chunk-7DQSDKDU.js +6 -0
- package/dist/chunk-7IQQQENP.mjs +401 -0
- package/dist/chunk-7KFTYENS.js +11357 -0
- package/dist/chunk-7SM6XSPZ.js +3171 -0
- package/dist/chunk-7SXOHAIR.mjs +28 -0
- package/dist/chunk-A2MAX6S4.js +90 -0
- package/dist/chunk-A33OORT7.mjs +1530 -0
- package/dist/{chunk-U6ACF76H.mjs → chunk-A36JRXXH.mjs} +1075 -1845
- package/dist/chunk-A7BU3BK4.js +52 -0
- package/dist/chunk-A7MQSN2V.mjs +77 -0
- package/dist/chunk-A7V4L2IT.mjs +416 -0
- package/dist/chunk-AABEK6XU.js +226 -0
- package/dist/chunk-AGV33FWC.mjs +5005 -0
- package/dist/chunk-AHNR3BXI.js +108 -0
- package/dist/chunk-AQ5RLBU2.mjs +286 -0
- package/dist/chunk-AQOE6WCG.js +1270 -0
- package/dist/chunk-ATAWRACV.mjs +62 -0
- package/dist/chunk-ATCURNUV.js +14 -0
- package/dist/chunk-AWPV33OO.js +6 -0
- package/dist/chunk-AYJPHKYV.js +337 -0
- package/dist/chunk-AZ5BGWHB.js +162 -0
- package/dist/chunk-AZAXD44P.js +1373 -0
- package/dist/chunk-BBGKQIJJ.mjs +406 -0
- package/dist/chunk-BP4JLSUA.js +1453 -0
- package/dist/{chunk-SUCE7FWA.mjs → chunk-BTUSVHIE.mjs} +539 -978
- package/dist/chunk-BU6OK542.mjs +818 -0
- package/dist/chunk-CVSRWM6W.js +418 -0
- package/dist/chunk-CYBMFMJD.mjs +247 -0
- package/dist/chunk-DDJLDOUX.mjs +217 -0
- package/dist/{chunk-V32BCG7M.js → chunk-DFZWHNRG.js} +75 -215
- package/dist/chunk-DJ2C7AVG.js +644 -0
- package/dist/chunk-DS2VU4WW.mjs +102 -0
- package/dist/chunk-DSAG7T5P.js +7290 -0
- package/dist/chunk-E2QPPH7I.js +327 -0
- package/dist/chunk-E65WCTIG.mjs +1187 -0
- package/dist/{chunk-33VCYWVL.mjs → chunk-E6QQKDNE.mjs} +30 -42
- package/dist/chunk-ECDK6QBF.mjs +981 -0
- package/dist/chunk-EIB4OWVQ.mjs +620 -0
- package/dist/chunk-EQUZYCGO.js +250 -0
- package/dist/chunk-F3UJ6ZRM.mjs +313 -0
- package/dist/chunk-F63N2ZTQ.js +7023 -0
- package/dist/chunk-F6XRYEM3.mjs +26 -0
- package/dist/chunk-FE6VCE4K.js +5030 -0
- package/dist/chunk-FLWD6GRR.js +1372 -0
- package/dist/chunk-FQBFWJBS.mjs +110 -0
- package/dist/chunk-FXVJ2HFU.js +26 -0
- package/dist/chunk-FZMQMQBW.js +312 -0
- package/dist/chunk-G3EEC44R.js +53 -0
- package/dist/{chunk-KG3WT4PR.mjs → chunk-GCKWKLZF.mjs} +73 -104
- package/dist/chunk-GCX7TY4D.mjs +6826 -0
- package/dist/chunk-GDB6TCSD.js +450 -0
- package/dist/chunk-GDCV4IWO.mjs +21 -0
- package/dist/chunk-GDZT5LZ5.js +170 -0
- package/dist/chunk-GHPUYD4I.mjs +213 -0
- package/dist/chunk-GHS6MIL6.mjs +1432 -0
- package/dist/chunk-GPS2THCL.mjs +11 -0
- package/dist/{chunk-EV2EVOYS.js → chunk-GTJWQAGU.js} +31 -42
- package/dist/chunk-GVTI6UJQ.mjs +130 -0
- package/dist/chunk-GXKI64OT.mjs +1138 -0
- package/dist/chunk-GYDYF2WX.js +275 -0
- package/dist/chunk-GYLP6UG4.mjs +705 -0
- package/dist/chunk-H3OQKK6X.js +1158 -0
- package/dist/chunk-H5DFSCJ6.js +40 -0
- package/dist/chunk-HAGEIC2L.mjs +186 -0
- package/dist/chunk-HAJ4JRFO.js +293 -0
- package/dist/chunk-HDR72GB6.js +188 -0
- package/dist/chunk-HF5HPS4T.mjs +40 -0
- package/dist/chunk-HK6LOFDS.js +218 -0
- package/dist/chunk-HMWYTXCY.mjs +143 -0
- package/dist/chunk-HPCSRCMA.js +89 -0
- package/dist/chunk-HSEO6TPU.js +247 -0
- package/dist/chunk-I5FOHCLH.js +132 -0
- package/dist/chunk-IDLW4NWA.mjs +85 -0
- package/dist/chunk-IIDZ5WUX.js +61 -0
- package/dist/chunk-IR74FJHU.js +2332 -0
- package/dist/chunk-IRVFYAKP.mjs +100 -0
- package/dist/{chunk-XBL3TMPC.mjs → chunk-IZDWAL53.mjs} +1795 -3287
- package/dist/chunk-J2KZXIU3.js +51 -0
- package/dist/chunk-J2U6PJSO.js +91 -0
- package/dist/chunk-J5AJNY2N.js +283 -0
- package/dist/chunk-J6KQZ4FO.mjs +821 -0
- package/dist/{chunk-OWW5GUSB.js → chunk-JGBCIKJV.js} +7 -6
- package/dist/chunk-JKGTBMU7.mjs +25 -0
- package/dist/chunk-JR3TNEQC.js +422 -0
- package/dist/chunk-JURRXY2J.mjs +29 -0
- package/dist/chunk-K3HW5I2A.mjs +317 -0
- package/dist/chunk-K46SMZ66.mjs +103 -0
- package/dist/chunk-K4UDGE3Z.mjs +6 -0
- package/dist/chunk-KDQOR4QQ.mjs +350 -0
- package/dist/chunk-KDTVOLHI.mjs +288 -0
- package/dist/chunk-KGHJH5KJ.mjs +35 -0
- package/dist/chunk-KIZOA5LX.mjs +140 -0
- package/dist/chunk-KK6HYVBI.mjs +242 -0
- package/dist/chunk-KMKWGXMK.js +856 -0
- package/dist/chunk-KPA6K5IB.js +80 -0
- package/dist/chunk-KU7O4IXU.mjs +260 -0
- package/dist/chunk-KVFNRJOR.mjs +11142 -0
- package/dist/chunk-KZJRSXHK.js +2432 -0
- package/dist/chunk-LHWPRUJL.js +79 -0
- package/dist/chunk-LIV3KXJG.mjs +369 -0
- package/dist/chunk-LKV4LACG.js +21 -0
- package/dist/chunk-LUY45X3U.mjs +263 -0
- package/dist/chunk-LYEZZEEF.mjs +17 -0
- package/dist/chunk-M5EXQZYY.mjs +1519 -0
- package/dist/chunk-ME6HGG4I.mjs +1338 -0
- package/dist/chunk-MEXP6DA6.js +31 -0
- package/dist/chunk-MG52AW3H.js +902 -0
- package/dist/chunk-MIPO6F72.js +334 -0
- package/dist/{chunk-5QW7CQBA.js → chunk-MKIJQL5Q.js} +211 -321
- package/dist/chunk-MN3YETVN.mjs +17 -0
- package/dist/chunk-MOBSBXVE.mjs +2391 -0
- package/dist/chunk-MOMOZEUM.mjs +88 -0
- package/dist/chunk-MRFUNRAP.js +62 -0
- package/dist/chunk-MTIHEW2M.js +433 -0
- package/dist/chunk-N4RGGDEL.mjs +73 -0
- package/dist/chunk-NH654HAT.js +10 -0
- package/dist/chunk-NHJUGZUR.mjs +253 -0
- package/dist/chunk-NMQT4HG3.mjs +757 -0
- package/dist/chunk-NPSYB6DC.mjs +906 -0
- package/dist/chunk-NW2GPMSO.js +857 -0
- package/dist/chunk-NXKQOQ6L.js +76 -0
- package/dist/chunk-NXLAZIJZ.js +309 -0
- package/dist/chunk-NYWNA5CF.js +148 -0
- package/dist/chunk-NZTKLY2W.js +1442 -0
- package/dist/chunk-O2ICABUD.js +36 -0
- package/dist/chunk-OIVVQQ22.js +862 -0
- package/dist/chunk-OKC2B4O3.mjs +312 -0
- package/dist/chunk-OLWFPDBK.js +2220 -0
- package/dist/chunk-OMTVH334.js +3779 -0
- package/dist/chunk-OQRVEM56.mjs +362 -0
- package/dist/chunk-OXMIBOD4.js +337 -0
- package/dist/chunk-PBL6YL5L.mjs +288 -0
- package/dist/chunk-PDOELNNQ.js +97 -0
- package/dist/chunk-PDQJY2GZ.js +136 -0
- package/dist/chunk-PKOZXD2Q.js +1274 -0
- package/dist/chunk-PPF2BYFL.mjs +2191 -0
- package/dist/chunk-PQTQKNKD.js +539 -0
- package/dist/chunk-PRSR4FAV.mjs +81 -0
- package/dist/chunk-PTRNO5UD.js +95 -0
- package/dist/chunk-Q2Y3VMKH.js +2000 -0
- package/dist/chunk-QCZOE65N.js +96 -0
- package/dist/chunk-QDYFLATW.mjs +52 -0
- package/dist/chunk-QQABGCMM.js +22 -0
- package/dist/chunk-QS6TRHMR.js +345 -0
- package/dist/chunk-R56P64LB.mjs +208 -0
- package/dist/chunk-RCQ2MPBV.js +428 -0
- package/dist/chunk-RFVRPYR2.mjs +856 -0
- package/dist/chunk-RKBLPGPV.js +11521 -0
- package/dist/chunk-RM2V4IND.mjs +327 -0
- package/dist/chunk-RQXN5A34.mjs +613 -0
- package/dist/chunk-RUVGVNOF.mjs +2687 -0
- package/dist/chunk-SAFJIGYB.mjs +165 -0
- package/dist/chunk-SKQFLBDD.js +263 -0
- package/dist/chunk-SMK6JU2F.mjs +2092 -0
- package/dist/{chunk-UVRPC2P7.js → chunk-SNNEOS5Z.js} +1984 -3476
- package/dist/chunk-SPCRQ6NO.mjs +1246 -0
- package/dist/chunk-SWX4SALA.mjs +19 -0
- package/dist/{chunk-JVODCGFP.mjs → chunk-SYEO2WV4.mjs} +128 -238
- package/dist/chunk-T2QQMX2N.js +10 -0
- package/dist/chunk-T3AFF3L7.mjs +57 -0
- package/dist/chunk-T6Z2EXYL.js +712 -0
- package/dist/chunk-T7LOXGYX.js +118 -0
- package/dist/chunk-TJCAE7RC.mjs +1315 -0
- package/dist/chunk-TJI3K6RP.js +137 -0
- package/dist/chunk-TL2SVO4P.mjs +55 -0
- package/dist/chunk-TM63CYGN.mjs +399 -0
- package/dist/chunk-TU5RYTYU.mjs +13 -0
- package/dist/chunk-TVJZ4GPS.js +1553 -0
- package/dist/chunk-TWM6DLYF.js +371 -0
- package/dist/chunk-U63OC4TQ.js +30 -0
- package/dist/{chunk-L5GKVQVJ.js → chunk-U6BVSJZ6.js} +25 -57
- package/dist/chunk-U6UVWEAK.mjs +792 -0
- package/dist/chunk-UCEPNO6N.mjs +11048 -0
- package/dist/{chunk-ANT574FD.js → chunk-UCR5HRYM.js} +74 -105
- package/dist/chunk-UG5BTOTF.mjs +334 -0
- package/dist/chunk-UGH37BQW.mjs +157 -0
- package/dist/chunk-V7ZRH3PY.mjs +271 -0
- package/dist/chunk-VBGHBL3E.mjs +1394 -0
- package/dist/chunk-VRBDAS5I.js +920 -0
- package/dist/chunk-VVE3Y76O.js +230 -0
- package/dist/chunk-W65JIRI4.mjs +1182 -0
- package/dist/chunk-WHYKAT7G.js +62 -0
- package/dist/{chunk-YOIVZ6OA.mjs → chunk-WIZRUIZB.mjs} +25 -57
- package/dist/chunk-WKWTDZS7.js +385 -0
- package/dist/chunk-WLMINRC4.mjs +78 -0
- package/dist/chunk-WOF3AD3J.js +22 -0
- package/dist/chunk-WWKMOA76.js +1262 -0
- package/dist/chunk-X5A5FOWW.js +615 -0
- package/dist/chunk-X6CN6KQF.mjs +192 -0
- package/dist/chunk-XD2PMH46.mjs +517 -0
- package/dist/chunk-XJA2NGTI.mjs +88 -0
- package/dist/chunk-XJIHN3BY.mjs +8 -0
- package/dist/chunk-XK6UDWJS.js +203 -0
- package/dist/chunk-XPG3N5CF.mjs +415 -0
- package/dist/chunk-XVZ2NKSU.mjs +74 -0
- package/dist/chunk-XYP45OLE.js +117 -0
- package/dist/chunk-XZSDGZX6.mjs +301 -0
- package/dist/chunk-Y2EMGN4T.mjs +120 -0
- package/dist/chunk-Y3XWP5XW.mjs +298 -0
- package/dist/chunk-Y4K22JL6.js +228 -0
- package/dist/chunk-Y65LXQGA.mjs +3164 -0
- package/dist/chunk-Y66WVMO5.mjs +87 -0
- package/dist/chunk-Y7JWLB25.mjs +7280 -0
- package/dist/chunk-YCDXAJKU.js +175 -0
- package/dist/chunk-YRDQCCIS.js +152 -0
- package/dist/chunk-YV52DGSA.js +111 -0
- package/dist/chunk-YXGZQPUD.js +94 -0
- package/dist/chunk-Z3A3AFVU.mjs +102 -0
- package/dist/chunk-ZCY6YKKP.mjs +475 -0
- package/dist/chunk-ZEQHXVU5.js +215 -0
- package/dist/chunk-ZF7JCXCI.js +284 -0
- package/dist/chunk-ZJBRUH6V.js +29 -0
- package/dist/chunk-ZMIL4ZOA.js +365 -0
- package/dist/chunk-ZR5ULMN2.mjs +337 -0
- package/dist/chunk-ZXREOYOW.js +87 -0
- package/dist/{client-BSP9U1O1.d.mts → client-CX_WR0-J.d.mts} +2 -2
- package/dist/client-Dytx_ZTC.d.ts +230 -0
- package/dist/{client-B878xeAP.d.ts → client-dqOhP9Nc.d.ts} +2 -2
- package/dist/client-hTKbCuhG.d.mts +230 -0
- package/dist/clock-B-UAjkKa.d.mts +5 -0
- package/dist/clock-B-UAjkKa.d.ts +5 -0
- package/dist/config-BlXQluJR.d.mts +36 -0
- package/dist/config-BlXQluJR.d.ts +36 -0
- package/dist/courier-Cnn-edJ4.d.ts +95 -0
- package/dist/courier-FmGfkvIN.d.mts +95 -0
- package/dist/crowd-DdHFbqKK.d.ts +186 -0
- package/dist/crowd-hOVSAmA3.d.mts +186 -0
- package/dist/danfo-BEBapFlX.d.mts +146 -0
- package/dist/danfo-UQ_PTIIx.d.ts +146 -0
- package/dist/{elements-Bty6Qs_N.d.mts → elements-DdsRig-2.d.mts} +1548 -257
- package/dist/{elements-Bty6Qs_N.d.ts → elements-DdsRig-2.d.ts} +1548 -257
- package/dist/engines/godot.d.mts +56 -0
- package/dist/engines/godot.d.ts +56 -0
- package/dist/engines/godot.js +28 -0
- package/dist/engines/godot.mjs +3 -0
- package/dist/engines/wasm.d.mts +11 -0
- package/dist/engines/wasm.d.ts +11 -0
- package/dist/engines/wasm.js +178 -0
- package/dist/engines/wasm.mjs +176 -0
- package/dist/fallback-CrG_lTFk.d.mts +270 -0
- package/dist/fallback-CrG_lTFk.d.ts +270 -0
- package/dist/fallback-KDB4Y2CE.mjs +6 -0
- package/dist/fallback-Y26TQENE.js +19 -0
- package/dist/features-CZB4rmcD.d.mts +118 -0
- package/dist/features-CZB4rmcD.d.ts +118 -0
- package/dist/fit-BWiE7rgA.d.mts +44 -0
- package/dist/fit-DK0oT7zO.d.ts +44 -0
- package/dist/five-a-side-Bv1AOUy3.d.mts +115 -0
- package/dist/five-a-side-EC51SJY1.d.ts +115 -0
- package/dist/fluid-ARr0qUIL.d.ts +939 -0
- package/dist/fluid-DLlEj2cs.d.mts +939 -0
- package/dist/game/conformance.d.mts +84 -0
- package/dist/game/conformance.d.ts +84 -0
- package/dist/game/conformance.js +1025 -0
- package/dist/game/conformance.mjs +994 -0
- package/dist/game/heap.d.mts +40 -0
- package/dist/game/heap.d.ts +40 -0
- package/dist/game/heap.js +48 -0
- package/dist/game/heap.mjs +7 -0
- package/dist/game/kit/canvas.d.mts +240 -0
- package/dist/game/kit/canvas.d.ts +240 -0
- package/dist/game/kit/canvas.js +3566 -0
- package/dist/game/kit/canvas.mjs +1039 -0
- package/dist/game/kit/courier.d.mts +17 -0
- package/dist/game/kit/courier.d.ts +17 -0
- package/dist/game/kit/courier.js +66 -0
- package/dist/game/kit/courier.mjs +49 -0
- package/dist/game/kit/danfo.d.mts +11 -0
- package/dist/game/kit/danfo.d.ts +11 -0
- package/dist/game/kit/danfo.js +109 -0
- package/dist/game/kit/danfo.mjs +44 -0
- package/dist/game/kit/engine.d.mts +29 -0
- package/dist/game/kit/engine.d.ts +29 -0
- package/dist/game/kit/engine.js +183 -0
- package/dist/game/kit/engine.mjs +30 -0
- package/dist/game/kit/five-a-side.d.mts +11 -0
- package/dist/game/kit/five-a-side.d.ts +11 -0
- package/dist/game/kit/five-a-side.js +86 -0
- package/dist/game/kit/five-a-side.mjs +41 -0
- package/dist/game/kit/frontier.d.mts +344 -0
- package/dist/game/kit/frontier.d.ts +344 -0
- package/dist/game/kit/frontier.js +435 -0
- package/dist/game/kit/frontier.mjs +14 -0
- package/dist/game/kit/genesis.d.mts +752 -0
- package/dist/game/kit/genesis.d.ts +752 -0
- package/dist/game/kit/genesis.js +380 -0
- package/dist/game/kit/genesis.mjs +15 -0
- package/dist/game/kit/ludo.d.mts +15 -0
- package/dist/game/kit/ludo.d.ts +15 -0
- package/dist/game/kit/ludo.js +87 -0
- package/dist/game/kit/ludo.mjs +42 -0
- package/dist/game/kit/runner.d.mts +12 -0
- package/dist/game/kit/runner.d.ts +12 -0
- package/dist/game/kit/runner.js +83 -0
- package/dist/game/kit/runner.mjs +46 -0
- package/dist/game/kit/shootout.d.mts +13 -0
- package/dist/game/kit/shootout.d.ts +13 -0
- package/dist/game/kit/shootout.js +122 -0
- package/dist/game/kit/shootout.mjs +57 -0
- package/dist/game/kit/slots.d.mts +392 -0
- package/dist/game/kit/slots.d.ts +392 -0
- package/dist/game/kit/slots.js +215 -0
- package/dist/game/kit/slots.mjs +6 -0
- package/dist/game/kit/tycoon.d.mts +16 -0
- package/dist/game/kit/tycoon.d.ts +16 -0
- package/dist/game/kit/tycoon.js +145 -0
- package/dist/game/kit/tycoon.mjs +44 -0
- package/dist/game/kit/word.d.mts +11 -0
- package/dist/game/kit/word.d.ts +11 -0
- package/dist/game/kit/word.js +78 -0
- package/dist/game/kit/word.mjs +41 -0
- package/dist/game/kit/worlds.d.mts +18 -0
- package/dist/game/kit/worlds.d.ts +18 -0
- package/dist/game/kit/worlds.js +74 -0
- package/dist/game/kit/worlds.mjs +49 -0
- package/dist/game/kit.d.mts +53 -0
- package/dist/game/kit.d.ts +53 -0
- package/dist/game/kit.js +2610 -0
- package/dist/game/kit.mjs +101 -0
- package/dist/game/prepared.d.mts +14 -0
- package/dist/game/prepared.d.ts +14 -0
- package/dist/game/prepared.js +81 -0
- package/dist/game/prepared.mjs +32 -0
- package/dist/game-Bx8onkhX.d.mts +1451 -0
- package/dist/game-fgQy2YIm.d.ts +1451 -0
- package/dist/game-theme-CBTw1b_d.d.mts +35 -0
- package/dist/game-theme-Dg-ict5A.d.ts +35 -0
- package/dist/game.d.mts +3546 -0
- package/dist/game.d.ts +3546 -0
- package/dist/game.js +4455 -0
- package/dist/game.mjs +50 -0
- package/dist/graphics-C6YjWYvP.d.ts +5 -0
- package/dist/graphics-Dk2yQnYN.d.mts +5 -0
- package/dist/guest-DrsA00XD.d.mts +732 -0
- package/dist/guest-wIdfoT05.d.ts +732 -0
- package/dist/hit-stop-BKkVwTq7.d.mts +43 -0
- package/dist/hit-stop-D-8pPYnM.d.ts +43 -0
- package/dist/hot-Crn9XpHJ.d.ts +29 -0
- package/dist/hot-DH3nOhQD.d.mts +29 -0
- package/dist/{index-CQStGb3B.d.mts → index-6gkHMGAq.d.mts} +2 -2
- package/dist/index-B8ybCKJI.d.ts +41 -0
- package/dist/{index-DJwXmoaP.d.ts → index-B98Xac8e.d.ts} +2 -2
- package/dist/{index-B7oA_1XI.d.ts → index-B_ByTtIT.d.ts} +2 -2
- package/dist/index-DHjNHb1c.d.mts +41 -0
- package/dist/{index-DhUSTAhT.d.mts → index-DbAN_VQE.d.mts} +2 -2
- package/dist/index.d.mts +134 -24
- package/dist/index.d.ts +134 -24
- package/dist/index.js +407 -248
- package/dist/index.mjs +184 -58
- package/dist/interactives-authoring.d.mts +231 -0
- package/dist/interactives-authoring.d.ts +231 -0
- package/dist/interactives-authoring.js +1743 -0
- package/dist/interactives-authoring.mjs +1704 -0
- package/dist/interactives-canvas.global.js +148 -0
- package/dist/interactives-guest.d.mts +20 -0
- package/dist/interactives-guest.d.ts +20 -0
- package/dist/interactives-guest.js +63 -0
- package/dist/interactives-guest.json +1 -0
- package/dist/interactives-guest.mjs +61 -0
- package/dist/interactives-jsc.global.js +9357 -0
- package/dist/interactives-meters.d.mts +93 -0
- package/dist/interactives-meters.d.ts +93 -0
- package/dist/interactives-meters.js +252 -0
- package/dist/interactives-meters.mjs +68 -0
- package/dist/interactives-production.d.mts +430 -0
- package/dist/interactives-production.d.ts +430 -0
- package/dist/interactives-production.js +1231 -0
- package/dist/interactives-production.mjs +1170 -0
- package/dist/interactives-record.d.mts +112 -0
- package/dist/interactives-record.d.ts +112 -0
- package/dist/interactives-record.js +302 -0
- package/dist/interactives-record.mjs +295 -0
- package/dist/interactives-runtime.d.mts +61 -0
- package/dist/interactives-runtime.d.ts +61 -0
- package/dist/interactives-runtime.js +442 -0
- package/dist/interactives-runtime.mjs +25 -0
- package/dist/interactives-studio-kernel.global.js +1 -0
- package/dist/interactives-studio.d.mts +806 -0
- package/dist/interactives-studio.d.ts +806 -0
- package/dist/interactives-studio.js +5741 -0
- package/dist/interactives-studio.mjs +5651 -0
- package/dist/interactives-tick.d.mts +90 -0
- package/dist/interactives-tick.d.ts +90 -0
- package/dist/interactives-tick.js +203 -0
- package/dist/interactives-tick.mjs +6 -0
- package/dist/interactives-web.d.mts +762 -0
- package/dist/interactives-web.d.ts +762 -0
- package/dist/interactives-web.js +5000 -0
- package/dist/interactives-web.mjs +4628 -0
- package/dist/interactives.d.mts +2430 -0
- package/dist/interactives.d.ts +2430 -0
- package/dist/interactives.js +5723 -0
- package/dist/interactives.mjs +4333 -0
- package/dist/juice-CoHxlpKA.d.ts +42 -0
- package/dist/juice-DQztFS43.d.mts +42 -0
- package/dist/launch-T2f4_Di4.d.mts +151 -0
- package/dist/launch-d6oreMzR.d.ts +151 -0
- package/dist/library-DXYaMFhi.d.mts +69 -0
- package/dist/library-DXYaMFhi.d.ts +69 -0
- package/dist/link-BUTqGmyi.d.mts +38 -0
- package/dist/link-BUTqGmyi.d.ts +38 -0
- package/dist/lint.js +104 -204
- package/dist/lint.mjs +103 -203
- package/dist/local-D8_I6UeL.d.mts +6967 -0
- package/dist/local-VZkqsCzR.d.ts +6967 -0
- package/dist/lockstep-BLf6dglI.d.mts +321 -0
- package/dist/lockstep-D50Ia0JW.d.ts +321 -0
- package/dist/ludo-B8ClkDqr.d.ts +205 -0
- package/dist/ludo-BOuohQ-M.d.mts +205 -0
- package/dist/mock/cli.mjs +200 -56
- package/dist/mock/library.js +200 -56
- package/dist/mock/library.mjs +200 -56
- package/dist/mock/msw.js +200 -56
- package/dist/mock/msw.mjs +200 -56
- package/dist/native-BodxSh03.d.mts +16 -0
- package/dist/native-DUHMT8gA.d.ts +16 -0
- package/dist/network-ZXLD7l1b.d.mts +19 -0
- package/dist/network-ZXLD7l1b.d.ts +19 -0
- package/dist/online-XeymeM9s.d.ts +381 -0
- package/dist/online-d7W_Al9a.d.mts +381 -0
- package/dist/params-DxFb5G_U.d.mts +155 -0
- package/dist/params-DxFb5G_U.d.ts +155 -0
- package/dist/play-BRRlfLhX.d.ts +940 -0
- package/dist/play-ClrMd_e8.d.mts +940 -0
- package/dist/policy-CCw8tXLm.d.mts +3078 -0
- package/dist/policy-CMqOSQIu.d.ts +3078 -0
- package/dist/ports-B_0v_P3A.d.mts +13 -0
- package/dist/ports-CGU_3e_0.d.ts +13 -0
- package/dist/prefetch-BHnicOQj.d.ts +117 -0
- package/dist/prefetch-CBXgYacv.d.mts +117 -0
- package/dist/{price-CSztR02F.d.mts → price-BOzexBww.d.mts} +1 -1
- package/dist/{price-C_vasx9A.d.ts → price-C1h9sPxE.d.ts} +1 -1
- package/dist/protocol-C8qbpUbT.d.mts +242 -0
- package/dist/protocol-C8qbpUbT.d.ts +242 -0
- package/dist/rapier-AZHT4YI7.js +7886 -0
- package/dist/rapier-ODEPCQA6.mjs +7792 -0
- package/dist/react.d.mts +157 -15
- package/dist/react.d.ts +157 -15
- package/dist/react.js +5564 -5904
- package/dist/react.mjs +5451 -5808
- package/dist/runner-CQcLL7By.d.ts +189 -0
- package/dist/runner-D46Yj-wE.d.mts +189 -0
- package/dist/runtime-BRWfkf_q.d.mts +51 -0
- package/dist/runtime-DyuBMkKM.d.ts +51 -0
- package/dist/scheduling-D2ajXpMC.d.ts +224 -0
- package/dist/scheduling-DSRbbaZb.d.mts +224 -0
- package/dist/schema-BrWxzKp6.d.mts +63 -0
- package/dist/schema-BrWxzKp6.d.ts +63 -0
- package/dist/server/evict.js +34 -37
- package/dist/server/evict.mjs +34 -37
- package/dist/server/tanstack.d.mts +49 -3
- package/dist/server/tanstack.d.ts +49 -3
- package/dist/server/tanstack.js +169 -117
- package/dist/server/tanstack.mjs +166 -118
- package/dist/{server-Dckg4Vdr.d.ts → server-D29IIuDV.d.ts} +136 -130
- package/dist/{server-B6dW7-Lj.d.mts → server-DQMWPnc8.d.mts} +136 -130
- package/dist/server.d.mts +45 -5
- package/dist/server.d.ts +45 -5
- package/dist/server.js +171 -227
- package/dist/server.mjs +165 -225
- package/dist/session-grant-CJ27DwrT.d.mts +19 -0
- package/dist/session-grant-CJ27DwrT.d.ts +19 -0
- package/dist/shootout-BJZeX6FG.d.ts +140 -0
- package/dist/shootout-tcZd1Rxt.d.mts +140 -0
- package/dist/state-replica-stMtdkVD.d.mts +42 -0
- package/dist/state-replica-stMtdkVD.d.ts +42 -0
- package/dist/studio-CowqWqez.d.mts +14 -0
- package/dist/studio-CowqWqez.d.ts +14 -0
- package/dist/styles.css +1 -1
- package/dist/template-AhCdB1kW.d.mts +190 -0
- package/dist/template-BkEGVTQj.d.ts +190 -0
- package/dist/terrain-BMxEc6Oc.d.ts +429 -0
- package/dist/terrain-C-XC1Oui.d.mts +429 -0
- package/dist/testing/msw.d.mts +28 -4
- package/dist/testing/msw.d.ts +28 -4
- package/dist/testing/msw.js +15 -21
- package/dist/testing/msw.mjs +15 -21
- package/dist/testing/suite.d.mts +6 -5
- package/dist/testing/suite.d.ts +6 -5
- package/dist/testing/suite.js +89 -124
- package/dist/testing/suite.mjs +81 -116
- package/dist/testing.d.mts +27 -1227
- package/dist/testing.d.ts +27 -1227
- package/dist/testing.js +127 -131
- package/dist/testing.mjs +19 -23
- package/dist/tick-transport-C8QEh8Uw.d.mts +50 -0
- package/dist/tick-transport-UjHY3xK1.d.ts +50 -0
- package/dist/timeline-protocol-hp6e8zFB.d.mts +47 -0
- package/dist/timeline-protocol-hp6e8zFB.d.ts +47 -0
- package/dist/tokens-DhanQRQS.d.mts +21 -0
- package/dist/tokens-K8yxwd6G.d.ts +21 -0
- package/dist/tree-C-Io2Hbx.d.mts +35 -0
- package/dist/tree-CP_qSW4H.d.ts +35 -0
- package/dist/tycoon-B5KHk2Xx.d.mts +255 -0
- package/dist/tycoon-hmHo-3HX.d.ts +255 -0
- package/dist/types-BQkxPwZP.d.mts +219 -0
- package/dist/types-D_f6UUxM.d.ts +219 -0
- package/dist/ui-DwHicuFv.d.mts +563 -0
- package/dist/ui-hi7S2YcH.d.ts +563 -0
- package/dist/{sign-in-DQlIdqsi.d.mts → url-52ndUruG.d.mts} +15 -1
- package/dist/{sign-in-DQlIdqsi.d.ts → url-52ndUruG.d.ts} +15 -1
- package/dist/utils.d.mts +3 -3
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +37 -37
- package/dist/utils.mjs +4 -4
- package/dist/vars-Dc_PrhBK.d.mts +511 -0
- package/dist/vars-Dc_PrhBK.d.ts +511 -0
- package/dist/vm-IUARFFAI.mjs +63 -0
- package/dist/vm-N7L6MGGH.js +65 -0
- package/dist/weave-delivery-CW-Kstut.d.mts +360 -0
- package/dist/weave-delivery-CW-Kstut.d.ts +360 -0
- package/dist/web-Dss74a7v.d.ts +883 -0
- package/dist/web-f9ZQPoyw.d.mts +883 -0
- package/dist/web-transport-C7MkBL0a.d.ts +19 -0
- package/dist/web-transport-aYEqXMd9.d.mts +19 -0
- package/dist/weight-CPGjsgjV.d.ts +92 -0
- package/dist/weight-tF1ODR1p.d.mts +92 -0
- package/dist/word-BcX9Jcmv.d.mts +70 -0
- package/dist/word-C7sVPLHm.d.ts +70 -0
- package/dist/world-PvILHDR1.d.ts +2285 -0
- package/dist/world-qekkXjJv.d.mts +2285 -0
- package/dist/worlds-Br2Pb0Cs.d.ts +109 -0
- package/dist/worlds-D5ydYr7d.d.mts +109 -0
- package/engines/c/cimplify.h +108 -0
- package/engines/c/cimplify.lib.js +11 -0
- package/engines/godot/addons/cimplify/cimplify.gd +97 -0
- package/engines/rust/interactives-ctx/Cargo.toml +9 -0
- package/engines/rust/interactives-ctx/src/lib.rs +189 -0
- package/package.json +189 -3
- package/vendor/rapier3d-compat/LICENSE +201 -0
- package/vendor/rapier3d-compat/PATCHES.md +61 -0
- package/dist/chunk-2P4KXFB6.js +0 -274
- package/dist/chunk-3G6RQLXK.mjs +0 -21
- package/dist/chunk-3V4DVXV3.mjs +0 -254
- package/dist/chunk-EDK3LNM6.js +0 -2436
- package/dist/chunk-F7J3HK27.js +0 -4549
- package/dist/chunk-U4MW6PYU.mjs +0 -23
- package/dist/chunk-XREIZ56K.js +0 -26
|
@@ -0,0 +1,1039 @@
|
|
|
1
|
+
import { PlaceViewerScene, PLACE_VIEWER_SET, PLACE_VIEWER_CAMERA, emptyWorld, bakeThingGlb, ThingEffects, LivePlayer, applySky, buildIdentityCharacter, engineAvatarExports, AVATAR_DESIGN_REPORT, AvatarDesignSession, AvatarDesigner, VECTOR_REPORT, VectorEditSession, CROWD_CHARACTER_ASSET } from '../../chunk-GCX7TY4D.mjs';
|
|
2
|
+
export { ANCHOR_ROLL, ANCHOR_SCALE, ANCHOR_STRIDE, ANCHOR_X, ANCHOR_Y, ANY_STATE, ARKIT_COUNT, AVATAR_DESIGN, AVATAR_DESIGN_REPORT, AVATAR_MOODS, AVATAR_OUTPUT_FLOATS, AVATAR_SLOTS, AVATAR_SPRING_GROUPS, AXIS_X, AXIS_Y, AXIS_Z, Achievements, AdaptiveMusic, AiInbox, AnimationGraph, Autosave, AvatarDesignSession, AvatarDesigner, AvatarModels, AvatarPerformer, AvatarRoster, BLANK_ARTBOARD_NAME, BLANK_ARTBOARD_SIZE, BindState, CAST_SHADOW, CATALOGUE_MODELS, CATALOGUE_PROP_RECIPES, CATALOGUE_RECIPE_SOURCES, CHEER_FULL_MOMENT, CROWD_CHARACTER_ASSET, CROWD_CHARACTER_ITEM, Checkpoints, ClipRecorder, CtxTurnRoom, DAY_HOUR, DAY_INDEX, DEFAULT_CLIP_MS, DEFAULT_FLY_ROTATION_KEYS, DEFAULT_MOVEMENT_KEYS, DEFAULT_STACK_LIMIT, DayClock, DragControls, DropTable, ENGINE_AVATAR_EXPORT_NAMES, EXPRESSION_COUNT, EYE_HEIGHT, FIRST_RANK, FaceAnchors, FaceExpression, FaceLandmark, FaceSession, FirstPersonControls, FlyControls, FriendChallenges, GRAPH_BLEND_SECONDS, GRAPH_CURRENT, GRAPH_ELAPSED, GRAPH_PREVIOUS, GRAPH_PRIORITY, GRAPH_STATE_SECONDS, GRAPH_TRANSITION, GyroLookControls, HOURS_PER_DAY, HeadPose, INVENTORY_SNAPSHOT_STRIDE, Inventory, LANDMARK_COUNT, LEVEL_FOR_TIER, LIVE_VALUES, Leaderboard, Ledger, LivePlayer, METRIC_WIDTH, MapControls, MathUtils, MovementAxes, NO_ACHIEVEMENT, NO_CHECKPOINT, NO_ITEM, NO_MOOD, NO_OBJECTIVE, NO_SLOT, NO_STATE, NPC_STRIDE, NPC_WALKING, NpcSchedules, ONE_WATCHER, Objectives, OrbitControls, PLACE_VIEWER_CAMERA, PLACE_VIEWER_SET, PLAYER_WATCHER, POSE_COUNT, PROP_LEVELS, PROP_RECIPES, PlaceViewerScene, PointerLockControls, PortClipAction, PremiumStore, RECEIVE_SHADOW, REPLAY_RATES, RankedScores, ReplayRecorder, SCORE, SCORE_BEST, SCORE_COMBO, SCORE_COMBO_LEFT, SCORE_ELAPSED, SCORE_REMAINING, SCORE_TIME_UP, SETTLE_CYCLES, SETTLE_DAMPING, SKY_PRESETS, SOUND_RECIPES, START_MOMENT, SaveSlots, ScoreHud, ScoreTimer, Shop, ShopResult, SlotPool, StatusLine, TEXTURE_RECIPES, ThingEffects, ThreePort, TrackballControls, UNLIMITED_STOCK, UiBinder, VECTOR_REPORT, VECTOR_VIEWER, VectorEditSession, VectorMessageError, WORLD_LAYERS, Waves, applySky, arkitWeight, authorValue, bakeThingGlb, beats, blankVectorFile, blockoutKinds, buildIdentityCharacter, buildPropGlb, captureFace, catalogueProblems, chemistry_exports as chemistry, chooseMotion, choosePreset, clockText, defineEconomy, deviceQuaternion, economyManifest, economyToml, emptyWorld, encodeWav, engineAvatarExports, giftKey, hasModel, hourAt, keyOfCode, kindsWithoutModels, loadThingSounds, modelCost, modelRecipeFor, moodIndex, newStreak, oddsMatch, offerMatches, openSaveSlots, parseStreak, playable, propBounds, propTriangles, quiltTexture, readImageRequest, readInput, readPlayback, readShow, recordPlay, remainingCimples, replayInputs, showcase_exports as showcase, slottedRunner, slottedShootout, streakAlive, streakAtRisk, streakStatus, synthesizeSound, synthesizeTexture, voteKey, weatherOf } from '../../chunk-GCX7TY4D.mjs';
|
|
3
|
+
import { wordPuzzleTemplate } from '../../chunk-SAFJIGYB.mjs';
|
|
4
|
+
export { word_exports as word } from '../../chunk-SAFJIGYB.mjs';
|
|
5
|
+
import { jollofTycoonTemplate } from '../../chunk-F3UJ6ZRM.mjs';
|
|
6
|
+
export { DailyChallenges, MS_PER_DAY, dayIndex, daySeed, hashSalt, tycoon_exports as tycoon, utcOffsetMinutes } from '../../chunk-F3UJ6ZRM.mjs';
|
|
7
|
+
import { danfoRouteTemplate } from '../../chunk-7IQQQENP.mjs';
|
|
8
|
+
export { danfo_exports as danfo } from '../../chunk-7IQQQENP.mjs';
|
|
9
|
+
import { courierTemplate } from '../../chunk-KU7O4IXU.mjs';
|
|
10
|
+
export { CIRCLE_RADIUS, CIRCLE_WORDS, CIRCLE_X, CIRCLE_Z, KEEP_OUT_STRIDE, KeepOut, MAX_SCATTER_TRIES, NO_PICKUP, PICKUP_STRIDE, Pickups, SeekBot, courier_exports as courier, daylight, staticBox, walledArena, withinCircle, withinRadius } from '../../chunk-KU7O4IXU.mjs';
|
|
11
|
+
export { worlds_exports as worlds } from '../../chunk-AQ5RLBU2.mjs';
|
|
12
|
+
export { ANIM_AIR, ANIM_CROUCH, ANIM_PELVIS_OFFSET, ANIM_SPEED, CHASE_DISTANCE, CHASE_FOV, CHASE_PITCH, CHASE_SPEED, CHASE_X, CHASE_Y, CHASE_YAW, CHASE_Z, CharacterAnimator, ChaseCamera, FirstPersonView, TOUCH_CONTROLS, VIEW_BOB_PHASE, VIEW_BOB_WEIGHT, VIEW_DIP, VIEW_FOV, VIEW_PITCH, VIEW_X, VIEW_Y, VIEW_YAW, VIEW_Z, chasePreset, defineDriveActions, definePlayActions, engineSurfaceOf, firstPerson, thirdPersonCharacter, vehicleDriver } from '../../chunk-ZCY6YKKP.mjs';
|
|
13
|
+
export { KitVehicle, vehiclePreset } from '../../chunk-CYBMFMJD.mjs';
|
|
14
|
+
export { frontier_exports as frontier } from '../../chunk-J6KQZ4FO.mjs';
|
|
15
|
+
export { genesis_exports as genesis } from '../../chunk-6PFNJPBJ.mjs';
|
|
16
|
+
export { COMMERCE_CAPABILITIES, ECONOMY_IDENTIFIER, IN_WORLD_CATEGORY, REAL_MONEY_SUGGESTION, auditEconomy, auditManifestEconomy, inWorldRefusal, judgeEconomy, kitPublicationGates, realMoneyIn } from '../../chunk-XZSDGZX6.mjs';
|
|
17
|
+
export { Bool, Character, Choice, ContentRef, DIGEST_PREFIX, INLINE_VALUE_BYTES, Int, MAX_REMIX_DEPTH, Num, Palette, Params, REMIX_FORMAT, RemixError, SLOT_TEMPLATES, SceneReportError, SceneSlot, TEMPLATE_SCHEMA_FORMAT, TEMPLATE_SLOTS_FLAG, THEME_PRESETS, TemplateSlotError, Theme, Track, anchors, assignSlots, canonicalSlotJson, checkSlot, colorInt, contrastRatio, decodeRemix, describeIssue, describeSlot, encodeRemix, memoryRemixSources, parseColor, remix, remixDigest, remixLineage, resolveRemix, runnerSlots, shootoutSlots, slotChoices, slotContent, slotDigest, slotPresets, slotSceneFromReport, template, templateFromSchema, templateRef, templateSchema, templateSlotsEnabled } from '../../chunk-NMQT4HG3.mjs';
|
|
18
|
+
import { attachSurfaceInput } from '../../chunk-6DATW7TB.mjs';
|
|
19
|
+
export { CtxAudioPort, ORIGIN_QW, ORIGIN_QX, ORIGIN_QY, ORIGIN_QZ, ORIGIN_X, ORIGIN_Y, ORIGIN_Z, Particles, SILENT, SPAWN_B, SPAWN_END_B, SPAWN_END_G, SPAWN_END_R, SPAWN_G, SPAWN_LIFE, SPAWN_R, SPAWN_SIZE, SPAWN_SPIN, SPAWN_VX, SPAWN_VY, SPAWN_VZ, SPAWN_X, SPAWN_Y, SPAWN_Z, Spray, attachSurfaceInput, firstFrame } from '../../chunk-6DATW7TB.mjs';
|
|
20
|
+
import { penaltyShootoutTemplate } from '../../chunk-K3HW5I2A.mjs';
|
|
21
|
+
export { shootout_exports as shootout } from '../../chunk-K3HW5I2A.mjs';
|
|
22
|
+
import { endlessRunnerTemplate } from '../../chunk-LIV3KXJG.mjs';
|
|
23
|
+
export { CameraRig, LaneRunner, RUN_BEST, RUN_DISTANCE, RUN_SPEED, RUN_VY, RUN_X, RUN_Y, RUN_Z, runner_exports as runner } from '../../chunk-LIV3KXJG.mjs';
|
|
24
|
+
export { writePosition, writeScale } from '../../chunk-GPS2THCL.mjs';
|
|
25
|
+
export { ODDS_TOTAL_PPM, discloseOdds, effect, faucet, fixedOffer, grant, inWorldCurrency, premiumCurrency, premiumExchange, premiumItem, randomExchange, randomOffer, sink, softCurrency, softExchange, softItem, unlock } from '../../chunk-3DAD2LDF.mjs';
|
|
26
|
+
export { HitStop, SHAKE_ROLL, SHAKE_X, SHAKE_Y, SHAKE_Z, ScreenShake } from '../../chunk-2UN4SFLR.mjs';
|
|
27
|
+
export { ScreenFlash, Springs } from '../../chunk-A7MQSN2V.mjs';
|
|
28
|
+
import { fiveASideTemplate } from '../../chunk-6DAEZKIG.mjs';
|
|
29
|
+
export { PlanarSnapshotSync, SNAPSHOT_CHANNEL, five_a_side_exports as fiveASide } from '../../chunk-6DAEZKIG.mjs';
|
|
30
|
+
import { ludoTemplate } from '../../chunk-A7V4L2IT.mjs';
|
|
31
|
+
export { DEFAULT_TURN_LOG_CAPACITY, LocalTurnRoom, NO_WINNER, TURN_PASS_ACTION, TurnGame, ludo_exports as ludo } from '../../chunk-A7V4L2IT.mjs';
|
|
32
|
+
export { KitError } from '../../chunk-4DYKAYFO.mjs';
|
|
33
|
+
export { BOX_ROTATION, BOX_SX, BOX_SY, BOX_SZ, BOX_X, BOX_Y, BOX_Z, BoxBatch, addSceneCamera } from '../../chunk-QDYFLATW.mjs';
|
|
34
|
+
export { createTemplateHarness, digestFloats, digestInts, templateFrameStamp } from '../../chunk-KGHJH5KJ.mjs';
|
|
35
|
+
import { compileThing, ThingError } from '../../chunk-W65JIRI4.mjs';
|
|
36
|
+
export { BUTTON_MIDDLE, BUTTON_PRIMARY, BUTTON_SECONDARY, CELL_ROAD, CELL_SOLID, CELL_TAKEN, CLOSE_SEGMENTS, CROWD_VOTE_BYTES, CROWD_VOTE_TAG, CSG_EPSILON, CameraPose, CheerMeter, CsgPlane, CsgPolygon, DEFAULT_CELL, DEFAULT_PART_LENGTH, DEFAULT_PART_RADIUS, DEFAULT_PART_SIZE, DEFAULT_THING_MATERIAL, EFFECT_TRIANGLE_COST, FIT_HEADROOM, GROUND_AREA_UNIT, LAYER_COST, LIGHT_SHARE, LIGHT_TRIANGLES, MAX_THING_PARTS, MAX_VOTE_CHOICES, MAX_VOTE_INDEX, MEDIUM_TRIANGLES, MIDDLE_SEGMENTS, NO_VOTE_WINNER, OccupancyGrid, SCATTER_ATTEMPTS, SHOP_TAG, SMALL_PART_SHARE, THING_COMBINES, THING_EFFECTS, THING_MATERIALS, THING_MIRRORS, THING_SHAPE_KINDS, TIER_BUDGET, ThingError, VotePoll, applyGround, buildWorld, checkWorld, colliderOf, compileThing, csg, decodeVote, encodeVote, fewerPeople, flatPart, footprintOf, frameDamping, giftMoments, gridOf, heavyWithoutPeople, layerCounts, lighten, markPlacement, massOf, partOfFlat, peopleForTier, peopleOn, phoneCost, rotationMatrix, scatter, shapeFaces, shapeOfFlat, shapePolygons, shapeRadius, simplifyStroke, thingBreaks, thingMaterial, thingMaterialIds, verdict, votesOpenedBy, walkFrom, worldWeight } from '../../chunk-W65JIRI4.mjs';
|
|
37
|
+
export { CHAR_AIR_SECONDS, CHAR_BUFFER, CHAR_COYOTE, CHAR_CROUCH, CHAR_GROUND_NX, CHAR_GROUND_NY, CHAR_GROUND_NZ, CHAR_HEADING, CHAR_LANDING_SPEED, CHAR_MOVE_MAGNITUDE, CHAR_MOVE_X, CHAR_MOVE_Z, CHAR_PLATFORM_VX, CHAR_PLATFORM_VY, CHAR_PLATFORM_VZ, CHAR_SPEED, CHAR_SPEED_NORMALIZED, CHAR_VX, CHAR_VY, CHAR_VZ, CONTACT_LOCKED, CONTACT_LOCK_BLEND, CONTACT_LOCK_X, CONTACT_LOCK_Y, CONTACT_LOCK_Z, CONTACT_PLANTED, CONTACT_WEIGHT, CharacterMotor, ClipEventReader, DEFAULT_CLIP_EVENT_CAPACITY, DEFAULT_FOOT_UP, DEFAULT_GAMEPAD_LOOK_SPEED, DEFAULT_LOOK_SENSITIVITY, DEFAULT_MAX_FOOT_TILT, FOLLOW_CAMERA_X, FOLLOW_CAMERA_Y, FOLLOW_CAMERA_Z, FOLLOW_CLOSENESS, FOLLOW_DISTANCE, FOLLOW_FOV, FOLLOW_PITCH, FOLLOW_PIVOT_X, FOLLOW_PIVOT_Y, FOLLOW_PIVOT_Z, FOLLOW_SHOULDER, FOLLOW_YAW, FollowCamera, FootContact, MAX_TOUCH_BUTTONS, MOVE_IN_X, MOVE_IN_Y, MOVE_IO_MAGNITUDE, MOVE_IO_WORDS, MOVE_IO_X, MOVE_IO_Z, MOVE_OUT_X, MOVE_OUT_Z, ROOT_IO_DX, ROOT_IO_DZ, ROOT_IO_YAW, STICK_AIM, STICK_CURVE, STICK_DEAD_ZONE, STICK_DX, STICK_DY, STICK_IO_WORDS, STICK_MAGNITUDE, STICK_MOVE, STICK_OUT_WORDS, STICK_RADIUS, STICK_X, STICK_Y, TouchControls, createFootTiltChain, followOrigin, followOriginInto, shapeStick, shapeStickInto, touchLayout } from '../../chunk-ECDK6QBF.mjs';
|
|
38
|
+
export { BOOM_DISTANCE, BOOM_DX, BOOM_DY, BOOM_DZ, BOOM_FREE, BOOM_IO_WORDS, BOOM_OX, BOOM_OY, BOOM_OZ, CameraBoom, DEFAULT_BOOM_RADIUS, LensDriver, POSE_PITCH, POSE_X, POSE_Y, POSE_YAW, POSE_Z, interpolatedPosition, placeCamera, wrapAngle, yawOfQuat } from '../../chunk-Y2EMGN4T.mjs';
|
|
39
|
+
import '../../chunk-UCEPNO6N.mjs';
|
|
40
|
+
import '../../chunk-IRVFYAKP.mjs';
|
|
41
|
+
import '../../chunk-R56P64LB.mjs';
|
|
42
|
+
import '../../chunk-GHPUYD4I.mjs';
|
|
43
|
+
import { STARTER_CATALOGUE } from '../../chunk-TJCAE7RC.mjs';
|
|
44
|
+
import '../../chunk-2LHLG4OB.mjs';
|
|
45
|
+
import { createPreparedBackend, createEngineBackend } from '../../chunk-AGV33FWC.mjs';
|
|
46
|
+
import '../../chunk-BBGKQIJJ.mjs';
|
|
47
|
+
import '../../chunk-3ZYSAW2T.mjs';
|
|
48
|
+
import '../../chunk-NPSYB6DC.mjs';
|
|
49
|
+
import '../../chunk-RQXN5A34.mjs';
|
|
50
|
+
export { IdentityFitter, identityCapturePolicy, identityFromCapture } from '../../chunk-KK6HYVBI.mjs';
|
|
51
|
+
export { REPLAY_FORMAT_VERSION, ReplayClipRecorder, decodeReplay, encodeReplay, playFromReplay, simulateReplay, stateDigest } from '../../chunk-DDJLDOUX.mjs';
|
|
52
|
+
import { attachDomInput } from '../../chunk-HMWYTXCY.mjs';
|
|
53
|
+
import { createGame } from '../../chunk-KVFNRJOR.mjs';
|
|
54
|
+
import '../../chunk-KDTVOLHI.mjs';
|
|
55
|
+
import '../../chunk-RM2V4IND.mjs';
|
|
56
|
+
import '../../chunk-22BD3RHN.mjs';
|
|
57
|
+
import '../../chunk-ME6HGG4I.mjs';
|
|
58
|
+
import '../../chunk-5BYDGGWO.mjs';
|
|
59
|
+
import { EngineGraphics } from '../../chunk-Y65LXQGA.mjs';
|
|
60
|
+
import '../../chunk-7ARSJPV3.mjs';
|
|
61
|
+
import '../../chunk-7BHW5GTC.mjs';
|
|
62
|
+
import '../../chunk-RUVGVNOF.mjs';
|
|
63
|
+
import '../../chunk-HF5HPS4T.mjs';
|
|
64
|
+
import '../../chunk-XPG3N5CF.mjs';
|
|
65
|
+
import '../../chunk-KIZOA5LX.mjs';
|
|
66
|
+
import '../../chunk-7SXOHAIR.mjs';
|
|
67
|
+
import '../../chunk-ATAWRACV.mjs';
|
|
68
|
+
import '../../chunk-T3AFF3L7.mjs';
|
|
69
|
+
import '../../chunk-TL2SVO4P.mjs';
|
|
70
|
+
import { FRAME_SECONDS_SLOT, FRAME_NOW_MS_SLOT } from '../../chunk-IDLW4NWA.mjs';
|
|
71
|
+
import '../../chunk-3GXH2NFD.mjs';
|
|
72
|
+
export { ENGINE_RAGDOLL_POLICY_EXPORT_NAMES, POLICY_ACTION_MODES, POLICY_DRIVE_PRESETS, RagdollPolicies, RagdollPolicy, policyActionSize, policyObservationSize } from '../../chunk-PRSR4FAV.mjs';
|
|
73
|
+
import '../../chunk-TM63CYGN.mjs';
|
|
74
|
+
import '../../chunk-X6CN6KQF.mjs';
|
|
75
|
+
import '../../chunk-73SGZLAQ.mjs';
|
|
76
|
+
import '../../chunk-M5EXQZYY.mjs';
|
|
77
|
+
import '../../chunk-TU5RYTYU.mjs';
|
|
78
|
+
import '../../chunk-3OY3VYNF.mjs';
|
|
79
|
+
import '../../chunk-EIB4OWVQ.mjs';
|
|
80
|
+
import '../../chunk-PBL6YL5L.mjs';
|
|
81
|
+
import '../../chunk-GXKI64OT.mjs';
|
|
82
|
+
import '../../chunk-NHJUGZUR.mjs';
|
|
83
|
+
import '../../chunk-E65WCTIG.mjs';
|
|
84
|
+
import '../../chunk-5YFBGGCK.mjs';
|
|
85
|
+
import '../../chunk-K4UDGE3Z.mjs';
|
|
86
|
+
import '../../chunk-MOBSBXVE.mjs';
|
|
87
|
+
import '../../chunk-SMK6JU2F.mjs';
|
|
88
|
+
import '../../chunk-JURRXY2J.mjs';
|
|
89
|
+
import { bindEngineRuntime } from '../../chunk-GHS6MIL6.mjs';
|
|
90
|
+
import '../../chunk-GDCV4IWO.mjs';
|
|
91
|
+
import '../../chunk-Y66WVMO5.mjs';
|
|
92
|
+
import '../../chunk-A33OORT7.mjs';
|
|
93
|
+
export { IdentityCaptureError } from '../../chunk-5C3C7VDM.mjs';
|
|
94
|
+
import '../../chunk-LYEZZEEF.mjs';
|
|
95
|
+
import { sendToStudio, onStudio } from '../../chunk-HAGEIC2L.mjs';
|
|
96
|
+
import '../../chunk-K46SMZ66.mjs';
|
|
97
|
+
import '../../chunk-PPF2BYFL.mjs';
|
|
98
|
+
export { themeTokens as slotUiTheme } from '../../chunk-WLMINRC4.mjs';
|
|
99
|
+
import { UiVectorPlay } from '../../chunk-RFVRPYR2.mjs';
|
|
100
|
+
import '../../chunk-5YWN6H5Q.mjs';
|
|
101
|
+
import '../../chunk-F6XRYEM3.mjs';
|
|
102
|
+
import '../../chunk-OQRVEM56.mjs';
|
|
103
|
+
import '../../chunk-SPCRQ6NO.mjs';
|
|
104
|
+
import '../../chunk-V7ZRH3PY.mjs';
|
|
105
|
+
import '../../chunk-GYLP6UG4.mjs';
|
|
106
|
+
import '../../chunk-XJA2NGTI.mjs';
|
|
107
|
+
import '../../chunk-2IC4H6OV.mjs';
|
|
108
|
+
import '../../chunk-MOMOZEUM.mjs';
|
|
109
|
+
import '../../chunk-N4RGGDEL.mjs';
|
|
110
|
+
import { GameError } from '../../chunk-XJIHN3BY.mjs';
|
|
111
|
+
import { base64Bytes } from '../../chunk-Z3A3AFVU.mjs';
|
|
112
|
+
import { LAUNCH_ITEMS, LAUNCH_FILES } from '../../chunk-JKGTBMU7.mjs';
|
|
113
|
+
export { LAUNCH_CLIPS, LAUNCH_FILES, LAUNCH_HAIR_STYLES, LAUNCH_ITEMS, LAUNCH_RIG } from '../../chunk-JKGTBMU7.mjs';
|
|
114
|
+
import { parseIdentityBase, decodeIdentity } from '../../chunk-XD2PMH46.mjs';
|
|
115
|
+
export { MONK_TONES, NEUTRAL_HAIR, NO_PART, catalogueHair, decodeIdentity, encodeIdentity, isCatalogueHair, monkTone, neutralIdentity, parseIdentityBase, snapTone, toneColour, toneFromColour } from '../../chunk-XD2PMH46.mjs';
|
|
116
|
+
import '../../chunk-25T4JHEA.mjs';
|
|
117
|
+
|
|
118
|
+
// src/game/kit/host/canvas-backend.ts
|
|
119
|
+
var PREPARED_ENGINE = { kind: "prepared" }, PREPARED_PLATFORM = { engine: () => Promise.resolve(PREPARED_ENGINE) };
|
|
120
|
+
async function canvasPlatformBackend(graphics, options = {}) {
|
|
121
|
+
let platform = await graphics.engine();
|
|
122
|
+
return platform.kind === "prepared" ? createPreparedBackend(options.prepared) : createEngineBackend(bindEngineRuntime(platform.runtime), options.engine);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// src/game/kit/host/warmup.ts
|
|
126
|
+
var WARMUP_FRAMES = 4800, WARMUP_SLICE_MS = 4, WARMUP_SEED = 24301, WARMUP_FRAME_INTERVAL_MS = 1e3 / 120, WARMUP_SURFACE_PIXELS = 64;
|
|
127
|
+
function warmupSurface() {
|
|
128
|
+
return typeof OffscreenCanvas != "function" ? null : { canvas: new OffscreenCanvas((64), (64)), width: (64), height: (64), pixelRatio: 1 };
|
|
129
|
+
}
|
|
130
|
+
var TEMPLATES = [
|
|
131
|
+
fiveASideTemplate,
|
|
132
|
+
penaltyShootoutTemplate,
|
|
133
|
+
endlessRunnerTemplate,
|
|
134
|
+
ludoTemplate,
|
|
135
|
+
wordPuzzleTemplate,
|
|
136
|
+
jollofTycoonTemplate,
|
|
137
|
+
danfoRouteTemplate,
|
|
138
|
+
courierTemplate
|
|
139
|
+
];
|
|
140
|
+
function warmupTemplateFor(sceneName) {
|
|
141
|
+
for (let i = 0; i < TEMPLATES.length; i++) if (TEMPLATES[i].id === sceneName) return TEMPLATES[i];
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
var yieldTask = () => new Promise((resolve) => setTimeout(resolve, 0)), TASK_CLOCK = { now: () => performance.now(), yield: yieldTask };
|
|
145
|
+
function warmTemplate(template2, backend, clock = TASK_CLOCK, frames = (4800)) {
|
|
146
|
+
let cancelled = false;
|
|
147
|
+
return {
|
|
148
|
+
done: (async () => {
|
|
149
|
+
let game = await createGame({ backend: await backend(), seed: (24301), ui: null, surface: warmupSurface() }), scene = template2.scene(), bot = template2.bot();
|
|
150
|
+
game.addScene(scene), game.start(scene.name);
|
|
151
|
+
let frame = 0, now = clock.now();
|
|
152
|
+
try {
|
|
153
|
+
for (; frame < frames && !cancelled; ) {
|
|
154
|
+
let until = clock.now() + (4);
|
|
155
|
+
for (; frame < frames && clock.now() < until; )
|
|
156
|
+
bot.drive(scene, game, frame++), now += WARMUP_FRAME_INTERVAL_MS, game.clock[FRAME_NOW_MS_SLOT] = now, game.runFrame();
|
|
157
|
+
await clock.yield();
|
|
158
|
+
}
|
|
159
|
+
} finally {
|
|
160
|
+
game.dispose();
|
|
161
|
+
}
|
|
162
|
+
return frame;
|
|
163
|
+
})(),
|
|
164
|
+
cancel() {
|
|
165
|
+
cancelled = true;
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// src/game/kit/host/canvas.ts
|
|
171
|
+
var PIXEL_RATIO_CAP = 2, UNSUPPORTED = "unsupported_feature", NO_FRAME = 0;
|
|
172
|
+
function animationFrames() {
|
|
173
|
+
let scope = globalThis;
|
|
174
|
+
return typeof scope.requestAnimationFrame == "function" && typeof scope.cancelAnimationFrame == "function" ? scope : null;
|
|
175
|
+
}
|
|
176
|
+
async function runNativeGame(ctx, options, runtime) {
|
|
177
|
+
let backend = options.backend ?? createEngineBackend(bindEngineRuntime(runtime), {
|
|
178
|
+
renderer: "cimplify",
|
|
179
|
+
attach: (render, attach) => ctx.graphics.attach_engine(render, { ...attach, pixel_ratio_cap: (2) })
|
|
180
|
+
}), game = await createGame({ backend, seed: options.seed, ui: options.ui ?? null, surface: null }).catch((error) => {
|
|
181
|
+
throw backend.graphics.dispose(), backend.physics.dispose(), backend.audio.dispose(), error;
|
|
182
|
+
}), surface = backend.graphics instanceof EngineGraphics ? backend.graphics.native : null;
|
|
183
|
+
if (surface === null)
|
|
184
|
+
throw game.dispose(), new GameError("unsupported_feature", "the host did not attach a native engine surface");
|
|
185
|
+
let detachInput = attachSurfaceInput(game.input, surface);
|
|
186
|
+
game.addScene(options.scene), game.start(options.scene.name);
|
|
187
|
+
let onFrame = options.onFrame ?? null, running = true, stopFrames = surface.on_frame((targetMs) => {
|
|
188
|
+
running && (onFrame?.(game, targetMs), game.clock[FRAME_NOW_MS_SLOT] = targetMs, game.runFrame());
|
|
189
|
+
}), pause = () => {
|
|
190
|
+
running = false;
|
|
191
|
+
}, resume = () => {
|
|
192
|
+
running = true;
|
|
193
|
+
}, listeners = [
|
|
194
|
+
ctx.lifecycle.on("hidden", pause),
|
|
195
|
+
ctx.lifecycle.on("suspend", pause),
|
|
196
|
+
ctx.lifecycle.on("visible", resume),
|
|
197
|
+
ctx.lifecycle.on("resume", resume)
|
|
198
|
+
];
|
|
199
|
+
return ctx.on_dispose(() => {
|
|
200
|
+
running = false, stopFrames(), detachInput();
|
|
201
|
+
for (let i = 0; i < listeners.length; i++) listeners[i]();
|
|
202
|
+
game.dispose();
|
|
203
|
+
}), game;
|
|
204
|
+
}
|
|
205
|
+
function scheduler() {
|
|
206
|
+
let scope = globalThis;
|
|
207
|
+
if (typeof scope.requestAnimationFrame != "function" || typeof scope.cancelAnimationFrame != "function")
|
|
208
|
+
throw new Error("the canvas profile needs requestAnimationFrame");
|
|
209
|
+
return scope;
|
|
210
|
+
}
|
|
211
|
+
async function runWebGpuGame(ctx, options) {
|
|
212
|
+
if (options.backend !== void 0 || options.api === "webgl2") return null;
|
|
213
|
+
let platform = await ctx.graphics.engine();
|
|
214
|
+
if (platform.kind !== "engine" || !(ctx.graphics.features.apis.indexOf("webgpu") >= 0 && !!platform.runtime.gpu) && !platform.runtime.gl) return null;
|
|
215
|
+
try {
|
|
216
|
+
return await runNativeGame(ctx, options, platform.runtime);
|
|
217
|
+
} catch (error) {
|
|
218
|
+
if (error?.code === UNSUPPORTED) return null;
|
|
219
|
+
throw error;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
async function runCanvasGame(ctx, options) {
|
|
223
|
+
if (animationFrames() === null) {
|
|
224
|
+
let platform = await ctx.graphics.engine();
|
|
225
|
+
if (platform.kind === "engine") return runNativeGame(ctx, options, platform.runtime);
|
|
226
|
+
}
|
|
227
|
+
let webgpu = await runWebGpuGame(ctx, options);
|
|
228
|
+
if (webgpu !== null) return webgpu;
|
|
229
|
+
let template2 = options.warmup === false ? null : warmupTemplateFor(options.scene.name), warming = null, surface = await ctx.graphics.acquire_surface({
|
|
230
|
+
api: options.api ?? "webgl2",
|
|
231
|
+
transparent: false,
|
|
232
|
+
pixel_ratio_cap: (2),
|
|
233
|
+
offscreen: false
|
|
234
|
+
}), game = await createGame({
|
|
235
|
+
backend: options.backend ?? await canvasPlatformBackend(ctx.graphics),
|
|
236
|
+
seed: options.seed,
|
|
237
|
+
ui: options.ui ?? null,
|
|
238
|
+
surface: { canvas: surface.canvas, width: surface.width, height: surface.height, pixelRatio: surface.pixel_ratio }
|
|
239
|
+
}), canvas = surface.canvas, detachInput = canvas instanceof HTMLCanvasElement ? attachDomInput(game.input, canvas, globalThis) : null, stopResize = surface.on_resize((width, height) => game.graphics.resize(width, height, surface.pixel_ratio));
|
|
240
|
+
game.addScene(options.scene), game.start(options.scene.name);
|
|
241
|
+
let frames = scheduler(), onFrame = options.onFrame ?? null, handle = (0), running = false, tick = (now) => {
|
|
242
|
+
running && (template2 !== null && warming === null && (warming = warmTemplate(template2, () => canvasPlatformBackend(ctx.graphics))), onFrame?.(game, now), game.clock[FRAME_NOW_MS_SLOT] = now, game.runFrame(), handle = frames.requestAnimationFrame(tick));
|
|
243
|
+
}, resume = () => {
|
|
244
|
+
running || (running = true, handle = frames.requestAnimationFrame(tick));
|
|
245
|
+
}, pause = () => {
|
|
246
|
+
running = false, handle !== (0) && frames.cancelAnimationFrame(handle), handle = (0);
|
|
247
|
+
}, listeners = [
|
|
248
|
+
ctx.lifecycle.on("hidden", pause),
|
|
249
|
+
ctx.lifecycle.on("suspend", pause),
|
|
250
|
+
ctx.lifecycle.on("visible", resume),
|
|
251
|
+
ctx.lifecycle.on("resume", resume),
|
|
252
|
+
ctx.graphics.on_context_lost(pause),
|
|
253
|
+
ctx.graphics.on_context_restored(resume)
|
|
254
|
+
];
|
|
255
|
+
return ctx.on_dispose(() => {
|
|
256
|
+
warming?.cancel(), pause();
|
|
257
|
+
for (let i = 0; i < listeners.length; i++) listeners[i]();
|
|
258
|
+
stopResize(), detachInput?.(), game.dispose(), surface.release();
|
|
259
|
+
}), resume(), game;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// src/game/kit/viewers/place-viewer-main.ts
|
|
263
|
+
var PLACE_DOC_BINDING = "doc", PLACE_TIER_BINDING = "tier", PLACE_CAMERA_BINDING = "camera", TIERS = ["low", "mid", "high"], CAMERAS = ["walk", "orbit"];
|
|
264
|
+
function valueOf(values, binding) {
|
|
265
|
+
return values?.find((entry) => entry.binding === binding)?.value;
|
|
266
|
+
}
|
|
267
|
+
function isWorldDoc(value) {
|
|
268
|
+
if (typeof value != "object" || value === null) return false;
|
|
269
|
+
let doc = value;
|
|
270
|
+
return Array.isArray(doc.size) && Array.isArray(doc.scatters) && Array.isArray(doc.roads) && typeof doc.sky == "object";
|
|
271
|
+
}
|
|
272
|
+
function shownFrom(values) {
|
|
273
|
+
let doc = valueOf(values, PLACE_DOC_BINDING);
|
|
274
|
+
if (!isWorldDoc(doc)) return null;
|
|
275
|
+
let tier = valueOf(values, PLACE_TIER_BINDING);
|
|
276
|
+
return { doc, tier: TIERS.includes(tier) ? tier : "high" };
|
|
277
|
+
}
|
|
278
|
+
function cameraFrom(values) {
|
|
279
|
+
let camera = valueOf(values, PLACE_CAMERA_BINDING);
|
|
280
|
+
return CAMERAS.includes(camera) ? camera : null;
|
|
281
|
+
}
|
|
282
|
+
async function crowdCharacter(ctx) {
|
|
283
|
+
if (ctx.assets.has?.(CROWD_CHARACTER_ASSET) === false) return null;
|
|
284
|
+
try {
|
|
285
|
+
return (await ctx.assets.take(CROWD_CHARACTER_ASSET)).slice().buffer;
|
|
286
|
+
} catch {
|
|
287
|
+
return null;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
async function placeViewer(ctx) {
|
|
291
|
+
let scene = new PlaceViewerScene(null, STARTER_CATALOGUE, await crowdCharacter(ctx));
|
|
292
|
+
ctx.ui.on_event((event) => {
|
|
293
|
+
if (event.action === PLACE_VIEWER_SET) {
|
|
294
|
+
let shown = shownFrom(event.values);
|
|
295
|
+
shown !== null && scene.show(shown);
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
if (event.action === PLACE_VIEWER_CAMERA) {
|
|
299
|
+
let camera = cameraFrom(event.values);
|
|
300
|
+
camera !== null && scene.setCamera(camera);
|
|
301
|
+
}
|
|
302
|
+
}), await runCanvasGame(ctx, { scene }), ctx.program.ready(), await scene.ready();
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// src/game/kit/viewers/draft-player-main.ts
|
|
306
|
+
var DRAFT_ASSET = "assets/core/studio/draft.json", STUDIO_TEST_GIFT = "studio.test_gift", STUDIO_GIFT_BINDING = "gift", DRAFT_FORMAT = 1, SHOWCASE_SIZE = [30, 30], decoder = new TextDecoder();
|
|
307
|
+
function liveOf(value) {
|
|
308
|
+
if (typeof value != "object" || value === null) return null;
|
|
309
|
+
let live = value;
|
|
310
|
+
return !Array.isArray(live.bindings) || live.music === void 0 || live.crowd === void 0 ? null : { bindings: live.bindings, music: live.music, crowd: live.crowd };
|
|
311
|
+
}
|
|
312
|
+
function readDraftFile(bytes) {
|
|
313
|
+
try {
|
|
314
|
+
let value = JSON.parse(decoder.decode(bytes));
|
|
315
|
+
return value.format !== (1) || typeof value.title != "string" ? null : {
|
|
316
|
+
format: (1),
|
|
317
|
+
title: value.title,
|
|
318
|
+
kind: typeof value.kind == "string" ? value.kind : "game",
|
|
319
|
+
place: value.place ?? null,
|
|
320
|
+
things: Array.isArray(value.things) ? value.things : [],
|
|
321
|
+
live: liveOf(value.live)
|
|
322
|
+
};
|
|
323
|
+
} catch {
|
|
324
|
+
return null;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
function showcaseWorld(draft) {
|
|
328
|
+
return draft.place !== null ? draft.place : {
|
|
329
|
+
...emptyWorld(draft.title, SHOWCASE_SIZE),
|
|
330
|
+
gates: [[SHOWCASE_SIZE[0] / 2, SHOWCASE_SIZE[1] / 2]]
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
var BREAK_PIECES = 16, BREAK_EFFECT = "break", SEED_PRIME = 16777619, SEED_BASIS = 2166136261;
|
|
334
|
+
function bakedThings(things) {
|
|
335
|
+
let out = [];
|
|
336
|
+
for (let thing of things)
|
|
337
|
+
try {
|
|
338
|
+
let compiled = compileThing(thing);
|
|
339
|
+
out.push({ thing, compiled, glb: bakeThingGlb(compiled, thing.name) });
|
|
340
|
+
} catch (error) {
|
|
341
|
+
if (!(error instanceof ThingError)) throw error;
|
|
342
|
+
}
|
|
343
|
+
return out;
|
|
344
|
+
}
|
|
345
|
+
function breaks(thing) {
|
|
346
|
+
return thing.effects.some((effect2) => effect2.kind === BREAK_EFFECT);
|
|
347
|
+
}
|
|
348
|
+
function seedOf(name) {
|
|
349
|
+
let hash = (2166136261);
|
|
350
|
+
for (let i = 0; i < name.length; i++)
|
|
351
|
+
hash = Math.imul(hash ^ name.charCodeAt(i), (16777619)) >>> 0;
|
|
352
|
+
return hash;
|
|
353
|
+
}
|
|
354
|
+
async function brokenThing(game, baked) {
|
|
355
|
+
let port = game.backend.destruction;
|
|
356
|
+
if (!breaks(baked.thing) || port?.fracture === void 0) return null;
|
|
357
|
+
let mesh = baked.compiled.levels[0].mesh;
|
|
358
|
+
try {
|
|
359
|
+
let result = port.fracture(
|
|
360
|
+
{ positions: mesh.positions, normals: mesh.normals, indices: mesh.indices },
|
|
361
|
+
{ pieces: (16), seed: seedOf(baked.thing.name) }
|
|
362
|
+
);
|
|
363
|
+
return { model: await game.graphics.loadModel({ bytes: result.model.slice().buffer }), fracture: result.asset };
|
|
364
|
+
} catch {
|
|
365
|
+
return null;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
function draftSounds(draft) {
|
|
369
|
+
let out = /* @__PURE__ */ new Set(), live = draft.live;
|
|
370
|
+
if (live !== null) {
|
|
371
|
+
for (let stem of live.music.stems) stem.sound.length > 0 && out.add(stem.sound);
|
|
372
|
+
for (let cue of live.music.cues) cue.sound.length > 0 && out.add(cue.sound);
|
|
373
|
+
}
|
|
374
|
+
for (let thing of draft.things)
|
|
375
|
+
for (let effect2 of thing.effects) effect2.sound && out.add(effect2.sound);
|
|
376
|
+
return [...out];
|
|
377
|
+
}
|
|
378
|
+
var DraftScene = class {
|
|
379
|
+
constructor(place) {
|
|
380
|
+
this.place = place;
|
|
381
|
+
this.name = "studio-draft";
|
|
382
|
+
this.live = null;
|
|
383
|
+
this.ui = null;
|
|
384
|
+
this.things = [];
|
|
385
|
+
this.broken = [];
|
|
386
|
+
this.sounds = /* @__PURE__ */ new Map();
|
|
387
|
+
this.effects = [];
|
|
388
|
+
this.effectsFor = -1;
|
|
389
|
+
}
|
|
390
|
+
attachLive(live, ui) {
|
|
391
|
+
this.live = live, this.ui = ui;
|
|
392
|
+
}
|
|
393
|
+
attachThings(things, sounds, broken = []) {
|
|
394
|
+
this.things = things, this.sounds = sounds, this.broken = broken, this.effectsFor = -1;
|
|
395
|
+
}
|
|
396
|
+
enter(game) {
|
|
397
|
+
this.place.enter(game);
|
|
398
|
+
}
|
|
399
|
+
exit() {
|
|
400
|
+
this.disposeEffects(), this.place.exit();
|
|
401
|
+
}
|
|
402
|
+
fixedUpdate(game) {
|
|
403
|
+
for (let effects of this.effects) effects.fixedUpdate(game);
|
|
404
|
+
}
|
|
405
|
+
disposeEffects() {
|
|
406
|
+
for (let effects of this.effects) effects.dispose();
|
|
407
|
+
this.effects = [];
|
|
408
|
+
}
|
|
409
|
+
syncEffects(game) {
|
|
410
|
+
if (this.effectsFor === this.place.shownVersion) return;
|
|
411
|
+
this.effectsFor = this.place.shownVersion, this.disposeEffects();
|
|
412
|
+
let camera = this.place.cameraEntity, shown = this.place.thingsShown;
|
|
413
|
+
if (camera !== null)
|
|
414
|
+
for (let i = 0; i < shown.length && i < this.things.length; i++) {
|
|
415
|
+
let thing = this.things[i];
|
|
416
|
+
if (thing.effects.length === 0) continue;
|
|
417
|
+
let effects = new ThingEffects(game, shown[i], thing.effects, {
|
|
418
|
+
camera,
|
|
419
|
+
sounds: this.sounds,
|
|
420
|
+
broken: this.broken[i] ?? null
|
|
421
|
+
});
|
|
422
|
+
effects.play(), this.effects.push(effects);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
update(game) {
|
|
426
|
+
this.place.update(game), this.syncEffects(game);
|
|
427
|
+
for (let effects of this.effects) effects.update(game);
|
|
428
|
+
let live = this.live;
|
|
429
|
+
live !== null && (live.frame({
|
|
430
|
+
seconds: game.clock[FRAME_SECONDS_SLOT],
|
|
431
|
+
tick: game.tick,
|
|
432
|
+
hour: this.place.hour,
|
|
433
|
+
people: this.place.people
|
|
434
|
+
}), this.ui?.flush());
|
|
435
|
+
}
|
|
436
|
+
};
|
|
437
|
+
async function optionalAsset(ctx, name) {
|
|
438
|
+
if (ctx.assets.has?.(name) === false) return null;
|
|
439
|
+
try {
|
|
440
|
+
return await ctx.assets.take(name);
|
|
441
|
+
} catch {
|
|
442
|
+
return null;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
async function loadSounds(ctx, game, paths) {
|
|
446
|
+
let sounds = /* @__PURE__ */ new Map();
|
|
447
|
+
for (let path of paths) {
|
|
448
|
+
let bytes = await optionalAsset(ctx, path);
|
|
449
|
+
if (bytes !== null)
|
|
450
|
+
try {
|
|
451
|
+
sounds.set(path, await game.audio.load({ bytes: bytes.slice().buffer }));
|
|
452
|
+
} catch {
|
|
453
|
+
continue;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
return sounds;
|
|
457
|
+
}
|
|
458
|
+
async function draftPlayer(ctx) {
|
|
459
|
+
let draft = readDraftFile(await ctx.assets.take(DRAFT_ASSET));
|
|
460
|
+
if (draft === null) throw new Error("this Interactive's draft could not be read");
|
|
461
|
+
let character = await optionalAsset(ctx, CROWD_CHARACTER_ASSET), place = new PlaceViewerScene(
|
|
462
|
+
{ doc: showcaseWorld(draft), tier: ctx.graphics.features.device_tier },
|
|
463
|
+
STARTER_CATALOGUE,
|
|
464
|
+
character === null ? null : character.slice().buffer
|
|
465
|
+
);
|
|
466
|
+
place.setCamera("walk");
|
|
467
|
+
let scene = new DraftScene(place), game = await runCanvasGame(ctx, { scene }), sounds = await loadSounds(ctx, game, draftSounds(draft));
|
|
468
|
+
if (draft.live !== null) {
|
|
469
|
+
let ui = ctx.ui.game(), live = new LivePlayer(ui, draft.live, game.audio.conductor, sounds, 1 / game.stepSeconds);
|
|
470
|
+
scene.attachLive(live, ui), ctx.ui.on_event((event) => {
|
|
471
|
+
if (event.action !== STUDIO_TEST_GIFT) return;
|
|
472
|
+
let gift = event.values?.find((entry) => entry.binding === STUDIO_GIFT_BINDING)?.value;
|
|
473
|
+
typeof gift == "string" && live.gift(gift);
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
let baked = bakedThings(draft.things), broken = await Promise.all(baked.map((entry) => brokenThing(game, entry)));
|
|
477
|
+
scene.attachThings(
|
|
478
|
+
baked.map((entry) => entry.thing),
|
|
479
|
+
sounds,
|
|
480
|
+
broken
|
|
481
|
+
), await place.setThings(baked.map((entry) => entry.glb)), ctx.program.ready(), await place.ready();
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
// src/game/kit/viewers/avatar-viewer.ts
|
|
485
|
+
var AVATAR_VIEWER_SET = "avatar.set", AVATAR_VIEWER_TURN = "avatar.turn", MAX_TURN_RADIANS = Math.PI / 3, TURN_SPAN = 1, IDLE_CLIP = "idle", GESTURE_SECONDS = 2.4, ATTITUDE_CLIPS = {
|
|
486
|
+
neutral: null,
|
|
487
|
+
warm: "clap",
|
|
488
|
+
cool: "shrug",
|
|
489
|
+
playful: "wave"
|
|
490
|
+
}, FRAMINGS = {
|
|
491
|
+
head: { target: 1.6, distance: 0.75 },
|
|
492
|
+
bust: { target: 1.45, distance: 1.25 },
|
|
493
|
+
full: { target: 0.9, distance: 3.4 }
|
|
494
|
+
}, FOV = 30, NEAR = 0.05, FAR = 50, SUN_INTENSITY = 1.6, SKY_INTENSITY = 0.9, SUN_POSITION = [2, 4, 3], STUDIO_SKY = { hour: 15, weather: "clear", dayMinutes: 0 }, SPRING_RATE = Math.sqrt(90), SETTLED = 1e-4, FADE_SECONDS = 0.25, HALF = 0.5, AvatarViewerScene = class {
|
|
495
|
+
constructor(baseBytes, clipBytes) {
|
|
496
|
+
this.baseBytes = baseBytes;
|
|
497
|
+
this.clipBytes = clipBytes;
|
|
498
|
+
this.name = "avatar-viewer";
|
|
499
|
+
this.game = null;
|
|
500
|
+
this.base = null;
|
|
501
|
+
this.camera = null;
|
|
502
|
+
this.body = null;
|
|
503
|
+
this.node = null;
|
|
504
|
+
this.idle = null;
|
|
505
|
+
this.gesture = null;
|
|
506
|
+
this.gestureLeft = 0;
|
|
507
|
+
this.shown = null;
|
|
508
|
+
this.turning = new AvatarTurn();
|
|
509
|
+
this.turnInput = { down: false, released: false, dragX: 0 };
|
|
510
|
+
this.generation = 0;
|
|
511
|
+
this.arrivals = [];
|
|
512
|
+
}
|
|
513
|
+
get canDraw() {
|
|
514
|
+
return this.baseBytes !== null;
|
|
515
|
+
}
|
|
516
|
+
get turned() {
|
|
517
|
+
return this.turning.value;
|
|
518
|
+
}
|
|
519
|
+
enter(game) {
|
|
520
|
+
this.game = game;
|
|
521
|
+
let sun = game.world.spawn();
|
|
522
|
+
game.transforms.add(sun, SUN_POSITION[0], SUN_POSITION[1], SUN_POSITION[2]), game.graphics.create(sun, { kind: "light", light: "directional", intensity: (1.6) });
|
|
523
|
+
let sky = game.world.spawn();
|
|
524
|
+
game.transforms.add(sky), game.graphics.create(sky, { kind: "light", light: "hemisphere", intensity: (0.9) });
|
|
525
|
+
let camera = game.world.spawn();
|
|
526
|
+
game.transforms.add(camera), game.graphics.camera(camera, (30), (0.05), (50)), this.camera = camera, applySky(game.graphics, STUDIO_SKY, 0), this.shown !== null && this.show(this.shown);
|
|
527
|
+
}
|
|
528
|
+
exit() {
|
|
529
|
+
this.clear(), this.game = null;
|
|
530
|
+
}
|
|
531
|
+
shownOnce() {
|
|
532
|
+
return this.node !== null ? Promise.resolve() : new Promise((resolve) => this.arrivals.push(resolve));
|
|
533
|
+
}
|
|
534
|
+
show(shown) {
|
|
535
|
+
this.shown = shown;
|
|
536
|
+
let game = this.game;
|
|
537
|
+
if (game === null || this.baseBytes === null) return;
|
|
538
|
+
this.frame(shown.framing);
|
|
539
|
+
let glb;
|
|
540
|
+
try {
|
|
541
|
+
this.base ?? (this.base = parseIdentityBase(this.baseBytes)), glb = buildIdentityCharacter(this.base, decodeIdentity(shown.identity));
|
|
542
|
+
} catch {
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
let generation = ++this.generation;
|
|
546
|
+
game.graphics.loadModel({ bytes: glb.slice().buffer }).then(
|
|
547
|
+
(info) => {
|
|
548
|
+
generation !== this.generation || this.game === null || this.place(this.game, info.id);
|
|
549
|
+
},
|
|
550
|
+
() => {
|
|
551
|
+
}
|
|
552
|
+
);
|
|
553
|
+
}
|
|
554
|
+
setTurn(turn) {
|
|
555
|
+
this.turning.set(turn);
|
|
556
|
+
}
|
|
557
|
+
frame(framing) {
|
|
558
|
+
let game = this.game, camera = this.camera;
|
|
559
|
+
if (game === null || camera === null) return;
|
|
560
|
+
let view = FRAMINGS[framing];
|
|
561
|
+
game.transforms.setPosition(camera, 0, view.target, view.distance);
|
|
562
|
+
}
|
|
563
|
+
place(game, model) {
|
|
564
|
+
this.clear();
|
|
565
|
+
let body = game.world.spawn();
|
|
566
|
+
game.transforms.add(body), this.body = body;
|
|
567
|
+
let node = game.graphics.instantiate(body, model);
|
|
568
|
+
this.node = node, this.applyTurn(game), this.clipBytes !== null && game.graphics.loadClips(node, { bytes: this.clipBytes }).then(
|
|
569
|
+
(names) => {
|
|
570
|
+
this.node === node && this.animate(game, node, names);
|
|
571
|
+
},
|
|
572
|
+
() => {
|
|
573
|
+
}
|
|
574
|
+
);
|
|
575
|
+
for (let arrived of this.arrivals.splice(0)) arrived();
|
|
576
|
+
}
|
|
577
|
+
animate(game, node, names) {
|
|
578
|
+
let shown = this.shown;
|
|
579
|
+
if (shown === null || shown.still) return;
|
|
580
|
+
names.includes(IDLE_CLIP) && (this.idle = game.graphics.playClip(node, IDLE_CLIP, true, 0));
|
|
581
|
+
let gesture = ATTITUDE_CLIPS[shown.attitude];
|
|
582
|
+
gesture === null || !names.includes(gesture) || (this.gesture = game.graphics.playClip(node, gesture, false, (0.25)), this.gestureLeft = (2.4), this.idle !== null && game.graphics.setClipWeight(this.idle, 0));
|
|
583
|
+
}
|
|
584
|
+
clear() {
|
|
585
|
+
let game = this.game;
|
|
586
|
+
game !== null && this.body !== null && game.world.despawn(this.body), this.body = null, this.node = null, this.idle = null, this.gesture = null, this.gestureLeft = 0;
|
|
587
|
+
}
|
|
588
|
+
applyTurn(game) {
|
|
589
|
+
if (this.body === null) return;
|
|
590
|
+
let yaw = this.turning.value * MAX_TURN_RADIANS;
|
|
591
|
+
game.transforms.setRotation(this.body, 0, Math.sin(yaw * (0.5)), 0, Math.cos(yaw * (0.5)));
|
|
592
|
+
}
|
|
593
|
+
update(game) {
|
|
594
|
+
let seconds = game.clock[FRAME_SECONDS_SLOT], frame = game.input.frame;
|
|
595
|
+
this.turnInput.down = game.input.pointer.down, this.turnInput.released = frame.released, this.turnInput.dragX = frame.drag.x, this.turning.frame(this.turnInput, seconds, this.shown?.still === true), this.applyTurn(game), this.gesture !== null && (this.gestureLeft -= seconds, this.gestureLeft <= 0 && (this.idle !== null && game.graphics.setClipWeight(this.idle, 1), this.gesture = null));
|
|
596
|
+
}
|
|
597
|
+
}, AvatarTurn = class {
|
|
598
|
+
constructor() {
|
|
599
|
+
this.turn = 0;
|
|
600
|
+
this.velocity = 0;
|
|
601
|
+
}
|
|
602
|
+
get value() {
|
|
603
|
+
return this.turn;
|
|
604
|
+
}
|
|
605
|
+
set(turn) {
|
|
606
|
+
this.turn = clampTurn(turn), this.velocity = 0;
|
|
607
|
+
}
|
|
608
|
+
frame(input, seconds, still) {
|
|
609
|
+
if (input.down || input.released) {
|
|
610
|
+
this.turn = clampTurn(this.turn + input.dragX / (1)), this.velocity = 0;
|
|
611
|
+
return;
|
|
612
|
+
}
|
|
613
|
+
if (this.turn === 0 && this.velocity === 0) return;
|
|
614
|
+
if (still) {
|
|
615
|
+
this.turn = 0, this.velocity = 0;
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
let decay = Math.exp(-SPRING_RATE * seconds), lead = this.velocity + SPRING_RATE * this.turn;
|
|
619
|
+
this.turn = (this.turn + lead * seconds) * decay, this.velocity = (this.velocity - SPRING_RATE * lead * seconds) * decay, Math.abs(this.turn) < (1e-4) && Math.abs(this.velocity) < (1e-4) && (this.turn = 0, this.velocity = 0);
|
|
620
|
+
}
|
|
621
|
+
};
|
|
622
|
+
function clampTurn(turn) {
|
|
623
|
+
return Math.max(-1, Math.min(1, turn));
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
// src/game/kit/viewers/avatar-viewer-main.ts
|
|
627
|
+
var AVATAR_IDENTITY_ASSET = `content/${LAUNCH_ITEMS.identity}/${LAUNCH_FILES.identity}`, AVATAR_CLIPS_ASSET = `content/${LAUNCH_ITEMS.animations}/${LAUNCH_FILES.animations}`, AVATAR_IDENTITY_BINDING = "identity", AVATAR_ATTITUDE_BINDING = "attitude", AVATAR_FRAMING_BINDING = "framing", AVATAR_STILL_BINDING = "still", AVATAR_TURN_BINDING = "turn", ATTITUDES = ["neutral", "warm", "cool", "playful"], FRAMINGS2 = ["head", "bust", "full"];
|
|
628
|
+
function valueOf2(values, binding) {
|
|
629
|
+
return values?.find((entry) => entry.binding === binding)?.value;
|
|
630
|
+
}
|
|
631
|
+
function avatarShownFrom(values) {
|
|
632
|
+
let identity = valueOf2(values, AVATAR_IDENTITY_BINDING);
|
|
633
|
+
if (typeof identity != "string" || identity.length === 0) return null;
|
|
634
|
+
let attitude = valueOf2(values, AVATAR_ATTITUDE_BINDING), framing = valueOf2(values, AVATAR_FRAMING_BINDING);
|
|
635
|
+
return {
|
|
636
|
+
identity: base64Bytes(identity),
|
|
637
|
+
attitude: ATTITUDES.find((entry) => entry === attitude) ?? "neutral",
|
|
638
|
+
framing: FRAMINGS2.find((entry) => entry === framing) ?? "bust",
|
|
639
|
+
still: valueOf2(values, AVATAR_STILL_BINDING) === true
|
|
640
|
+
};
|
|
641
|
+
}
|
|
642
|
+
async function asset(ctx, name) {
|
|
643
|
+
if (ctx.assets.has?.(name) === false) return null;
|
|
644
|
+
try {
|
|
645
|
+
return new Uint8Array(await ctx.assets.take(name));
|
|
646
|
+
} catch {
|
|
647
|
+
return null;
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
async function avatarViewer(ctx) {
|
|
651
|
+
let [base, clips] = await Promise.all([
|
|
652
|
+
asset(ctx, AVATAR_IDENTITY_ASSET),
|
|
653
|
+
asset(ctx, AVATAR_CLIPS_ASSET)
|
|
654
|
+
]), scene = new AvatarViewerScene(base, clips === null ? null : clips.buffer);
|
|
655
|
+
ctx.ui.on_event((event) => {
|
|
656
|
+
if (event.action === AVATAR_VIEWER_SET) {
|
|
657
|
+
let shown = avatarShownFrom(event.values);
|
|
658
|
+
shown !== null && scene.show(shown);
|
|
659
|
+
return;
|
|
660
|
+
}
|
|
661
|
+
if (event.action === AVATAR_VIEWER_TURN) {
|
|
662
|
+
let turn = valueOf2(event.values, AVATAR_TURN_BINDING);
|
|
663
|
+
typeof turn == "number" && Number.isFinite(turn) && scene.setTurn(turn);
|
|
664
|
+
}
|
|
665
|
+
}), await runCanvasGame(ctx, { scene }), openDesigner(ctx, scene), scene.canDraw && (await scene.shownOnce(), ctx.program.ready());
|
|
666
|
+
}
|
|
667
|
+
var DESIGN_SHOWN = { attitude: "neutral", framing: "full", still: false };
|
|
668
|
+
function openDesigner(ctx, scene) {
|
|
669
|
+
ctx.graphics.engine().then((platform) => {
|
|
670
|
+
let runtime = platform.kind === "engine" ? bindEngineRuntime(platform.runtime) : null, exports = runtime === null ? null : engineAvatarExports(runtime);
|
|
671
|
+
if (runtime === null || exports === null) {
|
|
672
|
+
sendToStudio({ topic: AVATAR_DESIGN_REPORT.ready, body: { designing: false, schema: null } });
|
|
673
|
+
return;
|
|
674
|
+
}
|
|
675
|
+
let session = new AvatarDesignSession({
|
|
676
|
+
open: (file) => new AvatarDesigner(runtime, exports, file),
|
|
677
|
+
send: (message) => {
|
|
678
|
+
sendToStudio(message);
|
|
679
|
+
},
|
|
680
|
+
show: (identity) => scene.show({ identity, ...DESIGN_SHOWN })
|
|
681
|
+
});
|
|
682
|
+
ctx.on_dispose(() => session.close()), onStudio((message) => session.handle(message)), sendToStudio({
|
|
683
|
+
topic: AVATAR_DESIGN_REPORT.ready,
|
|
684
|
+
body: { designing: true, schema: AvatarDesigner.schema(runtime, exports) }
|
|
685
|
+
});
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
// src/game/vector/author.ts
|
|
690
|
+
var AUTHOR_REGISTER_WORDS = 8, AUTHOR_ITEMS = 0, AUTHOR_CAN_UNDO = 1, AUTHOR_CAN_REDO = 2;
|
|
691
|
+
var AUTHOR_FAILED_ITEM = 4, AUTHOR_FAILED_KEY = 5, AUTHOR_ITEM_WORDS = 6, AUTHOR_VALUE_WORDS = 2, AUTHOR_NONE = 4294967295, AUTHOR_KINDS = ["uint", "int", "float", "color", "bool", "ref", "str", "bytes"], ENGINE_VECTOR_AUTHOR_EXPORT_NAMES = [
|
|
692
|
+
"engine_vector_author_open",
|
|
693
|
+
"engine_vector_author_close",
|
|
694
|
+
"engine_vector_author_registers",
|
|
695
|
+
"engine_vector_author_item",
|
|
696
|
+
"engine_vector_author_prop",
|
|
697
|
+
"engine_vector_author_prop_bytes",
|
|
698
|
+
"engine_vector_author_set",
|
|
699
|
+
"engine_vector_author_set_bytes",
|
|
700
|
+
"engine_vector_author_unset",
|
|
701
|
+
"engine_vector_author_insert",
|
|
702
|
+
"engine_vector_author_add",
|
|
703
|
+
"engine_vector_author_remove",
|
|
704
|
+
"engine_vector_author_add_asset",
|
|
705
|
+
"engine_vector_author_add_artboard",
|
|
706
|
+
"engine_vector_author_bind",
|
|
707
|
+
"engine_vector_author_json",
|
|
708
|
+
"engine_vector_author_edit_json",
|
|
709
|
+
"engine_vector_author_result",
|
|
710
|
+
"engine_vector_author_checkpoint",
|
|
711
|
+
"engine_vector_author_undo",
|
|
712
|
+
"engine_vector_author_redo",
|
|
713
|
+
"engine_vector_author_write",
|
|
714
|
+
"engine_vector_author_bake"
|
|
715
|
+
];
|
|
716
|
+
var NULL = 0, BYTE_ALIGN = 1, WORD_BYTES = 4, UNKNOWN = -3, CONTENDED = -6, WORD_BITS = 32n, WORD_MASK = 0xffffffffn, SCRATCH_WORDS = 8, ENGINE_VECTOR_AUTHOR_SCHEMA_EXPORT = "engine_vector_author_schema";
|
|
717
|
+
function vectorAuthorSchema(runtime) {
|
|
718
|
+
let call = runtime.symbols[ENGINE_VECTOR_AUTHOR_SCHEMA_EXPORT];
|
|
719
|
+
if (typeof call != "function") return null;
|
|
720
|
+
let schema = call, length = schema((0), 0);
|
|
721
|
+
if (length <= 0) return null;
|
|
722
|
+
let at = runtime.exports.engine_alloc(length, (1));
|
|
723
|
+
if (at === (0)) return null;
|
|
724
|
+
try {
|
|
725
|
+
return schema(at, length) !== length ? null : JSON.parse(new TextDecoder().decode(new Uint8Array(runtime.memory.buffer, at, length).slice()));
|
|
726
|
+
} finally {
|
|
727
|
+
runtime.exports.engine_free(at, length, (1));
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
function engineVectorAuthorExports(runtime) {
|
|
731
|
+
let symbols = runtime.symbols;
|
|
732
|
+
return ENGINE_VECTOR_AUTHOR_EXPORT_NAMES.every((name) => typeof symbols[name] == "function") ? symbols : null;
|
|
733
|
+
}
|
|
734
|
+
function optional(word) {
|
|
735
|
+
return word === (4294967295) ? null : word;
|
|
736
|
+
}
|
|
737
|
+
var VectorAuthor = class {
|
|
738
|
+
constructor(runtime, exports, file) {
|
|
739
|
+
this.runtime = runtime;
|
|
740
|
+
this.exports = exports;
|
|
741
|
+
this.encoder = new TextEncoder();
|
|
742
|
+
this.decoder = new TextDecoder();
|
|
743
|
+
this.closed = false;
|
|
744
|
+
let at = this.alloc(Math.max(file.length, 1), (1));
|
|
745
|
+
try {
|
|
746
|
+
new Uint8Array(runtime.memory.buffer).set(file, at), this.handle = exports.engine_vector_author_open(at, file.length);
|
|
747
|
+
} finally {
|
|
748
|
+
runtime.exports.engine_free(at, Math.max(file.length, 1), (1));
|
|
749
|
+
}
|
|
750
|
+
if (this.handle === (0)) throw new GameError("invalid_argument", "the engine could not open that vector file for editing");
|
|
751
|
+
this.scratch = this.alloc((8) * (4), (4));
|
|
752
|
+
}
|
|
753
|
+
alloc(bytes, align) {
|
|
754
|
+
let at = this.runtime.exports.engine_alloc(bytes, align);
|
|
755
|
+
if (at === (0)) throw new GameError("capacity_exceeded", "engine memory cannot hold the vector file");
|
|
756
|
+
return at;
|
|
757
|
+
}
|
|
758
|
+
live() {
|
|
759
|
+
if (this.closed) throw new GameError("unknown_resource", "this vector document was closed");
|
|
760
|
+
return this.handle;
|
|
761
|
+
}
|
|
762
|
+
registers() {
|
|
763
|
+
return new Uint32Array(this.runtime.memory.buffer, this.exports.engine_vector_author_registers(this.live()), (8));
|
|
764
|
+
}
|
|
765
|
+
check(code, what) {
|
|
766
|
+
if (code >= 0) return code;
|
|
767
|
+
let r = this.registers(), where = ` (item ${optional(r[(4)]) ?? "none"}, property ${optional(r[(5)]) ?? "none"})`;
|
|
768
|
+
throw code === (-3) ? new GameError("unknown_resource", `the ${what} names nothing in this document${where}`) : code === (-6) ? new GameError("invalid_argument", `the ${what} would break a reference the document still holds${where}`) : new GameError("invalid_argument", `the engine refused the ${what}${where}`);
|
|
769
|
+
}
|
|
770
|
+
get length() {
|
|
771
|
+
return this.registers()[(0)];
|
|
772
|
+
}
|
|
773
|
+
get canUndo() {
|
|
774
|
+
return this.registers()[(1)] !== 0;
|
|
775
|
+
}
|
|
776
|
+
get canRedo() {
|
|
777
|
+
return this.registers()[(2)] !== 0;
|
|
778
|
+
}
|
|
779
|
+
get refused() {
|
|
780
|
+
let r = this.registers();
|
|
781
|
+
return { item: optional(r[(4)]), property: optional(r[(5)]) };
|
|
782
|
+
}
|
|
783
|
+
item(index) {
|
|
784
|
+
this.check(this.exports.engine_vector_author_item(this.live(), index, this.scratch), "item");
|
|
785
|
+
let w = new Uint32Array(this.runtime.memory.buffer, this.scratch, (6));
|
|
786
|
+
return { id: w[0], type: w[1], props: w[2], owner: optional(w[3]), artboard: optional(w[4]), parent: optional(w[5]) };
|
|
787
|
+
}
|
|
788
|
+
items() {
|
|
789
|
+
let out = [];
|
|
790
|
+
for (let i = 0; i < this.length; i++) out.push(this.item(i));
|
|
791
|
+
return out;
|
|
792
|
+
}
|
|
793
|
+
prop(id, key) {
|
|
794
|
+
let code = this.exports.engine_vector_author_prop(this.live(), id, key, this.scratch);
|
|
795
|
+
if (code === (-3)) return null;
|
|
796
|
+
let kind = AUTHOR_KINDS[this.check(code, "property")], w = new Uint32Array(this.runtime.memory.buffer, this.scratch, (2));
|
|
797
|
+
switch (kind) {
|
|
798
|
+
case "uint":
|
|
799
|
+
return { kind, value: BigInt(w[1]) << WORD_BITS | BigInt(w[0]) };
|
|
800
|
+
case "int":
|
|
801
|
+
return { kind, value: w[0] | 0 };
|
|
802
|
+
case "float":
|
|
803
|
+
return { kind, value: new Float32Array(w.buffer, w.byteOffset, 1)[0] };
|
|
804
|
+
case "color":
|
|
805
|
+
case "ref":
|
|
806
|
+
return { kind, value: w[0] };
|
|
807
|
+
case "bool":
|
|
808
|
+
return { kind, value: w[0] !== 0 };
|
|
809
|
+
case "str":
|
|
810
|
+
case "bytes": {
|
|
811
|
+
let bytes = this.bytes(id, key, w[0]);
|
|
812
|
+
return kind === "str" ? { kind, value: this.decoder.decode(bytes) } : { kind, value: bytes };
|
|
813
|
+
}
|
|
814
|
+
default:
|
|
815
|
+
throw new GameError("invalid_argument", "the engine returned an unknown property kind");
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
bytes(id, key, length) {
|
|
819
|
+
let at = this.alloc(Math.max(length, 1), (1));
|
|
820
|
+
try {
|
|
821
|
+
return this.check(this.exports.engine_vector_author_prop_bytes(this.live(), id, key, at, length), "property bytes"), new Uint8Array(this.runtime.memory.buffer, at, length).slice();
|
|
822
|
+
} finally {
|
|
823
|
+
this.runtime.exports.engine_free(at, Math.max(length, 1), (1));
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
set(id, key, value) {
|
|
827
|
+
let h = this.live();
|
|
828
|
+
if (value.kind === "str" || value.kind === "bytes") {
|
|
829
|
+
let data = value.kind === "str" ? this.encoder.encode(value.value) : value.value, at = this.alloc(Math.max(data.length, 1), (1));
|
|
830
|
+
try {
|
|
831
|
+
new Uint8Array(this.runtime.memory.buffer).set(data, at), this.check(this.exports.engine_vector_author_set_bytes(h, id, key, AUTHOR_KINDS.indexOf(value.kind), at, data.length), "property");
|
|
832
|
+
} finally {
|
|
833
|
+
this.runtime.exports.engine_free(at, Math.max(data.length, 1), (1));
|
|
834
|
+
}
|
|
835
|
+
return;
|
|
836
|
+
}
|
|
837
|
+
let lo = 0, hi = 0;
|
|
838
|
+
if (value.kind === "uint")
|
|
839
|
+
lo = Number(value.value & WORD_MASK), hi = Number(value.value >> WORD_BITS & WORD_MASK);
|
|
840
|
+
else if (value.kind === "bool")
|
|
841
|
+
lo = value.value ? 1 : 0;
|
|
842
|
+
else if (value.kind === "float") {
|
|
843
|
+
let word = new Uint32Array(1);
|
|
844
|
+
new Float32Array(word.buffer)[0] = value.value, lo = word[0];
|
|
845
|
+
} else
|
|
846
|
+
lo = value.value >>> 0;
|
|
847
|
+
this.check(this.exports.engine_vector_author_set(h, id, key, AUTHOR_KINDS.indexOf(value.kind), lo, hi), "property");
|
|
848
|
+
}
|
|
849
|
+
unset(id, key) {
|
|
850
|
+
this.check(this.exports.engine_vector_author_unset(this.live(), id, key), "property");
|
|
851
|
+
}
|
|
852
|
+
insert(parent, type, before = null) {
|
|
853
|
+
return this.check(this.exports.engine_vector_author_insert(this.live(), parent, type, before ?? (4294967295)), "insert");
|
|
854
|
+
}
|
|
855
|
+
add(owner, type, frame = null) {
|
|
856
|
+
return this.check(this.exports.engine_vector_author_add(this.live(), owner, type, frame ?? (4294967295)), "add");
|
|
857
|
+
}
|
|
858
|
+
addAsset(type, contents = null) {
|
|
859
|
+
let h = this.live();
|
|
860
|
+
if (contents === null) return this.check(this.exports.engine_vector_author_add_asset(h, type, (0), 0), "asset");
|
|
861
|
+
let at = this.alloc(Math.max(contents.length, 1), (1));
|
|
862
|
+
try {
|
|
863
|
+
return new Uint8Array(this.runtime.memory.buffer).set(contents, at), this.check(this.exports.engine_vector_author_add_asset(h, type, at, contents.length), "asset");
|
|
864
|
+
} finally {
|
|
865
|
+
this.runtime.exports.engine_free(at, Math.max(contents.length, 1), (1));
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
addArtboard() {
|
|
869
|
+
return this.check(this.exports.engine_vector_author_add_artboard(this.live()), "artboard");
|
|
870
|
+
}
|
|
871
|
+
bind(target, type) {
|
|
872
|
+
return this.check(this.exports.engine_vector_author_bind(this.live(), target, type), "bind");
|
|
873
|
+
}
|
|
874
|
+
later(name) {
|
|
875
|
+
let call = this.runtime.symbols[name];
|
|
876
|
+
if (typeof call != "function") throw new GameError("unsupported_feature", `this engine does not have ${name}`);
|
|
877
|
+
return call;
|
|
878
|
+
}
|
|
879
|
+
supports(name) {
|
|
880
|
+
return typeof this.runtime.symbols[name] == "function";
|
|
881
|
+
}
|
|
882
|
+
addViewModel() {
|
|
883
|
+
return this.check(this.later("engine_vector_author_add_view_model")(this.live()), "view model");
|
|
884
|
+
}
|
|
885
|
+
addViewModelProperty(viewModel, type) {
|
|
886
|
+
return this.check(this.later("engine_vector_author_add_view_model_property")(this.live(), viewModel, type), "view model property");
|
|
887
|
+
}
|
|
888
|
+
addViewModelInstance(viewModel) {
|
|
889
|
+
return this.check(this.later("engine_vector_author_add_view_model_instance")(this.live(), viewModel), "view model instance");
|
|
890
|
+
}
|
|
891
|
+
hit(artboard, x, y) {
|
|
892
|
+
return this.check(this.later("engine_vector_author_hit")(this.live(), artboard, x, y), "hit test");
|
|
893
|
+
}
|
|
894
|
+
remove(id) {
|
|
895
|
+
return this.check(this.exports.engine_vector_author_remove(this.live(), id), "removal");
|
|
896
|
+
}
|
|
897
|
+
checkpoint() {
|
|
898
|
+
this.check(this.exports.engine_vector_author_checkpoint(this.live()), "checkpoint");
|
|
899
|
+
}
|
|
900
|
+
undo() {
|
|
901
|
+
return this.check(this.exports.engine_vector_author_undo(this.live()), "undo") === 1;
|
|
902
|
+
}
|
|
903
|
+
redo() {
|
|
904
|
+
return this.check(this.exports.engine_vector_author_redo(this.live()), "redo") === 1;
|
|
905
|
+
}
|
|
906
|
+
output(call, what) {
|
|
907
|
+
let length = this.check(call((0), 0), what), at = this.alloc(Math.max(length, 1), (1));
|
|
908
|
+
try {
|
|
909
|
+
return this.check(call(at, length), what), new Uint8Array(this.runtime.memory.buffer, at, length).slice();
|
|
910
|
+
} finally {
|
|
911
|
+
this.runtime.exports.engine_free(at, Math.max(length, 1), (1));
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
json() {
|
|
915
|
+
return this.decoder.decode(this.output((out, capacity) => this.exports.engine_vector_author_json(this.live(), out, capacity), "document listing"));
|
|
916
|
+
}
|
|
917
|
+
editJson(ops) {
|
|
918
|
+
let data = this.encoder.encode(ops), at = this.alloc(Math.max(data.length, 1), (1));
|
|
919
|
+
try {
|
|
920
|
+
new Uint8Array(this.runtime.memory.buffer).set(data, at), this.check(this.exports.engine_vector_author_edit_json(this.live(), at, data.length), "edit");
|
|
921
|
+
} finally {
|
|
922
|
+
this.runtime.exports.engine_free(at, Math.max(data.length, 1), (1));
|
|
923
|
+
}
|
|
924
|
+
let result = this.decoder.decode(this.output((out, capacity) => this.exports.engine_vector_author_result(this.live(), out, capacity), "edit result"));
|
|
925
|
+
return JSON.parse(result).created;
|
|
926
|
+
}
|
|
927
|
+
write() {
|
|
928
|
+
return this.output((out, capacity) => this.exports.engine_vector_author_write(this.live(), out, capacity), "write");
|
|
929
|
+
}
|
|
930
|
+
bake() {
|
|
931
|
+
return this.output((out, capacity) => this.exports.engine_vector_author_bake(this.live(), out, capacity), "bake");
|
|
932
|
+
}
|
|
933
|
+
close() {
|
|
934
|
+
this.closed || (this.closed = true, this.exports.engine_vector_author_close(this.handle), this.runtime.exports.engine_free(this.scratch, (8) * (4), (4)));
|
|
935
|
+
}
|
|
936
|
+
};
|
|
937
|
+
|
|
938
|
+
// src/game/kit/viewers/vector-viewer-main.ts
|
|
939
|
+
var VECTOR_BACKDROP = "#26262b", NO_ASSET = 0, ORIGIN = [0, 0], VectorStage = class {
|
|
940
|
+
constructor(ui) {
|
|
941
|
+
this.ui = ui;
|
|
942
|
+
this.asset = (0);
|
|
943
|
+
this.element = null;
|
|
944
|
+
this.shown = null;
|
|
945
|
+
this.playing = null;
|
|
946
|
+
this.sought = null;
|
|
947
|
+
}
|
|
948
|
+
get loaded() {
|
|
949
|
+
return this.asset;
|
|
950
|
+
}
|
|
951
|
+
draw(file) {
|
|
952
|
+
let previous = this.asset, next = previous + 1;
|
|
953
|
+
this.ui.loadVector(next, file), this.asset = next;
|
|
954
|
+
let artboard = this.shown?.artboard ?? 0;
|
|
955
|
+
if (this.element === null) {
|
|
956
|
+
let backdrop = this.ui.box().style({ width: "100%", height: "100%", fill: VECTOR_BACKDROP, pointerEvents: "none" });
|
|
957
|
+
this.element = this.ui.vector(next, artboard).style({ position: "absolute", pointerEvents: "none", origin: ORIGIN }), backdrop.append(this.element), this.ui.root(backdrop);
|
|
958
|
+
} else
|
|
959
|
+
this.element.vector(next, artboard);
|
|
960
|
+
previous !== (0) && this.ui.unloadVector(previous), this.place(), this.replay();
|
|
961
|
+
}
|
|
962
|
+
show(show) {
|
|
963
|
+
let artboard = this.shown?.artboard ?? 0;
|
|
964
|
+
this.shown = show, this.element !== null && (show.artboard !== artboard && (this.element.vector(this.asset, show.artboard), this.replay()), this.place());
|
|
965
|
+
}
|
|
966
|
+
play(play) {
|
|
967
|
+
this.playing = play.kind === "stop" ? null : play, this.sought = null, this.element !== null && (play.kind === "stop" ? this.element.play(UiVectorPlay.stop, 0) : this.replay());
|
|
968
|
+
}
|
|
969
|
+
seek(seek) {
|
|
970
|
+
this.sought = seek, this.playing = null, this.replay();
|
|
971
|
+
}
|
|
972
|
+
input(input) {
|
|
973
|
+
this.element?.setInput(input.name, input.value);
|
|
974
|
+
}
|
|
975
|
+
place() {
|
|
976
|
+
let view = this.shown?.view;
|
|
977
|
+
this.element === null || view === void 0 || this.element.style({
|
|
978
|
+
left: view.left,
|
|
979
|
+
top: view.top,
|
|
980
|
+
width: view.width,
|
|
981
|
+
height: view.height,
|
|
982
|
+
scale: view.scale
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
replay() {
|
|
986
|
+
let sought = this.sought;
|
|
987
|
+
if (this.element !== null && sought !== null) {
|
|
988
|
+
this.element.seek(sought.kind === "machine" ? UiVectorPlay.machine : UiVectorPlay.animation, sought.index, sought.seconds).play(UiVectorPlay.stop, 0);
|
|
989
|
+
return;
|
|
990
|
+
}
|
|
991
|
+
let play = this.playing;
|
|
992
|
+
this.element === null || play === null || this.element.play(
|
|
993
|
+
play.kind === "machine" ? UiVectorPlay.machine : UiVectorPlay.animation,
|
|
994
|
+
play.index
|
|
995
|
+
);
|
|
996
|
+
}
|
|
997
|
+
}, VectorPointerScene = class {
|
|
998
|
+
constructor(report) {
|
|
999
|
+
this.report = report;
|
|
1000
|
+
this.name = "vector-viewer";
|
|
1001
|
+
this.lastU = -1;
|
|
1002
|
+
this.lastV = -1;
|
|
1003
|
+
}
|
|
1004
|
+
update(game) {
|
|
1005
|
+
let pointer = game.input.pointer, frame = game.input.frame;
|
|
1006
|
+
frame.pressed ? this.send("down", pointer.x, pointer.y) : pointer.down && (pointer.x !== this.lastU || pointer.y !== this.lastV) && this.send("move", pointer.x, pointer.y), frame.released && this.send("up", pointer.x, pointer.y);
|
|
1007
|
+
}
|
|
1008
|
+
send(phase, u, v) {
|
|
1009
|
+
this.lastU = u, this.lastV = v, this.report({ phase, u, v });
|
|
1010
|
+
}
|
|
1011
|
+
};
|
|
1012
|
+
async function vectorViewer(ctx) {
|
|
1013
|
+
let scene = new VectorPointerScene(
|
|
1014
|
+
(pointer) => sendToStudio({ topic: VECTOR_REPORT.pointer, body: pointer })
|
|
1015
|
+
);
|
|
1016
|
+
await runCanvasGame(ctx, { scene });
|
|
1017
|
+
let platform = await ctx.graphics.engine(), runtime = platform.kind === "engine" ? bindEngineRuntime(platform.runtime) : null, exports = runtime === null ? null : engineVectorAuthorExports(runtime);
|
|
1018
|
+
if (runtime === null || exports === null) {
|
|
1019
|
+
sendToStudio({ topic: VECTOR_REPORT.ready, body: { editing: false, schema: null } }), ctx.program.ready();
|
|
1020
|
+
return;
|
|
1021
|
+
}
|
|
1022
|
+
let ui = ctx.ui.game(), stage = new VectorStage(ui), session = new VectorEditSession({
|
|
1023
|
+
open: (file) => new VectorAuthor(runtime, exports, file),
|
|
1024
|
+
send: (message) => {
|
|
1025
|
+
sendToStudio(message);
|
|
1026
|
+
},
|
|
1027
|
+
draw: (file) => stage.draw(file),
|
|
1028
|
+
show: (show) => stage.show(show),
|
|
1029
|
+
play: (play) => stage.play(play),
|
|
1030
|
+
seek: (seek) => stage.seek(seek),
|
|
1031
|
+
input: (input) => stage.input(input)
|
|
1032
|
+
});
|
|
1033
|
+
ctx.on_dispose(() => session.close()), onStudio((message) => session.handle(message)), sendToStudio({
|
|
1034
|
+
topic: VECTOR_REPORT.ready,
|
|
1035
|
+
body: { editing: true, schema: vectorAuthorSchema(runtime) }
|
|
1036
|
+
}), ctx.program.ready();
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
export { ATTITUDE_CLIPS, AVATAR_ATTITUDE_BINDING, AVATAR_FRAMING_BINDING, AVATAR_IDENTITY_BINDING, AVATAR_STILL_BINDING, AVATAR_TURN_BINDING, AVATAR_VIEWER_SET, AVATAR_VIEWER_TURN, AvatarTurn, AvatarViewerScene, BREAK_PIECES, DRAFT_ASSET, DRAFT_FORMAT, DraftScene, MAX_TURN_RADIANS, PLACE_CAMERA_BINDING, PLACE_DOC_BINDING, PLACE_TIER_BINDING, PREPARED_PLATFORM, STUDIO_GIFT_BINDING, STUDIO_TEST_GIFT, VECTOR_BACKDROP, VectorPointerScene, VectorStage, avatarShownFrom, avatarViewer, bakedThings, breaks, brokenThing, cameraFrom, draftPlayer, draftSounds, placeViewer, canvasPlatformBackend as platformBackend, readDraftFile, runCanvasGame, showcaseWorld, shownFrom, vectorViewer };
|