@rpgjs/client 5.0.0-alpha.43 → 5.0.0-alpha.44

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 (137) hide show
  1. package/dist/Game/AnimationManager.js +25 -24
  2. package/dist/Game/AnimationManager.js.map +1 -1
  3. package/dist/Game/Event.js +11 -10
  4. package/dist/Game/Event.js.map +1 -1
  5. package/dist/Game/Map.js +78 -94
  6. package/dist/Game/Map.js.map +1 -1
  7. package/dist/Game/Object.js +182 -216
  8. package/dist/Game/Object.js.map +1 -1
  9. package/dist/Game/Player.js +11 -10
  10. package/dist/Game/Player.js.map +1 -1
  11. package/dist/Gui/Gui.js +440 -473
  12. package/dist/Gui/Gui.js.map +1 -1
  13. package/dist/Gui/NotificationManager.js +48 -50
  14. package/dist/Gui/NotificationManager.js.map +1 -1
  15. package/dist/Resource.js +132 -113
  16. package/dist/Resource.js.map +1 -1
  17. package/dist/RpgClientEngine.js +1333 -1486
  18. package/dist/RpgClientEngine.js.map +1 -1
  19. package/dist/Sound.js +162 -92
  20. package/dist/Sound.js.map +1 -1
  21. package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/decorate.js +9 -0
  22. package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/decorateMetadata.js +6 -0
  23. package/dist/components/animations/animation.ce.js +22 -19
  24. package/dist/components/animations/animation.ce.js.map +1 -1
  25. package/dist/components/animations/hit.ce.js +67 -68
  26. package/dist/components/animations/hit.ce.js.map +1 -1
  27. package/dist/components/animations/index.js +9 -8
  28. package/dist/components/animations/index.js.map +1 -1
  29. package/dist/components/character.ce.js +390 -314
  30. package/dist/components/character.ce.js.map +1 -1
  31. package/dist/components/dynamics/parse-value.js +42 -52
  32. package/dist/components/dynamics/parse-value.js.map +1 -1
  33. package/dist/components/dynamics/text.ce.js +71 -139
  34. package/dist/components/dynamics/text.ce.js.map +1 -1
  35. package/dist/components/gui/box.ce.js +26 -25
  36. package/dist/components/gui/box.ce.js.map +1 -1
  37. package/dist/components/gui/dialogbox/index.ce.js +202 -149
  38. package/dist/components/gui/dialogbox/index.ce.js.map +1 -1
  39. package/dist/components/gui/gameover.ce.js +190 -138
  40. package/dist/components/gui/gameover.ce.js.map +1 -1
  41. package/dist/components/gui/hud/hud.ce.js +90 -33
  42. package/dist/components/gui/hud/hud.ce.js.map +1 -1
  43. package/dist/components/gui/index.js +14 -0
  44. package/dist/components/gui/menu/equip-menu.ce.js +478 -346
  45. package/dist/components/gui/menu/equip-menu.ce.js.map +1 -1
  46. package/dist/components/gui/menu/exit-menu.ce.js +52 -33
  47. package/dist/components/gui/menu/exit-menu.ce.js.map +1 -1
  48. package/dist/components/gui/menu/items-menu.ce.js +341 -226
  49. package/dist/components/gui/menu/items-menu.ce.js.map +1 -1
  50. package/dist/components/gui/menu/main-menu.ce.js +414 -205
  51. package/dist/components/gui/menu/main-menu.ce.js.map +1 -1
  52. package/dist/components/gui/menu/options-menu.ce.js +46 -26
  53. package/dist/components/gui/menu/options-menu.ce.js.map +1 -1
  54. package/dist/components/gui/menu/skills-menu.ce.js +104 -50
  55. package/dist/components/gui/menu/skills-menu.ce.js.map +1 -1
  56. package/dist/components/gui/mobile/index.js +18 -21
  57. package/dist/components/gui/mobile/index.js.map +1 -1
  58. package/dist/components/gui/mobile/mobile.ce.js +76 -15
  59. package/dist/components/gui/mobile/mobile.ce.js.map +1 -1
  60. package/dist/components/gui/notification/notification.ce.js +62 -36
  61. package/dist/components/gui/notification/notification.ce.js.map +1 -1
  62. package/dist/components/gui/save-load.ce.js +386 -239
  63. package/dist/components/gui/save-load.ce.js.map +1 -1
  64. package/dist/components/gui/shop/shop.ce.js +649 -319
  65. package/dist/components/gui/shop/shop.ce.js.map +1 -1
  66. package/dist/components/gui/title-screen.ce.js +187 -145
  67. package/dist/components/gui/title-screen.ce.js.map +1 -1
  68. package/dist/components/index.js +4 -0
  69. package/dist/components/prebuilt/hp-bar.ce.js +114 -104
  70. package/dist/components/prebuilt/hp-bar.ce.js.map +1 -1
  71. package/dist/components/prebuilt/index.js +2 -0
  72. package/dist/components/prebuilt/light-halo.ce.js +92 -74
  73. package/dist/components/prebuilt/light-halo.ce.js.map +1 -1
  74. package/dist/components/scenes/canvas.ce.js +58 -42
  75. package/dist/components/scenes/canvas.ce.js.map +1 -1
  76. package/dist/components/scenes/draw-map.ce.js +87 -64
  77. package/dist/components/scenes/draw-map.ce.js.map +1 -1
  78. package/dist/components/scenes/event-layer.ce.js +26 -16
  79. package/dist/components/scenes/event-layer.ce.js.map +1 -1
  80. package/dist/core/inject.js +11 -10
  81. package/dist/core/inject.js.map +1 -1
  82. package/dist/core/setup.js +13 -13
  83. package/dist/core/setup.js.map +1 -1
  84. package/dist/index.js +44 -41
  85. package/dist/module.js +169 -168
  86. package/dist/module.js.map +1 -1
  87. package/dist/node_modules/.pnpm/@signe_di@2.8.3/node_modules/@signe/di/dist/index.js +209 -298
  88. package/dist/node_modules/.pnpm/@signe_di@2.8.3/node_modules/@signe/di/dist/index.js.map +1 -1
  89. package/dist/node_modules/.pnpm/@signe_reactive@2.8.3/node_modules/@signe/reactive/dist/index.js +430 -507
  90. package/dist/node_modules/.pnpm/@signe_reactive@2.8.3/node_modules/@signe/reactive/dist/index.js.map +1 -1
  91. package/dist/node_modules/.pnpm/@signe_room@2.8.3/node_modules/@signe/room/dist/index.js +2062 -2571
  92. package/dist/node_modules/.pnpm/@signe_room@2.8.3/node_modules/@signe/room/dist/index.js.map +1 -1
  93. package/dist/node_modules/.pnpm/@signe_sync@2.8.3/node_modules/@signe/sync/dist/chunk-7QVYU63E.js +8 -3
  94. package/dist/node_modules/.pnpm/@signe_sync@2.8.3/node_modules/@signe/sync/dist/chunk-7QVYU63E.js.map +1 -1
  95. package/dist/node_modules/.pnpm/@signe_sync@2.8.3/node_modules/@signe/sync/dist/client/index.js +78 -101
  96. package/dist/node_modules/.pnpm/@signe_sync@2.8.3/node_modules/@signe/sync/dist/client/index.js.map +1 -1
  97. package/dist/node_modules/.pnpm/@signe_sync@2.8.3/node_modules/@signe/sync/dist/index.js +264 -401
  98. package/dist/node_modules/.pnpm/@signe_sync@2.8.3/node_modules/@signe/sync/dist/index.js.map +1 -1
  99. package/dist/node_modules/.pnpm/dset@3.1.4/node_modules/dset/dist/index.js +9 -7
  100. package/dist/node_modules/.pnpm/dset@3.1.4/node_modules/dset/dist/index.js.map +1 -1
  101. package/dist/node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-HAC622V3.js +106 -165
  102. package/dist/node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-HAC622V3.js.map +1 -1
  103. package/dist/node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-S74YV6PU.js +361 -461
  104. package/dist/node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-S74YV6PU.js.map +1 -1
  105. package/dist/node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/index.js +2 -0
  106. package/dist/node_modules/.pnpm/zod@3.24.2/node_modules/zod/lib/index.js +3633 -4280
  107. package/dist/node_modules/.pnpm/zod@3.24.2/node_modules/zod/lib/index.js.map +1 -1
  108. package/dist/presets/animation.js +37 -25
  109. package/dist/presets/animation.js.map +1 -1
  110. package/dist/presets/faceset.js +49 -22
  111. package/dist/presets/faceset.js.map +1 -1
  112. package/dist/presets/icon.js +13 -13
  113. package/dist/presets/icon.js.map +1 -1
  114. package/dist/presets/index.js +15 -14
  115. package/dist/presets/index.js.map +1 -1
  116. package/dist/presets/lpc.js +96 -93
  117. package/dist/presets/lpc.js.map +1 -1
  118. package/dist/presets/rmspritesheet.js +40 -39
  119. package/dist/presets/rmspritesheet.js.map +1 -1
  120. package/dist/services/AbstractSocket.js +10 -8
  121. package/dist/services/AbstractSocket.js.map +1 -1
  122. package/dist/services/keyboardControls.js +20 -18
  123. package/dist/services/keyboardControls.js.map +1 -1
  124. package/dist/services/loadMap.js +120 -36
  125. package/dist/services/loadMap.js.map +1 -1
  126. package/dist/services/mmorpg.js +128 -136
  127. package/dist/services/mmorpg.js.map +1 -1
  128. package/dist/services/save.js +74 -66
  129. package/dist/services/save.js.map +1 -1
  130. package/dist/services/standalone.js +165 -167
  131. package/dist/services/standalone.js.map +1 -1
  132. package/dist/utils/getEntityProp.js +49 -51
  133. package/dist/utils/getEntityProp.js.map +1 -1
  134. package/package.json +8 -8
  135. package/src/components/character.ce +1 -1
  136. package/src/components/scenes/draw-map.ce +3 -1
  137. package/dist/index.js.map +0 -1
@@ -1,27 +1,39 @@
1
- const AnimationSpritesheetPreset = (framesWidth, framesHeight) => {
2
- const animations = [];
3
- for (let y = 0; y < framesHeight; y++) {
4
- for (let x = 0; x < framesWidth; x++) {
5
- const frameIndex = y * framesWidth + x;
6
- animations.push({
7
- time: frameIndex * 10,
8
- frameX: x,
9
- frameY: y
10
- });
11
- }
12
- }
13
- return {
14
- framesWidth,
15
- framesHeight,
16
- textures: {
17
- default: {
18
- animations: () => [
19
- animations
20
- ]
21
- }
22
- }
23
- };
1
+ //#region src/presets/animation.ts
2
+ /**
3
+ * Creates an animation spritesheet preset with automatic frame generation
4
+ *
5
+ * This function generates animation frames based on the provided width and height dimensions.
6
+ * It creates a sequence of frames that progresses through the spritesheet from left to right,
7
+ * top to bottom, with each frame having a 10ms time increment.
8
+ *
9
+ * @param {number} framesWidth - The number of frames horizontally in the spritesheet
10
+ * @param {number} framesHeight - The number of frames vertically in the spritesheet
11
+ * @returns {Object} Animation preset configuration object
12
+ *
13
+ * @example
14
+ * ```javascript
15
+ * // For a 4x4 spritesheet
16
+ * const preset = AnimationSpritesheetPreset(4, 4);
17
+ * // This will generate 16 frames with coordinates from (0,0) to (3,3)
18
+ * ```
19
+ */
20
+ var AnimationSpritesheetPreset = (framesWidth, framesHeight) => {
21
+ const animations = [];
22
+ for (let y = 0; y < framesHeight; y++) for (let x = 0; x < framesWidth; x++) {
23
+ const frameIndex = y * framesWidth + x;
24
+ animations.push({
25
+ time: frameIndex * 10,
26
+ frameX: x,
27
+ frameY: y
28
+ });
29
+ }
30
+ return {
31
+ framesWidth,
32
+ framesHeight,
33
+ textures: { default: { animations: () => [animations] } }
34
+ };
24
35
  };
25
-
36
+ //#endregion
26
37
  export { AnimationSpritesheetPreset };
27
- //# sourceMappingURL=animation.js.map
38
+
39
+ //# sourceMappingURL=animation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"animation.js","sources":["../../src/presets/animation.ts"],"sourcesContent":["/**\n * Creates an animation spritesheet preset with automatic frame generation\n * \n * This function generates animation frames based on the provided width and height dimensions.\n * It creates a sequence of frames that progresses through the spritesheet from left to right,\n * top to bottom, with each frame having a 10ms time increment.\n * \n * @param {number} framesWidth - The number of frames horizontally in the spritesheet\n * @param {number} framesHeight - The number of frames vertically in the spritesheet\n * @returns {Object} Animation preset configuration object\n * \n * @example\n * ```javascript\n * // For a 4x4 spritesheet\n * const preset = AnimationSpritesheetPreset(4, 4);\n * // This will generate 16 frames with coordinates from (0,0) to (3,3)\n * ```\n */\nexport const AnimationSpritesheetPreset = (framesWidth: number, framesHeight: number) => {\n \n const animations: Array<{ time: number; frameX: number; frameY: number }> = [];\n\n for (let y = 0; y < framesHeight; y++) {\n for (let x = 0; x < framesWidth; x++) {\n const frameIndex = y * framesWidth + x;\n animations.push({ \n time: frameIndex * 10, \n frameX: x, \n frameY: y \n });\n }\n }\n \n return {\n framesWidth,\n framesHeight,\n textures: {\n default: {\n animations: () => [\n animations\n ],\n }\n }\n };\n};\n "],"names":[],"mappings":"AAkBO,MAAM,0BAAA,GAA6B,CAAC,WAAA,EAAqB,YAAA,KAAyB;AAErF,EAAA,MAAM,aAAsE,EAAC;AAE7E,EAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,YAAA,EAAc,CAAA,EAAA,EAAK;AACnC,IAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,WAAA,EAAa,CAAA,EAAA,EAAK;AAClC,MAAA,MAAM,UAAA,GAAa,IAAI,WAAA,GAAc,CAAA;AACrC,MAAA,UAAA,CAAW,IAAA,CAAK;AAAA,QACZ,MAAM,UAAA,GAAa,EAAA;AAAA,QACnB,MAAA,EAAQ,CAAA;AAAA,QACR,MAAA,EAAQ;AAAA,OACX,CAAA;AAAA,IACL;AAAA,EACJ;AAEA,EAAA,OAAO;AAAA,IACH,WAAA;AAAA,IACA,YAAA;AAAA,IACA,QAAA,EAAU;AAAA,MACN,OAAA,EAAS;AAAA,QACL,YAAY,MAAM;AAAA,UACd;AAAA;AACJ;AACJ;AACJ,GACJ;AACJ;;;;"}
1
+ {"version":3,"file":"animation.js","names":[],"sources":["../../src/presets/animation.ts"],"sourcesContent":["/**\n * Creates an animation spritesheet preset with automatic frame generation\n * \n * This function generates animation frames based on the provided width and height dimensions.\n * It creates a sequence of frames that progresses through the spritesheet from left to right,\n * top to bottom, with each frame having a 10ms time increment.\n * \n * @param {number} framesWidth - The number of frames horizontally in the spritesheet\n * @param {number} framesHeight - The number of frames vertically in the spritesheet\n * @returns {Object} Animation preset configuration object\n * \n * @example\n * ```javascript\n * // For a 4x4 spritesheet\n * const preset = AnimationSpritesheetPreset(4, 4);\n * // This will generate 16 frames with coordinates from (0,0) to (3,3)\n * ```\n */\nexport const AnimationSpritesheetPreset = (framesWidth: number, framesHeight: number) => {\n \n const animations: Array<{ time: number; frameX: number; frameY: number }> = [];\n\n for (let y = 0; y < framesHeight; y++) {\n for (let x = 0; x < framesWidth; x++) {\n const frameIndex = y * framesWidth + x;\n animations.push({ \n time: frameIndex * 10, \n frameX: x, \n frameY: y \n });\n }\n }\n \n return {\n framesWidth,\n framesHeight,\n textures: {\n default: {\n animations: () => [\n animations\n ],\n }\n }\n };\n};\n "],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,IAAa,8BAA8B,aAAqB,iBAAyB;CAErF,MAAM,aAAsE,EAAE;AAE9E,MAAK,IAAI,IAAI,GAAG,IAAI,cAAc,IAC9B,MAAK,IAAI,IAAI,GAAG,IAAI,aAAa,KAAK;EAClC,MAAM,aAAa,IAAI,cAAc;AACrC,aAAW,KAAK;GACZ,MAAM,aAAa;GACnB,QAAQ;GACR,QAAQ;GACX,CAAC;;AAIV,QAAO;EACH;EACA;EACA,UAAU,EACN,SAAS,EACL,kBAAkB,CACd,WACH,EACJ,EACJ;EACJ"}
@@ -1,24 +1,51 @@
1
- const FacesetPreset = (options, framesWidth, framesHeight, expressions) => {
2
- const textures = {};
3
- Object.keys(expressions).forEach((expressionName) => {
4
- const [frameX, frameY] = expressions[expressionName];
5
- textures[expressionName] = {
6
- animations: () => [
7
- [{
8
- time: 0,
9
- frameX,
10
- frameY
11
- }]
12
- ]
13
- };
14
- });
15
- return {
16
- ...options,
17
- framesWidth,
18
- framesHeight,
19
- textures
20
- };
1
+ //#region src/presets/faceset.ts
2
+ /**
3
+ * Creates a faceset preset for character expressions
4
+ *
5
+ * This preset allows you to define multiple facial expressions for a character,
6
+ * where each expression corresponds to a specific frame position (frameX, frameY)
7
+ * within a single faceset texture. Each expression is defined by its position
8
+ * in the faceset grid.
9
+ *
10
+ * @param options - Object containing the faceset configuration
11
+ * @param framesWidth - Number of frames horizontally in the faceset texture
12
+ * @param framesHeight - Number of frames vertically in the faceset texture
13
+ * @param expressions - Object mapping expression names to their frame positions as tuples [frameX, frameY]
14
+ * @returns Faceset configuration with animations for each expression
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * const faceset = FacesetPreset({
19
+ * id: "facesetId",
20
+ * image: "faceset.png",
21
+ * width: 1024,
22
+ * height: 1024,
23
+ * }, 4, 2, {
24
+ * happy: [0, 0],
25
+ * sad: [1, 0],
26
+ * angry: [2, 0],
27
+ * surprised: [3, 0]
28
+ * });
29
+ * ```
30
+ */
31
+ var FacesetPreset = (options, framesWidth, framesHeight, expressions) => {
32
+ const textures = {};
33
+ Object.keys(expressions).forEach((expressionName) => {
34
+ const [frameX, frameY] = expressions[expressionName];
35
+ textures[expressionName] = { animations: () => [[{
36
+ time: 0,
37
+ frameX,
38
+ frameY
39
+ }]] };
40
+ });
41
+ return {
42
+ ...options,
43
+ framesWidth,
44
+ framesHeight,
45
+ textures
46
+ };
21
47
  };
22
-
48
+ //#endregion
23
49
  export { FacesetPreset };
24
- //# sourceMappingURL=faceset.js.map
50
+
51
+ //# sourceMappingURL=faceset.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"faceset.js","sources":["../../src/presets/faceset.ts"],"sourcesContent":["/**\n * Creates a faceset preset for character expressions\n * \n * This preset allows you to define multiple facial expressions for a character,\n * where each expression corresponds to a specific frame position (frameX, frameY)\n * within a single faceset texture. Each expression is defined by its position\n * in the faceset grid.\n * \n * @param options - Object containing the faceset configuration\n * @param framesWidth - Number of frames horizontally in the faceset texture\n * @param framesHeight - Number of frames vertically in the faceset texture\n * @param expressions - Object mapping expression names to their frame positions as tuples [frameX, frameY]\n * @returns Faceset configuration with animations for each expression\n * \n * @example\n * ```typescript\n * const faceset = FacesetPreset({\n * id: \"facesetId\",\n * image: \"faceset.png\",\n * width: 1024,\n * height: 1024,\n * }, 4, 2, {\n * happy: [0, 0],\n * sad: [1, 0],\n * angry: [2, 0],\n * surprised: [3, 0]\n * });\n * ```\n */\nexport const FacesetPreset = (\n options: any,\n framesWidth: number, \n framesHeight: number,\n expressions: Record<string, [number, number]>,\n) => {\n \n const textures: Record<string, any> = {};\n \n // Create texture configuration for each expression\n Object.keys(expressions).forEach((expressionName) => {\n const [frameX, frameY] = expressions[expressionName];\n textures[expressionName] = {\n animations: () => [\n [{ \n time: 0, \n frameX: frameX, \n frameY: frameY \n }]\n ],\n };\n });\n \n return {\n ...options,\n framesWidth,\n framesHeight,\n textures\n };\n};\n "],"names":[],"mappings":"AA6BO,MAAM,aAAA,GAAgB,CACzB,OAAA,EACA,WAAA,EACA,cACA,WAAA,KACC;AAED,EAAA,MAAM,WAAgC,EAAC;AAGvC,EAAA,MAAA,CAAO,IAAA,CAAK,WAAW,CAAA,CAAE,OAAA,CAAQ,CAAC,cAAA,KAAmB;AACjD,IAAA,MAAM,CAAC,MAAA,EAAQ,MAAM,CAAA,GAAI,YAAY,cAAc,CAAA;AACnD,IAAA,QAAA,CAAS,cAAc,CAAA,GAAI;AAAA,MACvB,YAAY,MAAM;AAAA,QACd,CAAC;AAAA,UACG,IAAA,EAAM,CAAA;AAAA,UACN,MAAA;AAAA,UACA;AAAA,SACH;AAAA;AACL,KACJ;AAAA,EACJ,CAAC,CAAA;AAED,EAAA,OAAO;AAAA,IACH,GAAG,OAAA;AAAA,IACH,WAAA;AAAA,IACA,YAAA;AAAA,IACA;AAAA,GACJ;AACJ;;;;"}
1
+ {"version":3,"file":"faceset.js","names":[],"sources":["../../src/presets/faceset.ts"],"sourcesContent":["/**\n * Creates a faceset preset for character expressions\n * \n * This preset allows you to define multiple facial expressions for a character,\n * where each expression corresponds to a specific frame position (frameX, frameY)\n * within a single faceset texture. Each expression is defined by its position\n * in the faceset grid.\n * \n * @param options - Object containing the faceset configuration\n * @param framesWidth - Number of frames horizontally in the faceset texture\n * @param framesHeight - Number of frames vertically in the faceset texture\n * @param expressions - Object mapping expression names to their frame positions as tuples [frameX, frameY]\n * @returns Faceset configuration with animations for each expression\n * \n * @example\n * ```typescript\n * const faceset = FacesetPreset({\n * id: \"facesetId\",\n * image: \"faceset.png\",\n * width: 1024,\n * height: 1024,\n * }, 4, 2, {\n * happy: [0, 0],\n * sad: [1, 0],\n * angry: [2, 0],\n * surprised: [3, 0]\n * });\n * ```\n */\nexport const FacesetPreset = (\n options: any,\n framesWidth: number, \n framesHeight: number,\n expressions: Record<string, [number, number]>,\n) => {\n \n const textures: Record<string, any> = {};\n \n // Create texture configuration for each expression\n Object.keys(expressions).forEach((expressionName) => {\n const [frameX, frameY] = expressions[expressionName];\n textures[expressionName] = {\n animations: () => [\n [{ \n time: 0, \n frameX: frameX, \n frameY: frameY \n }]\n ],\n };\n });\n \n return {\n ...options,\n framesWidth,\n framesHeight,\n textures\n };\n};\n "],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,IAAa,iBACT,SACA,aACA,cACA,gBACC;CAED,MAAM,WAAgC,EAAE;AAGxC,QAAO,KAAK,YAAY,CAAC,SAAS,mBAAmB;EACjD,MAAM,CAAC,QAAQ,UAAU,YAAY;AACrC,WAAS,kBAAkB,EACvB,kBAAkB,CACd,CAAC;GACG,MAAM;GACE;GACA;GACX,CAAC,CACL,EACJ;GACH;AAEF,QAAO;EACH,GAAG;EACH;EACA;EACA;EACH"}
@@ -1,15 +1,15 @@
1
- const IconPreset = (options) => {
2
- return {
3
- textures: {
4
- default: {
5
- animations: () => [
6
- [{ time: 0, frameX: 0, frameY: 0 }]
7
- ]
8
- }
9
- },
10
- ...options
11
- };
1
+ //#region src/presets/icon.ts
2
+ var IconPreset = (options) => {
3
+ return {
4
+ textures: { default: { animations: () => [[{
5
+ time: 0,
6
+ frameX: 0,
7
+ frameY: 0
8
+ }]] } },
9
+ ...options
10
+ };
12
11
  };
13
-
12
+ //#endregion
14
13
  export { IconPreset };
15
- //# sourceMappingURL=icon.js.map
14
+
15
+ //# sourceMappingURL=icon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"icon.js","sources":["../../src/presets/icon.ts"],"sourcesContent":["export const IconPreset = (options: {\n image: string;\n framesWidth: number;\n framesHeight: number;\n id: string;\n}) => {\n return {\n textures: {\n default: {\n animations: () => [\n [{ time: 0, frameX: 0, frameY: 0 }]\n ]\n }\n },\n ...options\n }\n}"],"names":[],"mappings":"AAAO,MAAM,UAAA,GAAa,CAAC,OAAA,KAKrB;AACF,EAAA,OAAO;AAAA,IACH,QAAA,EAAU;AAAA,MACN,OAAA,EAAS;AAAA,QACL,YAAY,MAAM;AAAA,UACd,CAAC,EAAE,IAAA,EAAM,CAAA,EAAG,QAAQ,CAAA,EAAG,MAAA,EAAQ,GAAG;AAAA;AACtC;AACJ,KACJ;AAAA,IACA,GAAG;AAAA,GACP;AACJ;;;;"}
1
+ {"version":3,"file":"icon.js","names":[],"sources":["../../src/presets/icon.ts"],"sourcesContent":["export const IconPreset = (options: {\n image: string;\n framesWidth: number;\n framesHeight: number;\n id: string;\n}) => {\n return {\n textures: {\n default: {\n animations: () => [\n [{ time: 0, frameX: 0, frameY: 0 }]\n ]\n }\n },\n ...options\n }\n}"],"mappings":";AAAA,IAAa,cAAc,YAKrB;AACF,QAAO;EACH,UAAU,EACN,SAAS,EACL,kBAAkB,CACd,CAAC;GAAE,MAAM;GAAG,QAAQ;GAAG,QAAQ;GAAG,CAAC,CACtC,EACJ,EACJ;EACD,GAAG;EACN"}
@@ -1,16 +1,17 @@
1
- import { AnimationSpritesheetPreset } from './animation.js';
2
- import { LPCSpritesheetPreset } from './lpc.js';
3
- import { RMSpritesheet } from './rmspritesheet.js';
4
- import { FacesetPreset } from './faceset.js';
5
- import { IconPreset } from './icon.js';
6
-
7
- const Presets = {
8
- RMSpritesheet,
9
- LPCSpritesheetPreset,
10
- AnimationSpritesheetPreset,
11
- FacesetPreset,
12
- IconPreset
1
+ import { AnimationSpritesheetPreset } from "./animation.js";
2
+ import { LPCSpritesheetPreset } from "./lpc.js";
3
+ import { RMSpritesheet } from "./rmspritesheet.js";
4
+ import { FacesetPreset } from "./faceset.js";
5
+ import { IconPreset } from "./icon.js";
6
+ //#region src/presets/index.ts
7
+ var Presets = {
8
+ RMSpritesheet,
9
+ LPCSpritesheetPreset,
10
+ AnimationSpritesheetPreset,
11
+ FacesetPreset,
12
+ IconPreset
13
13
  };
14
-
14
+ //#endregion
15
15
  export { Presets };
16
- //# sourceMappingURL=index.js.map
16
+
17
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/presets/index.ts"],"sourcesContent":["import { AnimationSpritesheetPreset } from \"./animation\";\nimport { LPCSpritesheetPreset } from \"./lpc\";\nimport { RMSpritesheet } from \"./rmspritesheet\";\nimport { FacesetPreset } from \"./faceset\";\nimport { IconPreset } from \"./icon\";\n\nexport const Presets = {\n RMSpritesheet,\n LPCSpritesheetPreset,\n AnimationSpritesheetPreset,\n FacesetPreset,\n IconPreset\n}"],"names":[],"mappings":";;;;;;AAMO,MAAM,OAAA,GAAU;AAAA,EACnB,aAAA;AAAA,EACA,oBAAA;AAAA,EACA,0BAAA;AAAA,EACA,aAAA;AAAA,EACA;AACJ;;;;"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/presets/index.ts"],"sourcesContent":["import { AnimationSpritesheetPreset } from \"./animation\";\nimport { LPCSpritesheetPreset } from \"./lpc\";\nimport { RMSpritesheet } from \"./rmspritesheet\";\nimport { FacesetPreset } from \"./faceset\";\nimport { IconPreset } from \"./icon\";\n\nexport const Presets = {\n RMSpritesheet,\n LPCSpritesheetPreset,\n AnimationSpritesheetPreset,\n FacesetPreset,\n IconPreset\n}"],"mappings":";;;;;;AAMA,IAAa,UAAU;CACnB;CACA;CACA;CACA;CACA"}
@@ -1,95 +1,98 @@
1
- import { Animation, Direction } from '@rpgjs/common';
2
-
3
- const LPCSpritesheetPreset = (options) => {
4
- const ratio = options.ratio ?? 1;
5
- const frameY = (direction) => {
6
- return {
7
- [Direction.Down]: 2,
8
- [Direction.Left]: 1,
9
- [Direction.Right]: 3,
10
- [Direction.Up]: 0
11
- }[direction];
12
- };
13
- const stand = (direction) => [
14
- { time: 0, frameX: 0, frameY: frameY(direction) }
15
- ];
16
- const anim = (direction, framesWidth, speed = 5) => {
17
- const array = [];
18
- for (let i = 0; i < framesWidth; i++) {
19
- array.push({ time: i * speed, frameX: i, frameY: frameY(direction) });
20
- }
21
- return array;
22
- };
23
- return {
24
- id: options.id,
25
- image: options.imageSource,
26
- width: options.width,
27
- height: options.height,
28
- opacity: 1,
29
- rectWidth: 64 * ratio,
30
- rectHeight: 64 * ratio,
31
- framesWidth: 6,
32
- framesHeight: 4,
33
- spriteRealSize: {
34
- width: 48 * ratio,
35
- height: 52 * ratio
36
- },
37
- textures: {
38
- [Animation.Stand]: {
39
- offset: {
40
- x: 0,
41
- y: 512 * ratio
42
- },
43
- animations: ({ direction }) => [stand(direction)]
44
- },
45
- [Animation.Walk]: {
46
- offset: {
47
- x: 0,
48
- y: 512 * ratio
49
- },
50
- framesWidth: 9,
51
- framesHeight: 4,
52
- animations: ({ direction }) => [anim(direction, 9)]
53
- },
54
- [Animation.Attack]: {
55
- offset: {
56
- x: 0,
57
- y: 768 * ratio
58
- },
59
- framesWidth: 6,
60
- framesHeight: 4,
61
- animations: ({ direction }) => [anim(direction, 6, 3)]
62
- },
63
- [Animation.Skill]: {
64
- framesWidth: 7,
65
- framesHeight: 4,
66
- animations: ({ direction }) => [anim(direction, 7, 3)]
67
- },
68
- attack2: {
69
- offset: {
70
- x: 0,
71
- y: 256 * ratio
72
- },
73
- framesWidth: 7,
74
- framesHeight: 8,
75
- animations: ({ direction }) => [anim(direction, 7, 3)]
76
- },
77
- ...options.height > 3e3 ? {
78
- attack3: {
79
- offset: {
80
- x: 0,
81
- y: 5568 - 288 * 4
82
- },
83
- rectWidth: 288,
84
- rectHeight: 288,
85
- framesWidth: 6,
86
- framesHeight: 4,
87
- animations: ({ direction }) => [anim(direction, 6, 3)]
88
- }
89
- } : {}
90
- }
91
- };
1
+ import { Animation, Direction } from "@rpgjs/common";
2
+ //#region src/presets/lpc.ts
3
+ var LPCSpritesheetPreset = (options) => {
4
+ const ratio = options.ratio ?? 1;
5
+ const frameY = (direction) => {
6
+ return {
7
+ [Direction.Down]: 2,
8
+ [Direction.Left]: 1,
9
+ [Direction.Right]: 3,
10
+ [Direction.Up]: 0
11
+ }[direction];
12
+ };
13
+ const stand = (direction) => [{
14
+ time: 0,
15
+ frameX: 0,
16
+ frameY: frameY(direction)
17
+ }];
18
+ const anim = (direction, framesWidth, speed = 5) => {
19
+ const array = [];
20
+ for (let i = 0; i < framesWidth; i++) array.push({
21
+ time: i * speed,
22
+ frameX: i,
23
+ frameY: frameY(direction)
24
+ });
25
+ return array;
26
+ };
27
+ return {
28
+ id: options.id,
29
+ image: options.imageSource,
30
+ width: options.width,
31
+ height: options.height,
32
+ opacity: 1,
33
+ rectWidth: 64 * ratio,
34
+ rectHeight: 64 * ratio,
35
+ framesWidth: 6,
36
+ framesHeight: 4,
37
+ spriteRealSize: {
38
+ width: 48 * ratio,
39
+ height: 52 * ratio
40
+ },
41
+ textures: {
42
+ [Animation.Stand]: {
43
+ offset: {
44
+ x: 0,
45
+ y: 512 * ratio
46
+ },
47
+ animations: ({ direction }) => [stand(direction)]
48
+ },
49
+ [Animation.Walk]: {
50
+ offset: {
51
+ x: 0,
52
+ y: 512 * ratio
53
+ },
54
+ framesWidth: 9,
55
+ framesHeight: 4,
56
+ animations: ({ direction }) => [anim(direction, 9)]
57
+ },
58
+ [Animation.Attack]: {
59
+ offset: {
60
+ x: 0,
61
+ y: 768 * ratio
62
+ },
63
+ framesWidth: 6,
64
+ framesHeight: 4,
65
+ animations: ({ direction }) => [anim(direction, 6, 3)]
66
+ },
67
+ [Animation.Skill]: {
68
+ framesWidth: 7,
69
+ framesHeight: 4,
70
+ animations: ({ direction }) => [anim(direction, 7, 3)]
71
+ },
72
+ attack2: {
73
+ offset: {
74
+ x: 0,
75
+ y: 256 * ratio
76
+ },
77
+ framesWidth: 7,
78
+ framesHeight: 8,
79
+ animations: ({ direction }) => [anim(direction, 7, 3)]
80
+ },
81
+ ...options.height > 3e3 ? { attack3: {
82
+ offset: {
83
+ x: 0,
84
+ y: 5568 - 288 * 4
85
+ },
86
+ rectWidth: 288,
87
+ rectHeight: 288,
88
+ framesWidth: 6,
89
+ framesHeight: 4,
90
+ animations: ({ direction }) => [anim(direction, 6, 3)]
91
+ } } : {}
92
+ }
93
+ };
92
94
  };
93
-
95
+ //#endregion
94
96
  export { LPCSpritesheetPreset };
95
- //# sourceMappingURL=lpc.js.map
97
+
98
+ //# sourceMappingURL=lpc.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lpc.js","sources":["../../src/presets/lpc.ts"],"sourcesContent":["import { Animation, Direction } from \"@rpgjs/common\";\n\nexport const LPCSpritesheetPreset = (options: {\n id: string;\n imageSource: string;\n width: number;\n height: number;\n ratio?: number;\n }) => {\n const ratio = options.ratio ?? 1;\n\n const frameY = (direction: Direction) => {\n return {\n [Direction.Down]: 2,\n [Direction.Left]: 1,\n [Direction.Right]: 3,\n [Direction.Up]: 0,\n }[direction];\n };\n \n const stand = (direction: Direction) => [\n { time: 0, frameX: 0, frameY: frameY(direction) },\n ];\n const anim = (\n direction: Direction,\n framesWidth: number,\n speed: number = 5\n ) => {\n const array: any = [];\n for (let i = 0; i < framesWidth; i++) {\n array.push({ time: i * speed, frameX: i, frameY: frameY(direction) });\n }\n return array;\n };\n \n return {\n id: options.id,\n image: options.imageSource,\n width: options.width,\n height: options.height,\n opacity: 1,\n rectWidth: 64 * ratio,\n rectHeight: 64 * ratio,\n framesWidth: 6,\n framesHeight: 4,\n spriteRealSize: {\n width: 48 * ratio,\n height: 52 * ratio,\n },\n textures: {\n [Animation.Stand]: {\n offset: {\n x: 0,\n y: 512 * ratio,\n },\n animations: ({ direction }) => [stand(direction)],\n },\n [Animation.Walk]: {\n offset: {\n x: 0,\n y: 512 * ratio,\n },\n framesWidth: 9,\n framesHeight: 4,\n animations: ({ direction }) => [anim(direction, 9)],\n },\n [Animation.Attack]: {\n offset: {\n x: 0,\n y: 768 * ratio,\n },\n framesWidth: 6,\n framesHeight: 4,\n animations: ({ direction }) => [anim(direction, 6, 3)],\n },\n [Animation.Skill]: {\n framesWidth: 7,\n framesHeight: 4,\n animations: ({ direction }) => [anim(direction, 7, 3)],\n },\n attack2: {\n offset: {\n x: 0,\n y: 256 * ratio,\n },\n framesWidth: 7,\n framesHeight: 8,\n animations: ({ direction }) => [anim(direction, 7, 3)],\n },\n ...(options.height > 3000\n ? {\n attack3: {\n offset: {\n x: 0,\n y: 5568 - 288 * 4,\n },\n rectWidth: 288,\n rectHeight: 288,\n framesWidth: 6,\n framesHeight: 4,\n animations: ({ direction }) => [anim(direction, 6, 3)],\n },\n }\n : {}),\n },\n };\n };\n "],"names":[],"mapp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OAAA,EAAS;AAAA,QACP,MAAA,EAAQ;AAAA,UACN,CAAA,EAAG,CAAA;AAAA,UACH,GAAG,GAAA,GAAM;AAAA,SACX;AAAA,QACA,WAAA,EAAa,CAAA;AAAA,QACb,YAAA,EAAc,CAAA;AAAA,QACd,UAAA,EAAY,CAAC,EAAE,SAAA,EAAU,KAAM,CAAC,IAAA,CAAK,SAAA,EAAW,CAAA,EAAG,CAAC,CAAC;AAAA,OACvD;AAAA,MACA,GAAI,OAAA,CAAQ,MAAA,GAAS,GAAA,GACjB;AAAA,QACE,OAAA,EAAS;AAAA,UACP,MAAA,EAAQ;AAAA,YACN,CAAA,EAAG,CAAA;AAAA,YACH,CAAA,EAAG,OAAO,GAAA,GAAM;AAAA,WAClB;AAAA,UACA,SAAA,EAAW,GAAA;AAAA,UACX,UAAA,EAAY,GAAA;AAAA,UACZ,WAAA,EAAa,CAAA;AAAA,UACb,YAAA,EAAc,CAAA;AAAA,UACd,UAAA,EAAY,CAAC,EAAE,SAAA,EAAU,KAAM,CAAC,IAAA,CAAK,SAAA,EAAW,CAAA,EAAG,CAAC,CAAC;AAAA;AACvD,UAEF;AAAC;AACP,GACF;AACF;;;;"}
1
+ {"version":3,"file":"lpc.js","names":[],"sources":["../../src/presets/lpc.ts"],"sourcesContent":["import { Animation, Direction } from \"@rpgjs/common\";\n\nexport const LPCSpritesheetPreset = (options: {\n id: string;\n imageSource: string;\n width: number;\n height: number;\n ratio?: number;\n }) => {\n const ratio = options.ratio ?? 1;\n\n const frameY = (direction: Direction) => {\n return {\n [Direction.Down]: 2,\n [Direction.Left]: 1,\n [Direction.Right]: 3,\n [Direction.Up]: 0,\n }[direction];\n };\n \n const stand = (direction: Direction) => [\n { time: 0, frameX: 0, frameY: frameY(direction) },\n ];\n const anim = (\n direction: Direction,\n framesWidth: number,\n speed: number = 5\n ) => {\n const array: any = [];\n for (let i = 0; i < framesWidth; i++) {\n array.push({ time: i * speed, frameX: i, frameY: frameY(direction) });\n }\n return array;\n };\n \n return {\n id: options.id,\n image: options.imageSource,\n width: options.width,\n height: options.height,\n opacity: 1,\n rectWidth: 64 * ratio,\n rectHeight: 64 * ratio,\n framesWidth: 6,\n framesHeight: 4,\n spriteRealSize: {\n width: 48 * ratio,\n height: 52 * ratio,\n },\n textures: {\n [Animation.Stand]: {\n offset: {\n x: 0,\n y: 512 * ratio,\n },\n animations: ({ direction }) => [stand(direction)],\n },\n [Animation.Walk]: {\n offset: {\n x: 0,\n y: 512 * ratio,\n },\n framesWidth: 9,\n framesHeight: 4,\n animations: ({ direction }) => [anim(direction, 9)],\n },\n [Animation.Attack]: {\n offset: {\n x: 0,\n y: 768 * ratio,\n },\n framesWidth: 6,\n framesHeight: 4,\n animations: ({ direction }) => [anim(direction, 6, 3)],\n },\n [Animation.Skill]: {\n framesWidth: 7,\n framesHeight: 4,\n animations: ({ direction }) => [anim(direction, 7, 3)],\n },\n attack2: {\n offset: {\n x: 0,\n y: 256 * ratio,\n },\n framesWidth: 7,\n framesHeight: 8,\n animations: ({ direction }) => [anim(direction, 7, 3)],\n },\n ...(options.height > 3000\n ? {\n attack3: {\n offset: {\n x: 0,\n y: 5568 - 288 * 4,\n },\n rectWidth: 288,\n rectHeight: 288,\n framesWidth: 6,\n framesHeight: 4,\n animations: ({ direction }) => [anim(direction, 6, 3)],\n },\n }\n : {}),\n },\n };\n };\n "],"mappings":";;AAEA,IAAa,wBAAwB,YAM7B;CACJ,MAAM,QAAQ,QAAQ,SAAS;CAE/B,MAAM,UAAU,cAAyB;AACvC,SAAO;IACJ,UAAU,OAAO;IACjB,UAAU,OAAO;IACjB,UAAU,QAAQ;IAClB,UAAU,KAAK;GACjB,CAAC;;CAGJ,MAAM,SAAS,cAAyB,CACtC;EAAE,MAAM;EAAG,QAAQ;EAAG,QAAQ,OAAO,UAAU;EAAE,CAClD;CACD,MAAM,QACJ,WACA,aACA,QAAgB,MACb;EACH,MAAM,QAAa,EAAE;AACrB,OAAK,IAAI,IAAI,GAAG,IAAI,aAAa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,41 +1,42 @@
1
- import { Animation, Direction } from '@rpgjs/common';
2
-
3
- const RMSpritesheet = (framesWidth, framesHeight, frameStand = 1) => {
4
- if (framesWidth <= frameStand) {
5
- frameStand = framesWidth - 1;
6
- }
7
- const frameY = (direction) => {
8
- const gap = Math.max(4 - framesHeight, 0);
9
- return {
10
- [Direction.Down]: 0,
11
- [Direction.Left]: Math.max(0, 1 - gap),
12
- [Direction.Right]: Math.max(0, 2 - gap),
13
- [Direction.Up]: Math.max(0, 3 - gap)
14
- }[direction];
15
- };
16
- const stand = (direction) => [{ time: 0, frameX: frameStand, frameY: frameY(direction) }];
17
- const walk = (direction) => {
18
- const array = [];
19
- const durationFrame = 10;
20
- for (let i = 0; i < framesWidth; i++) {
21
- array.push({ time: i * durationFrame, frameX: i, frameY: frameY(direction) });
22
- }
23
- array.push({ time: array[array.length - 1].time + durationFrame });
24
- return array;
25
- };
26
- return {
27
- textures: {
28
- [Animation.Stand]: {
29
- animations: ({ direction }) => [stand(direction)]
30
- },
31
- [Animation.Walk]: {
32
- animations: ({ direction }) => [walk(direction)]
33
- }
34
- },
35
- framesHeight,
36
- framesWidth
37
- };
1
+ import { Animation, Direction } from "@rpgjs/common";
2
+ //#region src/presets/rmspritesheet.ts
3
+ var RMSpritesheet = (framesWidth, framesHeight, frameStand = 1) => {
4
+ if (framesWidth <= frameStand) frameStand = framesWidth - 1;
5
+ const frameY = (direction) => {
6
+ const gap = Math.max(4 - framesHeight, 0);
7
+ return {
8
+ [Direction.Down]: 0,
9
+ [Direction.Left]: Math.max(0, 1 - gap),
10
+ [Direction.Right]: Math.max(0, 2 - gap),
11
+ [Direction.Up]: Math.max(0, 3 - gap)
12
+ }[direction];
13
+ };
14
+ const stand = (direction) => [{
15
+ time: 0,
16
+ frameX: frameStand,
17
+ frameY: frameY(direction)
18
+ }];
19
+ const walk = (direction) => {
20
+ const array = [];
21
+ const durationFrame = 10;
22
+ for (let i = 0; i < framesWidth; i++) array.push({
23
+ time: i * durationFrame,
24
+ frameX: i,
25
+ frameY: frameY(direction)
26
+ });
27
+ array.push({ time: array[array.length - 1].time + durationFrame });
28
+ return array;
29
+ };
30
+ return {
31
+ textures: {
32
+ [Animation.Stand]: { animations: ({ direction }) => [stand(direction)] },
33
+ [Animation.Walk]: { animations: ({ direction }) => [walk(direction)] }
34
+ },
35
+ framesHeight,
36
+ framesWidth
37
+ };
38
38
  };
39
-
39
+ //#endregion
40
40
  export { RMSpritesheet };
41
- //# sourceMappingURL=rmspritesheet.js.map
41
+
42
+ //# sourceMappingURL=rmspritesheet.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rmspritesheet.js","sources":["../../src/presets/rmspritesheet.ts"],"sourcesContent":["import { Direction, Animation } from '@rpgjs/common'\n\nexport const RMSpritesheet = (framesWidth: number, framesHeight: number, frameStand: number = 1) => {\n\n if (framesWidth <= frameStand) {\n frameStand = framesWidth - 1\n }\n\n const frameY = direction => {\n const gap = Math.max(4 - framesHeight, 0)\n return {\n [Direction.Down]: 0,\n [Direction.Left]: Math.max(0, 1 - gap),\n [Direction.Right]: Math.max(0, 2 - gap),\n [Direction.Up]: Math.max(0, 3 - gap)\n }[direction]\n }\n\n const stand = (direction: number) => [{ time: 0, frameX: frameStand, frameY: frameY(direction) }]\n const walk = direction => {\n const array: any = []\n const durationFrame = 10\n for (let i = 0; i < framesWidth; i++) {\n array.push({ time: i * durationFrame, frameX: i, frameY: frameY(direction) })\n }\n array.push({ time: array[array.length - 1].time + durationFrame })\n return array\n }\n\n return {\n textures: {\n [Animation.Stand]: {\n animations: ({direction}) => [stand(direction)]\n },\n [Animation.Walk]: {\n animations: ({direction}) => [walk(direction)]\n }\n },\n framesHeight,\n framesWidth\n }\n}"],"names":[],"mappings":";;AAEO,MAAM,aAAA,GAAgB,CAAC,WAAA,EAAqB,YAAA,EAAsB,aAAqB,CAAA,KAAM;AAEhG,EAAA,IAAI,eAAe,UAAA,EAAY;AAC3B,IAAA,UAAA,GAAa,WAAA,GAAc,CAAA;AAAA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AAC,SAAA,CAAU,KAAK,GAAG;AAAA,QACf,UAAA,EAAY,CAAC,EAAC,SAAA,OAAe,CAAC,KAAA,CAAM,SAAS,CAAC;AAAA,OAClD;AAAA,MACA,CAAC,SAAA,CAAU,IAAI,GAAG;AAAA,QACd,UAAA,EAAY,CAAC,EAAC,SAAA,OAAe,CAAC,IAAA,CAAK,SAAS,CAAC;AAAA;AACjD,KACJ;AAAA,IACA,YAAA;AAAA,IACA;AAAA,GACJ;AACJ;;;;"}
1
+ {"version":3,"file":"rmspritesheet.js","names":[],"sources":["../../src/presets/rmspritesheet.ts"],"sourcesContent":["import { Direction, Animation } from '@rpgjs/common'\n\nexport const RMSpritesheet = (framesWidth: number, framesHeight: number, frameStand: number = 1) => {\n\n if (framesWidth <= frameStand) {\n frameStand = framesWidth - 1\n }\n\n const frameY = direction => {\n const gap = Math.max(4 - framesHeight, 0)\n return {\n [Direction.Down]: 0,\n [Direction.Left]: Math.max(0, 1 - gap),\n [Direction.Right]: Math.max(0, 2 - gap),\n [Direction.Up]: Math.max(0, 3 - gap)\n }[direction]\n }\n\n const stand = (direction: number) => [{ time: 0, frameX: frameStand, frameY: frameY(direction) }]\n const walk = direction => {\n const array: any = []\n const durationFrame = 10\n for (let i = 0; i < framesWidth; i++) {\n array.push({ time: i * durationFrame, frameX: i, frameY: frameY(direction) })\n }\n array.push({ time: array[array.length - 1].time + durationFrame })\n return array\n }\n\n return {\n textures: {\n [Animation.Stand]: {\n animations: ({direction}) => [stand(direction)]\n },\n [Animation.Walk]: {\n animations: ({direction}) => [walk(direction)]\n }\n },\n framesHeight,\n framesWidth\n }\n}"],"mappings":";;AAEA,IAAa,iBAAiB,aAAqB,cAAsB,aAAqB,MAAM;AAEhG,KAAI,eAAe,WACf,cAAa,cAAc;CAG/B,MAAM,UAAS,cAAa;EACxB,MAAM,MAAM,KAAK,IAAI,IAAI,cAAc,EAAE;AACzC,SAAO;IACF,UAAU,OAAO;IACjB,UAAU,OAAO,KAAK,IAAI,GAAG,IAAI,IAAI;IACrC,UAAU,QAAQ,KAAK,IAAI,GAAG,IAAI,IAAI;IACtC,UAAU,KAAK,KAAK,IAAI,GAAG,IAAI,IAAI;GACvC,CAAC;;CAGN,MAAM,SAAS,cAAsB,CAAC;EAAE,MAAM;EAAG,QAAQ;EAAY,QAAQ,OAAO,UAAU;EAAE,CAAC;CACjG,MAAM,QAAO,cAAa;EACtB,MAAM,QAAa,EAAE;EACrB,MAAM,gBAAgB;AACtB,OAAK,IAAI,IAAI,GAAG,IAAI,aAAa,IAC7B,OAAM,KAAK;GAAE,MAAM,IAAI;GAAe,QAAQ;GAAG,QAAQ,OAAO,UAAU;GAAE,CAAC;AAEjF,QAAM,KAAK,EAAE,MAAM,MAAM,MAAM,SAAS,GAAG,OAAO,eAAe,CAAC;AAClE,SAAO;;AAGX,QAAO;EACH,UAAU;IACL,UAAU,QAAQ,EACf,aAAa,EAAC,gBAAe,CAAC,MAAM,UAAU,CAAC,EAClD;IACA,UAAU,OAAO,EACd,aAAa,EAAC,gBAAe,CAAC,KAAK,UAAU,CAAC,EACjD;GACJ;EACD;EACA;EACH"}
@@ -1,9 +1,11 @@
1
- const WebSocketToken = "websocket";
2
- class AbstractWebsocket {
3
- constructor(context) {
4
- this.context = context;
5
- }
6
- }
7
-
1
+ //#region src/services/AbstractSocket.ts
2
+ var WebSocketToken = "websocket";
3
+ var AbstractWebsocket = class {
4
+ constructor(context) {
5
+ this.context = context;
6
+ }
7
+ };
8
+ //#endregion
8
9
  export { AbstractWebsocket, WebSocketToken };
9
- //# sourceMappingURL=AbstractSocket.js.map
10
+
11
+ //# sourceMappingURL=AbstractSocket.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AbstractSocket.js","sources":["../../src/services/AbstractSocket.ts"],"sourcesContent":["import { Context } from \"@signe/di\";\n\nexport const WebSocketToken = \"websocket\";\n\nexport type SocketQueryValue = string | null | undefined;\nexport type SocketQuery = Record<string, SocketQueryValue>;\nexport type SocketUpdateProperties = {\n room: string;\n host?: string;\n query?: SocketQuery;\n};\n\nexport abstract class AbstractWebsocket {\n constructor(protected context: Context) {}\n\n abstract connection(listeners?: (data: any) => void): Promise<void>;\n abstract emit(event: string, data: any): void;\n abstract on(event: string, callback: (data: any) => void): void;\n abstract off(event: string, callback: (data: any) => void): void;\n abstract updateProperties(params: SocketUpdateProperties): void;\n abstract reconnect(listeners?: (data: any) => void): Promise<void>;\n}\n"],"names":[],"mappings":"AAEO,MAAM,cAAA,GAAiB;AAUvB,MAAe,iBAAA,CAAkB;AAAA,EACtC,YAAsB,OAAA,EAAkB;AAAlB,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AAAA,EAAmB;AAQ3C;;;;"}
1
+ {"version":3,"file":"AbstractSocket.js","names":[],"sources":["../../src/services/AbstractSocket.ts"],"sourcesContent":["import { Context } from \"@signe/di\";\n\nexport const WebSocketToken = \"websocket\";\n\nexport type SocketQueryValue = string | null | undefined;\nexport type SocketQuery = Record<string, SocketQueryValue>;\nexport type SocketUpdateProperties = {\n room: string;\n host?: string;\n query?: SocketQuery;\n};\n\nexport abstract class AbstractWebsocket {\n constructor(protected context: Context) {}\n\n abstract connection(listeners?: (data: any) => void): Promise<void>;\n abstract emit(event: string, data: any): void;\n abstract on(event: string, callback: (data: any) => void): void;\n abstract off(event: string, callback: (data: any) => void): void;\n abstract updateProperties(params: SocketUpdateProperties): void;\n abstract reconnect(listeners?: (data: any) => void): Promise<void>;\n}\n"],"mappings":";AAEA,IAAa,iBAAiB;AAU9B,IAAsB,oBAAtB,MAAwC;CACtC,YAAY,SAA4B;AAAlB,OAAA,UAAA"}