@rpgjs/client 5.0.0-beta.2 → 5.0.0-beta.22
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/CHANGELOG.md +130 -0
- package/dist/Game/AnimationManager.d.ts +2 -1
- package/dist/Game/AnimationManager.js +21 -9
- package/dist/Game/AnimationManager.js.map +1 -1
- package/dist/Game/AnimationManager.spec.d.ts +1 -0
- package/dist/Game/ClientVisuals.d.ts +61 -0
- package/dist/Game/ClientVisuals.js +96 -0
- package/dist/Game/ClientVisuals.js.map +1 -0
- package/dist/Game/ClientVisuals.spec.d.ts +1 -0
- package/dist/Game/Event.js.map +1 -1
- package/dist/Game/EventComponentResolver.d.ts +16 -0
- package/dist/Game/EventComponentResolver.js +52 -0
- package/dist/Game/EventComponentResolver.js.map +1 -0
- package/dist/Game/EventComponentResolver.spec.d.ts +1 -0
- package/dist/Game/Map.d.ts +9 -1
- package/dist/Game/Map.js +83 -5
- package/dist/Game/Map.js.map +1 -1
- package/dist/Game/Object.d.ts +49 -15
- package/dist/Game/Object.js +101 -42
- package/dist/Game/Object.js.map +1 -1
- package/dist/Game/Object.spec.d.ts +1 -0
- package/dist/Game/Player.js.map +1 -1
- package/dist/Game/ProjectileManager.d.ts +98 -0
- package/dist/Game/ProjectileManager.js +196 -0
- package/dist/Game/ProjectileManager.js.map +1 -0
- package/dist/Game/ProjectileManager.spec.d.ts +1 -0
- package/dist/Gui/Gui.d.ts +20 -6
- package/dist/Gui/Gui.js +132 -57
- package/dist/Gui/Gui.js.map +1 -1
- package/dist/Gui/Gui.spec.d.ts +1 -0
- package/dist/Gui/NotificationManager.js.map +1 -1
- package/dist/Resource.js +1 -1
- package/dist/Resource.js.map +1 -1
- package/dist/RpgClient.d.ts +194 -15
- package/dist/RpgClientEngine.d.ts +191 -19
- package/dist/RpgClientEngine.js +693 -74
- package/dist/RpgClientEngine.js.map +1 -1
- package/dist/Sound.js.map +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.122.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/decorate.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.122.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/decorateMetadata.js +1 -1
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/components/animations/animation.ce.js +6 -5
- package/dist/components/animations/animation.ce.js.map +1 -1
- package/dist/components/animations/fx.ce.js +60 -0
- package/dist/components/animations/fx.ce.js.map +1 -0
- package/dist/components/animations/hit.ce.js +24 -28
- package/dist/components/animations/hit.ce.js.map +1 -1
- package/dist/components/animations/index.d.ts +1 -0
- package/dist/components/animations/index.js +6 -4
- package/dist/components/animations/index.js.map +1 -1
- package/dist/components/character.ce.js +748 -249
- package/dist/components/character.ce.js.map +1 -1
- package/dist/components/dynamics/bar.ce.js +99 -0
- package/dist/components/dynamics/bar.ce.js.map +1 -0
- package/dist/components/dynamics/image.ce.js +26 -0
- package/dist/components/dynamics/image.ce.js.map +1 -0
- package/dist/components/dynamics/parse-value.d.ts +3 -0
- package/dist/components/dynamics/parse-value.js +54 -35
- package/dist/components/dynamics/parse-value.js.map +1 -1
- package/dist/components/dynamics/parse-value.spec.d.ts +1 -0
- package/dist/components/dynamics/shape-utils.d.ts +16 -0
- package/dist/components/dynamics/shape-utils.js +73 -0
- package/dist/components/dynamics/shape-utils.js.map +1 -0
- package/dist/components/dynamics/shape-utils.spec.d.ts +1 -0
- package/dist/components/dynamics/shape.ce.js +86 -0
- package/dist/components/dynamics/shape.ce.js.map +1 -0
- package/dist/components/dynamics/text.ce.js +36 -56
- package/dist/components/dynamics/text.ce.js.map +1 -1
- package/dist/components/gui/box.ce.js +9 -9
- package/dist/components/gui/box.ce.js.map +1 -1
- package/dist/components/gui/dialogbox/index.ce.js +75 -65
- package/dist/components/gui/dialogbox/index.ce.js.map +1 -1
- package/dist/components/gui/gameover.ce.js +47 -68
- package/dist/components/gui/gameover.ce.js.map +1 -1
- package/dist/components/gui/hud/hud.ce.js +23 -31
- package/dist/components/gui/hud/hud.ce.js.map +1 -1
- package/dist/components/gui/menu/equip-menu.ce.js +121 -172
- package/dist/components/gui/menu/equip-menu.ce.js.map +1 -1
- package/dist/components/gui/menu/exit-menu.ce.js +15 -10
- package/dist/components/gui/menu/exit-menu.ce.js.map +1 -1
- package/dist/components/gui/menu/items-menu.ce.js +62 -77
- package/dist/components/gui/menu/items-menu.ce.js.map +1 -1
- package/dist/components/gui/menu/main-menu.ce.js +89 -104
- package/dist/components/gui/menu/main-menu.ce.js.map +1 -1
- package/dist/components/gui/menu/options-menu.ce.js +12 -8
- package/dist/components/gui/menu/options-menu.ce.js.map +1 -1
- package/dist/components/gui/menu/skills-menu.ce.js +17 -19
- package/dist/components/gui/menu/skills-menu.ce.js.map +1 -1
- package/dist/components/gui/mobile/index.d.ts +51 -2
- package/dist/components/gui/mobile/index.js +14 -6
- package/dist/components/gui/mobile/index.js.map +1 -1
- package/dist/components/gui/mobile/index.spec.d.ts +1 -0
- package/dist/components/gui/mobile/mobile.ce.js +309 -59
- package/dist/components/gui/mobile/mobile.ce.js.map +1 -1
- package/dist/components/gui/notification/notification.ce.js +28 -26
- package/dist/components/gui/notification/notification.ce.js.map +1 -1
- package/dist/components/gui/save-load.ce.js +81 -256
- package/dist/components/gui/save-load.ce.js.map +1 -1
- package/dist/components/gui/shop/shop.ce.js +107 -142
- package/dist/components/gui/shop/shop.ce.js.map +1 -1
- package/dist/components/gui/title-screen.ce.js +50 -73
- package/dist/components/gui/title-screen.ce.js.map +1 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +1 -0
- package/dist/components/interaction-components.ce.js +22 -0
- package/dist/components/interaction-components.ce.js.map +1 -0
- package/dist/components/player-components-utils.d.ts +67 -0
- package/dist/components/player-components-utils.js +162 -0
- package/dist/components/player-components-utils.js.map +1 -0
- package/dist/components/player-components-utils.spec.d.ts +1 -0
- package/dist/components/player-components.ce.js +191 -0
- package/dist/components/player-components.ce.js.map +1 -0
- package/dist/components/prebuilt/hp-bar.ce.js +45 -45
- package/dist/components/prebuilt/hp-bar.ce.js.map +1 -1
- package/dist/components/prebuilt/light-halo.ce.js +39 -60
- package/dist/components/prebuilt/light-halo.ce.js.map +1 -1
- package/dist/components/scenes/canvas.ce.js +205 -27
- package/dist/components/scenes/canvas.ce.js.map +1 -1
- package/dist/components/scenes/draw-map.ce.js +39 -39
- package/dist/components/scenes/draw-map.ce.js.map +1 -1
- package/dist/components/scenes/event-layer.ce.js +51 -10
- package/dist/components/scenes/event-layer.ce.js.map +1 -1
- package/dist/core/inject.js +1 -1
- package/dist/core/inject.js.map +1 -1
- package/dist/core/setup.js +1 -1
- package/dist/core/setup.js.map +1 -1
- package/dist/decorators/spritesheet.d.ts +1 -0
- package/dist/decorators/spritesheet.js +11 -0
- package/dist/decorators/spritesheet.js.map +1 -0
- package/dist/i18n.d.ts +55 -0
- package/dist/i18n.js +60 -0
- package/dist/i18n.js.map +1 -0
- package/dist/i18n.spec.d.ts +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +29 -21
- package/dist/module.js +45 -4
- package/dist/module.js.map +1 -1
- package/dist/node_modules/.pnpm/{@signe_di@2.9.0 → @signe_di@3.1.0}/node_modules/@signe/di/dist/index.js +7 -117
- package/dist/node_modules/.pnpm/@signe_di@3.1.0/node_modules/@signe/di/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@signe_reactive@3.1.0/node_modules/@signe/reactive/dist/index.js +239 -0
- package/dist/node_modules/.pnpm/@signe_reactive@3.1.0/node_modules/@signe/reactive/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@signe_room@3.1.0_react@19.2.7/node_modules/@signe/room/dist/chunk-EUXUH3YW.js +13 -0
- package/dist/node_modules/.pnpm/@signe_room@3.1.0_react@19.2.7/node_modules/@signe/room/dist/chunk-EUXUH3YW.js.map +1 -0
- package/dist/node_modules/.pnpm/@signe_room@3.1.0_react@19.2.7/node_modules/@signe/room/dist/index.js +698 -0
- package/dist/node_modules/.pnpm/@signe_room@3.1.0_react@19.2.7/node_modules/@signe/room/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@signe_sync@3.1.0_react@19.2.7/node_modules/@signe/sync/dist/client/index.js +43 -0
- package/dist/node_modules/.pnpm/@signe_sync@3.1.0_react@19.2.7/node_modules/@signe/sync/dist/client/index.js.map +1 -0
- package/dist/node_modules/.pnpm/{@signe_sync@2.9.0 → @signe_sync@3.1.0_react@19.2.7}/node_modules/@signe/sync/dist/index.js +57 -141
- package/dist/node_modules/.pnpm/@signe_sync@3.1.0_react@19.2.7/node_modules/@signe/sync/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/{partysocket@1.1.3/node_modules/partysocket/dist/chunk-HAC622V3.js → partysocket@1.2.0_react@19.2.7/node_modules/partysocket/dist/index.js} +30 -17
- package/dist/node_modules/.pnpm/partysocket@1.2.0_react@19.2.7/node_modules/partysocket/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/{partysocket@1.1.3/node_modules/partysocket/dist/chunk-S74YV6PU.js → partysocket@1.2.0_react@19.2.7/node_modules/partysocket/dist/ws.js} +65 -34
- package/dist/node_modules/.pnpm/partysocket@1.2.0_react@19.2.7/node_modules/partysocket/dist/ws.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/index.js +13 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/index.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js +106 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js +13 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js +121 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js +10 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js +110 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js +99 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js +82 -0
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js.map +1 -0
- package/dist/node_modules/.pnpm/{zod@3.24.2/node_modules/zod/lib/index.js → zod@3.25.76/node_modules/zod/v3/types.js} +74 -611
- package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js.map +1 -0
- package/dist/presets/animation.js.map +1 -1
- package/dist/presets/faceset.js.map +1 -1
- package/dist/presets/icon.js.map +1 -1
- package/dist/presets/index.js.map +1 -1
- package/dist/presets/lpc.js.map +1 -1
- package/dist/presets/rmspritesheet.js.map +1 -1
- package/dist/services/AbstractSocket.d.ts +2 -0
- package/dist/services/AbstractSocket.js.map +1 -1
- package/dist/services/actionInput.d.ts +14 -0
- package/dist/services/actionInput.js +59 -0
- package/dist/services/actionInput.js.map +1 -0
- package/dist/services/actionInput.spec.d.ts +1 -0
- package/dist/services/cameraFollow.d.ts +51 -0
- package/dist/services/cameraFollow.js +134 -0
- package/dist/services/cameraFollow.js.map +1 -0
- package/dist/services/cameraFollow.spec.d.ts +1 -0
- package/dist/services/interactions.d.ts +159 -0
- package/dist/services/interactions.js +460 -0
- package/dist/services/interactions.js.map +1 -0
- package/dist/services/interactions.spec.d.ts +1 -0
- package/dist/services/keyboardControls.d.ts +1 -0
- package/dist/services/keyboardControls.js +1 -0
- package/dist/services/keyboardControls.js.map +1 -1
- package/dist/services/loadMap.d.ts +9 -0
- package/dist/services/loadMap.js +1 -1
- package/dist/services/loadMap.js.map +1 -1
- package/dist/services/mmorpg-connection.d.ts +5 -0
- package/dist/services/mmorpg-connection.js +50 -0
- package/dist/services/mmorpg-connection.js.map +1 -0
- package/dist/services/mmorpg-connection.spec.d.ts +1 -0
- package/dist/services/mmorpg.d.ts +11 -4
- package/dist/services/mmorpg.js +57 -33
- package/dist/services/mmorpg.js.map +1 -1
- package/dist/services/pointerContext.d.ts +11 -0
- package/dist/services/pointerContext.js +48 -0
- package/dist/services/pointerContext.js.map +1 -0
- package/dist/services/pointerContext.spec.d.ts +1 -0
- package/dist/services/save.js.map +1 -1
- package/dist/services/save.spec.d.ts +1 -0
- package/dist/services/standalone-message.d.ts +1 -0
- package/dist/services/standalone-message.js +9 -0
- package/dist/services/standalone-message.js.map +1 -0
- package/dist/services/standalone.d.ts +4 -1
- package/dist/services/standalone.js +36 -16
- package/dist/services/standalone.js.map +1 -1
- package/dist/services/standalone.spec.d.ts +1 -0
- package/dist/utils/getEntityProp.js +4 -3
- package/dist/utils/getEntityProp.js.map +1 -1
- package/dist/utils/getEntityProp.spec.d.ts +1 -0
- package/dist/utils/mapId.d.ts +1 -0
- package/dist/utils/mapId.js +6 -0
- package/dist/utils/mapId.js.map +1 -0
- package/dist/utils/readPropValue.d.ts +2 -0
- package/dist/utils/readPropValue.js +13 -0
- package/dist/utils/readPropValue.js.map +1 -0
- package/package.json +13 -13
- package/src/Game/AnimationManager.spec.ts +30 -0
- package/src/Game/AnimationManager.ts +26 -10
- package/src/Game/ClientVisuals.spec.ts +56 -0
- package/src/Game/ClientVisuals.ts +184 -0
- package/src/Game/EventComponentResolver.spec.ts +84 -0
- package/src/Game/EventComponentResolver.ts +74 -0
- package/src/Game/Map.ts +134 -2
- package/src/Game/Object.spec.ts +59 -0
- package/src/Game/Object.ts +181 -77
- package/src/Game/ProjectileManager.spec.ts +449 -0
- package/src/Game/ProjectileManager.ts +346 -0
- package/src/Gui/Gui.spec.ts +359 -0
- package/src/Gui/Gui.ts +178 -67
- package/src/Resource.ts +1 -2
- package/src/RpgClient.ts +220 -17
- package/src/RpgClientEngine.ts +995 -133
- package/src/components/animations/fx.ce +101 -0
- package/src/components/animations/index.ts +4 -2
- package/src/components/character.ce +839 -45
- package/src/components/dynamics/bar.ce +88 -0
- package/src/components/dynamics/image.ce +21 -0
- package/src/components/dynamics/parse-value.spec.ts +83 -0
- package/src/components/dynamics/parse-value.ts +111 -37
- package/src/components/dynamics/shape-utils.spec.ts +46 -0
- package/src/components/dynamics/shape-utils.ts +61 -0
- package/src/components/dynamics/shape.ce +90 -0
- package/src/components/dynamics/text.ce +35 -149
- package/src/components/gui/dialogbox/index.ce +52 -21
- package/src/components/gui/gameover.ce +6 -4
- package/src/components/gui/menu/equip-menu.ce +11 -9
- package/src/components/gui/menu/exit-menu.ce +6 -4
- package/src/components/gui/menu/items-menu.ce +11 -9
- package/src/components/gui/menu/main-menu.ce +14 -12
- package/src/components/gui/menu/options-menu.ce +4 -3
- package/src/components/gui/menu/skills-menu.ce +2 -1
- package/src/components/gui/mobile/index.spec.ts +94 -0
- package/src/components/gui/mobile/index.ts +74 -6
- package/src/components/gui/mobile/mobile.ce +347 -65
- package/src/components/gui/notification/notification.ce +7 -1
- package/src/components/gui/save-load.ce +13 -11
- package/src/components/gui/shop/shop.ce +20 -18
- package/src/components/gui/title-screen.ce +6 -4
- package/src/components/index.ts +2 -1
- package/src/components/interaction-components.ce +23 -0
- package/src/components/player-components-utils.spec.ts +109 -0
- package/src/components/player-components-utils.ts +205 -0
- package/src/components/player-components.ce +222 -0
- package/src/components/prebuilt/hp-bar.ce +4 -3
- package/src/components/prebuilt/light-halo.ce +2 -2
- package/src/components/scenes/canvas.ce +219 -15
- package/src/components/scenes/draw-map.ce +34 -22
- package/src/components/scenes/event-layer.ce +55 -4
- package/src/core/setup.ts +2 -2
- package/src/decorators/spritesheet.ts +8 -0
- package/src/i18n.spec.ts +39 -0
- package/src/i18n.ts +59 -0
- package/src/index.ts +19 -0
- package/src/module.ts +61 -11
- package/src/services/AbstractSocket.ts +3 -0
- package/src/services/actionInput.spec.ts +155 -0
- package/src/services/actionInput.ts +120 -0
- package/src/services/cameraFollow.spec.ts +220 -0
- package/src/services/cameraFollow.ts +222 -0
- package/src/services/interactions.spec.ts +175 -0
- package/src/services/interactions.ts +722 -0
- package/src/services/keyboardControls.ts +2 -1
- package/src/services/loadMap.ts +5 -1
- package/src/services/mmorpg-connection.spec.ts +99 -0
- package/src/services/mmorpg-connection.ts +69 -0
- package/src/services/mmorpg.ts +70 -36
- package/src/services/pointerContext.spec.ts +36 -0
- package/src/services/pointerContext.ts +84 -0
- package/src/services/save.spec.ts +127 -0
- package/src/services/standalone-message.ts +7 -0
- package/src/services/standalone.spec.ts +54 -0
- package/src/services/standalone.ts +44 -12
- package/src/utils/getEntityProp.spec.ts +96 -0
- package/src/utils/getEntityProp.ts +4 -3
- package/src/utils/mapId.ts +2 -0
- package/src/utils/readPropValue.ts +16 -0
- package/dist/node_modules/.pnpm/@signe_di@2.9.0/node_modules/@signe/di/dist/index.js.map +0 -1
- package/dist/node_modules/.pnpm/@signe_reactive@2.8.3/node_modules/@signe/reactive/dist/index.js +0 -457
- package/dist/node_modules/.pnpm/@signe_reactive@2.8.3/node_modules/@signe/reactive/dist/index.js.map +0 -1
- package/dist/node_modules/.pnpm/@signe_reactive@2.9.0/node_modules/@signe/reactive/dist/index.js +0 -463
- package/dist/node_modules/.pnpm/@signe_reactive@2.9.0/node_modules/@signe/reactive/dist/index.js.map +0 -1
- package/dist/node_modules/.pnpm/@signe_room@2.9.0/node_modules/@signe/room/dist/index.js +0 -2191
- package/dist/node_modules/.pnpm/@signe_room@2.9.0/node_modules/@signe/room/dist/index.js.map +0 -1
- package/dist/node_modules/.pnpm/@signe_sync@2.9.0/node_modules/@signe/sync/dist/chunk-7QVYU63E.js +0 -10
- package/dist/node_modules/.pnpm/@signe_sync@2.9.0/node_modules/@signe/sync/dist/chunk-7QVYU63E.js.map +0 -1
- package/dist/node_modules/.pnpm/@signe_sync@2.9.0/node_modules/@signe/sync/dist/client/index.js +0 -91
- package/dist/node_modules/.pnpm/@signe_sync@2.9.0/node_modules/@signe/sync/dist/client/index.js.map +0 -1
- package/dist/node_modules/.pnpm/@signe_sync@2.9.0/node_modules/@signe/sync/dist/index.js.map +0 -1
- package/dist/node_modules/.pnpm/dset@3.1.4/node_modules/dset/dist/index.js +0 -14
- package/dist/node_modules/.pnpm/dset@3.1.4/node_modules/dset/dist/index.js.map +0 -1
- package/dist/node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-HAC622V3.js.map +0 -1
- package/dist/node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-S74YV6PU.js.map +0 -1
- package/dist/node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/index.js +0 -2
- package/dist/node_modules/.pnpm/zod@3.24.2/node_modules/zod/lib/index.js.map +0 -1
|
@@ -1,9 +1,28 @@
|
|
|
1
|
+
import { Trigger } from 'canvasengine';
|
|
1
2
|
import { AbstractWebsocket } from './services/AbstractSocket';
|
|
2
|
-
import {
|
|
3
|
+
import { I18nParams, RpgActionInput, RpgActionName, RpgDashInput, RpgMovementInput } from '@rpgjs/common';
|
|
4
|
+
import { EventComponentConfig } from './RpgClient';
|
|
5
|
+
import { RpgClientEvent } from './Game/Event';
|
|
3
6
|
import { RpgClientMap } from './Game/Map';
|
|
4
7
|
import { AnimationManager } from './Game/AnimationManager';
|
|
5
8
|
import { Observable } from 'rxjs';
|
|
9
|
+
import { ProjectileManager } from './Game/ProjectileManager';
|
|
10
|
+
import { ClientVisualRegistry, ClientVisualHandler, ClientVisualMap, ClientVisualPacket } from './Game/ClientVisuals';
|
|
11
|
+
import { ClientPointerContext } from './services/pointerContext';
|
|
12
|
+
import { RpgClientInteractions } from './services/interactions';
|
|
13
|
+
import { EventComponentResolver } from './Game/EventComponentResolver';
|
|
14
|
+
import { CameraFollowSmoothMove } from './services/cameraFollow';
|
|
6
15
|
import * as PIXI from "pixi.js";
|
|
16
|
+
export type { CameraFollowEase, CameraFollowSmoothMove, CameraFollowSmoothMoveOptions, } from './services/cameraFollow';
|
|
17
|
+
type ConfigurableTrigger<T> = Omit<Trigger<T>, "start"> & {
|
|
18
|
+
start(config?: T): Promise<void>;
|
|
19
|
+
};
|
|
20
|
+
type MapShakeOptions = {
|
|
21
|
+
intensity?: number;
|
|
22
|
+
duration?: number;
|
|
23
|
+
frequency?: number;
|
|
24
|
+
direction?: string;
|
|
25
|
+
};
|
|
7
26
|
export declare class RpgClientEngine<T = any> {
|
|
8
27
|
context: any;
|
|
9
28
|
private guiService;
|
|
@@ -14,12 +33,18 @@ export declare class RpgClientEngine<T = any> {
|
|
|
14
33
|
private selector;
|
|
15
34
|
globalConfig: T;
|
|
16
35
|
sceneComponent: any;
|
|
36
|
+
sceneMapComponent: any;
|
|
17
37
|
stopProcessingInput: boolean;
|
|
18
38
|
width: import('canvasengine').WritableSignal<string>;
|
|
19
39
|
height: import('canvasengine').WritableSignal<string>;
|
|
20
|
-
spritesheets: Map<string, any>;
|
|
40
|
+
spritesheets: Map<string | number, any>;
|
|
41
|
+
private spritesheetPromises;
|
|
21
42
|
sounds: Map<string, any>;
|
|
22
43
|
componentAnimations: any[];
|
|
44
|
+
clientVisuals: ClientVisualRegistry;
|
|
45
|
+
projectiles: ProjectileManager;
|
|
46
|
+
pointer: ClientPointerContext;
|
|
47
|
+
interactions: RpgClientInteractions;
|
|
23
48
|
private spritesheetResolver?;
|
|
24
49
|
private soundResolver?;
|
|
25
50
|
particleSettings: {
|
|
@@ -32,19 +57,31 @@ export declare class RpgClientEngine<T = any> {
|
|
|
32
57
|
playerIdSignal: import('canvasengine').WritableSignal<string | null>;
|
|
33
58
|
spriteComponentsBehind: import('canvasengine').WritableArraySignal<any[]>;
|
|
34
59
|
spriteComponentsInFront: import('canvasengine').WritableArraySignal<any[]>;
|
|
60
|
+
spriteComponents: Map<string, any>;
|
|
61
|
+
private eventComponentResolvers;
|
|
35
62
|
/** ID of the sprite that the camera should follow. null means follow the current player */
|
|
36
63
|
cameraFollowTargetId: import('canvasengine').WritableSignal<string | null>;
|
|
64
|
+
/** Camera follow transition options used by character components when the target changes */
|
|
65
|
+
cameraFollowSmoothMove: CameraFollowSmoothMove;
|
|
66
|
+
/** Incremented for each camera follow command so repeated commands on the same target are applied */
|
|
67
|
+
cameraFollowRevision: import('canvasengine').WritableSignal<number>;
|
|
37
68
|
/** Trigger for map shake animation */
|
|
38
|
-
mapShakeTrigger:
|
|
39
|
-
controlsReady: import('canvasengine').WritableSignal<undefined>;
|
|
69
|
+
mapShakeTrigger: ConfigurableTrigger<MapShakeOptions>;
|
|
70
|
+
controlsReady: import('canvasengine').WritableSignal<boolean | undefined>;
|
|
40
71
|
gamePause: import('canvasengine').WritableSignal<boolean>;
|
|
41
72
|
private predictionEnabled;
|
|
42
73
|
private prediction?;
|
|
43
74
|
private readonly SERVER_CORRECTION_THRESHOLD;
|
|
75
|
+
private localMovementAuthority;
|
|
76
|
+
private lastLocalMovementInputAt;
|
|
77
|
+
private readonly LOCAL_MOVEMENT_AUTHORITY_ACK_GRACE_MS;
|
|
44
78
|
private inputFrameCounter;
|
|
45
79
|
private pendingPredictionFrames;
|
|
46
80
|
private lastClientPhysicsStepAt;
|
|
47
81
|
private frameOffset;
|
|
82
|
+
private latestServerTick?;
|
|
83
|
+
private latestServerTickAt;
|
|
84
|
+
private dashLockedUntil;
|
|
48
85
|
private rtt;
|
|
49
86
|
private pingInterval;
|
|
50
87
|
private readonly PING_INTERVAL_MS;
|
|
@@ -59,10 +96,30 @@ export declare class RpgClientEngine<T = any> {
|
|
|
59
96
|
private eventsReceived$;
|
|
60
97
|
private onAfterLoadingSubscription?;
|
|
61
98
|
private sceneResetQueued;
|
|
99
|
+
private mapTransitionInProgress;
|
|
100
|
+
private currentMapRoomId?;
|
|
101
|
+
private socketListenersInitialized;
|
|
102
|
+
private clientReadyForMapChanges;
|
|
103
|
+
private pendingMapChanges;
|
|
62
104
|
private tickSubscriptions;
|
|
63
105
|
private resizeHandler?;
|
|
106
|
+
private pointerMoveHandler?;
|
|
107
|
+
private pointerUpHandler?;
|
|
108
|
+
private pointerCancelHandler?;
|
|
109
|
+
private pointerCanvas?;
|
|
110
|
+
private pendingSyncPackets;
|
|
64
111
|
private notificationManager;
|
|
112
|
+
private i18nService;
|
|
113
|
+
private locale?;
|
|
65
114
|
constructor(context: any);
|
|
115
|
+
private resolveLocalMovementAuthority;
|
|
116
|
+
setLocale(locale: string): void;
|
|
117
|
+
getLocale(): string;
|
|
118
|
+
t(key: string, params?: I18nParams): string;
|
|
119
|
+
i18n(): {
|
|
120
|
+
locale: string;
|
|
121
|
+
t: (key: string, params?: I18nParams) => string;
|
|
122
|
+
};
|
|
66
123
|
/**
|
|
67
124
|
* Assigns a CanvasEngine KeyboardControls instance to the dependency injection context
|
|
68
125
|
*
|
|
@@ -98,9 +155,28 @@ export declare class RpgClientEngine<T = any> {
|
|
|
98
155
|
*/
|
|
99
156
|
setKeyboardControls(controlInstance: any): void;
|
|
100
157
|
start(): Promise<void>;
|
|
158
|
+
private installCanvasResizeGuard;
|
|
159
|
+
private readCanvasResizeTargetSize;
|
|
160
|
+
private readCanvasRendererSize;
|
|
161
|
+
private cancelCanvasResizeFrame;
|
|
162
|
+
private resolveSceneMapComponent;
|
|
163
|
+
private setupPointerTracking;
|
|
164
|
+
updatePointerFromInteractionEvent(event: any): void;
|
|
165
|
+
private findViewportInstance;
|
|
166
|
+
private clearCameraFollowViewportPlugins;
|
|
101
167
|
private prepareSyncPayload;
|
|
168
|
+
private shouldPreserveLocalPlayerPosition;
|
|
169
|
+
private shouldKeepLocalPlayerMovement;
|
|
102
170
|
private normalizeAckWithSyncState;
|
|
103
171
|
private initListeners;
|
|
172
|
+
private beginMapTransfer;
|
|
173
|
+
private clearComponentAnimations;
|
|
174
|
+
private shouldProcessProjectilePacket;
|
|
175
|
+
private callConnectError;
|
|
176
|
+
private flushPendingSyncPackets;
|
|
177
|
+
private flushPendingMapChanges;
|
|
178
|
+
private handleChangeMap;
|
|
179
|
+
private applySyncPacket;
|
|
104
180
|
/**
|
|
105
181
|
* Start periodic ping/pong for client-server synchronization
|
|
106
182
|
*
|
|
@@ -175,7 +251,7 @@ export declare class RpgClientEngine<T = any> {
|
|
|
175
251
|
* });
|
|
176
252
|
* ```
|
|
177
253
|
*/
|
|
178
|
-
setSpritesheetResolver(resolver: (id: string) => any | Promise<any>): void;
|
|
254
|
+
setSpritesheetResolver(resolver: (id: string | number) => any | Promise<any>): void;
|
|
179
255
|
/**
|
|
180
256
|
* Get a spritesheet by ID, using resolver if not found in cache
|
|
181
257
|
*
|
|
@@ -183,7 +259,7 @@ export declare class RpgClientEngine<T = any> {
|
|
|
183
259
|
* If not found and a resolver is set, it calls the resolver to create the spritesheet.
|
|
184
260
|
* The resolved spritesheet is automatically cached for future use.
|
|
185
261
|
*
|
|
186
|
-
* @param id - The spritesheet ID to retrieve
|
|
262
|
+
* @param id - The spritesheet ID or legacy tile ID to retrieve
|
|
187
263
|
* @returns The spritesheet if found or created, or undefined if not found and no resolver
|
|
188
264
|
* @returns Promise<any> if the resolver is asynchronous
|
|
189
265
|
*
|
|
@@ -196,7 +272,7 @@ export declare class RpgClientEngine<T = any> {
|
|
|
196
272
|
* const spritesheet = await engine.getSpriteSheet('dynamic-sprite');
|
|
197
273
|
* ```
|
|
198
274
|
*/
|
|
199
|
-
getSpriteSheet(id: string): any | Promise<any>;
|
|
275
|
+
getSpriteSheet(id: string | number): any | Promise<any>;
|
|
200
276
|
/**
|
|
201
277
|
* Add a sound to the engine
|
|
202
278
|
*
|
|
@@ -332,19 +408,22 @@ export declare class RpgClientEngine<T = any> {
|
|
|
332
408
|
* Set the camera to follow a specific sprite
|
|
333
409
|
*
|
|
334
410
|
* This method changes which sprite the camera viewport should follow.
|
|
335
|
-
* The camera
|
|
411
|
+
* The camera can smoothly animate to the target sprite before continuous follow starts.
|
|
336
412
|
*
|
|
337
413
|
* ## Design
|
|
338
414
|
*
|
|
339
415
|
* The camera follow target is stored in a signal that is read by sprite components.
|
|
340
416
|
* Each sprite checks if it should be followed by comparing its ID with the target ID.
|
|
341
|
-
* When smoothMove options are provided, the
|
|
342
|
-
* viewport system.
|
|
417
|
+
* When smoothMove options are provided, the transition is handled by pixi-viewport's
|
|
418
|
+
* animation plugin, then continuous follow is handled by CanvasEngine's viewport system.
|
|
343
419
|
*
|
|
344
420
|
* @param targetId - The ID of the sprite to follow. Set to null to follow the current player
|
|
345
421
|
* @param smoothMove - Animation options. Can be a boolean (default: true) or an object with time and ease
|
|
346
422
|
* @param smoothMove.time - Duration of the animation in milliseconds (optional)
|
|
347
423
|
* @param smoothMove.ease - Easing function name from https://easings.net (optional)
|
|
424
|
+
* @param smoothMove.speed - Continuous follow speed after the transition (optional)
|
|
425
|
+
* @param smoothMove.acceleration - Continuous follow acceleration after the transition (optional)
|
|
426
|
+
* @param smoothMove.radius - Center radius where the target can move without moving the viewport (optional)
|
|
348
427
|
*
|
|
349
428
|
* @example
|
|
350
429
|
* ```ts
|
|
@@ -364,10 +443,8 @@ export declare class RpgClientEngine<T = any> {
|
|
|
364
443
|
* engine.setCameraFollow(null);
|
|
365
444
|
* ```
|
|
366
445
|
*/
|
|
367
|
-
setCameraFollow(targetId: string | null, smoothMove?:
|
|
368
|
-
|
|
369
|
-
ease?: string;
|
|
370
|
-
}): void;
|
|
446
|
+
setCameraFollow(targetId: string | null, smoothMove?: CameraFollowSmoothMove): void;
|
|
447
|
+
private resetCameraFollow;
|
|
371
448
|
addParticle(particle: any): any;
|
|
372
449
|
/**
|
|
373
450
|
* Add a component to render behind sprites
|
|
@@ -451,6 +528,76 @@ export declare class RpgClientEngine<T = any> {
|
|
|
451
528
|
props: (object: any) => any;
|
|
452
529
|
dependencies?: (object: any) => any[];
|
|
453
530
|
}): any;
|
|
531
|
+
/**
|
|
532
|
+
* Register a reusable sprite component that can be addressed by the server.
|
|
533
|
+
*
|
|
534
|
+
* Server-side component definitions only carry the component id and
|
|
535
|
+
* serializable props. The client registry maps that id to the CanvasEngine
|
|
536
|
+
* component that performs the actual rendering.
|
|
537
|
+
*
|
|
538
|
+
* @param id - Stable component id used by server component definitions
|
|
539
|
+
* @param component - CanvasEngine component to render for this id
|
|
540
|
+
* @returns The registered component
|
|
541
|
+
*
|
|
542
|
+
* @example
|
|
543
|
+
* ```ts
|
|
544
|
+
* engine.registerSpriteComponent('guildBadge', GuildBadgeComponent);
|
|
545
|
+
* ```
|
|
546
|
+
*/
|
|
547
|
+
registerSpriteComponent(id: string, component: any): any;
|
|
548
|
+
/**
|
|
549
|
+
* Get a reusable sprite component by id.
|
|
550
|
+
*
|
|
551
|
+
* @param id - Component id registered on the client
|
|
552
|
+
* @returns The CanvasEngine component, or undefined when missing
|
|
553
|
+
*/
|
|
554
|
+
getSpriteComponent(id: string): any;
|
|
555
|
+
/**
|
|
556
|
+
* Register a custom event component resolver.
|
|
557
|
+
*
|
|
558
|
+
* The last resolver returning a component wins. This lets later modules
|
|
559
|
+
* override earlier defaults without replacing the whole map scene.
|
|
560
|
+
*
|
|
561
|
+
* @param resolver - Function receiving the synced event object
|
|
562
|
+
* @returns The registered resolver
|
|
563
|
+
*/
|
|
564
|
+
addEventComponentResolver(resolver: EventComponentResolver): EventComponentResolver;
|
|
565
|
+
/**
|
|
566
|
+
* Resolve the custom CanvasEngine component for an event, if any.
|
|
567
|
+
*
|
|
568
|
+
* @param event - Synced client event object
|
|
569
|
+
* @returns The component/config returned by the last matching resolver
|
|
570
|
+
*/
|
|
571
|
+
resolveEventComponent(event: RpgClientEvent): EventComponentConfig | null;
|
|
572
|
+
registerProjectileComponent(type: string, component: any): any;
|
|
573
|
+
getProjectileComponent(type: string): any;
|
|
574
|
+
/**
|
|
575
|
+
* Register a named client visual macro.
|
|
576
|
+
*
|
|
577
|
+
* Client visuals are small client-side functions that group existing visual
|
|
578
|
+
* primitives such as flash, sound, component animations, sprite animation, or
|
|
579
|
+
* map shake. The server sends only the visual name and a serializable payload.
|
|
580
|
+
*
|
|
581
|
+
* @param name - Stable visual name sent by the server
|
|
582
|
+
* @param handler - Client-side visual handler
|
|
583
|
+
* @returns The registered handler
|
|
584
|
+
*/
|
|
585
|
+
registerClientVisual(name: string, handler: ClientVisualHandler): ClientVisualHandler;
|
|
586
|
+
/**
|
|
587
|
+
* Register several named client visual macros.
|
|
588
|
+
*
|
|
589
|
+
* @param visuals - Map of visual names to client-side handlers
|
|
590
|
+
*/
|
|
591
|
+
registerClientVisuals(visuals: ClientVisualMap): void;
|
|
592
|
+
/**
|
|
593
|
+
* Play a registered client visual locally.
|
|
594
|
+
*
|
|
595
|
+
* This is also used by the websocket listener when the server calls
|
|
596
|
+
* `player.clientVisual()` or `map.clientVisual()`.
|
|
597
|
+
*
|
|
598
|
+
* @param packet - Visual name and serializable payload
|
|
599
|
+
*/
|
|
600
|
+
playClientVisual(packet: ClientVisualPacket): Promise<void>;
|
|
454
601
|
/**
|
|
455
602
|
* Add a component animation to the engine
|
|
456
603
|
*
|
|
@@ -520,26 +667,35 @@ export declare class RpgClientEngine<T = any> {
|
|
|
520
667
|
* duration: 1000,
|
|
521
668
|
* onFinish: () => console.log('Fade complete')
|
|
522
669
|
* });
|
|
670
|
+
*
|
|
671
|
+
* // Wait until the transition component calls onFinish
|
|
672
|
+
* await engine.startTransition('fade', { duration: 1000 });
|
|
523
673
|
* ```
|
|
524
674
|
*/
|
|
525
|
-
startTransition(id: string, props?: any): void
|
|
675
|
+
startTransition(id: string, props?: any): Promise<void>;
|
|
526
676
|
processInput({ input }: {
|
|
527
|
-
input:
|
|
677
|
+
input: RpgMovementInput;
|
|
528
678
|
}): Promise<void>;
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
679
|
+
processDash(input?: Partial<RpgDashInput>): Promise<void>;
|
|
680
|
+
processAction(action: RpgActionName, data?: any): void;
|
|
681
|
+
processAction(action: RpgActionInput): void;
|
|
532
682
|
get PIXI(): typeof PIXI;
|
|
533
683
|
get socket(): AbstractWebsocket;
|
|
534
684
|
get playerId(): string | null;
|
|
535
685
|
get scene(): RpgClientMap;
|
|
686
|
+
getObjectById(id: string): any;
|
|
536
687
|
private getPhysicsTick;
|
|
688
|
+
private getPhysicsTickDurationMs;
|
|
689
|
+
private updateServerTickEstimate;
|
|
690
|
+
private estimateServerTick;
|
|
691
|
+
private predictProjectileImpact;
|
|
537
692
|
private ensureCurrentPlayerBody;
|
|
538
693
|
private stepClientPhysicsTick;
|
|
539
694
|
private flushPendingPredictedStates;
|
|
540
695
|
private buildPendingMoveTrajectory;
|
|
541
696
|
private emitMovePacket;
|
|
542
697
|
private flushPendingMovePath;
|
|
698
|
+
private applyPredictedMovementInput;
|
|
543
699
|
private getLocalPlayerState;
|
|
544
700
|
private applyAuthoritativeState;
|
|
545
701
|
private initializePredictionController;
|
|
@@ -584,6 +740,22 @@ export declare class RpgClientEngine<T = any> {
|
|
|
584
740
|
* ```
|
|
585
741
|
*/
|
|
586
742
|
clearClientPredictionStates(): void;
|
|
743
|
+
/**
|
|
744
|
+
* Stop local movement immediately and discard pending predicted movement.
|
|
745
|
+
*
|
|
746
|
+
* Use this before a blocking action such as an A-RPG attack, dialog, dash
|
|
747
|
+
* startup, or any client-side state where already buffered movement inputs
|
|
748
|
+
* must not be replayed after server reconciliation.
|
|
749
|
+
*
|
|
750
|
+
* @param player - Player object to stop. Defaults to the current player.
|
|
751
|
+
* @returns `true` when a player was found and interrupted.
|
|
752
|
+
*
|
|
753
|
+
* @example
|
|
754
|
+
* ```ts
|
|
755
|
+
* engine.interruptCurrentPlayerMovement();
|
|
756
|
+
* ```
|
|
757
|
+
*/
|
|
758
|
+
interruptCurrentPlayerMovement(player?: any): boolean;
|
|
587
759
|
/**
|
|
588
760
|
* Trigger a flash animation on a sprite
|
|
589
761
|
*
|