@rpgjs/client 5.0.0-alpha.1 → 5.0.0-alpha.2
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/index22.js +1 -1
- package/dist/index36.js +62 -32
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +32 -62
- package/dist/index37.js.map +1 -1
- package/package.json +1 -1
package/dist/index13.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useProps, useDefineProps, h, Container, loop } from 'canvasengine';
|
|
2
2
|
import { inject } from './index6.js';
|
|
3
3
|
import { RpgClientEngine } from './index2.js';
|
|
4
|
-
import component$1 from './
|
|
4
|
+
import component$1 from './index36.js';
|
|
5
5
|
|
|
6
6
|
function component($$props) {
|
|
7
7
|
useProps($$props);
|
package/dist/index22.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useProps, useDefineProps, signal, animatedSignal, computed, trigger, mount, effect, h, Container, Rect, cond, Text } from 'canvasengine';
|
|
2
|
-
import component$1 from './
|
|
2
|
+
import component$1 from './index37.js';
|
|
3
3
|
import { inject } from './index6.js';
|
|
4
4
|
import { RpgClientEngine } from './index2.js';
|
|
5
5
|
|
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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AAQ,OAAO;AACf;;;;"}
|
package/dist/index37.js
CHANGED
|
@@ -1,89 +1,59 @@
|
|
|
1
|
-
import { useProps, useDefineProps,
|
|
2
|
-
import
|
|
1
|
+
import { useProps, useDefineProps, mount, signal, h, Container, loop, computed } from 'canvasengine';
|
|
2
|
+
import component$1 from './index39.js';
|
|
3
3
|
import { RpgClientEngine } from './index2.js';
|
|
4
4
|
import { inject } from './index6.js';
|
|
5
|
-
import { Direction } from '@rpgjs/common';
|
|
6
5
|
|
|
7
6
|
function component($$props) {
|
|
8
7
|
useProps($$props);
|
|
9
8
|
const defineProps = useDefineProps($$props);
|
|
10
|
-
var _a = defineProps(),
|
|
9
|
+
var _a = defineProps(), items = _a.items, wrapAround = _a.wrapAround, onSelect = _a.onSelect, selectedIndex = _a.selectedIndex;
|
|
11
10
|
var client = inject(RpgClientEngine);
|
|
12
|
-
var spritesheets = client.spritesheets;
|
|
13
|
-
var x = object.x;
|
|
14
|
-
var y = object.y;
|
|
15
|
-
var tint = object.tint;
|
|
16
|
-
var direction = object.direction;
|
|
17
|
-
var animationName = object.animationName;
|
|
18
|
-
var emitParticleTrigger = object.emitParticleTrigger;
|
|
19
|
-
var particleSettings = client.particleSettings;
|
|
20
|
-
var particleName = object.particleName;
|
|
21
|
-
var graphics = object.graphics;
|
|
22
|
-
var hitbox = object.hitbox;
|
|
23
|
-
var widthShadow = 10;
|
|
24
|
-
computed(function () { return ({
|
|
25
|
-
x: hitbox().w / 2,
|
|
26
|
-
y: hitbox().h - (hitbox().h / 2),
|
|
27
|
-
width: hitbox().w + widthShadow,
|
|
28
|
-
height: hitbox().h,
|
|
29
|
-
}); });
|
|
30
|
-
var canControls = function () { return isMe() && object.canMove(); };
|
|
31
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
|
+
});
|
|
32
22
|
var controls = signal({
|
|
33
23
|
down: {
|
|
34
|
-
repeat: true,
|
|
35
24
|
bind: keyboardControls.down,
|
|
36
25
|
keyDown: function () {
|
|
37
|
-
|
|
38
|
-
|
|
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
|
+
});
|
|
39
34
|
},
|
|
40
35
|
},
|
|
41
36
|
up: {
|
|
42
|
-
repeat: true,
|
|
43
37
|
bind: keyboardControls.up,
|
|
44
38
|
keyDown: function () {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if (canControls())
|
|
54
|
-
client.processInput({ input: Direction.Left });
|
|
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
|
+
});
|
|
55
47
|
},
|
|
56
48
|
},
|
|
57
|
-
|
|
58
|
-
repeat: true,
|
|
59
|
-
bind: keyboardControls.right,
|
|
60
|
-
keyDown: function () {
|
|
61
|
-
if (canControls())
|
|
62
|
-
client.processInput({ input: Direction.Right });
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
action: {
|
|
49
|
+
enter: {
|
|
66
50
|
bind: keyboardControls.action,
|
|
67
51
|
keyDown: function () {
|
|
68
|
-
|
|
69
|
-
client.processAction({ action: 'action' });
|
|
70
|
-
// particleName.set('hit')
|
|
71
|
-
// emitParticleTrigger.start()
|
|
72
|
-
// object.flash('red')
|
|
73
|
-
}
|
|
52
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect(selectedIndex());
|
|
74
53
|
},
|
|
75
54
|
},
|
|
76
55
|
});
|
|
77
|
-
|
|
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 }))]);
|
|
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) })));
|
|
87
57
|
return $this
|
|
88
58
|
}
|
|
89
59
|
|
package/dist/index37.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index37.js","sources":["../src/components/
|
|
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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