@rpgjs/client 4.0.2 → 4.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/browser/React-ab9e74c2.js +127 -0
  3. package/browser/manifest.json +5 -0
  4. package/browser/rpg.client.js +435 -362
  5. package/browser/rpg.client.umd.cjs +573 -375
  6. package/lib/Components/Component.js +6 -0
  7. package/lib/Components/Component.js.map +1 -1
  8. package/lib/GameEngine.d.ts +1 -0
  9. package/lib/GameEngine.js +6 -2
  10. package/lib/GameEngine.js.map +1 -1
  11. package/lib/{RpgGui.d.ts → Gui/Gui.d.ts} +27 -20
  12. package/lib/Gui/Gui.js +497 -0
  13. package/lib/Gui/Gui.js.map +1 -0
  14. package/lib/Gui/React.d.ts +14 -0
  15. package/lib/Gui/React.js +89 -0
  16. package/lib/Gui/React.js.map +1 -0
  17. package/lib/Gui/Vue.d.ts +13 -0
  18. package/lib/{RpgGuiCompiled.js → Gui/Vue.js} +64 -11
  19. package/lib/Gui/Vue.js.map +1 -0
  20. package/lib/Renderer.js +6 -4
  21. package/lib/Renderer.js.map +1 -1
  22. package/lib/RpgClientEngine.js +1 -1
  23. package/lib/RpgClientEngine.js.map +1 -1
  24. package/lib/Scene/Scene.d.ts +26 -1
  25. package/lib/Scene/Scene.js +32 -3
  26. package/lib/Scene/Scene.js.map +1 -1
  27. package/lib/index.d.ts +2 -1
  28. package/lib/index.js +2 -1
  29. package/lib/index.js.map +1 -1
  30. package/package.json +21 -6
  31. package/rpg.toml +1 -1
  32. package/src/Components/Component.ts +6 -0
  33. package/src/GameEngine.ts +7 -3
  34. package/src/Gui/Gui.ts +556 -0
  35. package/src/Gui/React.ts +116 -0
  36. package/src/Gui/Vue.ts +137 -0
  37. package/src/Renderer.ts +8 -4
  38. package/src/RpgClientEngine.ts +1 -1
  39. package/src/Scene/Scene.ts +35 -4
  40. package/src/index.ts +2 -1
  41. package/lib/RpgGui.js +0 -499
  42. package/lib/RpgGui.js.map +0 -1
  43. package/lib/RpgGuiCompiled.d.ts +0 -3
  44. package/lib/RpgGuiCompiled.js.map +0 -1
  45. package/src/RpgGui.ts +0 -553
  46. package/src/RpgGuiCompiled.ts +0 -43
package/lib/Gui/Gui.js ADDED
@@ -0,0 +1,497 @@
1
+ import { Utils } from '@rpgjs/common';
2
+ import { RpgSound } from '../Sound/RpgSound.js';
3
+ import { RpgResource } from '../index.js';
4
+ import { VueGui } from './Vue.js';
5
+ import { map, combineLatest, filter } from 'rxjs';
6
+ const { elementToPositionAbsolute } = Utils;
7
+ const COMPONENT_LIBRARIES = [
8
+ VueGui
9
+ ];
10
+ export class Gui {
11
+ constructor() {
12
+ this.gui = {};
13
+ this.currentScene = null;
14
+ this.librariesInstances = [];
15
+ }
16
+ async _initialize(clientEngine, guiEl) {
17
+ this.clientEngine = clientEngine;
18
+ this.renderer = clientEngine.renderer;
19
+ this.gameEngine = clientEngine.gameEngine;
20
+ const { gui } = this.renderer.options;
21
+ for (let ui of gui) {
22
+ let name = ui.name;
23
+ if (Utils.isFunction(ui)) {
24
+ name = Utils.camelToKebab(name);
25
+ }
26
+ this.gui[name] = {
27
+ data: ui.data,
28
+ attachToSprite: ui.rpgAttachToSprite,
29
+ display: false,
30
+ name: name,
31
+ isFunction: Utils.isFunction(ui),
32
+ gui: ui
33
+ };
34
+ }
35
+ if (this.clientEngine.envs?.['VITE_REACT']) {
36
+ console.warn('[RPGJS] React GUI is experimental feature. So, its use may change over time. Not yet in production');
37
+ COMPONENT_LIBRARIES.push(await import('./React.js').then(m => m.ReactGui));
38
+ }
39
+ const propagateEvents = (el) => {
40
+ const events = ['click', 'mousedown', 'mouseup', 'mousemove', 'mouseenter', 'mouseleave', 'mouseover', 'mouseout', 'contextmenu', 'pointerdown', 'pointerup', 'pointermove', 'pointerenter', 'pointerleave', 'pointerover', 'pointerout', 'pointerupoutside', 'pointercancel', 'touchstart', 'touchend', 'touchmove', 'touchcancel', 'wheel', 'keydown', 'keyup', 'keypress', 'keydownoutside', 'keyupoutside', 'keypressoutside'];
41
+ for (let type of events) {
42
+ el.addEventListener(type, (e) => {
43
+ this.renderer.canvas.dispatchEvent(new MouseEvent(type, e));
44
+ });
45
+ }
46
+ };
47
+ for (let componentClass of COMPONENT_LIBRARIES) {
48
+ const el = document.createElement('div');
49
+ elementToPositionAbsolute(el);
50
+ el.style['pointer-events'] = 'auto';
51
+ propagateEvents(el);
52
+ guiEl.appendChild(el);
53
+ this.librariesInstances.push(new componentClass(el, this));
54
+ }
55
+ guiEl.style['pointer-events'] = 'none';
56
+ }
57
+ _setSceneReady(scene) {
58
+ this.currentScene = scene;
59
+ this.librariesInstances.forEach(instance => {
60
+ if (instance._setSceneReady)
61
+ instance._setSceneReady(scene);
62
+ });
63
+ }
64
+ getInjectObject() {
65
+ const self = this;
66
+ return {
67
+ /**
68
+ * Recovery of the current scene
69
+ *
70
+ * ```js
71
+ * export default {
72
+ * inject: ['rpgScene'],
73
+ * mounted() {
74
+ * const scene = this.rpgScene()
75
+ * scene.stopInputs()
76
+ * }
77
+ * }
78
+ * ```
79
+ *
80
+ * @prop {Function returns RpgScene} [rpgScene]
81
+ * @memberof VueInject
82
+ * */
83
+ rpgScene: this.renderer.getScene.bind(this.renderer),
84
+ /**
85
+ * Retrieve the main container of the game
86
+ *
87
+ * ```js
88
+ * export default {
89
+ * inject: ['rpgStage'],
90
+ * mounted() {
91
+ * const blur = new PIXI.BlurFilter()
92
+ this.rpgStage.filters = [blur]
93
+ * }
94
+ * }
95
+ * ```
96
+ *
97
+ * @prop {PIXI.Container} [rpgStage]
98
+ * @memberof VueInject
99
+ * */
100
+ rpgStage: this.renderer.stage,
101
+ /**
102
+ * Listen to all the objects present in the room (events and players)
103
+ *
104
+ * ```js
105
+ * export default {
106
+ * inject: ['rpgObjects'],
107
+ * mounted() {
108
+ * this.obs = this.rpgObjects.subscribe((objects) => {
109
+ * for (let id in objects) {
110
+ * const obj = objects[id]
111
+ * console.log(obj.object, obj.paramsChanged)
112
+ * }
113
+ * })
114
+ * },
115
+ * unmounted() {
116
+ * this.obs.unsubscribe()
117
+ * }
118
+ * }
119
+ * ```
120
+ *
121
+ * > remember to unsubscribe for memory leaks
122
+ *
123
+ * It is an observable that returns an object:
124
+ *
125
+ * * the key is the object identifier
126
+ * * The value is an object comprising:
127
+ * * `object`: The entire object
128
+ * * `paramsChanged`: Only the representation of the properties that have been changed on this object
129
+ *
130
+ * @prop {Observable<{ [objectId]: { object: object, paramsChanged: object } }>} [rpgObjects]
131
+ * @memberof VueInject
132
+ * */
133
+ rpgObjects: this.clientEngine.objects,
134
+ /**
135
+ * Recovers and listens to the current player
136
+ *
137
+ * ```js
138
+ * export default {
139
+ * inject: ['rpgCurrentPlayer'],
140
+ * mounted() {
141
+ * this.obs = this.rpgCurrentPlayer.subscribe((obj) => {
142
+ * console.log(obj.object, obj.paramsChanged)
143
+ * })
144
+ * },
145
+ * unmounted() {
146
+ * this.obs.unsubscribe()
147
+ * }
148
+ * }
149
+ * ```
150
+ *
151
+ * * `object`: The whole player
152
+ * * `paramsChanged`: Only the representation of the properties that have been changed on this player
153
+ *
154
+ * @prop {Observable<{ object: object, paramsChanged: object }>} [rpgCurrentPlayer]
155
+ * @memberof VueInject
156
+ * */
157
+ rpgCurrentPlayer: this.clientEngine.objects
158
+ .pipe(map((objects) => objects[this.gameEngine.playerId]), filter(player => !!player)),
159
+ rpgGameEngine: this.gameEngine,
160
+ /**
161
+ * Tell the server to close the GUI.
162
+ *
163
+ * It is a function with 2 parameters:
164
+ * * `name`: The name of the component
165
+ * * `data`: The data you want to pass to the server
166
+ *
167
+ * ```js
168
+ * export default {
169
+ * inject: ['rpgGuiClose'],
170
+ * methods: {
171
+ * close() {
172
+ * this.rpgGuiClose('gui-name', {
173
+ * amount: 1000
174
+ * })
175
+ * }
176
+ * }
177
+ * }
178
+ * ```
179
+ *
180
+ * @prop {Function(name, data)} [rpgGuiClose]
181
+ * @memberof VueInject
182
+ * */
183
+ rpgGuiClose(name, data) {
184
+ const guiId = name || this.$options?.name;
185
+ self.socket.emit('gui.exit', {
186
+ guiId,
187
+ data
188
+ });
189
+ },
190
+ /**
191
+ * Perform an interaction with the open GUI
192
+ *
193
+ * It is a function with 2 parameters:
194
+ * * `guiId`: The name of the component/Gui
195
+ * * `name`: The name of the interaction (defined on the server side)
196
+ * * `data`: Data to be sent
197
+ *
198
+ * ```js
199
+ * export default {
200
+ * inject: ['rpgGuiInteraction'],
201
+ * methods: {
202
+ * changeGold() {
203
+ * this.rpgGuiInteraction('gui-name', 'change-gold', {
204
+ * amount: 100
205
+ * })
206
+ * }
207
+ * }
208
+ * }
209
+ * ```
210
+ *
211
+ * @prop {Function(guiId, name, data = {})} [rpgGuiInteraction]
212
+ * @memberof VueInject
213
+ * */
214
+ rpgGuiInteraction: (guiId, name, data = {}) => {
215
+ this.socket.emit('gui.interaction', {
216
+ guiId,
217
+ name,
218
+ data
219
+ });
220
+ },
221
+ /**
222
+ * Listen to the keys that are pressed on the keyboard
223
+ *
224
+ * ```js
225
+ * export default {
226
+ * inject: ['rpgKeypress'],
227
+ * mounted() {
228
+ * this.obs = this.rpgKeypress.subscribe(({ inputName, control }) => {
229
+ * console.log(inputName) // "escape"
230
+ * console.log(control.actionName) // "back"
231
+ * })
232
+ * },
233
+ * unmounted() {
234
+ * this.obs.unsubscribe()
235
+ * }
236
+ * }
237
+ * ```
238
+ *
239
+ * @prop {Observable<{ inputName: string, control: { actionName: string, options: any } }>} [rpgKeypress]
240
+ * @memberof VueInject
241
+ * */
242
+ rpgKeypress: this.clientEngine.keyChange
243
+ .pipe(map(name => {
244
+ const control = this.clientEngine.controls.getControl(name);
245
+ return {
246
+ inputName: name,
247
+ control
248
+ };
249
+ })),
250
+ /**
251
+ * Recovers the socket.
252
+ *
253
+ * ```js
254
+ * export default {
255
+ * inject: ['rpgSocket'],
256
+ * mounted() {
257
+ * const socket = this.rpgSocket()
258
+ * socket.emit('foo', 'bar')
259
+ * }
260
+ * }
261
+ * ```
262
+ *
263
+ * @prop {Function returns RpgScene} [rpgSocket]
264
+ * @memberof VueInject
265
+ * */
266
+ rpgSocket: () => this.socket,
267
+ /**
268
+ * The RpgGui object to control GUIs
269
+ *
270
+ * ```js
271
+ * export default {
272
+ * inject: ['rpgGui'],
273
+ * mounted() {
274
+ * const guis = this.rpgGui.getAll()
275
+ * }
276
+ * }
277
+ * ```
278
+ *
279
+ * @prop {RpgGui} [rpgGui]
280
+ * @memberof VueInject
281
+ * */
282
+ rpgGui: this,
283
+ /**
284
+ * Equivalent to RpgSound
285
+ *
286
+ * ```js
287
+ * export default {
288
+ * inject: ['rpgSound'],
289
+ * mounted() {
290
+ * this.rpgSound.get('my-sound-id').play()
291
+ * }
292
+ * }
293
+ * ```
294
+ *
295
+ * @prop {RpgSound} [rpgSound]
296
+ * @memberof VueInject
297
+ * */
298
+ rpgSound: RpgSound,
299
+ /**
300
+ * Find the game's image and sound library
301
+ *
302
+ * ```js
303
+ * export default {
304
+ * inject: ['rpgResource'],
305
+ * mounted() {
306
+ * const resourceImage = this.rpgResource.spritesheets.get('image_id')
307
+ * const resourceSound = this.rpgResource.sounds.get('sound_id')
308
+ * }
309
+ * }
310
+ * ```
311
+ *
312
+ * @prop { { spritesheets: Map, sounds: Map } } [rpgResource]
313
+ * @memberof VueInject
314
+ * */
315
+ rpgResource: RpgResource,
316
+ /**
317
+ * Get RpgClientEngine instance
318
+ *
319
+ * ```js
320
+ * export default {
321
+ * inject: ['rpgEngine'],
322
+ * mounted() {
323
+ * const vueInstance = this.rpgEngine.vueInstance
324
+ * }
325
+ * }
326
+ * ```
327
+ *
328
+ * @prop {RpgClientEngine} [rpgEngine]
329
+ * @memberof VueInject
330
+ * */
331
+ rpgEngine: this.clientEngine
332
+ };
333
+ }
334
+ /** @internal */
335
+ _setSocket(socket) {
336
+ this.socket = socket;
337
+ this.socket.on('gui.open', ({ guiId, data }) => {
338
+ this.display(guiId, data);
339
+ });
340
+ this.socket.on('gui.tooltip', ({ players, display }) => {
341
+ for (let playerId of players) {
342
+ const sprite = this.renderer.getScene()?.getSprite(playerId);
343
+ if (sprite)
344
+ sprite.guiDisplay = display;
345
+ }
346
+ });
347
+ this.socket.on('gui.exit', (guiId) => {
348
+ this.hide(guiId);
349
+ });
350
+ }
351
+ /** @internal */
352
+ _setGui(id, obj) {
353
+ const guiObj = this.get(id);
354
+ if (!guiObj) {
355
+ throw `The GUI named ${id} is non-existent. Please add the component in the gui property of the decorator @RpgClient`;
356
+ }
357
+ for (let key in obj) {
358
+ guiObj[key] = obj[key];
359
+ }
360
+ this.librariesInstances.forEach(instance => {
361
+ instance.gui = Object.assign({}, this.gui);
362
+ });
363
+ }
364
+ /**
365
+ * Get a GUI. You retrieve GUI data and information whether it is displayed or not
366
+ *
367
+ * ```ts
368
+ * import { RpgGui } from '@rpgjs/client'
369
+ *
370
+ * const gui = RpgGui.get('my-gui')
371
+ * console.log(gui.display) // false
372
+ * ```
373
+ *
374
+ * @title Get a GUI
375
+ * @method RpgGui.get(id)
376
+ * @param {string} id
377
+ * @returns { { data: any, display: boolean } }
378
+ * @memberof RpgGui
379
+ */
380
+ get(id) {
381
+ if (typeof id != 'string') {
382
+ id = id.name;
383
+ }
384
+ return this.gui[id];
385
+ }
386
+ /**
387
+ * Get all GUI. You retrieve GUI data and information whether it is displayed or not
388
+ *
389
+ * ```ts
390
+ * import { RpgGui } from '@rpgjs/client'
391
+ *
392
+ * const gui = RpgGui.getAll()
393
+ * console.log(gui) // { 'rpg-dialog': { data: {}, display: true } }
394
+ * ```
395
+ *
396
+ * @title Get all GUI
397
+ * @method RpgGui.getAll()
398
+ * @returns { { [guiName]: { data: any, display: boolean } }}
399
+ * @memberof RpgGui
400
+ */
401
+ getAll() {
402
+ return this.gui;
403
+ }
404
+ /**
405
+ * Checks if the GUI exists RpgClient's gui array
406
+ *
407
+ * ```ts
408
+ * import { RpgGui } from '@rpgjs/client'
409
+ *
410
+ * RpgGui.exists('my-gui') // true
411
+ * ```
412
+ *
413
+ * @title GUI Exists ?
414
+ * @method RpgGui.exists(id)
415
+ * @param {string} id
416
+ * @returns {boolean}
417
+ * @memberof RpgGui
418
+ */
419
+ exists(id) {
420
+ return !!this.get(id);
421
+ }
422
+ /**
423
+ * Calls a GUI according to identifier. You can send retrievable data in the component
424
+ *
425
+ * ```ts
426
+ * import { RpgGui } from '@rpgjs/client'
427
+ *
428
+ * RpgGui.display('my-gui')
429
+ * ```
430
+ *
431
+ * @title Display GUI
432
+ * @method RpgGui.display(id,data)
433
+ * @param {string} id
434
+ * @param {object} [data]
435
+ * @returns {void}
436
+ * @memberof RpgGui
437
+ */
438
+ display(id, data = {}) {
439
+ this._setGui(id, {
440
+ display: true,
441
+ data
442
+ });
443
+ }
444
+ /**
445
+ * Hide a GUI according to its identifier
446
+ *
447
+ * ```ts
448
+ * import { RpgGui } from '@rpgjs/client'
449
+ *
450
+ * RpgGui.hide('my-gui')
451
+ * ```
452
+ *
453
+ * @title Hide GUI
454
+ * @method RpgGui.hide(id)
455
+ * @param {string} id
456
+ * @returns {void}
457
+ * @memberof RpgGui
458
+ */
459
+ hide(id) {
460
+ this._setGui(id, {
461
+ display: false
462
+ });
463
+ }
464
+ /** @internal */
465
+ clear() {
466
+ this.gui = {};
467
+ }
468
+ /** @internal */
469
+ tooltipPosition(position) {
470
+ const scene = this.renderer.getScene();
471
+ const viewport = scene?.viewport;
472
+ if (viewport) {
473
+ const currentZoom = viewport.scale.x;
474
+ const left = (position.x - viewport.left) * currentZoom;
475
+ const top = (position.y - viewport.top) * currentZoom;
476
+ return {
477
+ transform: `translate(${left}px,${top}px)`
478
+ };
479
+ }
480
+ return {};
481
+ }
482
+ /** @internal */
483
+ tooltipFilter(sprites) {
484
+ return sprites.filter(tooltip => tooltip.guiDisplay);
485
+ }
486
+ /** @internal */
487
+ get listenTooltipObjects() {
488
+ return combineLatest([
489
+ this.clientEngine.gameEngine.all,
490
+ this.currentScene?.objectsMoving
491
+ ]).pipe(map(([objects]) => {
492
+ return Object.values(objects).map((obj) => obj.object);
493
+ }));
494
+ }
495
+ }
496
+ export const RpgGui = new Gui();
497
+ //# sourceMappingURL=Gui.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Gui.js","sourceRoot":"","sources":["../../src/Gui/Gui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAmB,WAAW,EAAE,MAAM,UAAU,CAAA;AAIvD,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,GAAG,EAAO,aAAa,EAAW,MAAM,EAAc,MAAM,MAAM,CAAC;AAE5E,MAAM,EAAE,yBAAyB,EAAE,GAAG,KAAK,CAAA;AAe3C,MAAM,mBAAmB,GAAQ;IAC7B,MAAM;CACT,CAAA;AAED,MAAM,OAAO,GAAG;IAAhB;QAKW,QAAG,GAAY,EAAE,CAAA;QACjB,iBAAY,GAAiB,IAAI,CAAA;QAChC,uBAAkB,GAAU,EAAE,CAAA;IAqgB1C,CAAC;IAngBG,KAAK,CAAC,WAAW,CAAC,YAA6B,EAAE,KAAqB;QAClE,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;QAChC,IAAI,CAAC,QAAQ,GAAG,YAAY,CAAC,QAAQ,CAAA;QACrC,IAAI,CAAC,UAAU,GAAG,YAAY,CAAC,UAAU,CAAA;QACzC,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAA;QAErC,KAAK,IAAI,EAAE,IAAI,GAAG,EAAE;YAChB,IAAI,IAAI,GAAG,EAAE,CAAC,IAAI,CAAA;YAClB,IAAI,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE;gBACtB,IAAI,GAAG,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;aAClC;YACD,IAAI,CAAC,GAAG,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I,CAAC,GAAG,WAAW,CAAA;YACvD,MAAM,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,WAAW,CAAA;YACrD,OAAO;gBACH,SAAS,EAAE,aAAa,IAAI,MAAM,GAAG,KAAK;aAC7C,CAAA;SACJ;QACD,OAAO,EAAE,CAAA;IACb,CAAC;IAED,gBAAgB;IAChB,aAAa,CAAC,OAA0B;QACpC,OAAO,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;IACxD,CAAC;IAED,gBAAgB;IAChB,IAAI,oBAAoB;QACpB,OAAO,aAAa,CAChB;YACI,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG;YAChC,IAAI,CAAC,YAAY,EAAE,aAA6B;SACnD,CACJ,CAAC,IAAI,CACF,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE;YACd,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QAC/D,CAAC,CAAC,CACL,CAAA;IACL,CAAC;CACJ;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAE,CAAA"}
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import type { Gui } from './Gui.js';
3
+ export { useStore } from '@nanostores/react';
4
+ export declare const RpgReactContext: import("react").Context<any>;
5
+ export declare const useObjects: () => any[];
6
+ export declare const useCurrentPlayer: () => {};
7
+ export declare class ReactGui {
8
+ private app;
9
+ private clientEngine;
10
+ private renderer;
11
+ private _gui;
12
+ constructor(rootEl: HTMLDivElement, parentGui: Gui);
13
+ set gui(val: any);
14
+ }
@@ -0,0 +1,89 @@
1
+ import { createRoot } from 'react-dom/client';
2
+ import { createElement, useState, createContext, useEffect, useContext, useSyncExternalStore, useRef } from 'react';
3
+ import { BehaviorSubject, map, tap } from 'rxjs';
4
+ export { useStore } from '@nanostores/react';
5
+ export const RpgReactContext = createContext({});
6
+ // TODO
7
+ export const useObjects = () => {
8
+ const [objects, setObjects] = useState([]);
9
+ const { rpgObjects } = useContext(RpgReactContext);
10
+ useEffect(() => {
11
+ rpgObjects
12
+ .pipe(map((objects) => Object.values(objects).map((obj) => obj.object)))
13
+ .subscribe(setObjects);
14
+ }, []);
15
+ return objects;
16
+ };
17
+ // TODO
18
+ export const useCurrentPlayer = () => {
19
+ const { rpgCurrentPlayer } = useContext(RpgReactContext);
20
+ const currentPlayerRef = useRef({});
21
+ let _onChanges;
22
+ const subscribe = (onChanges) => {
23
+ _onChanges = onChanges;
24
+ return () => {
25
+ _onChanges = null;
26
+ };
27
+ };
28
+ useEffect(() => {
29
+ const ob$ = rpgCurrentPlayer
30
+ .pipe(map((player) => player.object), tap((player) => currentPlayerRef.current = player));
31
+ const subscription = ob$.subscribe(() => {
32
+ _onChanges?.();
33
+ });
34
+ return () => subscription.unsubscribe();
35
+ }, []);
36
+ return useSyncExternalStore(subscribe, () => currentPlayerRef.current);
37
+ };
38
+ export class ReactGui {
39
+ //private _tooltips: BehaviorSubject<any[]> = new BehaviorSubject([] as any)
40
+ constructor(rootEl, parentGui) {
41
+ this._gui = new BehaviorSubject([]);
42
+ this.app = createRoot(rootEl);
43
+ this.clientEngine = parentGui.clientEngine;
44
+ this.renderer = this.clientEngine.renderer;
45
+ const GuiTooltip = (ui) => {
46
+ return () => {
47
+ const [_tooltip, setTooltip] = useState([]);
48
+ useEffect(() => {
49
+ parentGui.listenTooltipObjects.subscribe(setTooltip);
50
+ // force combineLatest to emit first value
51
+ parentGui.currentScene?.objectsMoving.next({});
52
+ }, [parentGui.currentScene]);
53
+ return parentGui.tooltipFilter(_tooltip).map(sprite => createElement('div', {
54
+ style: parentGui.tooltipPosition({ x: sprite.position.x, y: sprite.position.y }),
55
+ key: sprite.id,
56
+ }, createElement(ui.gui, {
57
+ spriteData: sprite,
58
+ ...(ui.data || {}),
59
+ })));
60
+ };
61
+ };
62
+ const GuiWrapper = () => {
63
+ const [_gui, setGui] = useState([]);
64
+ useEffect(() => {
65
+ this._gui.subscribe(gui => setGui(gui));
66
+ }, []);
67
+ return createElement(RpgReactContext.Provider, {
68
+ value: parentGui.getInjectObject()
69
+ }, ..._gui.filter(ui => ui.display && !ui.attachToSprite).map(ui => createElement(ui.gui, {
70
+ key: ui.name,
71
+ ...(ui.data || {})
72
+ })), ..._gui.filter(ui => ui.display && ui.attachToSprite).map(ui => createElement('div', {
73
+ key: ui.name
74
+ }, createElement(GuiTooltip(ui)))));
75
+ };
76
+ this.app.render(createElement(GuiWrapper));
77
+ }
78
+ set gui(val) {
79
+ let array = [];
80
+ for (let key in val) {
81
+ // ignore vuejs component
82
+ if (!val[key].isFunction)
83
+ continue;
84
+ array.push(val[key]);
85
+ }
86
+ this._gui.next(array);
87
+ }
88
+ }
89
+ //# sourceMappingURL=React.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"React.js","sourceRoot":"","sources":["../../src/Gui/React.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAY,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAe,oBAAoB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAG1I,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,GAAG,EAA0B,MAAM,MAAM,CAAC;AAGzE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC,EAAS,CAAC,CAAA;AAEvD,OAAO;AACP,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE;IAC3B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,EAAW,CAAC,CAAA;IACnD,MAAM,EAAE,UAAU,EAAE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AG,IAAI,GAAG,EAAE;YACjB,yBAAyB;YACzB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,UAAU;gBAAE,SAAQ;YAClC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;SACvB;QACD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACzB,CAAC;CACJ"}
@@ -0,0 +1,13 @@
1
+ import type { Gui } from './Gui.js';
2
+ export declare class VueGui {
3
+ private parentGui;
4
+ private renderer;
5
+ private gameEngine;
6
+ private clientEngine;
7
+ private app;
8
+ private vm;
9
+ private socket;
10
+ constructor(rootEl: HTMLDivElement, parentGui: Gui);
11
+ _setSceneReady(): void;
12
+ set gui(val: any);
13
+ }