@rpgjs/client 5.0.0-beta.2 → 5.0.0-beta.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.
Files changed (314) hide show
  1. package/CHANGELOG.md +123 -0
  2. package/dist/Game/AnimationManager.d.ts +2 -1
  3. package/dist/Game/AnimationManager.js +21 -9
  4. package/dist/Game/AnimationManager.js.map +1 -1
  5. package/dist/Game/AnimationManager.spec.d.ts +1 -0
  6. package/dist/Game/ClientVisuals.d.ts +61 -0
  7. package/dist/Game/ClientVisuals.js +96 -0
  8. package/dist/Game/ClientVisuals.js.map +1 -0
  9. package/dist/Game/ClientVisuals.spec.d.ts +1 -0
  10. package/dist/Game/Event.js.map +1 -1
  11. package/dist/Game/EventComponentResolver.d.ts +16 -0
  12. package/dist/Game/EventComponentResolver.js +52 -0
  13. package/dist/Game/EventComponentResolver.js.map +1 -0
  14. package/dist/Game/EventComponentResolver.spec.d.ts +1 -0
  15. package/dist/Game/Map.d.ts +9 -1
  16. package/dist/Game/Map.js +83 -5
  17. package/dist/Game/Map.js.map +1 -1
  18. package/dist/Game/Object.d.ts +49 -15
  19. package/dist/Game/Object.js +101 -42
  20. package/dist/Game/Object.js.map +1 -1
  21. package/dist/Game/Object.spec.d.ts +1 -0
  22. package/dist/Game/Player.js.map +1 -1
  23. package/dist/Game/ProjectileManager.d.ts +98 -0
  24. package/dist/Game/ProjectileManager.js +196 -0
  25. package/dist/Game/ProjectileManager.js.map +1 -0
  26. package/dist/Game/ProjectileManager.spec.d.ts +1 -0
  27. package/dist/Gui/Gui.d.ts +20 -6
  28. package/dist/Gui/Gui.js +96 -54
  29. package/dist/Gui/Gui.js.map +1 -1
  30. package/dist/Gui/Gui.spec.d.ts +1 -0
  31. package/dist/Gui/NotificationManager.js.map +1 -1
  32. package/dist/Resource.js +1 -1
  33. package/dist/Resource.js.map +1 -1
  34. package/dist/RpgClient.d.ts +194 -15
  35. package/dist/RpgClientEngine.d.ts +176 -11
  36. package/dist/RpgClientEngine.js +669 -68
  37. package/dist/RpgClientEngine.js.map +1 -1
  38. package/dist/Sound.js.map +1 -1
  39. package/dist/_virtual/{_@oxc-project_runtime@0.122.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/decorate.js +1 -1
  40. package/dist/_virtual/{_@oxc-project_runtime@0.122.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/decorateMetadata.js +1 -1
  41. package/dist/_virtual/_rolldown/runtime.js +13 -0
  42. package/dist/components/animations/animation.ce.js +6 -5
  43. package/dist/components/animations/animation.ce.js.map +1 -1
  44. package/dist/components/animations/fx.ce.js +60 -0
  45. package/dist/components/animations/fx.ce.js.map +1 -0
  46. package/dist/components/animations/hit.ce.js +24 -28
  47. package/dist/components/animations/hit.ce.js.map +1 -1
  48. package/dist/components/animations/index.d.ts +1 -0
  49. package/dist/components/animations/index.js +6 -4
  50. package/dist/components/animations/index.js.map +1 -1
  51. package/dist/components/character.ce.js +606 -248
  52. package/dist/components/character.ce.js.map +1 -1
  53. package/dist/components/dynamics/bar.ce.js +99 -0
  54. package/dist/components/dynamics/bar.ce.js.map +1 -0
  55. package/dist/components/dynamics/image.ce.js +26 -0
  56. package/dist/components/dynamics/image.ce.js.map +1 -0
  57. package/dist/components/dynamics/parse-value.d.ts +3 -0
  58. package/dist/components/dynamics/parse-value.js +54 -35
  59. package/dist/components/dynamics/parse-value.js.map +1 -1
  60. package/dist/components/dynamics/parse-value.spec.d.ts +1 -0
  61. package/dist/components/dynamics/shape-utils.d.ts +16 -0
  62. package/dist/components/dynamics/shape-utils.js +73 -0
  63. package/dist/components/dynamics/shape-utils.js.map +1 -0
  64. package/dist/components/dynamics/shape-utils.spec.d.ts +1 -0
  65. package/dist/components/dynamics/shape.ce.js +86 -0
  66. package/dist/components/dynamics/shape.ce.js.map +1 -0
  67. package/dist/components/dynamics/text.ce.js +36 -56
  68. package/dist/components/dynamics/text.ce.js.map +1 -1
  69. package/dist/components/gui/box.ce.js +9 -9
  70. package/dist/components/gui/box.ce.js.map +1 -1
  71. package/dist/components/gui/dialogbox/index.ce.js +75 -65
  72. package/dist/components/gui/dialogbox/index.ce.js.map +1 -1
  73. package/dist/components/gui/gameover.ce.js +47 -68
  74. package/dist/components/gui/gameover.ce.js.map +1 -1
  75. package/dist/components/gui/hud/hud.ce.js +23 -31
  76. package/dist/components/gui/hud/hud.ce.js.map +1 -1
  77. package/dist/components/gui/menu/equip-menu.ce.js +121 -172
  78. package/dist/components/gui/menu/equip-menu.ce.js.map +1 -1
  79. package/dist/components/gui/menu/exit-menu.ce.js +15 -10
  80. package/dist/components/gui/menu/exit-menu.ce.js.map +1 -1
  81. package/dist/components/gui/menu/items-menu.ce.js +62 -77
  82. package/dist/components/gui/menu/items-menu.ce.js.map +1 -1
  83. package/dist/components/gui/menu/main-menu.ce.js +89 -104
  84. package/dist/components/gui/menu/main-menu.ce.js.map +1 -1
  85. package/dist/components/gui/menu/options-menu.ce.js +12 -8
  86. package/dist/components/gui/menu/options-menu.ce.js.map +1 -1
  87. package/dist/components/gui/menu/skills-menu.ce.js +17 -19
  88. package/dist/components/gui/menu/skills-menu.ce.js.map +1 -1
  89. package/dist/components/gui/mobile/index.js +2 -2
  90. package/dist/components/gui/mobile/index.js.map +1 -1
  91. package/dist/components/gui/mobile/mobile.ce.js +7 -5
  92. package/dist/components/gui/mobile/mobile.ce.js.map +1 -1
  93. package/dist/components/gui/notification/notification.ce.js +28 -26
  94. package/dist/components/gui/notification/notification.ce.js.map +1 -1
  95. package/dist/components/gui/save-load.ce.js +81 -256
  96. package/dist/components/gui/save-load.ce.js.map +1 -1
  97. package/dist/components/gui/shop/shop.ce.js +107 -142
  98. package/dist/components/gui/shop/shop.ce.js.map +1 -1
  99. package/dist/components/gui/title-screen.ce.js +50 -73
  100. package/dist/components/gui/title-screen.ce.js.map +1 -1
  101. package/dist/components/index.d.ts +2 -1
  102. package/dist/components/index.js +1 -0
  103. package/dist/components/interaction-components.ce.js +22 -0
  104. package/dist/components/interaction-components.ce.js.map +1 -0
  105. package/dist/components/player-components-utils.d.ts +67 -0
  106. package/dist/components/player-components-utils.js +162 -0
  107. package/dist/components/player-components-utils.js.map +1 -0
  108. package/dist/components/player-components-utils.spec.d.ts +1 -0
  109. package/dist/components/player-components.ce.js +191 -0
  110. package/dist/components/player-components.ce.js.map +1 -0
  111. package/dist/components/prebuilt/hp-bar.ce.js +45 -45
  112. package/dist/components/prebuilt/hp-bar.ce.js.map +1 -1
  113. package/dist/components/prebuilt/light-halo.ce.js +39 -60
  114. package/dist/components/prebuilt/light-halo.ce.js.map +1 -1
  115. package/dist/components/scenes/canvas.ce.js +205 -27
  116. package/dist/components/scenes/canvas.ce.js.map +1 -1
  117. package/dist/components/scenes/draw-map.ce.js +39 -39
  118. package/dist/components/scenes/draw-map.ce.js.map +1 -1
  119. package/dist/components/scenes/event-layer.ce.js +51 -10
  120. package/dist/components/scenes/event-layer.ce.js.map +1 -1
  121. package/dist/core/inject.js +1 -1
  122. package/dist/core/inject.js.map +1 -1
  123. package/dist/core/setup.js +1 -1
  124. package/dist/core/setup.js.map +1 -1
  125. package/dist/decorators/spritesheet.d.ts +1 -0
  126. package/dist/decorators/spritesheet.js +11 -0
  127. package/dist/decorators/spritesheet.js.map +1 -0
  128. package/dist/i18n.d.ts +55 -0
  129. package/dist/i18n.js +60 -0
  130. package/dist/i18n.js.map +1 -0
  131. package/dist/i18n.spec.d.ts +1 -0
  132. package/dist/index.d.ts +7 -0
  133. package/dist/index.js +29 -21
  134. package/dist/module.js +45 -4
  135. package/dist/module.js.map +1 -1
  136. package/dist/node_modules/.pnpm/{@signe_di@2.9.0 → @signe_di@3.1.0}/node_modules/@signe/di/dist/index.js +7 -117
  137. package/dist/node_modules/.pnpm/@signe_di@3.1.0/node_modules/@signe/di/dist/index.js.map +1 -0
  138. package/dist/node_modules/.pnpm/@signe_reactive@3.1.0/node_modules/@signe/reactive/dist/index.js +239 -0
  139. package/dist/node_modules/.pnpm/@signe_reactive@3.1.0/node_modules/@signe/reactive/dist/index.js.map +1 -0
  140. package/dist/node_modules/.pnpm/@signe_room@3.1.0_react@19.2.7/node_modules/@signe/room/dist/chunk-EUXUH3YW.js +13 -0
  141. 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
  142. package/dist/node_modules/.pnpm/@signe_room@3.1.0_react@19.2.7/node_modules/@signe/room/dist/index.js +698 -0
  143. package/dist/node_modules/.pnpm/@signe_room@3.1.0_react@19.2.7/node_modules/@signe/room/dist/index.js.map +1 -0
  144. package/dist/node_modules/.pnpm/@signe_sync@3.1.0_react@19.2.7/node_modules/@signe/sync/dist/client/index.js +43 -0
  145. 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
  146. 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
  147. package/dist/node_modules/.pnpm/@signe_sync@3.1.0_react@19.2.7/node_modules/@signe/sync/dist/index.js.map +1 -0
  148. 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
  149. package/dist/node_modules/.pnpm/partysocket@1.2.0_react@19.2.7/node_modules/partysocket/dist/index.js.map +1 -0
  150. 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
  151. package/dist/node_modules/.pnpm/partysocket@1.2.0_react@19.2.7/node_modules/partysocket/dist/ws.js.map +1 -0
  152. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/index.js +13 -0
  153. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/index.js.map +1 -0
  154. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js +106 -0
  155. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js.map +1 -0
  156. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js +13 -0
  157. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js.map +1 -0
  158. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js +121 -0
  159. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js.map +1 -0
  160. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js +10 -0
  161. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js.map +1 -0
  162. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js +110 -0
  163. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js.map +1 -0
  164. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js +99 -0
  165. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js.map +1 -0
  166. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js +82 -0
  167. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js.map +1 -0
  168. 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
  169. package/dist/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js.map +1 -0
  170. package/dist/presets/animation.js.map +1 -1
  171. package/dist/presets/faceset.js.map +1 -1
  172. package/dist/presets/icon.js.map +1 -1
  173. package/dist/presets/index.js.map +1 -1
  174. package/dist/presets/lpc.js.map +1 -1
  175. package/dist/presets/rmspritesheet.js.map +1 -1
  176. package/dist/services/AbstractSocket.d.ts +2 -0
  177. package/dist/services/AbstractSocket.js.map +1 -1
  178. package/dist/services/actionInput.d.ts +14 -0
  179. package/dist/services/actionInput.js +59 -0
  180. package/dist/services/actionInput.js.map +1 -0
  181. package/dist/services/actionInput.spec.d.ts +1 -0
  182. package/dist/services/interactions.d.ts +159 -0
  183. package/dist/services/interactions.js +460 -0
  184. package/dist/services/interactions.js.map +1 -0
  185. package/dist/services/interactions.spec.d.ts +1 -0
  186. package/dist/services/keyboardControls.d.ts +1 -0
  187. package/dist/services/keyboardControls.js +1 -0
  188. package/dist/services/keyboardControls.js.map +1 -1
  189. package/dist/services/loadMap.d.ts +9 -0
  190. package/dist/services/loadMap.js +1 -1
  191. package/dist/services/loadMap.js.map +1 -1
  192. package/dist/services/mmorpg-connection.d.ts +5 -0
  193. package/dist/services/mmorpg-connection.js +50 -0
  194. package/dist/services/mmorpg-connection.js.map +1 -0
  195. package/dist/services/mmorpg-connection.spec.d.ts +1 -0
  196. package/dist/services/mmorpg.d.ts +11 -4
  197. package/dist/services/mmorpg.js +57 -33
  198. package/dist/services/mmorpg.js.map +1 -1
  199. package/dist/services/pointerContext.d.ts +11 -0
  200. package/dist/services/pointerContext.js +48 -0
  201. package/dist/services/pointerContext.js.map +1 -0
  202. package/dist/services/pointerContext.spec.d.ts +1 -0
  203. package/dist/services/save.js.map +1 -1
  204. package/dist/services/save.spec.d.ts +1 -0
  205. package/dist/services/standalone-message.d.ts +1 -0
  206. package/dist/services/standalone-message.js +9 -0
  207. package/dist/services/standalone-message.js.map +1 -0
  208. package/dist/services/standalone.d.ts +4 -1
  209. package/dist/services/standalone.js +36 -16
  210. package/dist/services/standalone.js.map +1 -1
  211. package/dist/services/standalone.spec.d.ts +1 -0
  212. package/dist/utils/getEntityProp.js +4 -3
  213. package/dist/utils/getEntityProp.js.map +1 -1
  214. package/dist/utils/getEntityProp.spec.d.ts +1 -0
  215. package/dist/utils/mapId.d.ts +1 -0
  216. package/dist/utils/mapId.js +6 -0
  217. package/dist/utils/mapId.js.map +1 -0
  218. package/dist/utils/readPropValue.d.ts +2 -0
  219. package/dist/utils/readPropValue.js +13 -0
  220. package/dist/utils/readPropValue.js.map +1 -0
  221. package/package.json +13 -13
  222. package/src/Game/AnimationManager.spec.ts +30 -0
  223. package/src/Game/AnimationManager.ts +26 -10
  224. package/src/Game/ClientVisuals.spec.ts +56 -0
  225. package/src/Game/ClientVisuals.ts +184 -0
  226. package/src/Game/EventComponentResolver.spec.ts +84 -0
  227. package/src/Game/EventComponentResolver.ts +74 -0
  228. package/src/Game/Map.ts +134 -2
  229. package/src/Game/Object.spec.ts +59 -0
  230. package/src/Game/Object.ts +181 -77
  231. package/src/Game/ProjectileManager.spec.ts +449 -0
  232. package/src/Game/ProjectileManager.ts +346 -0
  233. package/src/Gui/Gui.spec.ts +340 -0
  234. package/src/Gui/Gui.ts +129 -57
  235. package/src/Resource.ts +1 -2
  236. package/src/RpgClient.ts +220 -17
  237. package/src/RpgClientEngine.ts +959 -116
  238. package/src/components/animations/fx.ce +101 -0
  239. package/src/components/animations/index.ts +4 -2
  240. package/src/components/character.ce +681 -45
  241. package/src/components/dynamics/bar.ce +88 -0
  242. package/src/components/dynamics/image.ce +21 -0
  243. package/src/components/dynamics/parse-value.spec.ts +83 -0
  244. package/src/components/dynamics/parse-value.ts +111 -37
  245. package/src/components/dynamics/shape-utils.spec.ts +46 -0
  246. package/src/components/dynamics/shape-utils.ts +61 -0
  247. package/src/components/dynamics/shape.ce +90 -0
  248. package/src/components/dynamics/text.ce +35 -149
  249. package/src/components/gui/dialogbox/index.ce +52 -21
  250. package/src/components/gui/gameover.ce +6 -4
  251. package/src/components/gui/menu/equip-menu.ce +11 -9
  252. package/src/components/gui/menu/exit-menu.ce +6 -4
  253. package/src/components/gui/menu/items-menu.ce +11 -9
  254. package/src/components/gui/menu/main-menu.ce +14 -12
  255. package/src/components/gui/menu/options-menu.ce +4 -3
  256. package/src/components/gui/menu/skills-menu.ce +2 -1
  257. package/src/components/gui/notification/notification.ce +7 -1
  258. package/src/components/gui/save-load.ce +13 -11
  259. package/src/components/gui/shop/shop.ce +20 -18
  260. package/src/components/gui/title-screen.ce +6 -4
  261. package/src/components/index.ts +2 -1
  262. package/src/components/interaction-components.ce +23 -0
  263. package/src/components/player-components-utils.spec.ts +109 -0
  264. package/src/components/player-components-utils.ts +205 -0
  265. package/src/components/player-components.ce +222 -0
  266. package/src/components/prebuilt/hp-bar.ce +4 -3
  267. package/src/components/prebuilt/light-halo.ce +2 -2
  268. package/src/components/scenes/canvas.ce +219 -15
  269. package/src/components/scenes/draw-map.ce +34 -22
  270. package/src/components/scenes/event-layer.ce +55 -4
  271. package/src/core/setup.ts +2 -2
  272. package/src/decorators/spritesheet.ts +8 -0
  273. package/src/i18n.spec.ts +39 -0
  274. package/src/i18n.ts +59 -0
  275. package/src/index.ts +7 -0
  276. package/src/module.ts +61 -11
  277. package/src/services/AbstractSocket.ts +3 -0
  278. package/src/services/actionInput.spec.ts +155 -0
  279. package/src/services/actionInput.ts +120 -0
  280. package/src/services/interactions.spec.ts +175 -0
  281. package/src/services/interactions.ts +722 -0
  282. package/src/services/keyboardControls.ts +2 -1
  283. package/src/services/loadMap.ts +5 -1
  284. package/src/services/mmorpg-connection.spec.ts +99 -0
  285. package/src/services/mmorpg-connection.ts +69 -0
  286. package/src/services/mmorpg.ts +70 -36
  287. package/src/services/pointerContext.spec.ts +36 -0
  288. package/src/services/pointerContext.ts +84 -0
  289. package/src/services/save.spec.ts +127 -0
  290. package/src/services/standalone-message.ts +7 -0
  291. package/src/services/standalone.spec.ts +54 -0
  292. package/src/services/standalone.ts +44 -12
  293. package/src/utils/getEntityProp.spec.ts +96 -0
  294. package/src/utils/getEntityProp.ts +4 -3
  295. package/src/utils/mapId.ts +2 -0
  296. package/src/utils/readPropValue.ts +16 -0
  297. package/dist/node_modules/.pnpm/@signe_di@2.9.0/node_modules/@signe/di/dist/index.js.map +0 -1
  298. package/dist/node_modules/.pnpm/@signe_reactive@2.8.3/node_modules/@signe/reactive/dist/index.js +0 -457
  299. package/dist/node_modules/.pnpm/@signe_reactive@2.8.3/node_modules/@signe/reactive/dist/index.js.map +0 -1
  300. package/dist/node_modules/.pnpm/@signe_reactive@2.9.0/node_modules/@signe/reactive/dist/index.js +0 -463
  301. package/dist/node_modules/.pnpm/@signe_reactive@2.9.0/node_modules/@signe/reactive/dist/index.js.map +0 -1
  302. package/dist/node_modules/.pnpm/@signe_room@2.9.0/node_modules/@signe/room/dist/index.js +0 -2191
  303. package/dist/node_modules/.pnpm/@signe_room@2.9.0/node_modules/@signe/room/dist/index.js.map +0 -1
  304. package/dist/node_modules/.pnpm/@signe_sync@2.9.0/node_modules/@signe/sync/dist/chunk-7QVYU63E.js +0 -10
  305. package/dist/node_modules/.pnpm/@signe_sync@2.9.0/node_modules/@signe/sync/dist/chunk-7QVYU63E.js.map +0 -1
  306. package/dist/node_modules/.pnpm/@signe_sync@2.9.0/node_modules/@signe/sync/dist/client/index.js +0 -91
  307. package/dist/node_modules/.pnpm/@signe_sync@2.9.0/node_modules/@signe/sync/dist/client/index.js.map +0 -1
  308. package/dist/node_modules/.pnpm/@signe_sync@2.9.0/node_modules/@signe/sync/dist/index.js.map +0 -1
  309. package/dist/node_modules/.pnpm/dset@3.1.4/node_modules/dset/dist/index.js +0 -14
  310. package/dist/node_modules/.pnpm/dset@3.1.4/node_modules/dset/dist/index.js.map +0 -1
  311. package/dist/node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-HAC622V3.js.map +0 -1
  312. package/dist/node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-S74YV6PU.js.map +0 -1
  313. package/dist/node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/index.js +0 -2
  314. package/dist/node_modules/.pnpm/zod@3.24.2/node_modules/zod/lib/index.js.map +0 -1
@@ -1,9 +1,26 @@
1
+ import { Trigger } from 'canvasengine';
1
2
  import { AbstractWebsocket } from './services/AbstractSocket';
2
- import { Direction } from '@rpgjs/common';
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';
6
14
  import * as PIXI from "pixi.js";
15
+ type ConfigurableTrigger<T> = Omit<Trigger<T>, "start"> & {
16
+ start(config?: T): Promise<void>;
17
+ };
18
+ type MapShakeOptions = {
19
+ intensity?: number;
20
+ duration?: number;
21
+ frequency?: number;
22
+ direction?: string;
23
+ };
7
24
  export declare class RpgClientEngine<T = any> {
8
25
  context: any;
9
26
  private guiService;
@@ -14,12 +31,18 @@ export declare class RpgClientEngine<T = any> {
14
31
  private selector;
15
32
  globalConfig: T;
16
33
  sceneComponent: any;
34
+ sceneMapComponent: any;
17
35
  stopProcessingInput: boolean;
18
36
  width: import('canvasengine').WritableSignal<string>;
19
37
  height: import('canvasengine').WritableSignal<string>;
20
- spritesheets: Map<string, any>;
38
+ spritesheets: Map<string | number, any>;
39
+ private spritesheetPromises;
21
40
  sounds: Map<string, any>;
22
41
  componentAnimations: any[];
42
+ clientVisuals: ClientVisualRegistry;
43
+ projectiles: ProjectileManager;
44
+ pointer: ClientPointerContext;
45
+ interactions: RpgClientInteractions;
23
46
  private spritesheetResolver?;
24
47
  private soundResolver?;
25
48
  particleSettings: {
@@ -32,19 +55,27 @@ export declare class RpgClientEngine<T = any> {
32
55
  playerIdSignal: import('canvasengine').WritableSignal<string | null>;
33
56
  spriteComponentsBehind: import('canvasengine').WritableArraySignal<any[]>;
34
57
  spriteComponentsInFront: import('canvasengine').WritableArraySignal<any[]>;
58
+ spriteComponents: Map<string, any>;
59
+ private eventComponentResolvers;
35
60
  /** ID of the sprite that the camera should follow. null means follow the current player */
36
61
  cameraFollowTargetId: import('canvasengine').WritableSignal<string | null>;
37
62
  /** Trigger for map shake animation */
38
- mapShakeTrigger: import('canvasengine').Trigger<any>;
63
+ mapShakeTrigger: ConfigurableTrigger<MapShakeOptions>;
39
64
  controlsReady: import('canvasengine').WritableSignal<undefined>;
40
65
  gamePause: import('canvasengine').WritableSignal<boolean>;
41
66
  private predictionEnabled;
42
67
  private prediction?;
43
68
  private readonly SERVER_CORRECTION_THRESHOLD;
69
+ private localMovementAuthority;
70
+ private lastLocalMovementInputAt;
71
+ private readonly LOCAL_MOVEMENT_AUTHORITY_ACK_GRACE_MS;
44
72
  private inputFrameCounter;
45
73
  private pendingPredictionFrames;
46
74
  private lastClientPhysicsStepAt;
47
75
  private frameOffset;
76
+ private latestServerTick?;
77
+ private latestServerTickAt;
78
+ private dashLockedUntil;
48
79
  private rtt;
49
80
  private pingInterval;
50
81
  private readonly PING_INTERVAL_MS;
@@ -59,10 +90,30 @@ export declare class RpgClientEngine<T = any> {
59
90
  private eventsReceived$;
60
91
  private onAfterLoadingSubscription?;
61
92
  private sceneResetQueued;
93
+ private mapTransitionInProgress;
94
+ private currentMapRoomId?;
95
+ private socketListenersInitialized;
96
+ private clientReadyForMapChanges;
97
+ private pendingMapChanges;
62
98
  private tickSubscriptions;
63
99
  private resizeHandler?;
100
+ private pointerMoveHandler?;
101
+ private pointerUpHandler?;
102
+ private pointerCancelHandler?;
103
+ private pointerCanvas?;
104
+ private pendingSyncPackets;
64
105
  private notificationManager;
106
+ private i18nService;
107
+ private locale?;
65
108
  constructor(context: any);
109
+ private resolveLocalMovementAuthority;
110
+ setLocale(locale: string): void;
111
+ getLocale(): string;
112
+ t(key: string, params?: I18nParams): string;
113
+ i18n(): {
114
+ locale: string;
115
+ t: (key: string, params?: I18nParams) => string;
116
+ };
66
117
  /**
67
118
  * Assigns a CanvasEngine KeyboardControls instance to the dependency injection context
68
119
  *
@@ -98,9 +149,27 @@ export declare class RpgClientEngine<T = any> {
98
149
  */
99
150
  setKeyboardControls(controlInstance: any): void;
100
151
  start(): Promise<void>;
152
+ private installCanvasResizeGuard;
153
+ private readCanvasResizeTargetSize;
154
+ private readCanvasRendererSize;
155
+ private cancelCanvasResizeFrame;
156
+ private resolveSceneMapComponent;
157
+ private setupPointerTracking;
158
+ updatePointerFromInteractionEvent(event: any): void;
159
+ private findViewportInstance;
101
160
  private prepareSyncPayload;
161
+ private shouldPreserveLocalPlayerPosition;
162
+ private shouldKeepLocalPlayerMovement;
102
163
  private normalizeAckWithSyncState;
103
164
  private initListeners;
165
+ private beginMapTransfer;
166
+ private clearComponentAnimations;
167
+ private shouldProcessProjectilePacket;
168
+ private callConnectError;
169
+ private flushPendingSyncPackets;
170
+ private flushPendingMapChanges;
171
+ private handleChangeMap;
172
+ private applySyncPacket;
104
173
  /**
105
174
  * Start periodic ping/pong for client-server synchronization
106
175
  *
@@ -175,7 +244,7 @@ export declare class RpgClientEngine<T = any> {
175
244
  * });
176
245
  * ```
177
246
  */
178
- setSpritesheetResolver(resolver: (id: string) => any | Promise<any>): void;
247
+ setSpritesheetResolver(resolver: (id: string | number) => any | Promise<any>): void;
179
248
  /**
180
249
  * Get a spritesheet by ID, using resolver if not found in cache
181
250
  *
@@ -183,7 +252,7 @@ export declare class RpgClientEngine<T = any> {
183
252
  * If not found and a resolver is set, it calls the resolver to create the spritesheet.
184
253
  * The resolved spritesheet is automatically cached for future use.
185
254
  *
186
- * @param id - The spritesheet ID to retrieve
255
+ * @param id - The spritesheet ID or legacy tile ID to retrieve
187
256
  * @returns The spritesheet if found or created, or undefined if not found and no resolver
188
257
  * @returns Promise<any> if the resolver is asynchronous
189
258
  *
@@ -196,7 +265,7 @@ export declare class RpgClientEngine<T = any> {
196
265
  * const spritesheet = await engine.getSpriteSheet('dynamic-sprite');
197
266
  * ```
198
267
  */
199
- getSpriteSheet(id: string): any | Promise<any>;
268
+ getSpriteSheet(id: string | number): any | Promise<any>;
200
269
  /**
201
270
  * Add a sound to the engine
202
271
  *
@@ -451,6 +520,76 @@ export declare class RpgClientEngine<T = any> {
451
520
  props: (object: any) => any;
452
521
  dependencies?: (object: any) => any[];
453
522
  }): any;
523
+ /**
524
+ * Register a reusable sprite component that can be addressed by the server.
525
+ *
526
+ * Server-side component definitions only carry the component id and
527
+ * serializable props. The client registry maps that id to the CanvasEngine
528
+ * component that performs the actual rendering.
529
+ *
530
+ * @param id - Stable component id used by server component definitions
531
+ * @param component - CanvasEngine component to render for this id
532
+ * @returns The registered component
533
+ *
534
+ * @example
535
+ * ```ts
536
+ * engine.registerSpriteComponent('guildBadge', GuildBadgeComponent);
537
+ * ```
538
+ */
539
+ registerSpriteComponent(id: string, component: any): any;
540
+ /**
541
+ * Get a reusable sprite component by id.
542
+ *
543
+ * @param id - Component id registered on the client
544
+ * @returns The CanvasEngine component, or undefined when missing
545
+ */
546
+ getSpriteComponent(id: string): any;
547
+ /**
548
+ * Register a custom event component resolver.
549
+ *
550
+ * The last resolver returning a component wins. This lets later modules
551
+ * override earlier defaults without replacing the whole map scene.
552
+ *
553
+ * @param resolver - Function receiving the synced event object
554
+ * @returns The registered resolver
555
+ */
556
+ addEventComponentResolver(resolver: EventComponentResolver): EventComponentResolver;
557
+ /**
558
+ * Resolve the custom CanvasEngine component for an event, if any.
559
+ *
560
+ * @param event - Synced client event object
561
+ * @returns The component/config returned by the last matching resolver
562
+ */
563
+ resolveEventComponent(event: RpgClientEvent): EventComponentConfig | null;
564
+ registerProjectileComponent(type: string, component: any): any;
565
+ getProjectileComponent(type: string): any;
566
+ /**
567
+ * Register a named client visual macro.
568
+ *
569
+ * Client visuals are small client-side functions that group existing visual
570
+ * primitives such as flash, sound, component animations, sprite animation, or
571
+ * map shake. The server sends only the visual name and a serializable payload.
572
+ *
573
+ * @param name - Stable visual name sent by the server
574
+ * @param handler - Client-side visual handler
575
+ * @returns The registered handler
576
+ */
577
+ registerClientVisual(name: string, handler: ClientVisualHandler): ClientVisualHandler;
578
+ /**
579
+ * Register several named client visual macros.
580
+ *
581
+ * @param visuals - Map of visual names to client-side handlers
582
+ */
583
+ registerClientVisuals(visuals: ClientVisualMap): void;
584
+ /**
585
+ * Play a registered client visual locally.
586
+ *
587
+ * This is also used by the websocket listener when the server calls
588
+ * `player.clientVisual()` or `map.clientVisual()`.
589
+ *
590
+ * @param packet - Visual name and serializable payload
591
+ */
592
+ playClientVisual(packet: ClientVisualPacket): Promise<void>;
454
593
  /**
455
594
  * Add a component animation to the engine
456
595
  *
@@ -520,26 +659,35 @@ export declare class RpgClientEngine<T = any> {
520
659
  * duration: 1000,
521
660
  * onFinish: () => console.log('Fade complete')
522
661
  * });
662
+ *
663
+ * // Wait until the transition component calls onFinish
664
+ * await engine.startTransition('fade', { duration: 1000 });
523
665
  * ```
524
666
  */
525
- startTransition(id: string, props?: any): void;
667
+ startTransition(id: string, props?: any): Promise<void>;
526
668
  processInput({ input }: {
527
- input: Direction;
669
+ input: RpgMovementInput;
528
670
  }): Promise<void>;
529
- processAction({ action }: {
530
- action: number;
531
- }): void;
671
+ processDash(input?: Partial<RpgDashInput>): Promise<void>;
672
+ processAction(action: RpgActionName, data?: any): void;
673
+ processAction(action: RpgActionInput): void;
532
674
  get PIXI(): typeof PIXI;
533
675
  get socket(): AbstractWebsocket;
534
676
  get playerId(): string | null;
535
677
  get scene(): RpgClientMap;
678
+ getObjectById(id: string): any;
536
679
  private getPhysicsTick;
680
+ private getPhysicsTickDurationMs;
681
+ private updateServerTickEstimate;
682
+ private estimateServerTick;
683
+ private predictProjectileImpact;
537
684
  private ensureCurrentPlayerBody;
538
685
  private stepClientPhysicsTick;
539
686
  private flushPendingPredictedStates;
540
687
  private buildPendingMoveTrajectory;
541
688
  private emitMovePacket;
542
689
  private flushPendingMovePath;
690
+ private applyPredictedMovementInput;
543
691
  private getLocalPlayerState;
544
692
  private applyAuthoritativeState;
545
693
  private initializePredictionController;
@@ -584,6 +732,22 @@ export declare class RpgClientEngine<T = any> {
584
732
  * ```
585
733
  */
586
734
  clearClientPredictionStates(): void;
735
+ /**
736
+ * Stop local movement immediately and discard pending predicted movement.
737
+ *
738
+ * Use this before a blocking action such as an A-RPG attack, dialog, dash
739
+ * startup, or any client-side state where already buffered movement inputs
740
+ * must not be replayed after server reconciliation.
741
+ *
742
+ * @param player - Player object to stop. Defaults to the current player.
743
+ * @returns `true` when a player was found and interrupted.
744
+ *
745
+ * @example
746
+ * ```ts
747
+ * engine.interruptCurrentPlayerMovement();
748
+ * ```
749
+ */
750
+ interruptCurrentPlayerMovement(player?: any): boolean;
587
751
  /**
588
752
  * Trigger a flash animation on a sprite
589
753
  *
@@ -681,3 +845,4 @@ export declare class RpgClientEngine<T = any> {
681
845
  */
682
846
  clear(): void;
683
847
  }
848
+ export {};