@rpgjs/client 5.0.0-alpha.3 → 5.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index13.js +1 -1
- package/dist/index20.js +3 -3
- package/dist/index21.js +2 -2
- package/dist/index22.js +1 -1
- package/dist/index29.js +1 -1
- package/dist/index30.js +1 -1
- package/dist/index31.js +9 -171
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +4395 -493
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +313 -9
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +170 -4399
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +496 -86
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +62 -32
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +58 -17
- package/dist/index37.js.map +1 -1
- package/dist/index39.js +20 -0
- package/dist/index39.js.map +1 -0
- package/package.json +8 -8
- package/CHANGELOG.md +0 -9
package/dist/index36.js
CHANGED
|
@@ -1,59 +1,89 @@
|
|
|
1
|
-
import { useProps, useDefineProps,
|
|
2
|
-
import
|
|
1
|
+
import { useProps, useDefineProps, computed, signal, h, Container, loop, Sprite } from 'canvasengine';
|
|
2
|
+
import { Particle } from '@canvasengine/presets';
|
|
3
3
|
import { RpgClientEngine } from './index2.js';
|
|
4
4
|
import { inject } from './index6.js';
|
|
5
|
+
import { Direction } from '@rpgjs/common';
|
|
5
6
|
|
|
6
7
|
function component($$props) {
|
|
7
8
|
useProps($$props);
|
|
8
9
|
const defineProps = useDefineProps($$props);
|
|
9
|
-
var _a = defineProps(),
|
|
10
|
+
var _a = defineProps(), object = _a.object; _a.id; var isMe = _a.isMe;
|
|
10
11
|
var client = inject(RpgClientEngine);
|
|
12
|
+
var spritesheets = client.spritesheets;
|
|
13
|
+
var x = object.x;
|
|
14
|
+
var y = object.y;
|
|
15
|
+
var tint = object.tint;
|
|
16
|
+
var direction = object.direction;
|
|
17
|
+
var animationName = object.animationName;
|
|
18
|
+
var emitParticleTrigger = object.emitParticleTrigger;
|
|
19
|
+
var particleSettings = client.particleSettings;
|
|
20
|
+
var particleName = object.particleName;
|
|
21
|
+
var graphics = object.graphics;
|
|
22
|
+
var hitbox = object.hitbox;
|
|
23
|
+
var widthShadow = 10;
|
|
24
|
+
computed(function () { return ({
|
|
25
|
+
x: hitbox().w / 2,
|
|
26
|
+
y: hitbox().h - (hitbox().h / 2),
|
|
27
|
+
width: hitbox().w + widthShadow,
|
|
28
|
+
height: hitbox().h,
|
|
29
|
+
}); });
|
|
30
|
+
var canControls = function () { return isMe() && object.canMove(); };
|
|
11
31
|
var keyboardControls = client.globalConfig.keyboardControls;
|
|
12
|
-
var selected = function (index) {
|
|
13
|
-
return computed(function () {
|
|
14
|
-
return index === selectedIndex();
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
mount(function (element) {
|
|
18
|
-
return function () {
|
|
19
|
-
element.directives.controls.onDestroy();
|
|
20
|
-
};
|
|
21
|
-
});
|
|
22
32
|
var controls = signal({
|
|
23
33
|
down: {
|
|
34
|
+
repeat: true,
|
|
24
35
|
bind: keyboardControls.down,
|
|
25
36
|
keyDown: function () {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return (currentIndex + 1) % items().length;
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
return Math.min(currentIndex + 1, items().length - 1);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
37
|
+
if (canControls())
|
|
38
|
+
client.processInput({ input: Direction.Down });
|
|
34
39
|
},
|
|
35
40
|
},
|
|
36
41
|
up: {
|
|
42
|
+
repeat: true,
|
|
37
43
|
bind: keyboardControls.up,
|
|
38
44
|
keyDown: function () {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
if (canControls())
|
|
46
|
+
client.processInput({ input: Direction.Up });
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
left: {
|
|
50
|
+
repeat: true,
|
|
51
|
+
bind: keyboardControls.left,
|
|
52
|
+
keyDown: function () {
|
|
53
|
+
if (canControls())
|
|
54
|
+
client.processInput({ input: Direction.Left });
|
|
47
55
|
},
|
|
48
56
|
},
|
|
49
|
-
|
|
57
|
+
right: {
|
|
58
|
+
repeat: true,
|
|
59
|
+
bind: keyboardControls.right,
|
|
60
|
+
keyDown: function () {
|
|
61
|
+
if (canControls())
|
|
62
|
+
client.processInput({ input: Direction.Right });
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
action: {
|
|
50
66
|
bind: keyboardControls.action,
|
|
51
67
|
keyDown: function () {
|
|
52
|
-
|
|
68
|
+
if (canControls()) {
|
|
69
|
+
client.processAction({ action: 'action' });
|
|
70
|
+
// particleName.set('hit')
|
|
71
|
+
// emitParticleTrigger.start()
|
|
72
|
+
// object.flash('red')
|
|
73
|
+
}
|
|
53
74
|
},
|
|
54
75
|
},
|
|
55
76
|
});
|
|
56
|
-
|
|
77
|
+
var sheet = function (graphicId) {
|
|
78
|
+
return {
|
|
79
|
+
definition: spritesheets.get(graphicId),
|
|
80
|
+
playing: animationName,
|
|
81
|
+
params: {
|
|
82
|
+
direction: direction
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
let $this = h(Container, { x, y, zIndex: y, viewportFollow: isMe, controls }, [h(Particle, { emit: emitParticleTrigger, settings: particleSettings, zIndex: 1000, name: particleName }), loop(graphics, graphicId => h(Sprite, { sheet: sheet(graphicId), direction, tint }))]);
|
|
57
87
|
return $this
|
|
58
88
|
}
|
|
59
89
|
|
package/dist/index36.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index36.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index36.js","sources":["../src/components/character.ce"],"sourcesContent":["<Container x y zIndex={y} viewportFollow={isMe} controls>\n <Particle emit={@emitParticleTrigger} settings={@particleSettings} zIndex={1000} name={particleName} />\n @for (graphicId of graphics) {\n <Sprite sheet={@sheet(@graphicId)} direction tint />\n }\n <!-- <Ellipse \n x={shadow.@x} \n y={shadow.@y} \n width={shadow.@width} \n height={shadow.@height} \n color=\"black\" \n blur={10} \n alpha={0.5}\n /> -->\n</Container>\n\n<script>\n import { signal, effect, mount, computed } from \"canvasengine\";\n import { Particle } from \"@canvasengine/presets\";\n import { GameEngineToken } from \"@rpgjs/common\";\n import { RpgClientEngine } from \"../RpgClientEngine\";\n import { inject } from \"../core/inject\"; \n import { Direction } from \"@rpgjs/common\";\n import Hit from \"./effects/hit.ce\";\n\n const { object, id, isMe } = defineProps();\n\n const client = inject(RpgClientEngine);\n\n const spritesheets = client.spritesheets;\n\n const x = object.x;\n const y = object.y;\n const tint = object.tint;\n const direction = object.direction;\n const animationName = object.animationName;\n const emitParticleTrigger = object.emitParticleTrigger;\n const particleSettings = client.particleSettings;\n const particleName = object.particleName;\n const graphics = object.graphics;\n\n const hitbox = object.hitbox;\n const widthShadow = 10;\n const shadow = computed(() => ({\n x: hitbox().w / 2,\n y: hitbox().h - (hitbox().h / 2),\n width: hitbox().w + widthShadow,\n height: hitbox().h,\n }))\n const canControls = () => isMe() && object.canMove()\n const keyboardControls = client.globalConfig.keyboardControls;\n\n const controls = signal({\n down: {\n repeat: true,\n bind: keyboardControls.down,\n keyDown() {\n if (canControls()) client.processInput({ input: Direction.Down })\n },\n },\n up: {\n repeat: true,\n bind: keyboardControls.up,\n keyDown() {\n if (canControls()) client.processInput({ input: Direction.Up })\n },\n },\n left: {\n repeat: true,\n bind: keyboardControls.left,\n keyDown() {\n if (canControls()) client.processInput({ input: Direction.Left })\n },\n },\n right: {\n repeat: true,\n bind: keyboardControls.right,\n keyDown() {\n if (canControls()) client.processInput({ input: Direction.Right })\n },\n },\n action: {\n bind: keyboardControls.action,\n keyDown() {\n if (canControls()) {\n client.processAction({ action: 'action' })\n // particleName.set('hit') \n // emitParticleTrigger.start()\n // object.flash('red')\n }\n },\n },\n });\n\n const sheet = (graphicId) => {\n return {\n definition: spritesheets.get(graphicId),\n playing: animationName,\n params: {\n direction\n },\n };\n }\n</script>"],"names":[],"mappings":";;;;;;AAWqB,SAAS,SAAS,CAAC,OAAO,EAAE;AACjD,QAAuB,QAAQ,CAAC,OAAO;AACvC,QAAQ,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO;AAClD,QAAW,IAAC,EAAE,GAAG,WAAW,EAAE,CAAC,CAAC,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC,CAAM,EAAE,CAAC,EAAE,CAAC,KAAC,IAAI,GAAG,EAAE,CAAC;AAC1E,IAAI,MAAM,GAAG,MAAM,CAAC,eAAe,CAAC;AACpC,IAAI,YAAY,GAAG,MAAM,CAAC,YAAY;AACtC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC;AAChB,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC;AAChB,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI;AACtB,IAAI,SAAS,GAAG,MAAM,CAAC,SAAS;AAChC,IAAI,aAAa,GAAG,MAAM,CAAC,aAAa;AACxC,IAAI,mBAAmB,GAAG,MAAM,CAAC,mBAAmB;AACpD,IAAI,gBAAgB,GAAG,MAAM,CAAC,gBAAgB;AAC9C,IAAI,YAAY,GAAG,MAAM,CAAC,YAAY;AACtC,IAAI,QAAQ,GAAG,MAAM,CAAC,QAAQ;AAC9B,IAAI,MAAM,GAAG,MAAM,CAAC,MAAM;AAC1B,IAAI,WAAW,GAAG,EAAE;AACP,QAAQ,CAAC,YAAY,EAAE,QAAQ;AAC5C,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC;AACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;AACpC,IAAI,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,GAAG,WAAW;AACnC,IAAI,MAAM,EAAE,MAAM,E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
import component$1 from './index38.js';
|
|
3
|
+
import { RpgClientEngine } from './index2.js';
|
|
4
|
+
import { inject } from './index6.js';
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
function component($$props) {
|
|
7
|
+
useProps($$props);
|
|
8
|
+
const defineProps = useDefineProps($$props);
|
|
9
|
+
var _a = defineProps(), items = _a.items, wrapAround = _a.wrapAround, onSelect = _a.onSelect, selectedIndex = _a.selectedIndex;
|
|
10
|
+
var client = inject(RpgClientEngine);
|
|
11
|
+
var keyboardControls = client.globalConfig.keyboardControls;
|
|
12
|
+
var selected = function (index) {
|
|
13
|
+
return computed(function () {
|
|
14
|
+
return index === selectedIndex();
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
mount(function (element) {
|
|
18
|
+
return function () {
|
|
19
|
+
element.directives.controls.onDestroy();
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
var controls = signal({
|
|
23
|
+
down: {
|
|
24
|
+
bind: keyboardControls.down,
|
|
25
|
+
keyDown: function () {
|
|
26
|
+
selectedIndex.update(function (currentIndex) {
|
|
27
|
+
if (wrapAround) {
|
|
28
|
+
return (currentIndex + 1) % items().length;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
return Math.min(currentIndex + 1, items().length - 1);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
up: {
|
|
37
|
+
bind: keyboardControls.up,
|
|
38
|
+
keyDown: function () {
|
|
39
|
+
selectedIndex.update(function (currentIndex) {
|
|
40
|
+
if (wrapAround) {
|
|
41
|
+
return (currentIndex - 1 + items().length) % items().length;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
return Math.max(currentIndex - 1, 0);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
enter: {
|
|
50
|
+
bind: keyboardControls.action,
|
|
51
|
+
keyDown: function () {
|
|
52
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect(selectedIndex());
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
let $this = h(Container, { controls, flexDirection: 'column', margin: [0, 0, 0, 50] }, loop(items, (item, index) => h(component$1, { text: item.text, isSelected: selected(index) })));
|
|
57
|
+
return $this
|
|
58
|
+
}
|
|
18
59
|
|
|
19
|
-
export {
|
|
60
|
+
export { component as default };
|
|
20
61
|
//# sourceMappingURL=index37.js.map
|
package/dist/index37.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index37.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index37.js","sources":["../src/components/gui/dialogbox/selection.ce"],"sourcesContent":["<Container controls flexDirection=\"column\" margin={[0, 0, 0, 50]}>\n @for ((item,index) of items) { \n <ItemMenu text={@item.@text} isSelected={@selected(@index)} /> \n }\n</Container>\n\n<script>\n import { signal, computed, mount } from \"canvasengine\";\n import ItemMenu from \"./itemMenu.ce\";\n import { RpgClientEngine } from \"../../../RpgClientEngine\";\n import { inject } from \"../../../core/inject\";\n\n const {\n items,\n wrapAround,\n onSelect,\n selectedIndex,\n } = defineProps();\n\n const client = inject(RpgClientEngine);\n const keyboardControls = client.globalConfig.keyboardControls;\n\n const selected = (index) => {\n return computed(() => {\n return index === selectedIndex();\n })\n }\n\n mount((element) => {\n return () => {\n element.directives.controls.onDestroy()\n }\n })\n\n const controls = signal({\n down: {\n bind: keyboardControls.down,\n keyDown() {\n selectedIndex.update((currentIndex) => {\n if (wrapAround) {\n return (currentIndex + 1) % items().length;\n } else {\n return Math.min(currentIndex + 1, items().length - 1);\n }\n });\n },\n },\n up: {\n bind: keyboardControls.up,\n keyDown() {\n selectedIndex.update((currentIndex) => {\n if (wrapAround) {\n return (currentIndex - 1 + items().length) % items().length;\n } else {\n return Math.max(currentIndex - 1, 0);\n }\n });\n },\n },\n enter: {\n bind: keyboardControls.action,\n keyDown() {\n onSelect?.(selectedIndex());\n },\n },\n });\n</script>\n"],"names":["ItemMenu"],"mappings":";;;;;AASqB,SAAS,SAAS,CAAC,OAAO,EAAE;AACjD,QAAuB,QAAQ,CAAC,OAAO;AACvC,QAAQ,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO;AAClD,QAAQ,IAAI,EAAE,GAAG,WAAW,EAAE,EAAE,KAAK,GAAG,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,EAAE,CAAC,UAAU,EAAE,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,aAAa,GAAG,EAAE,CAAC,aAAa;AACtI,IAAI,MAAM,GAAG,MAAM,CAAC,eAAe,CAAC;AACpC,IAAI,gBAAgB,GAAG,MAAM,CAAC,YAAY,CAAC,gBAAgB;AAC3D,IAAI,QAAQ,GAAG,UAAU,KAAK,EAAE;AAChC,IAAI,OAAO,QAAQ,CAAC,YAAY;AAChC,QAAQ,OAAO,KAAK,KAAK,aAAa,EAAE;AACxC,KAAK,CAAC;AACN,CAAC;AACD,KAAK,CAAC,UAAU,OAAO,EAAE;AACzB,IAAI,OAAO,YAAY;AACvB,QAAQ,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,SAAS,EAAE;AAC/C,KAAK;AACL,CAAC,CAAC;AACF,IAAI,QAAQ,GAAG,MAAM,CAAC;AACtB,IAAI,IAAI,EAAE;AACV,QAAQ,IAAI,EAAE,gBAAgB,CAAC,IAAI;AACnC,QAAQ,OAAO,EAAE,YAAY;AAC7B,YAAY,aAAa,CAAC,MAAM,CAAC,UAAU,YAAY,EAAE;AACzD,gBAAgB,IAAI,UAAU,EAAE;AAChC,oBAAoB,OAAO,CAAC,YAAY,GAAG,CAAC,IAAI,KAAK,EAAE,CAAC,MAAM;AAC9D;AACA,qBAAqB;AACrB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
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RpgCommonPlayer } from '@rpgjs/common';
|
|
2
|
+
import { trigger, signal } from 'canvasengine';
|
|
3
|
+
|
|
4
|
+
class RpgClientObject extends RpgCommonPlayer {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.emitParticleTrigger = trigger();
|
|
8
|
+
this.particleName = signal("");
|
|
9
|
+
}
|
|
10
|
+
flash(color, duration = 100) {
|
|
11
|
+
const lastTint = this.tint();
|
|
12
|
+
this.tint.set(color);
|
|
13
|
+
setTimeout(() => {
|
|
14
|
+
this.tint.set(lastTint);
|
|
15
|
+
}, duration);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { RpgClientObject };
|
|
20
|
+
//# sourceMappingURL=index39.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index39.js","sources":["../src/Game/Object.ts"],"sourcesContent":["import { RpgCommonPlayer } from \"@rpgjs/common\";\nimport { trigger, signal } from \"canvasengine\";\n\nexport abstract class RpgClientObject extends RpgCommonPlayer {\n abstract type: string;\n emitParticleTrigger = trigger()\n particleName = signal('')\n\n flash(color: string, duration: number = 100) {\n const lastTint = this.tint()\n this.tint.set(color);\n setTimeout(() => {\n this.tint.set(lastTint)\n }, duration)\n }\n} "],"names":[],"mappings":";;;AAGO,MAAe,wBAAwB,eAAgB,CAAA;AAAA,EAAvD,WAAA,GAAA;AAAA,IAAA,KAAA,CAAA,GAAA,SAAA,CAAA;AAEL,IAAA,IAAA,CAAA,mBAAA,GAAsB,OAAQ,EAAA;AAC9B,IAAA,IAAA,CAAA,YAAA,GAAe,OAAO,EAAE,CAAA;AAAA;AAAA,EAExB,KAAA,CAAM,KAAe,EAAA,QAAA,GAAmB,GAAK,EAAA;AAC3C,IAAM,MAAA,QAAA,GAAW,KAAK,IAAK,EAAA;AAC3B,IAAK,IAAA,CAAA,IAAA,CAAK,IAAI,KAAK,CAAA;AACnB,IAAA,UAAA,CAAW,MAAM;AACf,MAAK,IAAA,CAAA,IAAA,CAAK,IAAI,QAAQ,CAAA;AAAA,OACrB,QAAQ,CAAA;AAAA;AAEf;;;;"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rpgjs/client",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.4",
|
|
4
4
|
"description": "RPGJS is a framework for creating RPG/MMORPG games",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
10
|
-
"scripts": {
|
|
11
|
-
"dev": "vite build --watch",
|
|
12
|
-
"build": "vite build"
|
|
13
|
-
},
|
|
14
10
|
"keywords": [
|
|
15
11
|
"rpg",
|
|
16
12
|
"game",
|
|
@@ -22,7 +18,7 @@
|
|
|
22
18
|
"license": "MIT",
|
|
23
19
|
"dependencies": {
|
|
24
20
|
"@canvasengine/presets": "2.0.0-beta.22",
|
|
25
|
-
"@rpgjs/common": "
|
|
21
|
+
"@rpgjs/common": "5.0.0-alpha.4",
|
|
26
22
|
"@signe/di": "^2.3.3",
|
|
27
23
|
"@signe/room": "^2.3.3",
|
|
28
24
|
"@signe/sync": "^2.3.3",
|
|
@@ -36,5 +32,9 @@
|
|
|
36
32
|
"vite-plugin-dts": "^4.5.3",
|
|
37
33
|
"vitest": "^3.1.1"
|
|
38
34
|
},
|
|
39
|
-
"type": "module"
|
|
40
|
-
|
|
35
|
+
"type": "module",
|
|
36
|
+
"scripts": {
|
|
37
|
+
"dev": "vite build --watch",
|
|
38
|
+
"build": "vite build"
|
|
39
|
+
}
|
|
40
|
+
}
|