@rpgjs/client 5.0.0-alpha.3 → 5.0.0-alpha.30

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 (275) hide show
  1. package/dist/Game/AnimationManager.d.ts +8 -0
  2. package/dist/{index19.js → Game/AnimationManager.js} +4 -3
  3. package/dist/Game/AnimationManager.js.map +1 -0
  4. package/dist/{index30.js → Game/Event.js} +2 -2
  5. package/dist/Game/Event.js.map +1 -0
  6. package/dist/Game/Map.d.ts +8 -1
  7. package/dist/Game/Map.js +54 -0
  8. package/dist/Game/Map.js.map +1 -0
  9. package/dist/Game/Object.d.ts +129 -0
  10. package/dist/Game/Object.js +218 -0
  11. package/dist/Game/Object.js.map +1 -0
  12. package/dist/{index29.js → Game/Player.js} +2 -2
  13. package/dist/Game/Player.js.map +1 -0
  14. package/dist/Gui/Gui.d.ts +177 -5
  15. package/dist/Gui/Gui.js +478 -0
  16. package/dist/Gui/Gui.js.map +1 -0
  17. package/dist/Gui/NotificationManager.d.ts +23 -0
  18. package/dist/Gui/NotificationManager.js +51 -0
  19. package/dist/Gui/NotificationManager.js.map +1 -0
  20. package/dist/Resource.d.ts +97 -0
  21. package/dist/Resource.js +114 -0
  22. package/dist/Resource.js.map +1 -0
  23. package/dist/RpgClient.d.ts +259 -59
  24. package/dist/RpgClientEngine.d.ts +632 -9
  25. package/dist/RpgClientEngine.js +1262 -0
  26. package/dist/RpgClientEngine.js.map +1 -0
  27. package/dist/Sound.d.ts +199 -0
  28. package/dist/Sound.js +97 -0
  29. package/dist/Sound.js.map +1 -0
  30. package/dist/components/animations/animation.ce.js +21 -0
  31. package/dist/components/animations/animation.ce.js.map +1 -0
  32. package/dist/{index23.js → components/animations/hit.ce.js} +3 -3
  33. package/dist/components/animations/hit.ce.js.map +1 -0
  34. package/dist/components/animations/index.d.ts +4 -0
  35. package/dist/components/animations/index.js +10 -0
  36. package/dist/components/animations/index.js.map +1 -0
  37. package/dist/components/character.ce.js +316 -0
  38. package/dist/components/character.ce.js.map +1 -0
  39. package/dist/components/dynamics/parse-value.d.ts +1 -0
  40. package/dist/components/dynamics/parse-value.js +54 -0
  41. package/dist/components/dynamics/parse-value.js.map +1 -0
  42. package/dist/components/dynamics/text.ce.js +141 -0
  43. package/dist/components/dynamics/text.ce.js.map +1 -0
  44. package/dist/components/gui/box.ce.js +27 -0
  45. package/dist/components/gui/box.ce.js.map +1 -0
  46. package/dist/components/gui/dialogbox/index.ce.js +152 -0
  47. package/dist/components/gui/dialogbox/index.ce.js.map +1 -0
  48. package/dist/components/gui/gameover.ce.js +141 -0
  49. package/dist/components/gui/gameover.ce.js.map +1 -0
  50. package/dist/components/gui/hud/hud.ce.js +35 -0
  51. package/dist/components/gui/hud/hud.ce.js.map +1 -0
  52. package/dist/components/gui/index.d.ts +15 -3
  53. package/dist/components/gui/menu/equip-menu.ce.js +349 -0
  54. package/dist/components/gui/menu/equip-menu.ce.js.map +1 -0
  55. package/dist/components/gui/menu/exit-menu.ce.js +35 -0
  56. package/dist/components/gui/menu/exit-menu.ce.js.map +1 -0
  57. package/dist/components/gui/menu/items-menu.ce.js +229 -0
  58. package/dist/components/gui/menu/items-menu.ce.js.map +1 -0
  59. package/dist/components/gui/menu/main-menu.ce.js +205 -0
  60. package/dist/components/gui/menu/main-menu.ce.js.map +1 -0
  61. package/dist/components/gui/menu/options-menu.ce.js +28 -0
  62. package/dist/components/gui/menu/options-menu.ce.js.map +1 -0
  63. package/dist/components/gui/menu/skills-menu.ce.js +53 -0
  64. package/dist/components/gui/menu/skills-menu.ce.js.map +1 -0
  65. package/dist/components/gui/mobile/index.d.ts +8 -0
  66. package/dist/components/gui/mobile/index.js +24 -0
  67. package/dist/components/gui/mobile/index.js.map +1 -0
  68. package/dist/components/gui/mobile/mobile.ce.js +17 -0
  69. package/dist/components/gui/mobile/mobile.ce.js.map +1 -0
  70. package/dist/components/gui/notification/notification.ce.js +38 -0
  71. package/dist/components/gui/notification/notification.ce.js.map +1 -0
  72. package/dist/components/gui/save-load.ce.js +242 -0
  73. package/dist/components/gui/save-load.ce.js.map +1 -0
  74. package/dist/components/gui/shop/shop.ce.js +322 -0
  75. package/dist/components/gui/shop/shop.ce.js.map +1 -0
  76. package/dist/components/gui/title-screen.ce.js +148 -0
  77. package/dist/components/gui/title-screen.ce.js.map +1 -0
  78. package/dist/components/index.d.ts +3 -1
  79. package/dist/components/prebuilt/hp-bar.ce.js +106 -0
  80. package/dist/components/prebuilt/hp-bar.ce.js.map +1 -0
  81. package/dist/components/prebuilt/index.d.ts +19 -0
  82. package/dist/components/prebuilt/light-halo.ce.js +76 -0
  83. package/dist/components/prebuilt/light-halo.ce.js.map +1 -0
  84. package/dist/components/scenes/canvas.ce.js +44 -0
  85. package/dist/components/scenes/canvas.ce.js.map +1 -0
  86. package/dist/components/scenes/draw-map.ce.js +34 -0
  87. package/dist/components/scenes/draw-map.ce.js.map +1 -0
  88. package/dist/{index13.js → components/scenes/event-layer.ce.js} +7 -6
  89. package/dist/components/scenes/event-layer.ce.js.map +1 -0
  90. package/dist/{index6.js → core/inject.js} +2 -2
  91. package/dist/core/inject.js.map +1 -0
  92. package/dist/core/setup.js +16 -0
  93. package/dist/core/setup.js.map +1 -0
  94. package/dist/index.d.ts +15 -1
  95. package/dist/index.js +40 -12
  96. package/dist/index.js.map +1 -1
  97. package/dist/module.d.ts +43 -4
  98. package/dist/module.js +175 -0
  99. package/dist/module.js.map +1 -0
  100. package/dist/node_modules/.pnpm/@signe_di@2.8.2/node_modules/@signe/di/dist/index.js +366 -0
  101. package/dist/node_modules/.pnpm/@signe_di@2.8.2/node_modules/@signe/di/dist/index.js.map +1 -0
  102. package/dist/{index27.js → node_modules/.pnpm/@signe_reactive@2.8.2/node_modules/@signe/reactive/dist/index.js} +229 -11
  103. package/dist/node_modules/.pnpm/@signe_reactive@2.8.2/node_modules/@signe/reactive/dist/index.js.map +1 -0
  104. package/dist/{index20.js → node_modules/.pnpm/@signe_room@2.8.2/node_modules/@signe/room/dist/index.js} +308 -40
  105. package/dist/node_modules/.pnpm/@signe_room@2.8.2/node_modules/@signe/room/dist/index.js.map +1 -0
  106. package/dist/{index26.js → node_modules/.pnpm/@signe_sync@2.8.2/node_modules/@signe/sync/dist/chunk-7QVYU63E.js} +1 -1
  107. package/dist/node_modules/.pnpm/@signe_sync@2.8.2/node_modules/@signe/sync/dist/chunk-7QVYU63E.js.map +1 -0
  108. package/dist/{index21.js → node_modules/.pnpm/@signe_sync@2.8.2/node_modules/@signe/sync/dist/client/index.js} +5 -5
  109. package/dist/node_modules/.pnpm/@signe_sync@2.8.2/node_modules/@signe/sync/dist/client/index.js.map +1 -0
  110. package/dist/{index17.js → node_modules/.pnpm/@signe_sync@2.8.2/node_modules/@signe/sync/dist/index.js} +89 -12
  111. package/dist/node_modules/.pnpm/@signe_sync@2.8.2/node_modules/@signe/sync/dist/index.js.map +1 -0
  112. package/dist/{index33.js → node_modules/.pnpm/dset@3.1.4/node_modules/dset/dist/index.js} +1 -1
  113. package/dist/node_modules/.pnpm/dset@3.1.4/node_modules/dset/dist/index.js.map +1 -0
  114. package/dist/{index31.js → node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-HAC622V3.js} +2 -2
  115. package/dist/node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-HAC622V3.js.map +1 -0
  116. package/dist/{index32.js → node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-S74YV6PU.js} +1 -1
  117. package/dist/node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-S74YV6PU.js.map +1 -0
  118. package/dist/{index34.js → node_modules/.pnpm/zod@3.24.2/node_modules/zod/lib/index.js} +1 -1
  119. package/dist/node_modules/.pnpm/zod@3.24.2/node_modules/zod/lib/index.js.map +1 -0
  120. package/dist/presets/animation.d.ts +31 -0
  121. package/dist/presets/animation.js +27 -0
  122. package/dist/presets/animation.js.map +1 -0
  123. package/dist/presets/faceset.d.ts +30 -0
  124. package/dist/presets/faceset.js +24 -0
  125. package/dist/presets/faceset.js.map +1 -0
  126. package/dist/presets/icon.d.ts +20 -0
  127. package/dist/presets/icon.js +15 -0
  128. package/dist/presets/icon.js.map +1 -0
  129. package/dist/presets/index.d.ts +123 -0
  130. package/dist/presets/index.js +16 -0
  131. package/dist/presets/index.js.map +1 -0
  132. package/dist/presets/lpc.d.ts +89 -0
  133. package/dist/presets/lpc.js +95 -0
  134. package/dist/presets/lpc.js.map +1 -0
  135. package/dist/{index25.js → presets/rmspritesheet.js} +1 -1
  136. package/dist/presets/rmspritesheet.js.map +1 -0
  137. package/dist/{index16.js → services/AbstractSocket.js} +1 -1
  138. package/dist/services/AbstractSocket.js.map +1 -0
  139. package/dist/services/keyboardControls.d.ts +15 -0
  140. package/dist/services/keyboardControls.js +21 -0
  141. package/dist/services/keyboardControls.js.map +1 -0
  142. package/dist/services/loadMap.d.ts +123 -2
  143. package/dist/{index7.js → services/loadMap.js} +12 -4
  144. package/dist/services/loadMap.js.map +1 -0
  145. package/dist/services/mmorpg.d.ts +16 -4
  146. package/dist/services/mmorpg.js +84 -0
  147. package/dist/services/mmorpg.js.map +1 -0
  148. package/dist/services/save.d.ts +19 -0
  149. package/dist/services/save.js +69 -0
  150. package/dist/services/save.js.map +1 -0
  151. package/dist/services/standalone.d.ts +65 -3
  152. package/dist/services/standalone.js +170 -0
  153. package/dist/services/standalone.js.map +1 -0
  154. package/dist/utils/getEntityProp.d.ts +39 -0
  155. package/dist/utils/getEntityProp.js +54 -0
  156. package/dist/utils/getEntityProp.js.map +1 -0
  157. package/package.json +24 -18
  158. package/src/Game/{EffectManager.ts → AnimationManager.ts} +3 -2
  159. package/src/Game/Map.ts +37 -2
  160. package/src/Game/Object.ts +296 -11
  161. package/src/Gui/Gui.ts +506 -18
  162. package/src/Gui/NotificationManager.ts +69 -0
  163. package/src/Resource.ts +150 -0
  164. package/src/RpgClient.ts +264 -58
  165. package/src/RpgClientEngine.ts +1421 -44
  166. package/src/Sound.ts +253 -0
  167. package/src/components/{effects → animations}/animation.ce +3 -6
  168. package/src/components/{effects → animations}/index.ts +1 -1
  169. package/src/components/character.ce +406 -40
  170. package/src/components/dynamics/parse-value.ts +80 -0
  171. package/src/components/dynamics/text.ce +183 -0
  172. package/src/components/gui/box.ce +17 -0
  173. package/src/components/gui/dialogbox/index.ce +204 -187
  174. package/src/components/gui/gameover.ce +158 -0
  175. package/src/components/gui/hud/hud.ce +56 -0
  176. package/src/components/gui/index.ts +30 -4
  177. package/src/components/gui/menu/equip-menu.ce +410 -0
  178. package/src/components/gui/menu/exit-menu.ce +41 -0
  179. package/src/components/gui/menu/items-menu.ce +317 -0
  180. package/src/components/gui/menu/main-menu.ce +291 -0
  181. package/src/components/gui/menu/options-menu.ce +35 -0
  182. package/src/components/gui/menu/skills-menu.ce +83 -0
  183. package/src/components/gui/mobile/index.ts +24 -0
  184. package/src/components/gui/mobile/mobile.ce +80 -0
  185. package/src/components/gui/notification/notification.ce +51 -0
  186. package/src/components/gui/save-load.ce +208 -0
  187. package/src/components/gui/shop/shop.ce +493 -0
  188. package/src/components/gui/title-screen.ce +163 -0
  189. package/src/components/index.ts +5 -1
  190. package/src/components/prebuilt/hp-bar.ce +255 -0
  191. package/src/components/prebuilt/index.ts +24 -0
  192. package/src/components/prebuilt/light-halo.ce +148 -0
  193. package/src/components/scenes/canvas.ce +19 -14
  194. package/src/components/scenes/draw-map.ce +21 -29
  195. package/src/components/scenes/event-layer.ce +10 -3
  196. package/src/components/scenes/transition.ce +60 -0
  197. package/src/core/setup.ts +2 -0
  198. package/src/index.ts +16 -2
  199. package/src/module.ts +145 -9
  200. package/src/presets/animation.ts +46 -0
  201. package/src/presets/faceset.ts +60 -0
  202. package/src/presets/icon.ts +17 -0
  203. package/src/presets/index.ts +9 -1
  204. package/src/presets/lpc.ts +108 -0
  205. package/src/services/keyboardControls.ts +20 -0
  206. package/src/services/loadMap.ts +132 -3
  207. package/src/services/mmorpg.ts +39 -5
  208. package/src/services/save.ts +103 -0
  209. package/src/services/standalone.ts +107 -15
  210. package/src/utils/getEntityProp.ts +87 -0
  211. package/tsconfig.json +1 -1
  212. package/vite.config.ts +5 -3
  213. package/CHANGELOG.md +0 -9
  214. package/dist/Game/EffectManager.d.ts +0 -5
  215. package/dist/components/effects/index.d.ts +0 -4
  216. package/dist/index10.js +0 -8
  217. package/dist/index10.js.map +0 -1
  218. package/dist/index11.js +0 -10
  219. package/dist/index11.js.map +0 -1
  220. package/dist/index12.js +0 -8
  221. package/dist/index12.js.map +0 -1
  222. package/dist/index13.js.map +0 -1
  223. package/dist/index14.js +0 -50
  224. package/dist/index14.js.map +0 -1
  225. package/dist/index15.js +0 -191
  226. package/dist/index15.js.map +0 -1
  227. package/dist/index16.js.map +0 -1
  228. package/dist/index17.js.map +0 -1
  229. package/dist/index18.js +0 -31
  230. package/dist/index18.js.map +0 -1
  231. package/dist/index19.js.map +0 -1
  232. package/dist/index2.js +0 -112
  233. package/dist/index2.js.map +0 -1
  234. package/dist/index20.js.map +0 -1
  235. package/dist/index21.js.map +0 -1
  236. package/dist/index22.js +0 -109
  237. package/dist/index22.js.map +0 -1
  238. package/dist/index23.js.map +0 -1
  239. package/dist/index24.js +0 -21
  240. package/dist/index24.js.map +0 -1
  241. package/dist/index25.js.map +0 -1
  242. package/dist/index26.js.map +0 -1
  243. package/dist/index27.js.map +0 -1
  244. package/dist/index28.js +0 -25
  245. package/dist/index28.js.map +0 -1
  246. package/dist/index29.js.map +0 -1
  247. package/dist/index3.js +0 -87
  248. package/dist/index3.js.map +0 -1
  249. package/dist/index30.js.map +0 -1
  250. package/dist/index31.js.map +0 -1
  251. package/dist/index32.js.map +0 -1
  252. package/dist/index33.js.map +0 -1
  253. package/dist/index34.js.map +0 -1
  254. package/dist/index35.js +0 -91
  255. package/dist/index35.js.map +0 -1
  256. package/dist/index36.js +0 -61
  257. package/dist/index36.js.map +0 -1
  258. package/dist/index37.js +0 -20
  259. package/dist/index37.js.map +0 -1
  260. package/dist/index38.js +0 -20
  261. package/dist/index38.js.map +0 -1
  262. package/dist/index4.js +0 -54
  263. package/dist/index4.js.map +0 -1
  264. package/dist/index5.js +0 -15
  265. package/dist/index5.js.map +0 -1
  266. package/dist/index6.js.map +0 -1
  267. package/dist/index7.js.map +0 -1
  268. package/dist/index8.js +0 -90
  269. package/dist/index8.js.map +0 -1
  270. package/dist/index9.js +0 -76
  271. package/dist/index9.js.map +0 -1
  272. package/src/components/gui/dialogbox/itemMenu.ce +0 -23
  273. package/src/components/gui/dialogbox/selection.ce +0 -67
  274. package/src/components/scenes/element-map.ce +0 -23
  275. /package/src/components/{effects → animations}/hit.ce +0 -0
package/dist/index35.js DELETED
@@ -1,91 +0,0 @@
1
- import { useProps, useDefineProps, computed, signal, h, Container, loop, Sprite } from 'canvasengine';
2
- import { Particle } from '@canvasengine/presets';
3
- import { RpgClientEngine } from './index2.js';
4
- import { inject } from './index6.js';
5
- import { Direction } from '@rpgjs/common';
6
-
7
- function component($$props) {
8
- useProps($$props);
9
- const defineProps = useDefineProps($$props);
10
- var _a = defineProps(), object = _a.object; _a.id; var isMe = _a.isMe;
11
- var client = inject(RpgClientEngine);
12
- var spritesheets = client.spritesheets;
13
- var x = object.x;
14
- var y = object.y;
15
- var tint = object.tint;
16
- var direction = object.direction;
17
- var animationName = object.animationName;
18
- var emitParticleTrigger = object.emitParticleTrigger;
19
- var particleSettings = client.particleSettings;
20
- var particleName = object.particleName;
21
- var graphics = object.graphics;
22
- var hitbox = object.hitbox;
23
- var widthShadow = 10;
24
- computed(function () { return ({
25
- x: hitbox().w / 2,
26
- y: hitbox().h - (hitbox().h / 2),
27
- width: hitbox().w + widthShadow,
28
- height: hitbox().h,
29
- }); });
30
- var canControls = function () { return isMe() && object.canMove(); };
31
- var keyboardControls = client.globalConfig.keyboardControls;
32
- var controls = signal({
33
- down: {
34
- repeat: true,
35
- bind: keyboardControls.down,
36
- keyDown: function () {
37
- if (canControls())
38
- client.processInput({ input: Direction.Down });
39
- },
40
- },
41
- up: {
42
- repeat: true,
43
- bind: keyboardControls.up,
44
- keyDown: function () {
45
- if (canControls())
46
- client.processInput({ input: Direction.Up });
47
- },
48
- },
49
- left: {
50
- repeat: true,
51
- bind: keyboardControls.left,
52
- keyDown: function () {
53
- if (canControls())
54
- client.processInput({ input: Direction.Left });
55
- },
56
- },
57
- right: {
58
- repeat: true,
59
- bind: keyboardControls.right,
60
- keyDown: function () {
61
- if (canControls())
62
- client.processInput({ input: Direction.Right });
63
- },
64
- },
65
- action: {
66
- bind: keyboardControls.action,
67
- keyDown: function () {
68
- if (canControls()) {
69
- client.processAction({ action: 'action' });
70
- // particleName.set('hit')
71
- // emitParticleTrigger.start()
72
- // object.flash('red')
73
- }
74
- },
75
- },
76
- });
77
- var sheet = function (graphicId) {
78
- return {
79
- definition: spritesheets.get(graphicId),
80
- playing: animationName,
81
- params: {
82
- direction: direction
83
- },
84
- };
85
- };
86
- let $this = h(Container, { x, y, zIndex: y, viewportFollow: isMe, controls }, [h(Particle, { emit: emitParticleTrigger, settings: particleSettings, zIndex: 1000, name: particleName }), loop(graphics, graphicId => h(Sprite, { sheet: sheet(graphicId), direction, tint }))]);
87
- return $this
88
- }
89
-
90
- export { component as default };
91
- //# sourceMappingURL=index35.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index35.js","sources":["../src/components/character.ce"],"sourcesContent":["<Container x y zIndex={y} viewportFollow={isMe} controls>\n <Particle emit={@emitParticleTrigger} settings={@particleSettings} zIndex={1000} name={particleName} />\n @for (graphicId of graphics) {\n <Sprite sheet={@sheet(@graphicId)} direction tint />\n }\n <!-- <Ellipse \n x={shadow.@x} \n y={shadow.@y} \n width={shadow.@width} \n height={shadow.@height} \n color=\"black\" \n blur={10} \n alpha={0.5}\n /> -->\n</Container>\n\n<script>\n import { signal, effect, mount, computed } from \"canvasengine\";\n import { Particle } from \"@canvasengine/presets\";\n import { GameEngineToken } from \"@rpgjs/common\";\n import { RpgClientEngine } from \"../RpgClientEngine\";\n import { inject } from \"../core/inject\"; \n import { Direction } from \"@rpgjs/common\";\n import Hit from \"./effects/hit.ce\";\n\n const { object, id, isMe } = defineProps();\n\n const client = inject(RpgClientEngine);\n\n const spritesheets = client.spritesheets;\n\n const x = object.x;\n const y = object.y;\n const tint = object.tint;\n const direction = object.direction;\n const animationName = object.animationName;\n const emitParticleTrigger = object.emitParticleTrigger;\n const particleSettings = client.particleSettings;\n const particleName = object.particleName;\n const graphics = object.graphics;\n\n const hitbox = object.hitbox;\n const widthShadow = 10;\n const shadow = computed(() => ({\n x: hitbox().w / 2,\n y: hitbox().h - (hitbox().h / 2),\n width: hitbox().w + widthShadow,\n height: hitbox().h,\n }))\n const canControls = () => isMe() && object.canMove()\n const keyboardControls = client.globalConfig.keyboardControls;\n\n const controls = signal({\n down: {\n repeat: true,\n bind: keyboardControls.down,\n keyDown() {\n if (canControls()) client.processInput({ input: Direction.Down })\n },\n },\n up: {\n repeat: true,\n bind: keyboardControls.up,\n keyDown() {\n if (canControls()) client.processInput({ input: Direction.Up })\n },\n },\n left: {\n repeat: true,\n bind: keyboardControls.left,\n keyDown() {\n if (canControls()) client.processInput({ input: Direction.Left })\n },\n },\n right: {\n repeat: true,\n bind: keyboardControls.right,\n keyDown() {\n if (canControls()) client.processInput({ input: Direction.Right })\n },\n },\n action: {\n bind: keyboardControls.action,\n keyDown() {\n if (canControls()) {\n client.processAction({ action: 'action' })\n // particleName.set('hit') \n // emitParticleTrigger.start()\n // object.flash('red')\n }\n },\n },\n });\n\n const sheet = (graphicId) => {\n return {\n definition: spritesheets.get(graphicId),\n playing: animationName,\n params: {\n direction\n },\n };\n }\n</script>"],"names":[],"mappings":";;;;;;AAWqB,SAAS,SAAS,CAAC,OAAO,EAAE;AACjD,QAAuB,QAAQ,CAAC,OAAO;AACvC,QAAQ,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO;AAClD,QAAW,IAAC,EAAE,GAAG,WAAW,EAAE,CAAC,CAAC,MAAM,GAAG,EAAE,CAAC,M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AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC,CAAC;AACF,IAAI,KAAK,GAAG,UAAU,SAAS,EAAE;AACjC,IAAI,OAAO;AACX,QAAQ,UAAU,EAAE,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC;AAC/C,QAAQ,OAAO,EAAE,aAAa;AAC9B,QAAQ,MAAM,EAAE;AAChB,YAAY,SAAS,EAAE;AACvB,SAAS;AACT,KAAK;AACL;AACA,QAAQ,IAAI,KAAK,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,SAAS,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACtR,QAAQ,OAAO;AACf;;;;"}
package/dist/index36.js DELETED
@@ -1,61 +0,0 @@
1
- import { useProps, useDefineProps, mount, signal, h, Container, loop, computed } from 'canvasengine';
2
- import component$1 from './index38.js';
3
- import { RpgClientEngine } from './index2.js';
4
- import { inject } from './index6.js';
5
-
6
- function component($$props) {
7
- useProps($$props);
8
- const defineProps = useDefineProps($$props);
9
- var _a = defineProps(), items = _a.items, wrapAround = _a.wrapAround, onSelect = _a.onSelect, selectedIndex = _a.selectedIndex;
10
- var client = inject(RpgClientEngine);
11
- var keyboardControls = client.globalConfig.keyboardControls;
12
- var selected = function (index) {
13
- return computed(function () {
14
- return index === selectedIndex();
15
- });
16
- };
17
- mount(function (element) {
18
- return function () {
19
- element.directives.controls.onDestroy();
20
- };
21
- });
22
- var controls = signal({
23
- down: {
24
- bind: keyboardControls.down,
25
- keyDown: function () {
26
- selectedIndex.update(function (currentIndex) {
27
- if (wrapAround) {
28
- return (currentIndex + 1) % items().length;
29
- }
30
- else {
31
- return Math.min(currentIndex + 1, items().length - 1);
32
- }
33
- });
34
- },
35
- },
36
- up: {
37
- bind: keyboardControls.up,
38
- keyDown: function () {
39
- selectedIndex.update(function (currentIndex) {
40
- if (wrapAround) {
41
- return (currentIndex - 1 + items().length) % items().length;
42
- }
43
- else {
44
- return Math.max(currentIndex - 1, 0);
45
- }
46
- });
47
- },
48
- },
49
- enter: {
50
- bind: keyboardControls.action,
51
- keyDown: function () {
52
- onSelect === null || onSelect === void 0 ? void 0 : onSelect(selectedIndex());
53
- },
54
- },
55
- });
56
- let $this = h(Container, { controls, flexDirection: 'column', margin: [0, 0, 0, 50] }, loop(items, (item, index) => h(component$1, { text: item.text, isSelected: selected(index) })));
57
- return $this
58
- }
59
-
60
- export { component as default };
61
- //# sourceMappingURL=index36.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index36.js","sources":["../src/components/gui/dialogbox/selection.ce"],"sourcesContent":["<Container controls flexDirection=\"column\" margin={[0, 0, 0, 50]}>\n @for ((item,index) of items) { \n <ItemMenu text={@item.@text} isSelected={@selected(@index)} /> \n }\n</Container>\n\n<script>\n import { signal, computed, mount } from \"canvasengine\";\n import ItemMenu from \"./itemMenu.ce\";\n import { RpgClientEngine } from \"../../../RpgClientEngine\";\n import { inject } from \"../../../core/inject\";\n\n const {\n items,\n wrapAround,\n onSelect,\n selectedIndex,\n } = defineProps();\n\n const client = inject(RpgClientEngine);\n const keyboardControls = client.globalConfig.keyboardControls;\n\n const selected = (index) => {\n return computed(() => {\n return index === selectedIndex();\n })\n }\n\n mount((element) => {\n return () => {\n element.directives.controls.onDestroy()\n }\n })\n\n const controls = signal({\n down: {\n bind: keyboardControls.down,\n keyDown() {\n selectedIndex.update((currentIndex) => {\n if (wrapAround) {\n return (currentIndex + 1) % items().length;\n } else {\n return Math.min(currentIndex + 1, items().length - 1);\n }\n });\n },\n },\n up: {\n bind: keyboardControls.up,\n keyDown() {\n selectedIndex.update((currentIndex) => {\n if (wrapAround) {\n return (currentIndex - 1 + items().length) % items().length;\n } else {\n return Math.max(currentIndex - 1, 0);\n }\n });\n },\n },\n enter: {\n bind: keyboardControls.action,\n keyDown() {\n onSelect?.(selectedIndex());\n },\n },\n });\n</script>\n"],"names":["ItemMenu"],"mappings":";;;;;AASqB,SAAS,SAAS,CAAC,OAAO,EAAE;AACjD,QAAuB,QAAQ,CAAC,OAAO;AACvC,QAAQ,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO;AAClD,QAAQ,IAAI,EAAE,GAAG,WAAW,EAAE,EAAE,KAAK,GAAG,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,EAAE,CAAC,UAAU,EAAE,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,aAAa,GAAG,EAAE,CAAC,aAAa;AACtI,IAAI,MAAM,GAAG,MAAM,CAAC,eAAe,CAAC;AACpC,IAAI,gBAAgB,GAAG,MAAM,CAAC,YAAY,CAAC,gBAAgB;AAC3D,IAAI,QAAQ,GAAG,UAAU,KAAK,EAAE;AAChC,IAAI,OAAO,QAAQ,CAAC,YAAY;AAChC,QAAQ,OAAO,KAAK,KAAK,aAAa,EAAE;AACxC,KAAK,CAAC;AACN,CAAC;AACD,KAAK,CAAC,UAAU,OAAO,EAAE;AACzB,IAAI,OAAO,YAAY;AACvB,QAAQ,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,SAAS,EAAE;AAC/C,KAAK;AACL,CAAC,CAAC;AACF,IAAI,QAAQ,GAAG,MAAM,CAAC;AACtB,IAAI,IAAI,EAAE;AACV,QAAQ,IAAI,EAAE,gBAAgB,CAAC,IAAI;AACnC,QAAQ,OAAO,EAAE,YAAY;AAC7B,YAAY,aAAa,CAAC,MAAM,CAAC,UAAU,YAAY,EAAE;AACzD,gBAAgB,IAAI,UAAU,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AAE,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAC1L,QAAQ,OAAO;AACf;;;;"}
package/dist/index37.js DELETED
@@ -1,20 +0,0 @@
1
- import { RpgCommonPlayer } from '@rpgjs/common';
2
- import { trigger, signal } from 'canvasengine';
3
-
4
- class RpgClientObject extends RpgCommonPlayer {
5
- constructor() {
6
- super(...arguments);
7
- this.emitParticleTrigger = trigger();
8
- this.particleName = signal("");
9
- }
10
- flash(color, duration = 100) {
11
- const lastTint = this.tint();
12
- this.tint.set(color);
13
- setTimeout(() => {
14
- this.tint.set(lastTint);
15
- }, duration);
16
- }
17
- }
18
-
19
- export { RpgClientObject };
20
- //# sourceMappingURL=index37.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index37.js","sources":["../src/Game/Object.ts"],"sourcesContent":["import { RpgCommonPlayer } from \"@rpgjs/common\";\nimport { trigger, signal } from \"canvasengine\";\n\nexport abstract class RpgClientObject extends RpgCommonPlayer {\n abstract type: string;\n emitParticleTrigger = trigger()\n particleName = signal('')\n\n flash(color: string, duration: number = 100) {\n const lastTint = this.tint()\n this.tint.set(color);\n setTimeout(() => {\n this.tint.set(lastTint)\n }, duration)\n }\n} "],"names":[],"mappings":";;;AAGO,MAAe,wBAAwB,eAAgB,CAAA;AAAA,EAAvD,WAAA,GAAA;AAAA,IAAA,KAAA,CAAA,GAAA,SAAA,CAAA;AAEL,IAAA,IAAA,CAAA,mBAAA,GAAsB,OAAQ,EAAA;AAC9B,IAAA,IAAA,CAAA,YAAA,GAAe,OAAO,EAAE,CAAA;AAAA;AAAA,EAExB,KAAA,CAAM,KAAe,EAAA,QAAA,GAAmB,GAAK,EAAA;AAC3C,IAAM,MAAA,QAAA,GAAW,KAAK,IAAK,EAAA;AAC3B,IAAK,IAAA,CAAA,IAAA,CAAK,IAAI,KAAK,CAAA;AACnB,IAAA,UAAA,CAAW,MAAM;AACf,MAAK,IAAA,CAAA,IAAA,CAAK,IAAI,QAAQ,CAAA;AAAA,OACrB,QAAQ,CAAA;AAAA;AAEf;;;;"}
package/dist/index38.js DELETED
@@ -1,20 +0,0 @@
1
- import { useProps, useDefineProps, animatedSignal, h, Container, Rect, Text } from 'canvasengine';
2
-
3
- function component($$props) {
4
- useProps($$props);
5
- const defineProps = useDefineProps($$props);
6
- var _a = defineProps(), text = _a.text, isSelected = _a.isSelected;
7
- var alpha = animatedSignal(1, {
8
- repeatType: "reverse",
9
- duration: 500,
10
- repeat: Infinity,
11
- });
12
- alpha.set(0.5);
13
- var height = 40;
14
- var width = 256;
15
- let $this = h(Container, null, [h(Rect, { width, height, color: '#595971', alpha, visible: isSelected }), h(Container, { flexDirection: 'row', alignItems: 'center', justifyContent: 'center' }, h(Text, { text, color: '#fff', fontSize: 18, margin: 10 }))]);
16
- return $this
17
- }
18
-
19
- export { component as default };
20
- //# sourceMappingURL=index38.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index38.js","sources":["../src/components/gui/dialogbox/itemMenu.ce"],"sourcesContent":["<Container>\n <Rect width height color=\"#595971\" alpha visible={isSelected} />\n <Container flexDirection=\"row\" alignItems=\"center\" justifyContent=\"center\">\n <Text text color=\"#fff\" fontSize={18} margin={10} />\n </Container>\n</Container>\n\n<script>\nimport { animatedSignal } from \"canvasengine\";\n\nconst { text, isSelected } = defineProps();\n\nconst alpha = animatedSignal(1, {\n repeatType: \"reverse\",\n duration: 500,\n repeat: Infinity,\n});\n\nalpha.set(0.5);\n\nconst height = 40;\nconst width = 256;\n</script>"],"names":[],"mappings":";;AAQqB,SAAS,SAAS,CAAC,OAAO,EAAE;AACjD,QAAuB,QAAQ,CAAC,OAAO;AACvC,QAAQ,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO;AAClD,QAAQ,IAAI,EAAE,GAAG,WAAW,EAAE,EAAE,IAAI,GAAG,EAAE,CAAC,IAAI,EAAE,UAAU,GAAG,EAAE,CAAC,UAAU;AAC1E,IAAI,KAAK,GAAG,cAAc,CAAC,CAAC,EAAE;AAC9B,IAAI,UAAU,EAAE,SAAS;AACzB,IAAI,QAAQ,EAAE,GAAG;AACjB,IAAI,MAAM,EAAE,QAAQ;AACpB,CAAC,CAAC;AACF,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;AACd,IAAI,MAAM,GAAG,EAAE;AACf,IAAI,KAAK,GAAG,GAAG;AACf,QAAQ,IAAI,KAAK,GAAG,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC,SAAS,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;AACrQ,QAAQ,OAAO;AACf;;;;"}
package/dist/index4.js DELETED
@@ -1,54 +0,0 @@
1
- import { connectionRoom } from './index21.js';
2
- import { RpgGui } from './index9.js';
3
- import { RpgClientEngine } from './index2.js';
4
- import { WebSocketToken, AbstractWebsocket } from './index16.js';
5
- import { UpdateMapToken, UpdateMapService } from '@rpgjs/common';
6
-
7
- class BridgeWebsocket extends AbstractWebsocket {
8
- constructor(context, options) {
9
- super(context);
10
- this.context = context;
11
- this.options = options;
12
- }
13
- async connection() {
14
- class Room {
15
- }
16
- const instance = new Room();
17
- this.socket = await connectionRoom(this.options, instance);
18
- }
19
- on(key, callback) {
20
- this.socket.on(key, callback);
21
- }
22
- off(event, callback) {
23
- this.socket.off(event, callback);
24
- }
25
- emit(event, data) {
26
- this.socket.emit(event, data);
27
- }
28
- }
29
- class UpdateMapStandaloneService extends UpdateMapService {
30
- constructor(context, options) {
31
- super(context);
32
- this.context = context;
33
- this.options = options;
34
- }
35
- async update(map) {
36
- }
37
- }
38
- function provideMmorpg(options) {
39
- return [
40
- {
41
- provide: WebSocketToken,
42
- useFactory: (context) => new BridgeWebsocket(context, options)
43
- },
44
- {
45
- provide: UpdateMapToken,
46
- useFactory: (context) => new UpdateMapStandaloneService(context, options)
47
- },
48
- RpgGui,
49
- RpgClientEngine
50
- ];
51
- }
52
-
53
- export { provideMmorpg };
54
- //# sourceMappingURL=index4.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index4.js","sources":["../src/services/mmorpg.ts"],"sourcesContent":["import { Context } from \"@signe/di\";\nimport { connectionRoom } from \"@signe/sync/client\";\nimport { RpgGui } from \"../Gui/Gui\";\nimport { RpgClientEngine } from \"../RpgClientEngine\";\nimport { AbstractWebsocket, WebSocketToken } from \"./AbstractSocket\";\nimport { UpdateMapService, UpdateMapToken } from \"@rpgjs/common\";\n\ninterface MmorpgOptions {\n host: string;\n}\n\nclass BridgeWebsocket extends AbstractWebsocket {\n private socket: any;\n\n constructor(protected context: Context, private options: MmorpgOptions) {\n super(context);\n }\n\n async connection() {\n // tmp\n class Room {\n \n }\n const instance = new Room()\n this.socket = await connectionRoom(this.options, instance)\n }\n\n on(key: string, callback: (data: any) => void) {\n this.socket.on(key, callback);\n }\n\n off(event: string, callback: (data: any) => void) {\n this.socket.off(event, callback);\n }\n\n emit(event: string, data: any) {\n this.socket.emit(event, data);\n }\n}\n\nclass UpdateMapStandaloneService extends UpdateMapService {\n constructor(protected context: Context, private options: MmorpgOptions) {\n super(context);\n }\n\n async update(map: any) {\n // nothing\n }\n}\n\nexport function provideMmorpg(options: MmorpgOptions) {\n return [\n {\n provide: WebSocketToken,\n useFactory: (context: Context) => new BridgeWebsocket(context, options),\n },\n {\n provide: UpdateMapToken,\n useFactory: (context: Context) => new UpdateMapStandaloneService(context, options),\n },\n RpgGui,\n RpgClientEngine,\n ];\n}\n"],"names":[],"mappings":";;;;;;AAWA,MAAM,wBAAwB,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A,cAAA;AAAA,MACT,YAAY,CAAC,OAAA,KAAqB,IAAI,0BAAA,CAA2B,SAAS,OAAO;AAAA,KACnF;AAAA,IACA,MAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
package/dist/index5.js DELETED
@@ -1,15 +0,0 @@
1
- import { injector, inject, Context } from './index15.js';
2
- import { RpgClientEngine } from './index2.js';
3
- import { setInject } from './index6.js';
4
-
5
- async function startGame(options) {
6
- const context = new Context();
7
- setInject(context);
8
- await injector(context, options.providers);
9
- const engine = inject(context, RpgClientEngine);
10
- await engine.start();
11
- return context;
12
- }
13
-
14
- export { startGame };
15
- //# sourceMappingURL=index5.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index5.js","sources":["../src/core/setup.ts"],"sourcesContent":["import { Context, FactoryProvider, findProvider, findProviders, inject, injector, Providers } from \"@signe/di\";\nimport { RpgClientEngine } from \"../RpgClientEngine\";\nimport { setInject } from \"./inject\";\n\ninterface SetupOptions {\n providers: Providers;\n}\n\nexport async function startGame(options: SetupOptions) {\n const context = new Context();\n setInject(context);\n\n await injector(context, options.providers);\n\n const engine = inject(context, RpgClientEngine);\n await engine.start();\n return context;\n}"],"names":[],"mappings":";;;;AAQA,eAAsB,UAAU,OAAuB,EAAA;AACrD,EAAM,MAAA,OAAA,GAAU,IAAI,OAAQ,EAAA;AAC5B,EAAA,SAAA,CAAU,OAAO,CAAA;AAEjB,EAAM,MAAA,QAAA,CAAS,OAAS,EAAA,OAAA,CAAQ,SAAS,CAAA;AAEzC,EAAM,MAAA,MAAA,GAAS,MAAO,CAAA,OAAA,EAAS,eAAe,CAAA;AAC9C,EAAA,MAAM,OAAO,KAAM,EAAA;AACnB,EAAO,OAAA,OAAA;AACT;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index6.js","sources":["../src/core/inject.ts"],"sourcesContent":["import { Context, inject as injector } from \"@signe/di\";\n\nexport let context: Context | null = null\n\nexport function inject<T>(service: (new (...args: any[]) => T) | string, _context?: Context): T {\n const c = _context ?? context\n if (!c) throw new Error(\"Context is not set. use setInject() to set the context\");\n return injector(c, service);\n}\n\nexport function setInject(_context: Context) {\n context = _context;\n}\n\nexport function clearInject() {\n context = null\n}"],"names":["injector"],"mappings":";;AAEO,IAAI,OAA0B,GAAA;AAErB,SAAA,MAAA,CAAU,SAA+C,QAAuB,EAAA;AAC5F,EAAA,MAAM,IAAI,QAAY,IAAA,OAAA;AACtB,EAAA,IAAI,CAAC,CAAA,EAAS,MAAA,IAAI,MAAM,wDAAwD,CAAA;AAChF,EAAO,OAAAA,QAAA,CAAS,GAAG,OAAO,CAAA;AAC9B;AAEO,SAAS,UAAU,QAAmB,EAAA;AACzC,EAAU,OAAA,GAAA,QAAA;AACd;AAEO,SAAS,WAAc,GAAA;AAC1B,EAAU,OAAA,GAAA,IAAA;AACd;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index7.js","sources":["../src/services/loadMap.ts"],"sourcesContent":["import { Context, inject } from \"@signe/di\";\nimport { UpdateMapToken, UpdateMapService } from \"@rpgjs/common\";\n\nexport const LoadMapToken = 'LoadMapToken'\n\nexport type LoadMapOptions = (mapId: string) => Promise<void>\n\nexport class LoadMapService {\n private updateMapService: UpdateMapService;\n\n constructor(private context: Context, private options: LoadMapOptions) {\n this.updateMapService = inject(context, UpdateMapToken);\n }\n\n async load(mapId: string) {\n const map = await this.options(mapId.replace('map-', ''))\n await this.updateMapService.update(mapId, map);\n return map;\n }\n}\n\nexport function provideLoadMap(options: LoadMapOptions) {\n return [\n {\n provide: UpdateMapToken,\n useFactory: (context: Context) => console.warn('UpdateMapToken is not overridden'),\n },\n {\n provide: LoadMapToken,\n useFactory: (context: Context) => new LoadMapService(context, options),\n },\n ];\n}\n"],"names":[],"mappings":";;;AAGO,MAAM,YAAe,GAAA;AAIrB,MAAM,cAAe,CAAA;AAAA,EAG1B,WAAA,CAAoB,SAA0B,OAAyB,EAAA;AAAnD,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AAA0B,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AAC5C,IAAK,IAAA,CAAA,gBAAA,GAAmB,MAAO,CAAA,OAAA,EAAS,cAAc,CAAA;AAAA;AACxD,EAEA,MAAM,KAAK,KAAe,EAAA;AACxB,IAAM,MAAA,GAAA,GAAM,MAAM,IAAK,CAAA,OAAA,CAAQ,MAAM,OAAQ,CAAA,MAAA,EAAQ,EAAE,CAAC,CAAA;AACxD,IAAA,MAAM,IAAK,CAAA,gBAAA,CAAiB,MAAO,CAAA,KAAA,EAAO,GAAG,CAAA;AAC7C,IAAO,OAAA,GAAA;AAAA;AAEX;AAEO,SAAS,eAAe,OAAyB,EAAA;AACtD,EAAO,OAAA;AAAA,IACL;AAAA,MACE,OAAS,EAAA,cAAA;AAAA,MACT,UAAY,EAAA,CAAC,OAAqB,KAAA,OAAA,CAAQ,KAAK,kCAAkC;AAAA,KACnF;AAAA,IACA;AAAA,MACE,OAAS,EAAA,YAAA;AAAA,MACT,YAAY,CAAC,OAAA,KAAqB,IAAI,cAAA,CAAe,SAAS,OAAO;AAAA;AACvE,GACF;AACF;;;;"}
package/dist/index8.js DELETED
@@ -1,90 +0,0 @@
1
- import { provideModules, findModules } from '@rpgjs/common';
2
- import { inject } from './index15.js';
3
- import { RpgGui } from './index9.js';
4
-
5
- function provideClientModules(modules) {
6
- return provideModules(modules, "client", (modules2, context) => {
7
- const mainModuleClient = findModules(context, "Client");
8
- modules2 = [...mainModuleClient, ...modules2];
9
- modules2 = modules2.map((module) => {
10
- if ("client" in module) {
11
- module = module.client;
12
- }
13
- if (module.spritesheets) {
14
- const spritesheets = [...module.spritesheets];
15
- module.spritesheets = {
16
- load: (engine) => {
17
- spritesheets.forEach((spritesheet) => {
18
- engine.addSpriteSheet(spritesheet);
19
- });
20
- }
21
- };
22
- }
23
- if (module.sounds) {
24
- const sounds = [...module.sounds];
25
- module.sounds = {
26
- load: (engine) => {
27
- sounds.forEach((sound) => {
28
- engine.addSound(sound);
29
- });
30
- }
31
- };
32
- }
33
- if (module.gui) {
34
- const gui = [...module.gui];
35
- module.gui = {
36
- load: (engine) => {
37
- const guiService = inject(engine.context, RpgGui);
38
- gui.forEach((gui2) => {
39
- guiService.add(gui2);
40
- });
41
- }
42
- };
43
- }
44
- if (module.effects) {
45
- const effects = [...module.effects];
46
- module.effects = {
47
- load: (engine) => {
48
- effects.forEach((effect) => {
49
- engine.addEffect(effect);
50
- });
51
- }
52
- };
53
- }
54
- if (module.particles) {
55
- const particles = [...module.particles];
56
- module.particles = {
57
- load: (engine) => {
58
- particles.forEach((particle) => {
59
- engine.addParticle(particle);
60
- });
61
- }
62
- };
63
- }
64
- return module;
65
- });
66
- return modules2;
67
- });
68
- }
69
- const GlobalConfigToken = "GlobalConfigToken";
70
- function provideGlobalConfig(config) {
71
- return {
72
- provide: GlobalConfigToken,
73
- useValue: config ?? {}
74
- };
75
- }
76
- function provideClientGlobalConfig(config = {}) {
77
- if (!config.keyboardControls) {
78
- config.keyboardControls = {
79
- up: "up",
80
- down: "down",
81
- left: "left",
82
- right: "right",
83
- action: "space"
84
- };
85
- }
86
- return provideGlobalConfig(config);
87
- }
88
-
89
- export { GlobalConfigToken, provideClientGlobalConfig, provideClientModules, provideGlobalConfig };
90
- //# sourceMappingURL=index8.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index8.js","sources":["../src/module.ts"],"sourcesContent":["import { findModules, provideModules } from \"@rpgjs/common\";\nimport { RpgClientEngine } from \"./RpgClientEngine\";\nimport { RpgClient } from \"./RpgClient\";\nimport { inject } from \"@signe/di\";\nimport { RpgGui } from \"./Gui/Gui\";\n\nexport function provideClientModules(modules: RpgClient[]) {\n return provideModules(modules, \"client\", (modules, context) => {\n const mainModuleClient = findModules(context, 'Client')\n modules = [...mainModuleClient, ...modules]\n modules = modules.map((module) => {\n if ('client' in module) {\n module = module.client as any;\n }\n if (module.spritesheets) {\n const spritesheets = [...module.spritesheets];\n module.spritesheets = {\n load: (engine: RpgClientEngine) => {\n spritesheets.forEach((spritesheet) => {\n engine.addSpriteSheet(spritesheet);\n });\n },\n };\n }\n if (module.sounds) {\n const sounds = [...module.sounds];\n module.sounds = {\n load: (engine: RpgClientEngine) => {\n sounds.forEach((sound) => {\n engine.addSound(sound);\n });\n },\n };\n }\n if (module.gui) {\n const gui = [...module.gui];\n module.gui = {\n load: (engine: RpgClientEngine) => {\n const guiService = inject(engine.context, RpgGui);\n gui.forEach((gui) => {\n guiService.add(gui);\n });\n },\n };\n }\n if (module.effects) {\n const effects = [...module.effects];\n module.effects = {\n load: (engine: RpgClientEngine) => {\n effects.forEach((effect) => {\n engine.addEffect(effect);\n });\n },\n };\n }\n if (module.particles) {\n const particles = [...module.particles];\n module.particles = {\n load: (engine: RpgClientEngine) => {\n particles.forEach((particle) => {\n engine.addParticle(particle);\n });\n },\n };\n }\n return module;\n });\n return modules\n });\n}\n\nexport const GlobalConfigToken = \"GlobalConfigToken\";\n\nexport function provideGlobalConfig(config: any) {\n return {\n provide: GlobalConfigToken,\n useValue: config ?? {},\n };\n}\n\nexport function provideClientGlobalConfig(config: any = {}) {\n if (!config.keyboardControls) {\n config.keyboardControls = {\n up: 'up',\n down: 'down',\n left: 'left',\n right: 'right',\n action: 'space'\n }\n }\n return provideGlobalConfig(config)\n}\n\n"],"names":["modules","gui"],"mappings":";;;;AAMO,SAAS,qBAAqB,OAAsB,EAAA;AACzD,EAAA,OAAO,cAAe,CAAA,OAAA,EAAS,QAAU,EAAA,CAACA,UAAS,OAAY,KAAA;AAC7D,IAAM,MAAA,gBAAA,GAAmB,WAAY,CAAA,OAAA,EAAS,QAAQ,CAAA;AACtD,IAAAA,QAAU,GAAA,CAAC,GAAG,gBAAA,EAAkB,GAAGA,QAAO,CAAA;AAC1C,IAAAA,QAAUA,GAAAA,QAAAA,CAAQ,GAAI,CAAA,CAAC,MAAW,KAAA;AAChC,MAAA,IAAI,YAAY,MAAQ,EAAA;AACtB,QAAA,MAAA,GAAS,MAAO,CAAA,MAAA;AAAA;AAEl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A,CAAA,OAAA,CAAQ,CAAC,MAAW,KAAA;AAC1B,cAAA,MAAA,CAAO,UAAU,MAAM,CAAA;AAAA,aACxB,CAAA;AAAA;AACH,SACF;AAAA;AAEF,MAAA,IAAI,OAAO,SAAW,EAAA;AACpB,QAAA,MAAM,SAAY,GAAA,CAAC,GAAG,MAAA,CAAO,SAAS,CAAA;AACtC,QAAA,MAAA,CAAO,SAAY,GAAA;AAAA,UACjB,IAAA,EAAM,CAAC,MAA4B,KAAA;AACjC,YAAU,SAAA,CAAA,OAAA,CAAQ,CAAC,QAAa,KAAA;AAC9B,cAAA,MAAA,CAAO,YAAY,QAAQ,CAAA;AAAA,aAC5B,CAAA;AAAA;AACH,SACF;AAAA;AAEF,MAAO,OAAA,MAAA;AAAA,KACR,CAAA;AACD,IAAOD,OAAAA,QAAAA;AAAA,GACR,CAAA;AACH;AAEO,MAAM,iBAAoB,GAAA;AAE1B,SAAS,oBAAoB,MAAa,EAAA;AAC/C,EAAO,OAAA;AAAA,IACL,OAAS,EAAA,iBAAA;AAAA,IACT,QAAA,EAAU,UAAU;AAAC,GACvB;AACF;AAEgB,SAAA,yBAAA,CAA0B,MAAc,GAAA,EAAI,EAAA;AAC1D,EAAI,IAAA,CAAC,OAAO,gBAAkB,EAAA;AAC5B,IAAA,MAAA,CAAO,gBAAmB,GAAA;AAAA,MACxB,EAAI,EAAA,IAAA;AAAA,MACJ,IAAM,EAAA,MAAA;AAAA,MACN,IAAM,EAAA,MAAA;AAAA,MACN,KAAO,EAAA,OAAA;AAAA,MACP,MAAQ,EAAA;AAAA,KACV;AAAA;AAEF,EAAA,OAAO,oBAAoB,MAAM,CAAA;AACnC;;;;"}
package/dist/index9.js DELETED
@@ -1,76 +0,0 @@
1
- import { inject } from './index15.js';
2
- import { signal } from 'canvasengine';
3
- import { WebSocketToken } from './index16.js';
4
- import { PrebuiltGui } from './index10.js';
5
-
6
- const throwError = (id) => {
7
- throw `The GUI named ${id} is non-existent. Please add the component in the gui property of the decorator @RpgClient`;
8
- };
9
- class RpgGui {
10
- constructor(context) {
11
- this.context = context;
12
- this.gui = signal({});
13
- this.webSocket = inject(context, WebSocketToken);
14
- this.add({
15
- name: "rpg-dialog",
16
- component: PrebuiltGui.Dialogbox
17
- });
18
- }
19
- async _initialize() {
20
- this.webSocket.on("gui.open", (data) => {
21
- this.display(data.guiId, data.data);
22
- });
23
- this.webSocket.on("gui.exit", (guiId) => {
24
- this.hide(guiId);
25
- });
26
- }
27
- guiInteraction(guiId, name, data) {
28
- this.webSocket.emit("gui.interaction", {
29
- guiId,
30
- name,
31
- data
32
- });
33
- }
34
- guiClose(guiId, data) {
35
- this.webSocket.emit("gui.exit", {
36
- guiId,
37
- data
38
- });
39
- }
40
- add(gui) {
41
- this.gui()[gui.name] = {
42
- name: gui.name,
43
- component: gui.component,
44
- display: signal(gui.display || false),
45
- data: signal(gui.data || {})
46
- };
47
- }
48
- get(id) {
49
- if (typeof id != "string") {
50
- id = id.name;
51
- }
52
- return this.gui()[id];
53
- }
54
- exists(id) {
55
- return !!this.get(id);
56
- }
57
- getAll() {
58
- return this.gui();
59
- }
60
- display(id, data = {}) {
61
- if (!this.exists(id)) {
62
- throw throwError(id);
63
- }
64
- this.get(id).data.set(data);
65
- this.get(id).display.set(true);
66
- }
67
- hide(id) {
68
- if (!this.exists(id)) {
69
- throw throwError(id);
70
- }
71
- this.get(id).display.set(false);
72
- }
73
- }
74
-
75
- export { RpgGui };
76
- //# sourceMappingURL=index9.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index9.js","sources":["../src/Gui/Gui.ts"],"sourcesContent":["import { Context, inject } from \"@signe/di\";\nimport { signal } from \"canvasengine\";\nimport { AbstractWebsocket, WebSocketToken } from \"../services/AbstractSocket\";\nimport { PrebuiltGui } from \"../components/gui\";\n\ninterface GuiOptions {\n name: string;\n component: any;\n display?: boolean;\n data?: any;\n}\n\nconst throwError = (id: string) => {\n throw `The GUI named ${id} is non-existent. Please add the component in the gui property of the decorator @RpgClient`;\n};\n\nexport class RpgGui {\n private webSocket: AbstractWebsocket;\n gui = signal<any>({});\n\n constructor(private context: Context) {\n this.webSocket = inject(context, WebSocketToken);\n this.add({\n name: \"rpg-dialog\",\n component: PrebuiltGui.Dialogbox,\n });\n }\n\n async _initialize() {\n this.webSocket.on(\"gui.open\", (data: { guiId: string; data: any }) => {\n this.display(data.guiId, data.data);\n });\n\n this.webSocket.on(\"gui.exit\", (guiId: string) => {\n this.hide(guiId);\n });\n }\n\n guiInteraction(guiId: string, name: string, data: any) {\n this.webSocket.emit(\"gui.interaction\", {\n guiId,\n name,\n data,\n });\n }\n\n guiClose(guiId: string, data?: any) {\n this.webSocket.emit(\"gui.exit\", {\n guiId,\n data,\n });\n }\n\n add(gui: GuiOptions) {\n this.gui()[gui.name] = {\n name: gui.name,\n component: gui.component,\n display: signal(gui.display || false),\n data: signal(gui.data || {}),\n };\n }\n\n get(id: string | GuiOptions) {\n if (typeof id != \"string\") {\n id = id.name;\n }\n return this.gui()[id];\n }\n\n exists(id: string): boolean {\n return !!this.get(id);\n }\n\n getAll() {\n return this.gui();\n }\n\n display(id: string, data = {}) {\n if (!this.exists(id)) {\n throw throwError(id);\n }\n this.get(id).data.set(data);\n this.get(id).display.set(true);\n }\n\n hide(id: string) {\n if (!this.exists(id)) {\n throw throwError(id);\n }\n this.get(id).display.set(false);\n }\n}\n"],"names":[],"mappings":";;;;;AAYA,MAAM,UAAA,GAAa,CAAC,EAAe,KAAA;AACjC,EAAA,MAAM,iBAAiB,EAAE,CAAA,0FAAA,CAAA;AAC3B,CAAA;AAEO,MAAM,MAAO,CAAA;AAAA,EAIlB,YAAoB,OAAkB,EAAA;AAAlB,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AAFpB,IAAM,IAAA,CAAA,GAAA,GAAA,MAAA,CAAY,EAAE,CAAA;AAGlB,IAAK,IAAA,CAAA,SAAA,GAAY,MAAO,CAAA,OAAA,EAAS,cAAc,CAAA;AAC/C,IAAA,IAAA,CAAK,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AA;AAEV,IAAO,OAAA,IAAA,CAAK,GAAI,EAAA,CAAE,EAAE,CAAA;AAAA;AACtB,EAEA,OAAO,EAAqB,EAAA;AAC1B,IAAA,OAAO,CAAC,CAAC,IAAK,CAAA,GAAA,CAAI,EAAE,CAAA;AAAA;AACtB,EAEA,MAAS,GAAA;AACP,IAAA,OAAO,KAAK,GAAI,EAAA;AAAA;AAClB,EAEA,OAAQ,CAAA,EAAA,EAAY,IAAO,GAAA,EAAI,EAAA;AAC7B,IAAA,IAAI,CAAC,IAAA,CAAK,MAAO,CAAA,EAAE,CAAG,EAAA;AACpB,MAAA,MAAM,WAAW,EAAE,CAAA;AAAA;AAErB,IAAA,IAAA,CAAK,GAAI,CAAA,EAAE,CAAE,CAAA,IAAA,CAAK,IAAI,IAAI,CAAA;AAC1B,IAAA,IAAA,CAAK,GAAI,CAAA,EAAE,CAAE,CAAA,OAAA,CAAQ,IAAI,IAAI,CAAA;AAAA;AAC/B,EAEA,KAAK,EAAY,EAAA;AACf,IAAA,IAAI,CAAC,IAAA,CAAK,MAAO,CAAA,EAAE,CAAG,EAAA;AACpB,MAAA,MAAM,WAAW,EAAE,CAAA;AAAA;AAErB,IAAA,IAAA,CAAK,GAAI,CAAA,EAAE,CAAE,CAAA,OAAA,CAAQ,IAAI,KAAK,CAAA;AAAA;AAElC;;;;"}
@@ -1,23 +0,0 @@
1
- <Container>
2
- <Rect width height color="#595971" alpha visible={isSelected} />
3
- <Container flexDirection="row" alignItems="center" justifyContent="center">
4
- <Text text color="#fff" fontSize={18} margin={10} />
5
- </Container>
6
- </Container>
7
-
8
- <script>
9
- import { animatedSignal } from "canvasengine";
10
-
11
- const { text, isSelected } = defineProps();
12
-
13
- const alpha = animatedSignal(1, {
14
- repeatType: "reverse",
15
- duration: 500,
16
- repeat: Infinity,
17
- });
18
-
19
- alpha.set(0.5);
20
-
21
- const height = 40;
22
- const width = 256;
23
- </script>
@@ -1,67 +0,0 @@
1
- <Container controls flexDirection="column" margin={[0, 0, 0, 50]}>
2
- @for ((item,index) of items) {
3
- <ItemMenu text={@item.@text} isSelected={@selected(@index)} />
4
- }
5
- </Container>
6
-
7
- <script>
8
- import { signal, computed, mount } from "canvasengine";
9
- import ItemMenu from "./itemMenu.ce";
10
- import { RpgClientEngine } from "../../../RpgClientEngine";
11
- import { inject } from "../../../core/inject";
12
-
13
- const {
14
- items,
15
- wrapAround,
16
- onSelect,
17
- selectedIndex,
18
- } = defineProps();
19
-
20
- const client = inject(RpgClientEngine);
21
- const keyboardControls = client.globalConfig.keyboardControls;
22
-
23
- const selected = (index) => {
24
- return computed(() => {
25
- return index === selectedIndex();
26
- })
27
- }
28
-
29
- mount((element) => {
30
- return () => {
31
- element.directives.controls.onDestroy()
32
- }
33
- })
34
-
35
- const controls = signal({
36
- down: {
37
- bind: keyboardControls.down,
38
- keyDown() {
39
- selectedIndex.update((currentIndex) => {
40
- if (wrapAround) {
41
- return (currentIndex + 1) % items().length;
42
- } else {
43
- return Math.min(currentIndex + 1, items().length - 1);
44
- }
45
- });
46
- },
47
- },
48
- up: {
49
- bind: keyboardControls.up,
50
- keyDown() {
51
- selectedIndex.update((currentIndex) => {
52
- if (wrapAround) {
53
- return (currentIndex - 1 + items().length) % items().length;
54
- } else {
55
- return Math.max(currentIndex - 1, 0);
56
- }
57
- });
58
- },
59
- },
60
- enter: {
61
- bind: keyboardControls.action,
62
- keyDown() {
63
- onSelect?.(selectedIndex());
64
- },
65
- },
66
- });
67
- </script>
@@ -1,23 +0,0 @@
1
- <Sprite image rectangle x y zIndex />
2
-
3
- <script>
4
- const {
5
- image,
6
- rect,
7
- drawIn,
8
- id,
9
- } = defineProps()
10
-
11
- const rectangle = {
12
- x: rect[0],
13
- y: rect[1],
14
- width: rect[2],
15
- height: rect[3]
16
- }
17
-
18
- const x = drawIn[0]
19
- const y = drawIn[1]
20
-
21
- const zIndex = y + rectangle.height
22
- </script>
23
-
File without changes