@rpgjs/client 5.0.0-alpha.18 → 5.0.0-alpha.19

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 (90) hide show
  1. package/dist/components/dynamics/parse-value.d.ts +1 -0
  2. package/dist/components/index.d.ts +1 -0
  3. package/dist/components/prebuilt/index.d.ts +18 -0
  4. package/dist/index.js +3 -2
  5. package/dist/index.js.map +1 -1
  6. package/dist/index10.js +1 -1
  7. package/dist/index11.js +4 -4
  8. package/dist/index12.js +2 -2
  9. package/dist/index13.js +4 -4
  10. package/dist/index15.js +5 -80
  11. package/dist/index15.js.map +1 -1
  12. package/dist/index16.js +99 -90
  13. package/dist/index16.js.map +1 -1
  14. package/dist/index17.js +82 -218
  15. package/dist/index17.js.map +1 -1
  16. package/dist/index18.js +361 -45
  17. package/dist/index18.js.map +1 -1
  18. package/dist/index19.js +48 -7
  19. package/dist/index19.js.map +1 -1
  20. package/dist/index2.js +7 -7
  21. package/dist/index20.js +5 -383
  22. package/dist/index20.js.map +1 -1
  23. package/dist/index21.js +397 -43
  24. package/dist/index21.js.map +1 -1
  25. package/dist/index22.js +39 -18
  26. package/dist/index22.js.map +1 -1
  27. package/dist/index23.js +17 -2616
  28. package/dist/index23.js.map +1 -1
  29. package/dist/index24.js +2607 -88
  30. package/dist/index24.js.map +1 -1
  31. package/dist/index25.js +107 -64
  32. package/dist/index25.js.map +1 -1
  33. package/dist/index26.js +62 -12
  34. package/dist/index26.js.map +1 -1
  35. package/dist/index27.js +18 -24
  36. package/dist/index27.js.map +1 -1
  37. package/dist/index28.js +19 -87
  38. package/dist/index28.js.map +1 -1
  39. package/dist/index29.js +74 -20
  40. package/dist/index29.js.map +1 -1
  41. package/dist/index3.js +2 -2
  42. package/dist/index30.js +35 -18
  43. package/dist/index30.js.map +1 -1
  44. package/dist/index31.js +22 -3
  45. package/dist/index31.js.map +1 -1
  46. package/dist/index32.js +9 -184
  47. package/dist/index32.js.map +1 -1
  48. package/dist/index33.js +6 -503
  49. package/dist/index33.js.map +1 -1
  50. package/dist/index34.js.map +1 -1
  51. package/dist/index35.js +3687 -24
  52. package/dist/index35.js.map +1 -1
  53. package/dist/index36.js +74 -8
  54. package/dist/index36.js.map +1 -1
  55. package/dist/index37.js +3 -9
  56. package/dist/index37.js.map +1 -1
  57. package/dist/index38.js +25 -10
  58. package/dist/index38.js.map +1 -1
  59. package/dist/index39.js +10 -6
  60. package/dist/index39.js.map +1 -1
  61. package/dist/index4.js +2 -2
  62. package/dist/index40.js +7 -3686
  63. package/dist/index40.js.map +1 -1
  64. package/dist/index41.js +180 -187
  65. package/dist/index41.js.map +1 -1
  66. package/dist/index42.js +498 -71
  67. package/dist/index42.js.map +1 -1
  68. package/dist/index43.js +1 -1
  69. package/dist/index45.js +30 -0
  70. package/dist/index45.js.map +1 -1
  71. package/dist/index5.js +1 -1
  72. package/dist/index51.js +139 -7
  73. package/dist/index51.js.map +1 -1
  74. package/dist/index52.js +9 -0
  75. package/dist/index52.js.map +1 -0
  76. package/dist/index53.js +54 -0
  77. package/dist/index53.js.map +1 -0
  78. package/dist/index6.js +1 -1
  79. package/dist/index7.js +1 -1
  80. package/dist/index8.js +2 -2
  81. package/dist/index9.js +5 -5
  82. package/package.json +10 -10
  83. package/src/Game/Object.ts +36 -2
  84. package/src/components/character.ce +5 -65
  85. package/src/components/dynamics/parse-value.ts +80 -0
  86. package/src/components/dynamics/text.ce +183 -0
  87. package/src/components/index.ts +3 -0
  88. package/src/components/prebuilt/hp-bar.ce +255 -0
  89. package/src/components/prebuilt/index.ts +21 -0
  90. package/src/components/player-components.ce +0 -308
@@ -0,0 +1 @@
1
+ export declare const parseDynamicValue: (value: any, object?: any) => import('canvasengine').ComputedSignal<string>;
@@ -1,3 +1,4 @@
1
1
  import { default as EventLayerComponent } from './scenes/event-layer.ce';
2
2
  import { default as CharacterComponent } from './character.ce';
3
+ export { HpBar } from './prebuilt';
3
4
  export { EventLayerComponent, CharacterComponent };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Prebuilt sprite components for common UI elements
3
+ *
4
+ * This module exports ready-to-use components that can be attached
5
+ * to sprites using componentsInFront or componentsBehind configuration.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * import { HpBar } from '@rpgjs/client/components/prebuilt';
10
+ *
11
+ * export default defineModule<RpgClient>({
12
+ * sprite: {
13
+ * componentsInFront: [HpBar]
14
+ * }
15
+ * })
16
+ * ```
17
+ */
18
+ export { default as HpBar } from './hp-bar.ce';
package/dist/index.js CHANGED
@@ -12,6 +12,7 @@ export { PrebuiltComponentAnimations } from './index12.js';
12
12
  export { Presets } from './index13.js';
13
13
  export { default as EventLayerComponent } from './index14.js';
14
14
  export { default as CharacterComponent } from './index15.js';
15
- export { RpgSound, Sound, getSoundMetadata } from './index16.js';
16
- export { Context } from './index17.js';
15
+ export { default as HpBar } from './index16.js';
16
+ export { RpgSound, Sound, getSoundMetadata } from './index17.js';
17
+ export { Context } from './index18.js';
17
18
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
package/dist/index10.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useProps, useDefineProps, signal, animatedSignal, computed, trigger, mount, effect, h, Container, Rect, cond, Text, Sprite } from 'canvasengine';
2
- import component$1 from './index42.js';
2
+ import component$1 from './index36.js';
3
3
  import { inject } from './index6.js';
4
4
  import { RpgClientEngine } from './index2.js';
5
5
 
package/dist/index11.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { useProps, useDefineProps, computed, h, Container, Rect } from 'canvasengine';
2
2
  import { RpgClientEngine } from './index2.js';
3
- import './index23.js';
3
+ import './index24.js';
4
4
  import '@rpgjs/common';
5
- import './index17.js';
5
+ import './index18.js';
6
6
  import { inject } from './index6.js';
7
7
  import 'rxjs';
8
- import './index24.js';
9
- import './index16.js';
8
+ import './index25.js';
9
+ import './index17.js';
10
10
  import '@canvasengine/presets';
11
11
 
12
12
  function component($$props) {
package/dist/index12.js CHANGED
@@ -1,5 +1,5 @@
1
- import component$1 from './index25.js';
2
- import component from './index26.js';
1
+ import component$1 from './index26.js';
2
+ import component from './index27.js';
3
3
 
4
4
  const PrebuiltComponentAnimations = {
5
5
  Hit: component$1,
package/dist/index13.js CHANGED
@@ -1,7 +1,7 @@
1
- import { AnimationSpritesheetPreset } from './index27.js';
2
- import { LPCSpritesheetPreset } from './index28.js';
3
- import { RMSpritesheet } from './index29.js';
4
- import { FacesetPreset } from './index30.js';
1
+ import { AnimationSpritesheetPreset } from './index28.js';
2
+ import { LPCSpritesheetPreset } from './index29.js';
3
+ import { RMSpritesheet } from './index30.js';
4
+ import { FacesetPreset } from './index31.js';
5
5
 
6
6
  const Presets = {
7
7
  RMSpritesheet,
package/dist/index15.js CHANGED
@@ -1,10 +1,9 @@
1
- import { useProps, useDefineProps, computed, signal, animatedSignal, mount, tick, h, Container, loop, cond, Sprite } from 'canvasengine';
1
+ import { useProps, useDefineProps, computed, signal, animatedSignal, mount, tick, h, Container, loop, Sprite } from 'canvasengine';
2
2
  import { combineLatest, map, startWith, pairwise, filter, lastValueFrom } from 'rxjs';
3
3
  import { Particle } from '@canvasengine/presets';
4
4
  import { Direction, ModulesToken } from '@rpgjs/common';
5
5
  import { RpgClientEngine } from './index2.js';
6
6
  import { inject } from './index6.js';
7
- import component$1 from './index41.js';
8
7
 
9
8
  function component($$props) {
10
9
  useProps($$props);
@@ -53,65 +52,7 @@ var playerId = client.playerId;
53
52
  var componentsBehind = client.spriteComponentsBehind;
54
53
  var componentsInFront = client.spriteComponentsInFront;
55
54
  var isMe = computed(function () { return id() === playerId; });
56
- var x = object.x, y = object.y, tint = object.tint, direction = object.direction, animationName = object.animationName, animationCurrentIndex = object.animationCurrentIndex, emitParticleTrigger = object.emitParticleTrigger, particleName = object.particleName, graphics = object.graphics, hitbox = object.hitbox, isConnected = object.isConnected, componentsTop = object.componentsTop, componentsBottom = object.componentsBottom; object.componentsCenter; object.componentsLeft; object.componentsRight;
57
- var componentsTopData = computed(function () {
58
- var data = componentsTop === null || componentsTop === void 0 ? void 0 : componentsTop();
59
- if (!data)
60
- return null;
61
- try {
62
- return typeof data === 'string' ? JSON.parse(data) : data;
63
- }
64
- catch (_a) {
65
- return null;
66
- }
67
- });
68
- var componentsBottomData = computed(function () {
69
- var data = componentsBottom === null || componentsBottom === void 0 ? void 0 : componentsBottom();
70
- if (!data)
71
- return null;
72
- try {
73
- return typeof data === 'string' ? JSON.parse(data) : data;
74
- }
75
- catch (_a) {
76
- return null;
77
- }
78
- });
79
- computed(function () {
80
- var _a;
81
- var data = (_a = object.componentsCenter) === null || _a === void 0 ? void 0 : _a.call(object);
82
- if (!data)
83
- return null;
84
- try {
85
- return typeof data === 'string' ? JSON.parse(data) : data;
86
- }
87
- catch (_b) {
88
- return null;
89
- }
90
- });
91
- computed(function () {
92
- var _a;
93
- var data = (_a = object.componentsLeft) === null || _a === void 0 ? void 0 : _a.call(object);
94
- if (!data)
95
- return null;
96
- try {
97
- return typeof data === 'string' ? JSON.parse(data) : data;
98
- }
99
- catch (_b) {
100
- return null;
101
- }
102
- });
103
- computed(function () {
104
- var _a;
105
- var data = (_a = object.componentsRight) === null || _a === void 0 ? void 0 : _a.call(object);
106
- if (!data)
107
- return null;
108
- try {
109
- return typeof data === 'string' ? JSON.parse(data) : data;
110
- }
111
- catch (_b) {
112
- return null;
113
- }
114
- });
55
+ var x = object.x, y = object.y, tint = object.tint, direction = object.direction, animationName = object.animationName, animationCurrentIndex = object.animationCurrentIndex, emitParticleTrigger = object.emitParticleTrigger, particleName = object.particleName; object.graphics; var hitbox = object.hitbox, isConnected = object.isConnected, graphicsSignals = object.graphicsSignals;
115
56
  var particleSettings = client.particleSettings;
116
57
  var canControls = function () { return isMe() && object.canMove(); };
117
58
  var keyboardControls = client.globalConfig.keyboardControls;
@@ -179,9 +120,9 @@ var xSubscription = x.observable.subscribe(function (value) {
179
120
  var ySubscription = y.observable.subscribe(function (value) {
180
121
  smoothY.set(value);
181
122
  });
182
- var sheet = function (graphicId) {
123
+ var sheet = function (graphicObject) {
183
124
  return {
184
- definition: client.getSpriteSheet(graphicId),
125
+ definition: graphicObject,
185
126
  playing: realAnimationName,
186
127
  params: {
187
128
  direction: direction
@@ -246,26 +187,10 @@ mount(function (element) {
246
187
  hooks.callHooks("client-sprite-onAdd", object).subscribe();
247
188
  hooks.callHooks("client-sceneMap-onAddSprite", client.sceneMap, object).subscribe();
248
189
  });
249
- var getComponentsTopY = function () {
250
- var _a, _b;
251
- var layout = ((_a = componentsTopData()) === null || _a === void 0 ? void 0 : _a.layout) || {};
252
- var hitboxValue = typeof hitbox === 'function' ? hitbox() : hitbox;
253
- var playerHeight = (hitboxValue === null || hitboxValue === void 0 ? void 0 : hitboxValue.h) || 32;
254
- var marginBottom = (_b = layout.marginBottom) !== null && _b !== void 0 ? _b : 0;
255
- return -(playerHeight / 2) - marginBottom;
256
- };
257
- var getComponentsBottomY = function () {
258
- var _a, _b;
259
- var layout = ((_a = componentsBottomData()) === null || _a === void 0 ? void 0 : _a.layout) || {};
260
- var hitboxValue = typeof hitbox === 'function' ? hitbox() : hitbox;
261
- var playerHeight = (hitboxValue === null || hitboxValue === void 0 ? void 0 : hitboxValue.h) || 32;
262
- var marginTop = (_b = layout.marginTop) !== null && _b !== void 0 ? _b : 0;
263
- return (playerHeight / 2) + marginTop;
264
- };
265
190
  tick(function () {
266
191
  hooks.callHooks("client-sprite-onUpdate").subscribe();
267
192
  });
268
- let $this = h(Container, { x: smoothX, y: smoothY, zIndex: y, viewportFollow: isMe, controls, onBeforeDestroy, visible }, [loop(componentsBehind, component => h(Container, null, h(component, { object }))), h(Particle, { emit: emitParticleTrigger, settings: particleSettings, zIndex: 1000, name: particleName }), cond(componentsTopData, () => h(Container, { y: computed(() => getComponentsTopY()), anchor: [0.5, 1] }, h(component$1, { componentsData: componentsTopData, object: object }))), h(Container, null, loop(graphics, graphicId => h(Sprite, { sheet: sheet(graphicId), direction, tint, hitbox }))), cond(componentsBottomData, () => h(Container, { y: computed(() => getComponentsBottomY()), anchor: [0.5, 0] }, h(component$1, { componentsData: componentsBottomData, object: object }))), loop(componentsInFront, component => h(Container, null, h(component, { object })))]);
193
+ let $this = h(Container, { x: smoothX, y: smoothY, zIndex: y, viewportFollow: isMe, controls, onBeforeDestroy, visible }, [loop(componentsBehind, component => h(Container, null, h(component, { object }))), h(Particle, { emit: emitParticleTrigger, settings: particleSettings, zIndex: 1000, name: particleName }), h(Container, null, loop(graphicsSignals, graphicObj => h(Sprite, { sheet: sheet(graphicObj), direction, tint, hitbox }))), loop(componentsInFront, component => h(Container, null, h(component, { object })))]);
269
194
  return $this
270
195
  }
271
196
 
@@ -1 +1 @@
1
- {"version":3,"file":"index15.js","sources":["../src/components/character.ce"],"sourcesContent":["<Container x={smoothX} y={smoothY} zIndex={y} viewportFollow={isMe} controls onBeforeDestroy visible>\n @for (component of componentsBehind) {\n <Container>\n <component object />\n </Container>\n } \n <Particle emit={@emitParticleTrigger} settings={@particleSettings} zIndex={1000} name={particleName} />\n @if (componentsTopData) {\n <Container y={@getComponentsTopY()} anchor={[0.5, 1]}>\n <PlayerComponents componentsData={componentsTopData} object={object} />\n </Container>\n }\n <Container>\n @for (graphicId of graphics) {\n <Sprite sheet={@sheet(@graphicId)} direction tint hitbox />\n }\n </Container>\n @if (componentsBottomData) {\n <Container y={@getComponentsBottomY()} anchor={[0.5, 0]}>\n <PlayerComponents componentsData={componentsBottomData} object={object} />\n </Container>\n }\n @for (component of componentsInFront) {\n <Container>\n <component object />\n </Container>\n } \n</Container>\n\n<script>\n import { signal, effect, mount, computed, tick, animatedSignal } from \"canvasengine\";\n import { lastValueFrom, combineLatest, pairwise, filter, map, startWith } from \"rxjs\";\n import { Particle } from \"@canvasengine/presets\";\n import { GameEngineToken, ModulesToken } 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 import PlayerComponents from \"./player-components.ce\";\n\n const { object, id } = defineProps();\n\n const client = inject(RpgClientEngine);\n const hooks = inject(ModulesToken);\n\n const spritesheets = client.spritesheets;\n const playerId = client.playerId;\n const componentsBehind = client.spriteComponentsBehind;\n const componentsInFront = client.spriteComponentsInFront;\n const isMe = computed(() => id() === playerId);\n\n const { \n x, \n y, \n tint, \n direction, \n animationName, \n animationCurrentIndex,\n emitParticleTrigger, \n particleName, \n graphics, \n hitbox,\n isConnected,\n componentsTop,\n componentsBottom,\n componentsCenter,\n componentsLeft,\n componentsRight,\n } = object;\n\n const componentsTopData = computed(() => {\n const data = componentsTop?.();\n if (!data) return null;\n try {\n return typeof data === 'string' ? JSON.parse(data) : data;\n } catch {\n return null;\n }\n });\n const componentsBottomData = computed(() => {\n const data = componentsBottom?.();\n if (!data) return null;\n try {\n return typeof data === 'string' ? JSON.parse(data) : data;\n } catch {\n return null;\n }\n });\n const componentsCenterData = computed(() => {\n const data = object.componentsCenter?.();\n if (!data) return null;\n try {\n return typeof data === 'string' ? JSON.parse(data) : data;\n } catch {\n return null;\n }\n });\n const componentsLeftData = computed(() => {\n const data = object.componentsLeft?.();\n if (!data) return null;\n try {\n return typeof data === 'string' ? JSON.parse(data) : data;\n } catch {\n return null;\n }\n });\n const componentsRightData = computed(() => {\n const data = object.componentsRight?.();\n if (!data) return null;\n try {\n return typeof data === 'string' ? JSON.parse(data) : data;\n } catch {\n return null;\n }\n });\n\n const particleSettings = client.particleSettings;\n\n const canControls = () => isMe() && object.canMove()\n const keyboardControls = client.globalConfig.keyboardControls;\n\n const visible = computed(() => {\n if (object.type === 'event') {\n return true\n }\n return isConnected()\n });\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 smoothX = animatedSignal(x(), {\n duration: isMe() ? 0 : 0\n });\n\n const smoothY = animatedSignal(y(), {\n duration: isMe() ? 0 : 0,\n });\n\n const realAnimationName = signal(animationName());\n\n const xSubscription = x.observable.subscribe((value) => {\n smoothX.set(value);\n });\n\n const ySubscription = y.observable.subscribe((value) => {\n smoothY.set(value);\n });\n \n const sheet = (graphicId) => {\n return {\n definition: client.getSpriteSheet(graphicId),\n playing: realAnimationName,\n params: {\n direction\n },\n onFinish() {\n animationCurrentIndex.update(index => index + 1)\n }\n };\n }\n\n // Combine animation change detection with movement state from smoothX/smoothY\n const movementAnimations = ['walk', 'stand'];\n const epsilon = 0; // movement threshold to consider the easing still running\n\n const stateX$ = smoothX.animatedState.observable;\n const stateY$ = smoothY.animatedState.observable;\n const animationName$ = animationName.observable;\n\n const moving$ = combineLatest([stateX$, stateY$]).pipe(\n map(([sx, sy]) => {\n const xFinished = Math.abs(sx.value.current - sx.value.end) <= epsilon;\n const yFinished = Math.abs(sy.value.current - sy.value.end) <= epsilon;\n return !xFinished || !yFinished; // moving if X or Y is not finished\n }),\n startWith(false)\n );\n\n const animationChange$ = animationName$.pipe(\n startWith(animationName()),\n pairwise(),\n filter(([prev, curr]) => prev !== curr)\n );\n\n const animationMovementSubscription = combineLatest([animationChange$, moving$]).subscribe(([[prev, curr], isMoving]) => {\n if (curr == 'stand' && !isMoving) {\n realAnimationName.set(curr);\n }\n else if (curr == 'walk' && isMoving) {\n realAnimationName.set(curr);\n }\n else if (!movementAnimations.includes(curr)) {\n realAnimationName.set(curr);\n }\n if (!isMoving && object.animationIsPlaying && object.animationIsPlaying()) {\n if (movementAnimations.includes(curr)) {\n if (typeof object.resetAnimationState === 'function') {\n object.resetAnimationState();\n }\n }\n }\n });\n\n /**\n * Cleanup subscriptions and call hooks before sprite destruction.\n *\n * # Design\n * - Prevent memory leaks by unsubscribing from all local subscriptions created in this component.\n * - Execute destruction hooks to notify modules and scene map of sprite removal.\n *\n * @example\n * await onBeforeDestroy();\n */\n const onBeforeDestroy = async () => {\n animationMovementSubscription.unsubscribe();\n xSubscription.unsubscribe();\n ySubscription.unsubscribe();\n await lastValueFrom(hooks.callHooks(\"client-sprite-onDestroy\", object)) \n await lastValueFrom(hooks.callHooks(\"client-sceneMap-onRemoveSprite\", client.sceneMap, object))\n }\n\n mount((element) => {\n hooks.callHooks(\"client-sprite-onAdd\", object).subscribe()\n hooks.callHooks(\"client-sceneMap-onAddSprite\", client.sceneMap, object).subscribe()\n })\n\n /**\n * Calculate Y position for components above player\n */\n const getComponentsTopY = () => {\n const layout = componentsTopData()?.layout || {};\n const hitboxValue = typeof hitbox === 'function' ? hitbox() : hitbox;\n const playerHeight = hitboxValue?.h || 32;\n const marginBottom = layout.marginBottom ?? 0;\n return -(playerHeight / 2) - marginBottom;\n };\n\n /**\n * Calculate Y position for components below player\n */\n const getComponentsBottomY = () => {\n const layout = componentsBottomData()?.layout || {};\n const hitboxValue = typeof hitbox === 'function' ? hitbox() : hitbox;\n const playerHeight = hitboxValue?.h || 32;\n const marginTop = layout.marginTop ?? 0;\n return (playerHeight / 2) + marginTop;\n };\n\n tick(() => {\n hooks.callHooks(\"client-sprite-onUpdate\").subscribe()\n })\n</script>"],"names":["PlayerComponents"],"mappings":";;;;;;;;AAcqB,SAAS,SAAS,CAAC,OAAO,EAAE;AACjD,QAAuB,QAAQ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,CAAC,EAAE,QAAQ,CAAC,MAAM,oBAAoB,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAACA,WAAgB,EAAE,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,SAAS,IAAI,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;AAC53B,QAAQ,OAAO;AACf,MAAM;;;;"}
1
+ {"version":3,"file":"index15.js","sources":["../src/components/character.ce"],"sourcesContent":["<Container x={smoothX} y={smoothY} zIndex={y} viewportFollow={isMe} controls onBeforeDestroy visible>\n @for (component of componentsBehind) {\n <Container>\n <component object />\n </Container>\n } \n <Particle emit={@emitParticleTrigger} settings={@particleSettings} zIndex={1000} name={particleName} />\n <Container>\n @for (graphicObj of graphicsSignals) {\n <Sprite sheet={@sheet(@graphicObj)} direction tint hitbox />\n }\n </Container>\n @for (component of componentsInFront) {\n <Container>\n <component object />\n </Container>\n } \n</Container>\n\n<script>\n import { signal, effect, mount, computed, tick, animatedSignal } from \"canvasengine\";\n import { lastValueFrom, combineLatest, pairwise, filter, map, startWith } from \"rxjs\";\n import { Particle } from \"@canvasengine/presets\";\n import { GameEngineToken, ModulesToken } 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 import PlayerComponents from \"./player-components.ce\";\n\n const { object, id } = defineProps();\n\n const client = inject(RpgClientEngine);\n const hooks = inject(ModulesToken);\n\n const spritesheets = client.spritesheets;\n const playerId = client.playerId;\n const componentsBehind = client.spriteComponentsBehind;\n const componentsInFront = client.spriteComponentsInFront;\n const isMe = computed(() => id() === playerId);\n\n const { \n x, \n y, \n tint, \n direction, \n animationName, \n animationCurrentIndex,\n emitParticleTrigger, \n particleName, \n graphics, \n hitbox,\n isConnected,\n graphicsSignals\n } = object;\n\n const particleSettings = client.particleSettings;\n\n const canControls = () => isMe() && object.canMove()\n const keyboardControls = client.globalConfig.keyboardControls;\n\n const visible = computed(() => {\n if (object.type === 'event') {\n return true\n }\n return isConnected()\n });\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 smoothX = animatedSignal(x(), {\n duration: isMe() ? 0 : 0\n });\n\n const smoothY = animatedSignal(y(), {\n duration: isMe() ? 0 : 0,\n });\n\n const realAnimationName = signal(animationName());\n\n const xSubscription = x.observable.subscribe((value) => {\n smoothX.set(value);\n });\n\n const ySubscription = y.observable.subscribe((value) => {\n smoothY.set(value);\n });\n \n const sheet = (graphicObject) => {\n return {\n definition: graphicObject,\n playing: realAnimationName,\n params: {\n direction\n },\n onFinish() {\n animationCurrentIndex.update(index => index + 1)\n }\n };\n }\n\n // Combine animation change detection with movement state from smoothX/smoothY\n const movementAnimations = ['walk', 'stand'];\n const epsilon = 0; // movement threshold to consider the easing still running\n\n const stateX$ = smoothX.animatedState.observable;\n const stateY$ = smoothY.animatedState.observable;\n const animationName$ = animationName.observable;\n\n const moving$ = combineLatest([stateX$, stateY$]).pipe(\n map(([sx, sy]) => {\n const xFinished = Math.abs(sx.value.current - sx.value.end) <= epsilon;\n const yFinished = Math.abs(sy.value.current - sy.value.end) <= epsilon;\n return !xFinished || !yFinished; // moving if X or Y is not finished\n }),\n startWith(false)\n );\n\n const animationChange$ = animationName$.pipe(\n startWith(animationName()),\n pairwise(),\n filter(([prev, curr]) => prev !== curr)\n );\n\n const animationMovementSubscription = combineLatest([animationChange$, moving$]).subscribe(([[prev, curr], isMoving]) => {\n if (curr == 'stand' && !isMoving) {\n realAnimationName.set(curr);\n }\n else if (curr == 'walk' && isMoving) {\n realAnimationName.set(curr);\n }\n else if (!movementAnimations.includes(curr)) {\n realAnimationName.set(curr);\n }\n if (!isMoving && object.animationIsPlaying && object.animationIsPlaying()) {\n if (movementAnimations.includes(curr)) {\n if (typeof object.resetAnimationState === 'function') {\n object.resetAnimationState();\n }\n }\n }\n });\n\n /**\n * Cleanup subscriptions and call hooks before sprite destruction.\n *\n * # Design\n * - Prevent memory leaks by unsubscribing from all local subscriptions created in this component.\n * - Execute destruction hooks to notify modules and scene map of sprite removal.\n *\n * @example\n * await onBeforeDestroy();\n */\n const onBeforeDestroy = async () => {\n animationMovementSubscription.unsubscribe();\n xSubscription.unsubscribe();\n ySubscription.unsubscribe();\n await lastValueFrom(hooks.callHooks(\"client-sprite-onDestroy\", object)) \n await lastValueFrom(hooks.callHooks(\"client-sceneMap-onRemoveSprite\", client.sceneMap, object))\n }\n\n mount((element) => {\n hooks.callHooks(\"client-sprite-onAdd\", object).subscribe()\n hooks.callHooks(\"client-sceneMap-onAddSprite\", client.sceneMap, object).subscribe()\n })\n\n /**\n * Calculate Y position for components above player\n */\n const getComponentsTopY = () => {\n const layout = componentsTopData()?.layout || {};\n const hitboxValue = typeof hitbox === 'function' ? hitbox() : hitbox;\n const playerHeight = hitboxValue?.h || 32;\n const marginBottom = layout.marginBottom ?? 0;\n return -(playerHeight / 2) - marginBottom;\n };\n\n /**\n * Calculate Y position for components below player\n */\n const getComponentsBottomY = () => {\n const layout = componentsBottomData()?.layout || {};\n const hitboxValue = typeof hitbox === 'function' ? hitbox() : hitbox;\n const playerHeight = hitboxValue?.h || 32;\n const marginTop = layout.marginTop ?? 0;\n return (playerHeight / 2) + marginTop;\n };\n\n tick(() => {\n hooks.callHooks(\"client-sprite-onUpdate\").subscribe()\n })\n</script>"],"names":[],"mappings":";;;;;;;AAaqB,SAAS,SAAS,CAAC,OAAO,EAAE;AACjD,QAAuB,QAAQ,CAAC,OAAO;AACvC,QAAQ,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO;AAClD,QAAQ,IAAI,SAAS,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,SAAS,KAAK,UAAU,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE;AACjG,IAAI,SAAS,KAAK,CAAC,KAAK,EAAE,EAAE,OAAO,KAAK,YAAY,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC,UAAU,OAAO,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/G,IAAI,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,EAAE,UAAU,OAAO,EAAE,MAAM,EAAE;AAC/D,QAAQ,SAAS,SAAS,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClG,QAAQ,SAAS,QAAQ,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrG,QAAQ,SAAS,IAAI,CAAC,MAAM,EAAE,EAA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AAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;AAC9gB,QAAQ,OAAO;AACf,MAAM;;;;"}
package/dist/index16.js CHANGED
@@ -1,97 +1,106 @@
1
- import { Howler } from 'canvasengine';
1
+ import { useProps, useDefineProps, computed, animatedSignal, effect, h, Container, Graphics } from 'canvasengine';
2
2
 
3
- const SOUND_METADATA_KEY = Symbol("rpgjs:sound");
4
- function Sound(options) {
5
- return function(constructor) {
6
- const metadata = {
7
- id: options.id,
8
- sound: options.sound,
9
- sounds: options.sounds,
10
- loop: options.loop,
11
- volume: options.volume
12
- };
13
- constructor[SOUND_METADATA_KEY] = metadata;
14
- return constructor;
15
- };
16
- }
17
- function getSoundMetadata(soundClass) {
18
- return soundClass[SOUND_METADATA_KEY];
19
- }
20
- class RpgSound {
21
- static {
22
- this.engine = null;
23
- }
24
- /**
25
- * Initialize RpgSound with the engine instance
26
- *
27
- * This is called automatically by the engine during initialization.
28
- *
29
- * @param engine - The RpgClientEngine instance
30
- */
31
- static init(engine) {
32
- RpgSound.engine = engine;
33
- }
34
- /**
35
- * Get a sound by its ID
36
- *
37
- * Retrieves a Howler sound instance from the engine's sound cache.
38
- * The sound must be registered beforehand (via @Sound decorator or manually).
39
- *
40
- * @param id - The sound identifier
41
- * @returns The Howler sound instance, or undefined if not found
42
- *
43
- * @example
44
- * ```ts
45
- * // Get and play a sound
46
- * const sound = RpgSound.get('town-music');
47
- * if (sound) {
48
- * sound.play();
49
- * }
50
- *
51
- * // Chain methods
52
- * RpgSound.get('battle-theme')?.volume(0.8).play();
53
- * ```
54
- */
55
- static get(id) {
56
- if (!RpgSound.engine) {
57
- console.warn("RpgSound not initialized. Make sure the engine has started.");
58
- return void 0;
3
+ function component($$props) {
4
+ useProps($$props);
5
+ const defineProps = useDefineProps($$props);
6
+ var object = defineProps().object;
7
+ var barWidth = 50;
8
+ var barHeight = 8;
9
+ var borderRadius = 4;
10
+ var innerRadius = 3;
11
+ var padding = 1;
12
+ var bgColor = 0x16213e;
13
+ var shadowColor = 0x000000;
14
+ var borderColor = 0x4a5568;
15
+ var maxFillWidth = barWidth - (padding * 2);
16
+ var fillHeight = barHeight - (padding * 2);
17
+ var highlightHeight = Math.floor(fillHeight / 2);
18
+ var hitbox = object.hitbox;
19
+ var currentHp = computed(function () {
20
+ var _a, _b;
21
+ return (_b = (_a = object.hpSignal) === null || _a === void 0 ? void 0 : _a.call(object)) !== null && _b !== void 0 ? _b : 0;
22
+ });
23
+ var maxHp = computed(function () {
24
+ var _a, _b, _c;
25
+ var params = (_b = (_a = object._param) === null || _a === void 0 ? void 0 : _a.call(object)) !== null && _b !== void 0 ? _b : {};
26
+ return (_c = params.maxHp) !== null && _c !== void 0 ? _c : 100;
27
+ });
28
+ var hpPercent = computed(function () {
29
+ var max = maxHp();
30
+ if (max <= 0)
31
+ return 0;
32
+ var percent = currentHp() / max;
33
+ return Math.max(0, Math.min(1, percent));
34
+ });
35
+ var animatedPercent = animatedSignal(hpPercent(), {
36
+ duration: 300,
37
+ easing: 'easeOutCubic'
38
+ });
39
+ effect(function () {
40
+ var newPercent = hpPercent();
41
+ animatedPercent.set(newPercent);
42
+ });
43
+ var position = computed(function () { return ({
44
+ x: (hitbox().w / 2) - (barWidth / 2),
45
+ y: -barHeight - 8
46
+ }); });
47
+ var fillWidth = computed(function () {
48
+ var percent = animatedPercent();
49
+ var width = maxFillWidth * percent;
50
+ // Ensure minimum visible width when HP > 0
51
+ if (percent > 0 && width < innerRadius * 2) {
52
+ return innerRadius * 2;
59
53
  }
60
- const sound = RpgSound.engine.sounds.get(id);
61
- if (!sound) {
62
- console.warn(`Sound with id "${id}" not found`);
63
- return void 0;
54
+ return Math.max(0, width);
55
+ });
56
+ var hpColorHex = computed(function () {
57
+ var percent = hpPercent();
58
+ if (percent > 0.6) {
59
+ return 0x4ade80; // Green - healthy
64
60
  }
65
- if (sound && typeof sound.play === "function") {
66
- return sound;
61
+ else if (percent > 0.3) {
62
+ return 0xfacc15; // Yellow - caution
67
63
  }
68
- if (sound && sound.src) {
69
- return sound;
64
+ else if (percent > 0.15) {
65
+ return 0xfb923c; // Orange - danger
70
66
  }
71
- return sound;
72
- }
73
- /**
74
- * Global Howler instance for managing all sounds
75
- *
76
- * Provides access to Howler.js global methods for controlling all sounds
77
- * at once (volume, mute, etc.).
78
- *
79
- * @example
80
- * ```ts
81
- * // Set global volume to 20%
82
- * RpgSound.global.volume(0.2)
83
- *
84
- * // Mute all sounds
85
- * RpgSound.global.mute(true)
86
- *
87
- * // Unmute all sounds
88
- * RpgSound.global.mute(false)
89
- * ```
90
- */
91
- static get global() {
92
- return Howler;
93
- }
94
- }
67
+ else {
68
+ return 0xef4444; // Red - critical
69
+ }
70
+ });
71
+ var drawShadow = function (g) {
72
+ g.roundRect(0, 0, barWidth, barHeight, borderRadius);
73
+ g.fill({ color: shadowColor, alpha: 0.3 });
74
+ };
75
+ var drawBackground = function (g) {
76
+ g.roundRect(0, 0, barWidth, barHeight, borderRadius);
77
+ g.fill({ color: bgColor, alpha: 0.9 });
78
+ };
79
+ var drawFill = function (g) {
80
+ var width = fillWidth();
81
+ if (width > 0) {
82
+ g.roundRect(padding, padding, width, fillHeight, innerRadius);
83
+ g.fill({ color: hpColorHex() });
84
+ }
85
+ };
86
+ var drawHighlight = function (g) {
87
+ var width = fillWidth();
88
+ if (width > 0) {
89
+ g.roundRect(padding, padding, width, highlightHeight, innerRadius);
90
+ g.fill({ color: 0xffffff, alpha: 0.25 });
91
+ }
92
+ };
93
+ var drawBorder = function (g) {
94
+ g.roundRect(0, 0, barWidth, barHeight, borderRadius);
95
+ g.stroke({
96
+ color: borderColor,
97
+ width: 1,
98
+ alpha: 0.7
99
+ });
100
+ };
101
+ let $this = [,h(Container, { x: computed(() => position().x), y: computed(() => position().y) }, [h(Graphics, { draw: drawShadow, x: 1, y: 1 }), h(Graphics, { draw: drawBackground }), h(Graphics, { draw: drawFill }), h(Graphics, { draw: drawHighlight }), h(Graphics, { draw: drawBorder })])];
102
+ return $this
103
+ }
95
104
 
96
- export { RpgSound, Sound, getSoundMetadata };
105
+ export { component as default };
97
106
  //# sourceMappingURL=index16.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index16.js","sources":["../src/Sound.ts"],"sourcesContent":["import { Howler } from 'canvasengine';\nimport { RpgClientEngine } from './RpgClientEngine';\nimport { inject } from './core/inject';\n\n/**\n * Sound decorator options\n * \n * Defines the configuration for a sound that can be played in the game.\n * The sound can be a single file or multiple files (for different formats).\n * \n * @interface SoundOptions\n */\nexport interface SoundOptions {\n /**\n * Sound identifier. Used to retrieve the sound later with RpgSound.get()\n * \n * @type {string}\n */\n id?: string;\n\n /**\n * Single sound file path. Use require() to wrap the path.\n * \n * @type {string}\n * @example\n * sound: require('./assets/sound.ogg')\n */\n sound?: string;\n\n /**\n * Multiple sounds with different IDs. The key is the sound ID and the value is the file path.\n * Use require() to wrap each path.\n * \n * @type {{ [id: string]: string }}\n * @example\n * sounds: {\n * hero: require('./assets/hero.ogg'),\n * monster: require('./assets/monster.ogg')\n * }\n */\n sounds?: { [id: string]: string };\n\n /**\n * Whether the sound should loop when it finishes playing.\n * \n * @type {boolean}\n * @default false\n */\n loop?: boolean;\n\n /**\n * Volume level (0.0 to 1.0).\n * \n * @type {number}\n * @default 1.0\n */\n volume?: number;\n}\n\n/**\n * Metadata stored on the class decorated with @Sound\n * \n * @interface SoundMetadata\n */\ninterface SoundMetadata {\n id?: string;\n sound?: string;\n sounds?: { [id: string]: string };\n loop?: boolean;\n volume?: number;\n}\n\nconst SOUND_METADATA_KEY = Symbol('rpgjs:sound');\n\n/**\n * Sound decorator\n * \n * Decorates a class to define a sound configuration. The decorated class can be\n * added to the RpgClient module configuration, and the sound will be automatically\n * registered and available through RpgSound.get().\n * \n * ## Design\n * \n * The decorator stores metadata on the class that is later used by the module loader\n * to register sounds with the engine. The sound is created using Howler.js for\n * advanced audio features like looping, volume control, and cross-browser compatibility.\n * \n * @param options - Sound configuration options\n * \n * @example\n * ```ts\n * import { Sound } from '@rpgjs/client'\n * \n * @Sound({\n * id: 'town-music',\n * sound: require('./sound/town.ogg'),\n * loop: true,\n * volume: 0.5\n * })\n * export class TownMusic {}\n * \n * // Multiple sounds in one class\n * @Sound({\n * sounds: {\n * hero: require('./assets/hero.ogg'),\n * monster: require('./assets/monster.ogg')\n * },\n * loop: true\n * })\n * export class CharacterSounds {}\n * ```\n */\nexport function Sound(options: SoundOptions) {\n return function <T extends { new (...args: any[]): {} }>(constructor: T) {\n const metadata: SoundMetadata = {\n id: options.id,\n sound: options.sound,\n sounds: options.sounds,\n loop: options.loop,\n volume: options.volume,\n };\n\n // Store metadata on the class\n (constructor as any)[SOUND_METADATA_KEY] = metadata;\n\n return constructor;\n };\n}\n\n/**\n * Get sound metadata from a decorated class\n * \n * @param soundClass - The class decorated with @Sound\n * @returns The sound metadata or undefined\n */\nexport function getSoundMetadata(soundClass: any): SoundMetadata | undefined {\n return (soundClass as any)[SOUND_METADATA_KEY];\n}\n\n/**\n * RpgSound class\n * \n * Provides a unified API to manage sounds in the game. Uses Howler.js internally\n * for advanced audio features. Sounds can be retrieved by ID and controlled\n * using Howler.js methods.\n * \n * ## Design\n * \n * RpgSound acts as a facade over Howler.js, providing easy access to sounds\n * registered in the engine. It supports both individual sound control and\n * global sound management (volume, mute, etc.).\n * \n * @example\n * ```ts\n * import { RpgSound } from '@rpgjs/client'\n * \n * // Play a sound\n * RpgSound.get('town-music').play()\n * \n * // Control volume\n * RpgSound.get('town-music').volume(0.5)\n * \n * // Stop a sound\n * RpgSound.get('town-music').stop()\n * \n * // Global volume control\n * RpgSound.global.volume(0.2)\n * ```\n */\nexport class RpgSound {\n private static engine: RpgClientEngine | null = null;\n\n /**\n * Initialize RpgSound with the engine instance\n * \n * This is called automatically by the engine during initialization.\n * \n * @param engine - The RpgClientEngine instance\n */\n static init(engine: RpgClientEngine): void {\n RpgSound.engine = engine;\n }\n\n /**\n * Get a sound by its ID\n * \n * Retrieves a Howler sound instance from the engine's sound cache.\n * The sound must be registered beforehand (via @Sound decorator or manually).\n * \n * @param id - The sound identifier\n * @returns The Howler sound instance, or undefined if not found\n * \n * @example\n * ```ts\n * // Get and play a sound\n * const sound = RpgSound.get('town-music');\n * if (sound) {\n * sound.play();\n * }\n * \n * // Chain methods\n * RpgSound.get('battle-theme')?.volume(0.8).play();\n * ```\n */\n static get(id: string): any {\n if (!RpgSound.engine) {\n console.warn('RpgSound not initialized. Make sure the engine has started.');\n return undefined;\n }\n\n const sound = RpgSound.engine.sounds.get(id);\n if (!sound) {\n console.warn(`Sound with id \"${id}\" not found`);\n return undefined;\n }\n\n // If the sound is a Howler instance, return it directly\n if (sound && typeof sound.play === 'function') {\n return sound;\n }\n\n // If the sound has a src property, try to create a Howler instance\n if (sound && sound.src) {\n // This should have been handled during addSound, but just in case\n return sound;\n }\n\n return sound;\n }\n\n /**\n * Global Howler instance for managing all sounds\n * \n * Provides access to Howler.js global methods for controlling all sounds\n * at once (volume, mute, etc.).\n * \n * @example\n * ```ts\n * // Set global volume to 20%\n * RpgSound.global.volume(0.2)\n * \n * // Mute all sounds\n * RpgSound.global.mute(true)\n * \n * // Unmute all sounds\n * RpgSound.global.mute(false)\n * ```\n */\n static get global(): typeof Howler {\n return Howler;\n }\n}\n\n"],"names":[],"mappings":";;AAwEA,MAAM,kBAAA,GAAqB,OAAO,aAAa,CAAA;AAwCxC,SAAS,MAAM,OAAA,EAAuB;AAC3C,EAAA,OAAO,SAAkD,WAAA,EAAgB;AACvE,IAAA,MAAM,QAAA,GAA0B;AAAA,MAC9B,IAAI,OAAA,CAAQ,EAAA;AAAA,MACZ,OAAO,OAAA,CAAQ,KAAA;AAAA,MACf,QAAQ,OAAA,CAAQ,MAAA;AAAA,MAChB,MAAM,OAAA,CAAQ,IAAA;AAAA,MACd,QAAQ,OAAA,CAAQ;AAAA,KAClB;AAGA,IAAC,WAAA,CAAoB,kBAAkB,CAAA,GAAI,QAAA;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A,WAAW,MAAA,GAAwB;AACjC,IAAA,OAAO,MAAA;AAAA,EACT;AACF;;;;"}
1
+ {"version":3,"file":"index16.js","sources":["../src/components/prebuilt/hp-bar.ce"],"sourcesContent":["<!-- \n HP Bar Component\n \n A beautiful, animated health bar component for displaying player HP above sprites.\n Features a gradient color based on HP level, smooth animations, and modern styling.\n \n ## Design\n \n The bar changes color dynamically based on HP percentage:\n - Green (#4ade80) when HP > 60% - Healthy state\n - Yellow (#facc15) when HP 30-60% - Caution state \n - Orange (#fb923c) when HP 15-30% - Danger state\n - Red (#ef4444) when HP < 15% - Critical state\n \n @example\n ```ts\n import HpBar from './hp-bar.ce';\n \n // In module configuration\n export default defineModule<RpgClient>({\n sprite: {\n componentsInFront: [HpBar]\n }\n })\n ```\n-->\n\n<Container x={position.@x} y={position.@y}>\n <!-- Background shadow for depth effect -->\n <Graphics draw={drawShadow} x={1} y={1} />\n \n <!-- Main background -->\n <Graphics draw={drawBackground} />\n \n <!-- HP fill bar -->\n <Graphics draw={drawFill} />\n \n <!-- Highlight overlay for 3D effect -->\n <Graphics draw={drawHighlight} />\n \n <!-- Border frame -->\n <Graphics draw={drawBorder} />\n</Container>\n\n<script>\nimport { computed, animatedSignal, effect } from \"canvasengine\";\n\nconst { object } = defineProps();\n\n// ====================\n// Configuration\n// ====================\n\n/** Total width of the HP bar in pixels */\nconst barWidth = 50;\n\n/** Total height of the HP bar in pixels */\nconst barHeight = 8;\n\n/** Border radius for rounded corners */\nconst borderRadius = 4;\n\n/** Inner border radius for the fill bar */\nconst innerRadius = 3;\n\n/** Padding between background and fill */\nconst padding = 1;\n\n/** Background color (dark theme) */\nconst bgColor = 0x16213e;\n\n/** Shadow color */\nconst shadowColor = 0x000000;\n\n/** Border color */\nconst borderColor = 0x4a5568;\n\n// ====================\n// Calculated dimensions\n// ====================\n\n/** Maximum fill width */\nconst maxFillWidth = barWidth - (padding * 2);\n\n/** Fill height */\nconst fillHeight = barHeight - (padding * 2);\n\n/** Highlight height (half of fill) */\nconst highlightHeight = Math.floor(fillHeight / 2);\n\n// ====================\n// Reactive HP values\n// ====================\n\n/** Gets hitbox dimensions for positioning */\nconst hitbox = object.hitbox;\n\n/**\n * Gets the current HP value from the player object\n * Uses hpSignal which is synchronized from the server\n */\nconst currentHp = computed(() => {\n return object.hpSignal?.() ?? 0;\n});\n\n/**\n * Gets the maximum HP value from player parameters\n * Reads from _param.maxHp which contains calculated stats\n */\nconst maxHp = computed(() => {\n const params = object._param?.() ?? {};\n return params.maxHp ?? 100;\n});\n\n/**\n * Calculates HP percentage (0 to 1)\n */\nconst hpPercent = computed(() => {\n const max = maxHp();\n if (max <= 0) return 0;\n const percent = currentHp() / max;\n return Math.max(0, Math.min(1, percent));\n});\n\n// ====================\n// Animated values\n// ====================\n\n/**\n * Animated percentage for smooth bar transitions\n */\nconst animatedPercent = animatedSignal(hpPercent(), {\n duration: 300,\n easing: 'easeOutCubic'\n});\n\n// Update animated value when HP changes\neffect(() => {\n const newPercent = hpPercent();\n animatedPercent.set(newPercent);\n});\n\n// ====================\n// Visual calculations\n// ====================\n\n/**\n * Position of the bar relative to the sprite\n */\nconst position = computed(() => ({\n x: (hitbox().w / 2) - (barWidth / 2),\n y: -barHeight - 8\n}));\n\n/**\n * Current width of the HP fill based on animated percentage\n */\nconst fillWidth = computed(() => {\n const percent = animatedPercent();\n const width = maxFillWidth * percent;\n // Ensure minimum visible width when HP > 0\n if (percent > 0 && width < innerRadius * 2) {\n return innerRadius * 2;\n }\n return Math.max(0, width);\n});\n\n/**\n * Determines HP bar color based on current HP percentage\n * Returns hex color number for PixiJS\n * \n * ## Color Thresholds\n * - Green (0x4ade80): HP > 60% - Healthy\n * - Yellow (0xfacc15): HP 30-60% - Caution\n * - Orange (0xfb923c): HP 15-30% - Danger\n * - Red (0xef4444): HP < 15% - Critical\n */\nconst hpColorHex = computed(() => {\n const percent = hpPercent();\n \n if (percent > 0.6) {\n return 0x4ade80; // Green - healthy\n } else if (percent > 0.3) {\n return 0xfacc15; // Yellow - caution\n } else if (percent > 0.15) {\n return 0xfb923c; // Orange - danger\n } else {\n return 0xef4444; // Red - critical\n }\n});\n\n// ====================\n// Drawing functions\n// ====================\n\n/**\n * Draws the shadow behind the HP bar for depth effect\n */\nconst drawShadow = (g) => {\n g.roundRect(0, 0, barWidth, barHeight, borderRadius);\n g.fill({ color: shadowColor, alpha: 0.3 });\n};\n\n/**\n * Draws the main background of the HP bar\n */\nconst drawBackground = (g) => {\n g.roundRect(0, 0, barWidth, barHeight, borderRadius);\n g.fill({ color: bgColor, alpha: 0.9 });\n};\n\n/**\n * Draws the HP fill bar with dynamic color\n */\nconst drawFill = (g) => {\n const width = fillWidth();\n if (width > 0) {\n g.roundRect(padding, padding, width, fillHeight, innerRadius);\n g.fill({ color: hpColorHex() });\n }\n};\n\n/**\n * Draws the highlight overlay for 3D effect\n */\nconst drawHighlight = (g) => {\n const width = fillWidth();\n if (width > 0) {\n g.roundRect(padding, padding, width, highlightHeight, innerRadius);\n g.fill({ color: 0xffffff, alpha: 0.25 });\n }\n};\n\n/**\n * Draws the border frame around the HP bar\n * \n * Uses PixiJS Graphics API to create a rounded rectangle stroke\n * that serves as a visual border for the bar.\n * \n * @param g - PixiJS Graphics object\n * \n * @example\n * ```html\n * <Graphics draw={drawBorder} />\n * ```\n */\nconst drawBorder = (g) => {\n g.roundRect(0, 0, barWidth, barHeight, borderRadius);\n g.stroke({ \n color: borderColor, \n width: 1,\n alpha: 0.7\n });\n};\n</script>\n"],"names":[],"mappings":";;AAOqB,SAAS,SAAS,CAAC,OAAO,EAAE;AACjD,QAAuB,QAAQ,CAAC,OAAO;AACvC,QAAQ,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO;AAClD,QAAQ,IAAI,MAAM,GAAG,WAAW,EAAE,CAAC,MAAM;AACzC,IAAI,QAAQ,GAAG,EAAE;AACjB,IAAI,SAAS,GAAG,CAAC;AACjB,IAAI,YAAY,GAAG,CAAC;AACpB,IAAI,WAAW,GAAG,CAAC;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