@rpgjs/client 5.0.0-alpha.2 → 5.0.0-alpha.20
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/dist/Game/AnimationManager.d.ts +8 -0
- package/dist/Game/Map.d.ts +7 -1
- package/dist/Gui/Gui.d.ts +128 -5
- package/dist/RpgClient.d.ts +217 -59
- package/dist/RpgClientEngine.d.ts +345 -6
- package/dist/Sound.d.ts +199 -0
- package/dist/components/animations/index.d.ts +4 -0
- package/dist/components/dynamics/parse-value.d.ts +1 -0
- package/dist/components/gui/index.d.ts +3 -3
- package/dist/components/index.d.ts +3 -1
- package/dist/components/prebuilt/index.d.ts +18 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/dist/index10.js +149 -4
- package/dist/index10.js.map +1 -1
- package/dist/index11.js +21 -7
- package/dist/index11.js.map +1 -1
- package/dist/index12.js +6 -4
- package/dist/index12.js.map +1 -1
- package/dist/index13.js +11 -14
- package/dist/index13.js.map +1 -1
- package/dist/index14.js +8 -40
- package/dist/index14.js.map +1 -1
- package/dist/index15.js +187 -180
- package/dist/index15.js.map +1 -1
- package/dist/index16.js +104 -7
- package/dist/index16.js.map +1 -1
- package/dist/index17.js +82 -372
- package/dist/index17.js.map +1 -1
- package/dist/index18.js +361 -26
- package/dist/index18.js.map +1 -1
- package/dist/index19.js +46 -20
- package/dist/index19.js.map +1 -1
- package/dist/index2.js +683 -32
- package/dist/index2.js.map +1 -1
- package/dist/index20.js +5 -2417
- package/dist/index20.js.map +1 -1
- package/dist/index21.js +383 -97
- package/dist/index21.js.map +1 -1
- package/dist/index22.js +41 -104
- package/dist/index22.js.map +1 -1
- package/dist/index23.js +21 -67
- package/dist/index23.js.map +1 -1
- package/dist/index24.js +2632 -20
- package/dist/index24.js.map +1 -1
- package/dist/index25.js +107 -34
- package/dist/index25.js.map +1 -1
- package/dist/index26.js +69 -3
- package/dist/index26.js.map +1 -1
- package/dist/index27.js +17 -318
- package/dist/index27.js.map +1 -1
- package/dist/index28.js +24 -22
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +92 -8
- package/dist/index29.js.map +1 -1
- package/dist/index3.js +68 -8
- package/dist/index3.js.map +1 -1
- package/dist/index30.js +37 -7
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +18 -168
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +3 -499
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +332 -9
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +24 -4400
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +6 -311
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +8 -88
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +182 -56
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +500 -16
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +10 -18
- package/dist/index39.js.map +1 -1
- package/dist/index4.js +23 -5
- package/dist/index4.js.map +1 -1
- package/dist/index40.js +7 -0
- package/dist/index40.js.map +1 -0
- package/dist/index41.js +3690 -0
- package/dist/index41.js.map +1 -0
- package/dist/index42.js +77 -0
- package/dist/index42.js.map +1 -0
- package/dist/index43.js +6 -0
- package/dist/index43.js.map +1 -0
- package/dist/index44.js +20 -0
- package/dist/index44.js.map +1 -0
- package/dist/index45.js +146 -0
- package/dist/index45.js.map +1 -0
- package/dist/index46.js +12 -0
- package/dist/index46.js.map +1 -0
- package/dist/index47.js +113 -0
- package/dist/index47.js.map +1 -0
- package/dist/index48.js +136 -0
- package/dist/index48.js.map +1 -0
- package/dist/index49.js +137 -0
- package/dist/index49.js.map +1 -0
- package/dist/index5.js +2 -1
- package/dist/index5.js.map +1 -1
- package/dist/index50.js +112 -0
- package/dist/index50.js.map +1 -0
- package/dist/index51.js +141 -0
- package/dist/index51.js.map +1 -0
- package/dist/index52.js +9 -0
- package/dist/index52.js.map +1 -0
- package/dist/index53.js +54 -0
- package/dist/index53.js.map +1 -0
- package/dist/index6.js +1 -1
- package/dist/index6.js.map +1 -1
- package/dist/index7.js +11 -3
- package/dist/index7.js.map +1 -1
- package/dist/index8.js +68 -7
- package/dist/index8.js.map +1 -1
- package/dist/index9.js +230 -15
- package/dist/index9.js.map +1 -1
- package/dist/presets/animation.d.ts +31 -0
- package/dist/presets/faceset.d.ts +30 -0
- package/dist/presets/index.d.ts +103 -0
- package/dist/presets/lpc.d.ts +89 -0
- package/dist/services/loadMap.d.ts +123 -2
- package/dist/services/mmorpg.d.ts +9 -4
- package/dist/services/standalone.d.ts +51 -2
- package/package.json +22 -18
- package/src/Game/{EffectManager.ts → AnimationManager.ts} +3 -2
- package/src/Game/Map.ts +20 -2
- package/src/Game/Object.ts +163 -9
- package/src/Gui/Gui.ts +300 -17
- package/src/RpgClient.ts +222 -58
- package/src/RpgClientEngine.ts +804 -36
- package/src/Sound.ts +253 -0
- package/src/components/{effects → animations}/animation.ce +3 -6
- package/src/components/{effects → animations}/index.ts +1 -1
- package/src/components/character.ce +165 -37
- package/src/components/dynamics/parse-value.ts +80 -0
- package/src/components/dynamics/text.ce +183 -0
- package/src/components/gui/box.ce +17 -0
- package/src/components/gui/dialogbox/index.ce +73 -35
- package/src/components/gui/dialogbox/selection.ce +16 -1
- package/src/components/gui/index.ts +3 -4
- package/src/components/index.ts +5 -1
- package/src/components/prebuilt/hp-bar.ce +255 -0
- package/src/components/prebuilt/index.ts +21 -0
- package/src/components/scenes/draw-map.ce +6 -23
- package/src/components/scenes/event-layer.ce +9 -3
- package/src/core/setup.ts +2 -0
- package/src/index.ts +5 -2
- package/src/module.ts +72 -6
- package/src/presets/animation.ts +46 -0
- package/src/presets/faceset.ts +60 -0
- package/src/presets/index.ts +7 -1
- package/src/presets/lpc.ts +108 -0
- package/src/services/loadMap.ts +132 -3
- package/src/services/mmorpg.ts +27 -5
- package/src/services/standalone.ts +68 -6
- package/tsconfig.json +1 -1
- package/vite.config.ts +1 -1
- package/dist/Game/EffectManager.d.ts +0 -5
- package/dist/components/effects/index.d.ts +0 -4
- package/src/components/scenes/element-map.ce +0 -23
- /package/src/components/{effects → animations}/hit.ce +0 -0
package/dist/index29.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index29.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index29.js","sources":["../src/presets/lpc.ts"],"sourcesContent":["import { Animation, Direction } from \"@rpgjs/common\";\n\nexport const LPCSpritesheetPreset = (options: {\n id: string;\n imageSource: string;\n width: number;\n height: number;\n ratio?: number;\n }) => {\n const ratio = options.ratio ?? 1;\n\n const frameY = (direction: Direction) => {\n return {\n [Direction.Down]: 2,\n [Direction.Left]: 1,\n [Direction.Right]: 3,\n [Direction.Up]: 0,\n }[direction];\n };\n \n const stand = (direction: Direction) => [\n { time: 0, frameX: 0, frameY: frameY(direction) },\n ];\n const anim = (\n direction: Direction,\n framesWidth: number,\n speed: number = 5\n ) => {\n const array: any = [];\n for (let i = 0; i < framesWidth; i++) {\n array.push({ time: i * speed, frameX: i, frameY: frameY(direction) });\n }\n return array;\n };\n \n return {\n id: options.id,\n image: options.imageSource,\n width: options.width,\n height: options.height,\n opacity: 1,\n rectWidth: 64 * ratio,\n rectHeight: 64 * ratio,\n framesWidth: 6,\n framesHeight: 4,\n spriteRealSize: {\n width: 48 * ratio,\n height: 52 * ratio,\n },\n textures: {\n [Animation.Stand]: {\n offset: {\n x: 0,\n y: 512 * ratio,\n },\n animations: ({ direction }) => [stand(direction)],\n },\n [Animation.Walk]: {\n offset: {\n x: 0,\n y: 512 * ratio,\n },\n framesWidth: 9,\n framesHeight: 4,\n animations: ({ direction }) => [anim(direction, 9)],\n },\n [Animation.Attack]: {\n offset: {\n x: 0,\n y: 768 * ratio,\n },\n framesWidth: 6,\n framesHeight: 4,\n animations: ({ direction }) => [anim(direction, 6, 3)],\n },\n [Animation.Skill]: {\n framesWidth: 7,\n framesHeight: 4,\n animations: ({ direction }) => [anim(direction, 7, 3)],\n },\n attack2: {\n offset: {\n x: 0,\n y: 256 * ratio,\n },\n framesWidth: 7,\n framesHeight: 8,\n animations: ({ direction }) => [anim(direction, 7, 3)],\n },\n ...(options.height > 3000\n ? {\n attack3: {\n offset: {\n x: 0,\n y: 5568 - 288 * 4,\n },\n rectWidth: 288,\n rectHeight: 288,\n framesWidth: 6,\n framesHeight: 4,\n animations: ({ direction }) => [anim(direction, 6, 3)],\n },\n }\n : {}),\n },\n };\n };\n "],"names":[],"mappings":";;AAEO,MAAM,oBAAA,GAAuB,CAAC,OAAA,KAM7B;AACJ,EAAA,MAAM,KAAA,GAAQ,QAAQ,KAAA,IAAS,CAAA;AAE/B,EAAA,MAAM,MAAA,GAAS,CAAC,SAAA,KAAyB;AACvC,IAAA,OAAO;AAAA,MACL,CAAC,SAAA,CAAU,IAAI,GAAG,CAAA;AAAA,MAClB,CAAC,SAAA,CAAU,IAAI,GAAG,CAAA;AAAA,MAClB,CAAC,SAAA,CAAU,KAAK,GAAG,CAAA;AAAA,MACnB,CAAC,SAAA,CAAU,EAAE,GAAG;AAAA,MAChB,SAAS,CAAA;AAAA,EACb,CAAA;AAEA,EAAA,MAAM,KAAA,GAAQ,CAAC,SAAA,KAAyB;AAAA,IACtC,EAAE,MAAM,CAAA,EAAG,MAAA,EAAQ,GAAG,MAAA,EAAQ,MAAA,CAAO,SAAS,CAAA;AAAE,GAClD;AACA,EAAA,MAAM,IAAA,GAAO,CACX,SAAA,EACA,WAAA,EACA,QAAgB,CAAA,KACb;AACH,IAAA,MAAM,QAAa,EAAC;AACpB,IAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,WAAA,EAAa,CAAA,EAAA,EAAK;AACpC,MAAA,KAAA,CAAM,IAAA,CAAK,EAAE,IAAA,EAAM,CAAA,GAAI,KAAA,EAAO,MAAA,EAAQ,CAAA,EAAG,MAAA,EAAQ,MAAA,CAAO,SAAS,CAAA,EAAG,CAAA;AAAA,IACtE;AACA,IAAA,OAAO,KAAA;AAAA,EACT,C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AAK,SAAA,EAAW,CAAA,EAAG,CAAC,CAAC;AAAA,OACvD;AAAA,MACA,CAAC,SAAA,CAAU,KAAK,GAAG;AAAA,QACjB,WAAA,EAAa,CAAA;AAAA,QACb,YAAA,EAAc,CAAA;AAAA,QACd,UAAA,EAAY,CAAC,EAAE,SAAA,EAAU,KAAM,CAAC,IAAA,CAAK,SAAA,EAAW,CAAA,EAAG,CAAC,CAAC;AAAA,OACvD;AAAA,MACA,OAAA,EAAS;AAAA,QACP,MAAA,EAAQ;AAAA,UACN,CAAA,EAAG,CAAA;AAAA,UACH,GAAG,GAAA,GAAM;AAAA,SACX;AAAA,QACA,WAAA,EAAa,CAAA;AAAA,QACb,YAAA,EAAc,CAAA;AAAA,QACd,UAAA,EAAY,CAAC,EAAE,SAAA,EAAU,KAAM,CAAC,IAAA,CAAK,SAAA,EAAW,CAAA,EAAG,CAAC,CAAC;AAAA,OACvD;AAAA,MACA,GAAI,OAAA,CAAQ,MAAA,GAAS,GAAA,GACjB;AAAA,QACE,OAAA,EAAS;AAAA,UACP,MAAA,EAAQ;AAAA,YACN,CAAA,EAAG,CAAA;AAAA,YACH,CAAA,EAAG,OAAO,GAAA,GAAM;AAAA,WAClB;AAAA,UACA,SAAA,EAAW,GAAA;AAAA,UACX,UAAA,EAAY,GAAA;AAAA,UACZ,WAAA,EAAa,CAAA;AAAA,UACb,YAAA,EAAc,CAAA;AAAA,UACd,UAAA,EAAY,CAAC,EAAE,SAAA,EAAU,KAAM,CAAC,IAAA,CAAK,SAAA,EAAW,CAAA,EAAG,CAAC,CAAC;AAAA;AACvD,UAEF;AAAC;AACP,GACF;AACF;;;;"}
|
package/dist/index3.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WebSocketToken, AbstractWebsocket } from './
|
|
2
|
-
import { ServerIo, ClientIo } from './
|
|
1
|
+
import { WebSocketToken, AbstractWebsocket } from './index20.js';
|
|
2
|
+
import { ServerIo, ClientIo } from './index24.js';
|
|
3
3
|
import { RpgClientEngine } from './index2.js';
|
|
4
4
|
import { UpdateMapToken, UpdateMapService } from '@rpgjs/common';
|
|
5
5
|
import { RpgGui } from './index9.js';
|
|
@@ -9,13 +9,26 @@ class BridgeWebsocket extends AbstractWebsocket {
|
|
|
9
9
|
super(context);
|
|
10
10
|
this.context = context;
|
|
11
11
|
this.server = server;
|
|
12
|
-
this.
|
|
12
|
+
this.rooms = {
|
|
13
|
+
partyFn: async (roomId) => {
|
|
14
|
+
this.room = new ServerIo(roomId, this.rooms);
|
|
15
|
+
const server = new this.server(this.room);
|
|
16
|
+
await server.onStart();
|
|
17
|
+
this.context.set("server", server);
|
|
18
|
+
return server;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
this.room = new ServerIo("lobby-1", this.rooms);
|
|
13
22
|
}
|
|
14
23
|
async connection(listeners) {
|
|
15
24
|
const server = new this.server(this.room);
|
|
16
25
|
await server.onStart();
|
|
17
26
|
this.context.set("server", server);
|
|
18
|
-
this.
|
|
27
|
+
return this._connection(listeners);
|
|
28
|
+
}
|
|
29
|
+
async _connection(listeners) {
|
|
30
|
+
const server = this.context.get("server");
|
|
31
|
+
this.socket = new ClientIo(server, "player-client-id");
|
|
19
32
|
const url = new URL("http://localhost");
|
|
20
33
|
const request = new Request(url.toString(), {
|
|
21
34
|
method: "GET",
|
|
@@ -45,20 +58,67 @@ class BridgeWebsocket extends AbstractWebsocket {
|
|
|
45
58
|
value: data
|
|
46
59
|
});
|
|
47
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Update underlying connection properties before a reconnect
|
|
63
|
+
*
|
|
64
|
+
* Design
|
|
65
|
+
* - Dynamically register a factory for the requested room to ensure a fresh server instance
|
|
66
|
+
* - Swap the internal ServerIo to target the new room
|
|
67
|
+
*
|
|
68
|
+
* @param params - Properties to update
|
|
69
|
+
* @param params.room - The target room id (e.g. `map-simplemap2`)
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* websocket.updateProperties({ room: 'map-simplemap2' })
|
|
74
|
+
* await websocket.reconnect()
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
48
77
|
updateProperties({ room }) {
|
|
49
|
-
this.room = new ServerIo(room);
|
|
50
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Reconnect the client to the current Party room
|
|
81
|
+
*
|
|
82
|
+
* Design
|
|
83
|
+
* - Must be called after `updateProperties()` when switching rooms
|
|
84
|
+
* - Rebuilds the client <-> server bridge and re-triggers connection listeners
|
|
85
|
+
*
|
|
86
|
+
* @param listeners - Optional callback to re-bind event handlers on the new socket
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```ts
|
|
90
|
+
* websocket.updateProperties({ room: 'map-dungeon' })
|
|
91
|
+
* await websocket.reconnect((socket) => {
|
|
92
|
+
* // re-bind events here
|
|
93
|
+
* })
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
51
96
|
async reconnect(listeners) {
|
|
52
|
-
await this.
|
|
97
|
+
await this._connection((socket) => {
|
|
53
98
|
listeners?.(socket);
|
|
54
99
|
});
|
|
55
100
|
}
|
|
56
101
|
}
|
|
57
102
|
class UpdateMapStandaloneService extends UpdateMapService {
|
|
58
|
-
|
|
103
|
+
/**
|
|
104
|
+
* Update the current room map data on the server side
|
|
105
|
+
*
|
|
106
|
+
* Design
|
|
107
|
+
* - Uses the in-memory server instance stored in context (standalone mode)
|
|
108
|
+
* - Builds a local HTTP-like request to the current Party room endpoint
|
|
109
|
+
*
|
|
110
|
+
* @param map - The map payload to apply on the server
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```ts
|
|
114
|
+
* await updateMapService.update({ width: 1024, height: 768, events: [] })
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
async update(map) {
|
|
59
118
|
this.server = this.context.get("server");
|
|
119
|
+
const roomId = this.server?.room?.id ?? "lobby-1";
|
|
60
120
|
const req = {
|
|
61
|
-
url: `http://localhost/parties/main/${
|
|
121
|
+
url: `http://localhost/parties/main/${roomId}/map/update`,
|
|
62
122
|
method: "POST",
|
|
63
123
|
headers: new Headers({}),
|
|
64
124
|
json: async () => {
|
package/dist/index3.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index3.js","sources":["../src/services/standalone.ts"],"sourcesContent":["import { AbstractWebsocket, WebSocketToken } from \"./AbstractSocket\";\nimport { ClientIo, ServerIo } from \"@signe/room\";\nimport { Context } from \"@signe/di\";\nimport { RpgClientEngine } from \"../RpgClientEngine\";\nimport { UpdateMapService, UpdateMapToken } from \"@rpgjs/common\";\nimport { LoadMapToken } from \"./loadMap\";\nimport { RpgGui } from \"../Gui/Gui\";\n\ntype ServerIo = any;\ntype ClientIo = any;\n\nclass BridgeWebsocket extends AbstractWebsocket {\n private room: ServerIo;\n private socket: ClientIo;\n\n constructor(protected context: Context, private server: any) {\n super(context);\n // fake room\n this.room = new ServerIo(\"lobby-1\");\n }\n\n async connection(listeners?: (data: any) => void) {\n const server = new this.server(this.room);\n await server.onStart();\n this.context.set('server', server)\n this.socket = new ClientIo(server);\n const url = new URL('http://localhost')\n const request = new Request(url.toString(), {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n listeners?.(this.socket)\n await server.onConnect(this.socket.conn as any, { request } as any);\n this.room.clients.set(this.socket.id, this.socket);\n return this.socket\n }\n\n on(key: string, callback: (data: any) => void) {\n this.socket.addEventListener(\"message\", (event) => {\n const object = JSON.parse(event);\n if (object.type === key) {\n callback(object.value);\n }\n });\n }\n\n off(event: string, callback: (data: any) => void) {\n this.socket.removeEventListener(event, callback);\n }\n\n emit(event: string, data: any) {\n this.socket.send({\n action: event,\n value: data,\n });\n }\n\n updateProperties({ room }: { room: any }) {\n
|
|
1
|
+
{"version":3,"file":"index3.js","sources":["../src/services/standalone.ts"],"sourcesContent":["import { AbstractWebsocket, WebSocketToken } from \"./AbstractSocket\";\nimport { ClientIo, ServerIo } from \"@signe/room\";\nimport { Context } from \"@signe/di\";\nimport { RpgClientEngine } from \"../RpgClientEngine\";\nimport { UpdateMapService, UpdateMapToken } from \"@rpgjs/common\";\nimport { LoadMapToken } from \"./loadMap\";\nimport { RpgGui } from \"../Gui/Gui\";\n\ntype ServerIo = any;\ntype ClientIo = any;\n\nclass BridgeWebsocket extends AbstractWebsocket {\n private room: ServerIo;\n private socket: ClientIo;\n private rooms = {\n partyFn: async (roomId: string) => {\n this.room = new ServerIo(roomId, this.rooms);\n const server = new this.server(this.room)\n await server.onStart();\n this.context.set('server', server)\n return server\n } \n }\n\n constructor(protected context: Context, private server: any) {\n super(context);\n // fake room\n this.room = new ServerIo(\"lobby-1\", this.rooms);\n }\n\n async connection(listeners?: (data: any) => void) {\n const server = new this.server(this.room);\n await server.onStart();\n this.context.set('server', server)\n return this._connection(listeners)\n }\n\n private async _connection(listeners?: (data: any) => void) {\n const server = this.context.get('server')\n this.socket = new ClientIo(server, 'player-client-id');\n const url = new URL('http://localhost')\n const request = new Request(url.toString(), {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n listeners?.(this.socket)\n await server.onConnect(this.socket.conn as any, { request } as any);\n this.room.clients.set(this.socket.id, this.socket);\n return this.socket\n }\n\n on(key: string, callback: (data: any) => void) {\n this.socket.addEventListener(\"message\", (event) => {\n const object = JSON.parse(event);\n if (object.type === key) {\n callback(object.value);\n }\n });\n }\n\n off(event: string, callback: (data: any) => void) {\n this.socket.removeEventListener(event, callback);\n }\n\n emit(event: string, data: any) {\n this.socket.send({\n action: event,\n value: data,\n });\n }\n\n /**\n * Update underlying connection properties before a reconnect\n *\n * Design\n * - Dynamically register a factory for the requested room to ensure a fresh server instance\n * - Swap the internal ServerIo to target the new room\n *\n * @param params - Properties to update\n * @param params.room - The target room id (e.g. `map-simplemap2`)\n *\n * @example\n * ```ts\n * websocket.updateProperties({ room: 'map-simplemap2' })\n * await websocket.reconnect()\n * ```\n */\n updateProperties({ room }: { room: any }) {\n // empty\n }\n\n /**\n * Reconnect the client to the current Party room\n *\n * Design\n * - Must be called after `updateProperties()` when switching rooms\n * - Rebuilds the client <-> server bridge and re-triggers connection listeners\n *\n * @param listeners - Optional callback to re-bind event handlers on the new socket\n *\n * @example\n * ```ts\n * websocket.updateProperties({ room: 'map-dungeon' })\n * await websocket.reconnect((socket) => {\n * // re-bind events here\n * })\n * ```\n */\n async reconnect(listeners?: (data: any) => void) {\n await this._connection((socket) => {\n listeners?.(socket)\n })\n }\n}\n\nclass UpdateMapStandaloneService extends UpdateMapService {\n private server: any;\n\n /**\n * Update the current room map data on the server side\n *\n * Design\n * - Uses the in-memory server instance stored in context (standalone mode)\n * - Builds a local HTTP-like request to the current Party room endpoint\n *\n * @param map - The map payload to apply on the server\n *\n * @example\n * ```ts\n * await updateMapService.update({ width: 1024, height: 768, events: [] })\n * ```\n */\n async update(map: any) {\n this.server = this.context.get('server')\n const roomId = this.server?.room?.id ?? 'lobby-1'\n const req = {\n url: `http://localhost/parties/main/${roomId}/map/update`,\n method: 'POST',\n headers: new Headers({}),\n json: async () => {\n return map;\n }\n };\n await this.server.onRequest(req)\n }\n}\n\nexport function provideRpg(server: any) {\n return [\n {\n provide: WebSocketToken,\n useFactory: (context: Context) => new BridgeWebsocket(context, server),\n },\n {\n provide: UpdateMapToken,\n useClass: UpdateMapStandaloneService,\n },\n RpgGui,\n RpgClientEngine,\n ];\n}\n"],"names":[],"mappings":";;;;;;AAWA,MAAM,wBAAwB,iBAAA,CAAkB;AAAA,EAa9C,WAAA,CAAsB,SAA0B,MAAA,EAAa;AAC3D,IAAA,KAAA,CAAM,OAAO,CAAA;AADO,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AAA0B,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAVhD,IAAA,IAAA,CAAQ,KAAA,GAAQ;AAAA,MACd,OAAA,EAAS,OAAO,MAAA,KAAmB;AACjC,QAAA,IAAA,CAAK,IAAA,GAAO,IAAI,QAAA,CAAS,MAAA,EA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AAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBxD,MAAM,OAAO,GAAA,EAAU;AACrB,IAAA,IAAA,CAAK,MAAA,GAAS,IAAA,CAAK,OAAA,CAAQ,GAAA,CAAI,QAAQ,CAAA;AACvC,IAAA,MAAM,MAAA,GAAS,IAAA,CAAK,MAAA,EAAQ,IAAA,EAAM,EAAA,IAAM,SAAA;AACxC,IAAA,MAAM,GAAA,GAAM;AAAA,MACV,GAAA,EAAK,iCAAiC,MAAM,CAAA,WAAA,CAAA;AAAA,MAC5C,MAAA,EAAQ,MAAA;AAAA,MACR,OAAA,EAAS,IAAI,OAAA,CAAQ,EAAE,CAAA;AAAA,MACvB,MAAM,YAAY;AAChB,QAAA,OAAO,GAAA;AAAA,MACT;AAAA,KACF;AACA,IAAA,MAAM,IAAA,CAAK,MAAA,CAAO,SAAA,CAAU,GAAG,CAAA;AAAA,EACjC;AACF;AAEO,SAAS,WAAW,MAAA,EAAa;AACtC,EAAA,OAAO;AAAA,IACL;AAAA,MACE,OAAA,EAAS,cAAA;AAAA,MACT,YAAY,CAAC,OAAA,KAAqB,IAAI,eAAA,CAAgB,SAAS,MAAM;AAAA,KACvE;AAAA,IACA;AAAA,MACE,OAAA,EAAS,cAAA;AAAA,MACT,QAAA,EAAU;AAAA,KACZ;AAAA,IACA,MAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
|
package/dist/index30.js
CHANGED
|
@@ -1,11 +1,41 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Animation, Direction } from '@rpgjs/common';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
this.type = "event";
|
|
3
|
+
const RMSpritesheet = (framesWidth, framesHeight, frameStand = 1) => {
|
|
4
|
+
if (framesWidth <= frameStand) {
|
|
5
|
+
frameStand = framesWidth - 1;
|
|
7
6
|
}
|
|
8
|
-
|
|
7
|
+
const frameY = (direction) => {
|
|
8
|
+
const gap = Math.max(4 - framesHeight, 0);
|
|
9
|
+
return {
|
|
10
|
+
[Direction.Down]: 0,
|
|
11
|
+
[Direction.Left]: Math.max(0, 1 - gap),
|
|
12
|
+
[Direction.Right]: Math.max(0, 2 - gap),
|
|
13
|
+
[Direction.Up]: Math.max(0, 3 - gap)
|
|
14
|
+
}[direction];
|
|
15
|
+
};
|
|
16
|
+
const stand = (direction) => [{ time: 0, frameX: frameStand, frameY: frameY(direction) }];
|
|
17
|
+
const walk = (direction) => {
|
|
18
|
+
const array = [];
|
|
19
|
+
const durationFrame = 10;
|
|
20
|
+
for (let i = 0; i < framesWidth; i++) {
|
|
21
|
+
array.push({ time: i * durationFrame, frameX: i, frameY: frameY(direction) });
|
|
22
|
+
}
|
|
23
|
+
array.push({ time: array[array.length - 1].time + durationFrame });
|
|
24
|
+
return array;
|
|
25
|
+
};
|
|
26
|
+
return {
|
|
27
|
+
textures: {
|
|
28
|
+
[Animation.Stand]: {
|
|
29
|
+
animations: ({ direction }) => [stand(direction)]
|
|
30
|
+
},
|
|
31
|
+
[Animation.Walk]: {
|
|
32
|
+
animations: ({ direction }) => [walk(direction)]
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
framesHeight,
|
|
36
|
+
framesWidth
|
|
37
|
+
};
|
|
38
|
+
};
|
|
9
39
|
|
|
10
|
-
export {
|
|
40
|
+
export { RMSpritesheet };
|
|
11
41
|
//# sourceMappingURL=index30.js.map
|
package/dist/index30.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index30.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index30.js","sources":["../src/presets/rmspritesheet.ts"],"sourcesContent":["import { Direction, Animation } from '@rpgjs/common'\n\nexport const RMSpritesheet = (framesWidth: number, framesHeight: number, frameStand: number = 1) => {\n\n if (framesWidth <= frameStand) {\n frameStand = framesWidth - 1\n }\n\n const frameY = direction => {\n const gap = Math.max(4 - framesHeight, 0)\n return {\n [Direction.Down]: 0,\n [Direction.Left]: Math.max(0, 1 - gap),\n [Direction.Right]: Math.max(0, 2 - gap),\n [Direction.Up]: Math.max(0, 3 - gap)\n }[direction]\n }\n\n const stand = (direction: number) => [{ time: 0, frameX: frameStand, frameY: frameY(direction) }]\n const walk = direction => {\n const array: any = []\n const durationFrame = 10\n for (let i = 0; i < framesWidth; i++) {\n array.push({ time: i * durationFrame, frameX: i, frameY: frameY(direction) })\n }\n array.push({ time: array[array.length - 1].time + durationFrame })\n return array\n }\n\n return {\n textures: {\n [Animation.Stand]: {\n animations: ({direction}) => [stand(direction)]\n },\n [Animation.Walk]: {\n animations: ({direction}) => [walk(direction)]\n }\n },\n framesHeight,\n framesWidth\n }\n}"],"names":[],"mappings":";;AAEO,MAAM,aAAA,GAAgB,CAAC,WAAA,EAAqB,YAAA,EAAsB,aAAqB,CAAA,KAAM;AAEhG,EAAA,IAAI,eAAe,UAAA,EAAY;AAC3B,IAAA,UAAA,GAAa,WAAA,GAAc,CAAA;AAAA,EAC/B;AAEA,EAAA,MAAM,SAAS,CAAA,SAAA,KAAa;AACxB,IAAA,MAAM,GAAA,GAAM,IAAA,CAAK,GAAA,CAAI,CAAA,GAAI,cAAc,CAAC,CAAA;AACxC,IAAA,OAAO;AAAA,MACH,CAAC,SAAA,CAAU,IAAI,GAAG,CAAA;AAAA,MAClB,CAAC,UAAU,IAAI,GAAG,KAAK,GAAA,CAAI,CAAA,EAAG,IAAI,GAAG,CAAA;AAAA,MACrC,CAAC,UAAU,KAAK,GAAG,KAAK,GAAA,CAAI,CAAA,EAAG,IAAI,GAAG,CAAA;AAAA,MACtC,CAAC,UAAU,EAAE,GAAG,KAAK,GAAA,CAAI,CAAA,EAAG,IAAI,GAAG;AAAA,MACrC,SAAS,CAAA;AAAA,EACf,CAAA;AAEA,EAAA,MAAM,KAAA,GAAQ,CAAC,SAAA,KAAsB,CAAC,EAAE,IAAA,EAAM,CAAA,EAAG,MAAA,EAAQ,UAAA,EAAY,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xxxxxxxxxx".replace(/[xy]/g, function (c) {
|
|
17
|
-
let r = Math.random() * 16;
|
|
18
|
-
if (d > 0) {
|
|
19
|
-
r = (d + r) % 16 | 0;
|
|
20
|
-
d = Math.floor(d / 16);
|
|
21
|
-
} else {
|
|
22
|
-
r = (d2 + r) % 16 | 0;
|
|
23
|
-
d2 = Math.floor(d2 / 16);
|
|
24
|
-
}
|
|
25
|
-
return (c === "x" ? r : (r & 3) | 8).toString(16);
|
|
1
|
+
const FacesetPreset = (options, framesWidth, framesHeight, expressions) => {
|
|
2
|
+
const textures = {};
|
|
3
|
+
Object.keys(expressions).forEach((expressionName) => {
|
|
4
|
+
const [frameX, frameY] = expressions[expressionName];
|
|
5
|
+
textures[expressionName] = {
|
|
6
|
+
animations: () => [
|
|
7
|
+
[{
|
|
8
|
+
time: 0,
|
|
9
|
+
frameX,
|
|
10
|
+
frameY
|
|
11
|
+
}]
|
|
12
|
+
]
|
|
13
|
+
};
|
|
26
14
|
});
|
|
27
|
-
}
|
|
28
|
-
function getPartyInfo(partySocketOptions, defaultProtocol, defaultParams = {}) {
|
|
29
|
-
const {
|
|
30
|
-
host: rawHost,
|
|
31
|
-
path: rawPath,
|
|
32
|
-
protocol: rawProtocol,
|
|
33
|
-
room,
|
|
34
|
-
party,
|
|
35
|
-
basePath,
|
|
36
|
-
prefix,
|
|
37
|
-
query
|
|
38
|
-
} = partySocketOptions;
|
|
39
|
-
let host = rawHost.replace(/^(http|https|ws|wss):\/\//, "");
|
|
40
|
-
if (host.endsWith("/")) {
|
|
41
|
-
host = host.slice(0, -1);
|
|
42
|
-
}
|
|
43
|
-
if (rawPath == null ? void 0 : rawPath.startsWith("/")) {
|
|
44
|
-
throw new Error("path must not start with a slash");
|
|
45
|
-
}
|
|
46
|
-
const name = party ?? "main";
|
|
47
|
-
const path = rawPath ? `/${rawPath}` : "";
|
|
48
|
-
const protocol =
|
|
49
|
-
rawProtocol ||
|
|
50
|
-
(host.startsWith("localhost:") ||
|
|
51
|
-
host.startsWith("127.0.0.1:") ||
|
|
52
|
-
host.startsWith("192.168.") ||
|
|
53
|
-
host.startsWith("10.") ||
|
|
54
|
-
(host.startsWith("172.") &&
|
|
55
|
-
host.split(".")[1] >= "16" &&
|
|
56
|
-
host.split(".")[1] <= "31") ||
|
|
57
|
-
host.startsWith("[::ffff:7f00:1]:")
|
|
58
|
-
? // http / ws
|
|
59
|
-
defaultProtocol
|
|
60
|
-
: // https / wss
|
|
61
|
-
`${defaultProtocol}s`);
|
|
62
|
-
const baseUrl = `${protocol}://${host}/${basePath || `${prefix || "parties"}/${name}/${room}`}${path}`;
|
|
63
|
-
const makeUrl = (query2 = {}) =>
|
|
64
|
-
`${baseUrl}?${new URLSearchParams([
|
|
65
|
-
...Object.entries(defaultParams),
|
|
66
|
-
...Object.entries(query2).filter(valueIsNotNil)
|
|
67
|
-
])}`;
|
|
68
|
-
const urlProvider =
|
|
69
|
-
typeof query === "function"
|
|
70
|
-
? async () => makeUrl(await query())
|
|
71
|
-
: makeUrl(query);
|
|
72
15
|
return {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
protocol,
|
|
78
|
-
partyUrl: baseUrl,
|
|
79
|
-
urlProvider
|
|
16
|
+
...options,
|
|
17
|
+
framesWidth,
|
|
18
|
+
framesHeight,
|
|
19
|
+
textures
|
|
80
20
|
};
|
|
81
|
-
}
|
|
82
|
-
var PartySocket = class extends ReconnectingWebSocket {
|
|
83
|
-
constructor(partySocketOptions) {
|
|
84
|
-
const wsOptions = getWSOptions(partySocketOptions);
|
|
85
|
-
super(wsOptions.urlProvider, wsOptions.protocols, wsOptions.socketOptions);
|
|
86
|
-
this.partySocketOptions = partySocketOptions;
|
|
87
|
-
this.setWSProperties(wsOptions);
|
|
88
|
-
}
|
|
89
|
-
_pk;
|
|
90
|
-
_pkurl;
|
|
91
|
-
name;
|
|
92
|
-
room;
|
|
93
|
-
host;
|
|
94
|
-
path;
|
|
95
|
-
updateProperties(partySocketOptions) {
|
|
96
|
-
const wsOptions = getWSOptions({
|
|
97
|
-
...this.partySocketOptions,
|
|
98
|
-
...partySocketOptions,
|
|
99
|
-
host: partySocketOptions.host ?? this.host,
|
|
100
|
-
room: partySocketOptions.room ?? this.room,
|
|
101
|
-
path: partySocketOptions.path ?? this.path
|
|
102
|
-
});
|
|
103
|
-
this._url = wsOptions.urlProvider;
|
|
104
|
-
this._protocols = wsOptions.protocols;
|
|
105
|
-
this._options = wsOptions.socketOptions;
|
|
106
|
-
this.setWSProperties(wsOptions);
|
|
107
|
-
}
|
|
108
|
-
setWSProperties(wsOptions) {
|
|
109
|
-
const { _pk, _pkurl, name, room, host, path } = wsOptions;
|
|
110
|
-
this._pk = _pk;
|
|
111
|
-
this._pkurl = _pkurl;
|
|
112
|
-
this.name = name;
|
|
113
|
-
this.room = room;
|
|
114
|
-
this.host = host;
|
|
115
|
-
this.path = path;
|
|
116
|
-
}
|
|
117
|
-
reconnect(code, reason) {
|
|
118
|
-
if (!this.room || !this.host) {
|
|
119
|
-
throw new Error(
|
|
120
|
-
"The room and host must be set before connecting, use `updateProperties` method to set them or pass them to the constructor."
|
|
121
|
-
);
|
|
122
|
-
}
|
|
123
|
-
super.reconnect(code, reason);
|
|
124
|
-
}
|
|
125
|
-
get id() {
|
|
126
|
-
return this._pk;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Exposes the static PartyKit room URL without applying query parameters.
|
|
130
|
-
* To access the currently connected WebSocket url, use PartySocket#url.
|
|
131
|
-
*/
|
|
132
|
-
get roomUrl() {
|
|
133
|
-
return this._pkurl;
|
|
134
|
-
}
|
|
135
|
-
// a `fetch` method that uses (almost) the same options as `PartySocket`
|
|
136
|
-
static async fetch(options, init) {
|
|
137
|
-
const party = getPartyInfo(options, "http");
|
|
138
|
-
const url =
|
|
139
|
-
typeof party.urlProvider === "string"
|
|
140
|
-
? party.urlProvider
|
|
141
|
-
: await party.urlProvider();
|
|
142
|
-
const doFetch = options.fetch ?? fetch;
|
|
143
|
-
return doFetch(url, init);
|
|
144
|
-
}
|
|
145
21
|
};
|
|
146
|
-
function getWSOptions(partySocketOptions) {
|
|
147
|
-
const {
|
|
148
|
-
id,
|
|
149
|
-
host: _host,
|
|
150
|
-
path: _path,
|
|
151
|
-
party: _party,
|
|
152
|
-
room: _room,
|
|
153
|
-
protocol: _protocol,
|
|
154
|
-
query: _query,
|
|
155
|
-
protocols,
|
|
156
|
-
...socketOptions
|
|
157
|
-
} = partySocketOptions;
|
|
158
|
-
const _pk = id || generateUUID();
|
|
159
|
-
const party = getPartyInfo(partySocketOptions, "ws", { _pk });
|
|
160
|
-
return {
|
|
161
|
-
_pk,
|
|
162
|
-
_pkurl: party.partyUrl,
|
|
163
|
-
name: party.name,
|
|
164
|
-
room: party.room,
|
|
165
|
-
host: party.host,
|
|
166
|
-
path: party.path,
|
|
167
|
-
protocols,
|
|
168
|
-
socketOptions,
|
|
169
|
-
urlProvider: party.urlProvider
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
22
|
|
|
173
|
-
export {
|
|
23
|
+
export { FacesetPreset };
|
|
174
24
|
//# sourceMappingURL=index31.js.map
|
package/dist/index31.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index31.js","sources":["../../../node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-HAC622V3.mjs"],"sourcesContent":["import { ReconnectingWebSocket } from \"./chunk-S74YV6PU.mjs\";\n\n// src/index.ts\nvar valueIsNotNil = (keyValuePair) =>\n keyValuePair[1] !== null && keyValuePair[1] !== void 0;\nfunction generateUUID() {\n if (typeof crypto !== \"undefined\" && crypto.randomUUID) {\n return crypto.randomUUID();\n }\n let d = /* @__PURE__ */ new Date().getTime();\n let d2 =\n (typeof performance !== \"undefined\" &&\n performance.now &&\n performance.now() * 1e3) ||\n 0;\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n let r = Math.random() * 16;\n if (d > 0) {\n r = (d + r) % 16 | 0;\n d = Math.floor(d / 16);\n } else {\n r = (d2 + r) % 16 | 0;\n d2 = Math.floor(d2 / 16);\n }\n return (c === \"x\" ? r : (r & 3) | 8).toString(16);\n });\n}\nfunction getPartyInfo(partySocketOptions, defaultProtocol, defaultParams = {}) {\n const {\n host: rawHost,\n path: rawPath,\n protocol: rawProtocol,\n room,\n party,\n basePath,\n prefix,\n query\n } = partySocketOptions;\n let host = rawHost.replace(/^(http|https|ws|wss):\\/\\//, \"\");\n if (host.endsWith(\"/\")) {\n host = host.slice(0, -1);\n }\n if (rawPath == null ? void 0 : rawPath.startsWith(\"/\")) {\n throw new Error(\"path must not start with a slash\");\n }\n const name = party ?? \"main\";\n const path = rawPath ? `/${rawPath}` : \"\";\n const protocol =\n rawProtocol ||\n (host.startsWith(\"localhost:\") ||\n host.startsWith(\"127.0.0.1:\") ||\n host.startsWith(\"192.168.\") ||\n host.startsWith(\"10.\") ||\n (host.startsWith(\"172.\") &&\n host.split(\".\")[1] >= \"16\" &&\n host.split(\".\")[1] <= \"31\") ||\n host.startsWith(\"[::ffff:7f00:1]:\")\n ? // http / ws\n defaultProtocol\n : // https / wss\n `${defaultProtocol}s`);\n const baseUrl = `${protocol}://${host}/${basePath || `${prefix || \"parties\"}/${name}/${room}`}${path}`;\n const makeUrl = (query2 = {}) =>\n `${baseUrl}?${new URLSearchParams([\n ...Object.entries(defaultParams),\n ...Object.entries(query2).filter(valueIsNotNil)\n ])}`;\n const urlProvider =\n typeof query === \"function\"\n ? async () => makeUrl(await query())\n : makeUrl(query);\n return {\n host,\n path,\n room,\n name,\n protocol,\n partyUrl: baseUrl,\n urlProvider\n };\n}\nvar PartySocket = class extends ReconnectingWebSocket {\n constructor(partySocketOptions) {\n const wsOptions = getWSOptions(partySocketOptions);\n super(wsOptions.urlProvider, wsOptions.protocols, wsOptions.socketOptions);\n this.partySocketOptions = partySocketOptions;\n this.setWSProperties(wsOptions);\n }\n _pk;\n _pkurl;\n name;\n room;\n host;\n path;\n updateProperties(partySocketOptions) {\n const wsOptions = getWSOptions({\n ...this.partySocketOptions,\n ...partySocketOptions,\n host: partySocketOptions.host ?? this.host,\n room: partySocketOptions.room ?? this.room,\n path: partySocketOptions.path ?? this.path\n });\n this._url = wsOptions.urlProvider;\n this._protocols = wsOptions.protocols;\n this._options = wsOptions.socketOptions;\n this.setWSProperties(wsOptions);\n }\n setWSProperties(wsOptions) {\n const { _pk, _pkurl, name, room, host, path } = wsOptions;\n this._pk = _pk;\n this._pkurl = _pkurl;\n this.name = name;\n this.room = room;\n this.host = host;\n this.path = path;\n }\n reconnect(code, reason) {\n if (!this.room || !this.host) {\n throw new Error(\n \"The room and host must be set before connecting, use `updateProperties` method to set them or pass them to the constructor.\"\n );\n }\n super.reconnect(code, reason);\n }\n get id() {\n return this._pk;\n }\n /**\n * Exposes the static PartyKit room URL without applying query parameters.\n * To access the currently connected WebSocket url, use PartySocket#url.\n */\n get roomUrl() {\n return this._pkurl;\n }\n // a `fetch` method that uses (almost) the same options as `PartySocket`\n static async fetch(options, init) {\n const party = getPartyInfo(options, \"http\");\n const url =\n typeof party.urlProvider === \"string\"\n ? party.urlProvider\n : await party.urlProvider();\n const doFetch = options.fetch ?? fetch;\n return doFetch(url, init);\n }\n};\nfunction getWSOptions(partySocketOptions) {\n const {\n id,\n host: _host,\n path: _path,\n party: _party,\n room: _room,\n protocol: _protocol,\n query: _query,\n protocols,\n ...socketOptions\n } = partySocketOptions;\n const _pk = id || generateUUID();\n const party = getPartyInfo(partySocketOptions, \"ws\", { _pk });\n return {\n _pk,\n _pkurl: party.partyUrl,\n name: party.name,\n room: party.room,\n host: party.host,\n path: party.path,\n protocols,\n socketOptions,\n urlProvider: party.urlProvider\n };\n}\n\nexport { PartySocket };\n//# sourceMappingURL=chunk-HAC622V3.mjs.map\n"],"names":[],"mappings":";;AAEA;AACA,IAAI,aAAa,GAAG,CAAC,YAAY;AACjC,EAAE,YAAY,CAAC,CAAC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AI;AACpB,IAAI,IAAI,EAAE,KAAK,CAAC,IAAI;AACpB,IAAI,SAAS;AACb,IAAI,aAAa;AACjB,IAAI,WAAW,EAAE,KAAK,CAAC;AACvB,GAAG;AACH;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index31.js","sources":["../src/presets/faceset.ts"],"sourcesContent":["/**\n * Creates a faceset preset for character expressions\n * \n * This preset allows you to define multiple facial expressions for a character,\n * where each expression corresponds to a specific frame position (frameX, frameY)\n * within a single faceset texture. Each expression is defined by its position\n * in the faceset grid.\n * \n * @param options - Object containing the faceset configuration\n * @param framesWidth - Number of frames horizontally in the faceset texture\n * @param framesHeight - Number of frames vertically in the faceset texture\n * @param expressions - Object mapping expression names to their frame positions as tuples [frameX, frameY]\n * @returns Faceset configuration with animations for each expression\n * \n * @example\n * ```typescript\n * const faceset = FacesetPreset({\n * id: \"facesetId\",\n * image: \"faceset.png\",\n * width: 1024,\n * height: 1024,\n * }, 4, 2, {\n * happy: [0, 0],\n * sad: [1, 0],\n * angry: [2, 0],\n * surprised: [3, 0]\n * });\n * ```\n */\nexport const FacesetPreset = (\n options: any,\n framesWidth: number, \n framesHeight: number,\n expressions: Record<string, [number, number]>,\n) => {\n \n const textures: Record<string, any> = {};\n \n // Create texture configuration for each expression\n Object.keys(expressions).forEach((expressionName) => {\n const [frameX, frameY] = expressions[expressionName];\n textures[expressionName] = {\n animations: () => [\n [{ \n time: 0, \n frameX: frameX, \n frameY: frameY \n }]\n ],\n };\n });\n \n return {\n ...options,\n framesWidth,\n framesHeight,\n textures\n };\n};\n "],"names":[],"mappings":"AA6BO,MAAM,aAAA,GAAgB,CACzB,OAAA,EACA,WAAA,EACA,cACA,WAAA,KACC;AAED,EAAA,MAAM,WAAgC,EAAC;AAGvC,EAAA,MAAA,CAAO,IAAA,CAAK,WAAW,CAAA,CAAE,OAAA,CAAQ,CAAC,cAAA,KAAmB;AACjD,IAAA,MAAM,CAAC,MAAA,EAAQ,MAAM,CAAA,GAAI,YAAY,cAAc,CAAA;AACnD,IAAA,QAAA,CAAS,cAAc,CAAA,GAAI;AAAA,MACvB,YAAY,MAAM;AAAA,QACd,CAAC;AAAA,UACG,IAAA,EAAM,CAAA;AAAA,UACN,MAAA;AAAA,UACA;AAAA,SACH;AAAA;AACL,KACJ;AAAA,EACJ,CAAC,CAAA;AAED,EAAA,OAAO;AAAA,IACH,GAAG,OAAA;AAAA,IACH,WAAA;AAAA,IACA,YAAA;AAAA,IACA;AAAA,GACJ;AACJ;;;;"}
|