@rpgjs/client 5.0.0-alpha.2 → 5.0.0-alpha.21
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/Game/AnimationManager.d.ts +8 -0
- package/dist/Game/Map.d.ts +7 -1
- package/dist/Gui/Gui.d.ts +170 -5
- package/dist/Resource.d.ts +97 -0
- package/dist/RpgClient.d.ts +259 -59
- package/dist/RpgClientEngine.d.ts +379 -6
- package/dist/Sound.d.ts +199 -0
- package/dist/components/animations/index.d.ts +4 -0
- package/dist/components/dynamics/parse-value.d.ts +1 -0
- package/dist/components/gui/index.d.ts +3 -3
- package/dist/components/index.d.ts +3 -1
- package/dist/components/prebuilt/index.d.ts +18 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +11 -4
- package/dist/index.js.map +1 -1
- package/dist/index10.js +149 -4
- package/dist/index10.js.map +1 -1
- package/dist/index11.js +22 -7
- package/dist/index11.js.map +1 -1
- package/dist/index12.js +6 -4
- package/dist/index12.js.map +1 -1
- package/dist/index13.js +11 -14
- package/dist/index13.js.map +1 -1
- package/dist/index14.js +8 -40
- package/dist/index14.js.map +1 -1
- package/dist/index15.js +217 -180
- package/dist/index15.js.map +1 -1
- package/dist/index16.js +104 -7
- package/dist/index16.js.map +1 -1
- package/dist/index17.js +82 -372
- package/dist/index17.js.map +1 -1
- package/dist/index18.js +110 -27
- package/dist/index18.js.map +1 -1
- package/dist/index19.js +360 -18
- package/dist/index19.js.map +1 -1
- package/dist/index2.js +726 -32
- package/dist/index2.js.map +1 -1
- package/dist/index20.js +5 -2416
- package/dist/index20.js.map +1 -1
- package/dist/index21.js +47 -109
- package/dist/index21.js.map +1 -1
- package/dist/index22.js +7 -107
- package/dist/index22.js.map +1 -1
- package/dist/index23.js +394 -65
- package/dist/index23.js.map +1 -1
- package/dist/index24.js +40 -15
- package/dist/index24.js.map +1 -1
- package/dist/index25.js +20 -36
- package/dist/index25.js.map +1 -1
- package/dist/index26.js +2629 -1
- package/dist/index26.js.map +1 -1
- package/dist/index27.js +102 -310
- package/dist/index27.js.map +1 -1
- package/dist/index28.js +63 -17
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +18 -8
- package/dist/index29.js.map +1 -1
- package/dist/index3.js +70 -8
- package/dist/index3.js.map +1 -1
- package/dist/index30.js +24 -8
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +88 -167
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +34 -494
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +22 -10
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +3 -4401
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +20 -1
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +18 -82
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +8 -58
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +4 -13
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +10 -18
- package/dist/index39.js.map +1 -1
- package/dist/index4.js +25 -5
- package/dist/index4.js.map +1 -1
- package/dist/index40.js +7 -0
- package/dist/index40.js.map +1 -0
- package/dist/index41.js +3690 -0
- package/dist/index41.js.map +1 -0
- package/dist/index42.js +187 -0
- package/dist/index42.js.map +1 -0
- package/dist/index43.js +504 -0
- package/dist/index43.js.map +1 -0
- package/dist/index44.js +77 -0
- package/dist/index44.js.map +1 -0
- package/dist/index45.js +6 -0
- package/dist/index45.js.map +1 -0
- package/dist/index46.js +20 -0
- package/dist/index46.js.map +1 -0
- package/dist/index47.js +146 -0
- package/dist/index47.js.map +1 -0
- package/dist/index48.js +12 -0
- package/dist/index48.js.map +1 -0
- package/dist/index49.js +113 -0
- package/dist/index49.js.map +1 -0
- package/dist/index5.js +2 -1
- package/dist/index5.js.map +1 -1
- package/dist/index50.js +136 -0
- package/dist/index50.js.map +1 -0
- package/dist/index51.js +137 -0
- package/dist/index51.js.map +1 -0
- package/dist/index52.js +112 -0
- package/dist/index52.js.map +1 -0
- package/dist/index53.js +141 -0
- package/dist/index53.js.map +1 -0
- package/dist/index54.js +9 -0
- package/dist/index54.js.map +1 -0
- package/dist/index55.js +54 -0
- package/dist/index55.js.map +1 -0
- package/dist/index6.js +1 -1
- package/dist/index6.js.map +1 -1
- package/dist/index7.js +11 -3
- package/dist/index7.js.map +1 -1
- package/dist/index8.js +68 -7
- package/dist/index8.js.map +1 -1
- package/dist/index9.js +278 -15
- package/dist/index9.js.map +1 -1
- package/dist/presets/animation.d.ts +31 -0
- package/dist/presets/faceset.d.ts +30 -0
- package/dist/presets/index.d.ts +103 -0
- package/dist/presets/lpc.d.ts +89 -0
- package/dist/services/keyboardControls.d.ts +5 -0
- package/dist/services/loadMap.d.ts +123 -2
- package/dist/services/mmorpg.d.ts +12 -4
- package/dist/services/standalone.d.ts +54 -2
- package/package.json +22 -18
- package/src/Game/{EffectManager.ts → AnimationManager.ts} +3 -2
- package/src/Game/Map.ts +20 -2
- package/src/Game/Object.ts +163 -9
- package/src/Gui/Gui.ts +362 -17
- package/src/Resource.ts +150 -0
- package/src/RpgClient.ts +264 -58
- package/src/RpgClientEngine.ts +848 -36
- package/src/Sound.ts +253 -0
- package/src/components/{effects → animations}/animation.ce +3 -6
- package/src/components/{effects → animations}/index.ts +1 -1
- package/src/components/character.ce +193 -36
- package/src/components/dynamics/parse-value.ts +80 -0
- package/src/components/dynamics/text.ce +183 -0
- package/src/components/gui/box.ce +17 -0
- package/src/components/gui/dialogbox/index.ce +73 -35
- package/src/components/gui/dialogbox/selection.ce +16 -1
- package/src/components/gui/index.ts +3 -4
- package/src/components/index.ts +5 -1
- package/src/components/prebuilt/hp-bar.ce +255 -0
- package/src/components/prebuilt/index.ts +22 -0
- package/src/components/scenes/canvas.ce +12 -10
- package/src/components/scenes/draw-map.ce +6 -23
- package/src/components/scenes/event-layer.ce +9 -3
- package/src/core/setup.ts +2 -0
- package/src/index.ts +7 -2
- package/src/module.ts +72 -6
- package/src/presets/animation.ts +46 -0
- package/src/presets/faceset.ts +60 -0
- package/src/presets/index.ts +7 -1
- package/src/presets/lpc.ts +108 -0
- package/src/services/keyboardControls.ts +8 -0
- package/src/services/loadMap.ts +132 -3
- package/src/services/mmorpg.ts +29 -5
- package/src/services/standalone.ts +70 -6
- package/tsconfig.json +1 -1
- package/vite.config.ts +1 -1
- package/dist/Game/EffectManager.d.ts +0 -5
- package/dist/components/effects/index.d.ts +0 -4
- package/src/components/scenes/element-map.ce +0 -23
- /package/src/components/{effects → animations}/hit.ce +0 -0
package/dist/index10.js
CHANGED
|
@@ -1,8 +1,153 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useProps, useDefineProps, signal, animatedSignal, computed, trigger, mount, effect, h, Container, Rect, cond, Text, Sprite } from 'canvasengine';
|
|
2
|
+
import component$1 from './index44.js';
|
|
3
|
+
import { inject } from './index6.js';
|
|
4
|
+
import { RpgClientEngine } from './index2.js';
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
6
|
+
function component($$props) {
|
|
7
|
+
useProps($$props);
|
|
8
|
+
const defineProps = useDefineProps($$props);
|
|
9
|
+
var __assign = (this && this.__assign) || function () {
|
|
10
|
+
__assign = Object.assign || function(t) {
|
|
11
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
12
|
+
s = arguments[i];
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
}
|
|
16
|
+
return t;
|
|
17
|
+
};
|
|
18
|
+
return __assign.apply(this, arguments);
|
|
5
19
|
};
|
|
20
|
+
var _a, _b, _c, _d, _e;
|
|
21
|
+
var _f = defineProps(), message = _f.message, _choices = _f.choices, onFinish = _f.onFinish; _f.onInteraction; var face = _f.face, position = _f.position, typewriterEffect = _f.typewriterEffect, autoClose = _f.autoClose;
|
|
22
|
+
var client = inject(RpgClientEngine);
|
|
23
|
+
var keyboardControls = client.globalConfig.keyboardControls;
|
|
24
|
+
var dialogboxStyles = (_a = client.globalConfig.box.styles) !== null && _a !== void 0 ? _a : {
|
|
25
|
+
backgroundColor: "#1a1a2e",
|
|
26
|
+
backgroundOpacity: 0.9,
|
|
27
|
+
};
|
|
28
|
+
var dialogBoxTypewriterSound = (_d = (_c = (_b = client.globalConfig) === null || _b === void 0 ? void 0 : _b.box) === null || _c === void 0 ? void 0 : _c.sounds) === null || _d === void 0 ? void 0 : _d.typewriter;
|
|
29
|
+
var sounds = client.sounds;
|
|
30
|
+
client.stopProcessingInput = true;
|
|
31
|
+
var isDestroyed = false;
|
|
32
|
+
var texts = [message()];
|
|
33
|
+
var height = signal(256);
|
|
34
|
+
var margin = signal(40);
|
|
35
|
+
var isTextCompleted = signal(false);
|
|
36
|
+
signal({ width: 5, color: "#595971" });
|
|
37
|
+
signal({ color: "#000", blur: 10, offsetX: 10, offsetY: 10 });
|
|
38
|
+
var contentOpacity = animatedSignal(0, {
|
|
39
|
+
duration: 1000,
|
|
40
|
+
});
|
|
41
|
+
var scaleX = animatedSignal(0, {
|
|
42
|
+
duration: 500,
|
|
43
|
+
});
|
|
44
|
+
var positionBox = computed(function () {
|
|
45
|
+
if (position() === 'bottom') {
|
|
46
|
+
return { positionType: 'absolute', bottom: 10 };
|
|
47
|
+
}
|
|
48
|
+
else if (position() === 'top') {
|
|
49
|
+
return { positionType: 'absolute', top: 10 };
|
|
50
|
+
}
|
|
51
|
+
return {};
|
|
52
|
+
});
|
|
53
|
+
var widthBox = computed(function () {
|
|
54
|
+
return 700;
|
|
55
|
+
});
|
|
56
|
+
scaleX.set(1);
|
|
57
|
+
contentOpacity.set(1);
|
|
58
|
+
var currentTextIndex = signal(0);
|
|
59
|
+
var currentText = computed(function () { var _a; return (_a = texts === null || texts === void 0 ? void 0 : texts[currentTextIndex()]) !== null && _a !== void 0 ? _a : ''; });
|
|
60
|
+
var isChoiceDisplayed = signal(false);
|
|
61
|
+
var text = computed(function () {
|
|
62
|
+
var current = currentText();
|
|
63
|
+
return typeof current === "string" ? current : current.text;
|
|
64
|
+
});
|
|
65
|
+
var faceSheet = function (graphicId, animationName) {
|
|
66
|
+
return {
|
|
67
|
+
definition: client.getSpriteSheet(graphicId),
|
|
68
|
+
playing: animationName,
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
var choices = computed(function () {
|
|
72
|
+
//const current = currentText();
|
|
73
|
+
//return typeof current === "string" ? null : current.choices;
|
|
74
|
+
return _choices;
|
|
75
|
+
});
|
|
76
|
+
var visibleSelection = computed(function () { return isChoiceDisplayed() && choices().length != 0; });
|
|
77
|
+
var triggerSkip = trigger();
|
|
78
|
+
var typewriter = typewriterEffect() ? {
|
|
79
|
+
speed: 0.3,
|
|
80
|
+
skip: triggerSkip,
|
|
81
|
+
sound: {
|
|
82
|
+
src: (_e = sounds.get(dialogBoxTypewriterSound)) === null || _e === void 0 ? void 0 : _e.src
|
|
83
|
+
},
|
|
84
|
+
onComplete: function () {
|
|
85
|
+
isTextCompleted.set(true);
|
|
86
|
+
if (autoClose()) {
|
|
87
|
+
setTimeout(function () {
|
|
88
|
+
onFinish();
|
|
89
|
+
}, 1000);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
} : null;
|
|
93
|
+
var textStyle = {
|
|
94
|
+
wordWrap: true,
|
|
95
|
+
wordWrapWidth: widthBox() - margin() * 2 - (face ? 256 : 0)
|
|
96
|
+
};
|
|
97
|
+
mount(function (element) {
|
|
98
|
+
var dialogbox = element.props.children[0];
|
|
99
|
+
return function () {
|
|
100
|
+
dialogbox.directives.controls.onDestroy();
|
|
101
|
+
isDestroyed = true;
|
|
102
|
+
// Wait destroy is finished before start processing input
|
|
103
|
+
setTimeout(function () {
|
|
104
|
+
client.stopProcessingInput = false;
|
|
105
|
+
}, 500);
|
|
106
|
+
};
|
|
107
|
+
});
|
|
108
|
+
var controls = signal({
|
|
109
|
+
next: {
|
|
110
|
+
bind: keyboardControls.action,
|
|
111
|
+
keyDown: function (e) {
|
|
112
|
+
if (isDestroyed)
|
|
113
|
+
return;
|
|
114
|
+
if (isChoiceDisplayed()) {
|
|
115
|
+
// If choices are displayed, do nothing (wait for selection)
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
// If text is still typing, just skip (fast forward) the animation
|
|
119
|
+
if (!isTextCompleted()) {
|
|
120
|
+
triggerSkip.start();
|
|
121
|
+
isTextCompleted.set(true);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
var isFinished = currentTextIndex() === texts.length - 1;
|
|
125
|
+
currentTextIndex.update(function (index) {
|
|
126
|
+
if (index < texts.length - 1) {
|
|
127
|
+
return index + 1;
|
|
128
|
+
}
|
|
129
|
+
return index;
|
|
130
|
+
});
|
|
131
|
+
isChoiceDisplayed.set(false);
|
|
132
|
+
isTextCompleted.set(false);
|
|
133
|
+
if (isFinished && onFinish) {
|
|
134
|
+
onFinish();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
var onSelect = function (index) {
|
|
141
|
+
onFinish(index);
|
|
142
|
+
};
|
|
143
|
+
effect(function () {
|
|
144
|
+
if (choices().length != 0) {
|
|
145
|
+
isChoiceDisplayed.set(true);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
let $this = h(Container, { justifyContent: 'center', alignItems: 'center', width: '100%', height: '100%' }, h(Container, { ref: 'dialogbox', scale: { x: scaleX }, anchor: [0.5, 0.5], width: widthBox, height, controls, ...positionBox() }, [h(Rect, { width: widthBox, height, color: dialogboxStyles.backgroundColor, alpha: dialogboxStyles.backgroundOpacity }), h(Container, { flexDirection: 'row', width: widthBox, height, alpha: contentOpacity }, h(Container, { flexDirection: 'row' }, [h(Container, { flexDirection: 'column' }, [h(Text, { text, color: '#fff', fontSize: 18, margin, typewriter, style: textStyle }), cond(visibleSelection, () => h(component$1, { selectedIndex: 0, items: choices, onSelect }))]), cond(face, () => h(Sprite, { sheet: faceSheet(face.id, face.expression) }))]))]));
|
|
149
|
+
return $this
|
|
150
|
+
}
|
|
6
151
|
|
|
7
|
-
export {
|
|
152
|
+
export { component as default };
|
|
8
153
|
//# sourceMappingURL=index10.js.map
|
package/dist/index10.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index10.js","sources":["../src/components/gui/index.ts"],"sourcesContent":["import Dialogbox from \"./dialogbox/index.ce\";\n\nexport const PrebuiltGui = {\n Dialogbox\n}"],"names":["Dialogbox"],"mappings":";;AAEO,MAAM,WAAc,GAAA;AAAA,aACvBA;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"index10.js","sources":["../src/components/gui/dialogbox/index.ce"],"sourcesContent":["<Container justifyContent=\"center\" alignItems=\"center\" width=\"100%\" height=\"100%\">\n <Container\n ref=\"dialogbox\"\n scale={{ x: scaleX }}\n anchor={[0.5, 0.5]}\n width={widthBox}\n height\n controls\n ...positionBox()\n >\n <Rect \n width={widthBox} \n height \n color={@dialogboxStyles.@backgroundColor} \n alpha={@dialogboxStyles.@backgroundOpacity} />\n <Container\n flexDirection=\"row\"\n width={widthBox}\n height\n alpha={contentOpacity}\n >\n <Container flexDirection=\"row\">\n <Container flexDirection=\"column\">\n <Text\n text\n color=\"#fff\"\n fontSize={18}\n margin\n typewriter\n style={textStyle}\n />\n @if (visibleSelection) {\n <Selection selectedIndex={0} items={choices} onSelect />\n }\n </Container>\n @if (face) {\n <Sprite sheet={@faceSheet(@face.@id, @face.@expression)} />\n }\n </Container>\n </Container>\n</Container> \n\n \n</Container>\n<script>\n import Selection from './selection.ce'\n\n import {\n animatedSignal,\n computed,\n effect,\n signal,\n trigger,\n mount\n } from \"canvasengine\";\n\n import { inject } from \"../../../core/inject\";\n import { RpgClientEngine } from \"../../../RpgClientEngine\";\n import BoxComponent from \"../box.ce\";\n\n const {\n message,\n choices: _choices,\n onFinish,\n onInteraction,\n face,\n position,\n typewriterEffect,\n autoClose\n } = defineProps();\n \n const client = inject(RpgClientEngine);\n const keyboardControls = client.globalConfig.keyboardControls;\n\n const dialogboxStyles = client.globalConfig.box.styles ?? {\n backgroundColor: \"#1a1a2e\",\n backgroundOpacity: 0.9,\n }\n const dialogBoxTypewriterSound = client.globalConfig?.box?.sounds?.typewriter\n\n const sounds = client.sounds;\n\n client.stopProcessingInput = true;\n let isDestroyed = false;\n\n const texts = [message()]\n const height = signal(256);\n const margin = signal(40);\n const isTextCompleted = signal(false);\n\n const drawSpeaker = (g) => {\n g.beginFill(0xffa500); // Orange color\n g.lineStyle(2, 0x000000); // Black border\n g.moveTo(0, 0);\n g.lineTo(70, 0);\n g.lineTo(80, 15);\n g.lineTo(70, 30);\n g.lineTo(0, 30);\n g.lineTo(0, 0);\n g.endFill();\n };\n\n const border = signal({ width: 5, color: \"#595971\" });\n const shadow = signal({ color: \"#000\", blur: 10, offsetX: 10, offsetY: 10 });\n\n const contentOpacity = animatedSignal(0, {\n duration: 1000,\n });\n\n const scaleX = animatedSignal(0, {\n duration: 500,\n });\n\n const positionBox = computed(() => {\n if (position() === 'bottom') {\n return { positionType: 'absolute', bottom: 10 };\n }\n else if (position() === 'top') {\n return { positionType: 'absolute', top: 10 };\n }\n return {};\n });\n\n const widthBox = computed(() => {\n return 700;\n });\n\n scaleX.set(1);\n contentOpacity.set(1);\n\n const currentTextIndex = signal(0);\n const currentText = computed(() => texts?.[currentTextIndex()] ?? '');\n const isChoiceDisplayed = signal(false);\n\n const text = computed(() => {\n const current = currentText();\n return typeof current === \"string\" ? current : current.text;\n });\n\n const faceSheet = (graphicId, animationName) => {\n return {\n definition: client.getSpriteSheet(graphicId),\n playing: animationName,\n };\n }\n\n const choices = computed(() => {\n //const current = currentText();\n //return typeof current === \"string\" ? null : current.choices;\n return _choices;\n });\n\n const visibleSelection = computed(() => isChoiceDisplayed() && choices().length != 0)\n\n const triggerSkip = trigger();\n\n const typewriter = typewriterEffect() ? {\n speed: 0.3,\n skip: triggerSkip,\n sound: {\n src: sounds.get(dialogBoxTypewriterSound)?.src\n },\n onComplete: () => {\n isTextCompleted.set(true);\n if (autoClose()) {\n setTimeout(() => {\n onFinish();\n }, 1000);\n }\n }\n } : null;\n\n const textStyle = {\n wordWrap: true,\n wordWrapWidth: widthBox() - margin() * 2 - (face ? 256 : 0)\n }\n\n mount((element) => {\n const [dialogbox] = element.props.children\n return () => {\n dialogbox.directives.controls.onDestroy()\n isDestroyed = true;\n // Wait destroy is finished before start processing input\n setTimeout(() => {\n client.stopProcessingInput = false;\n }, 500)\n }\n })\n\n const controls = signal({\n next: {\n bind: keyboardControls.action,\n keyDown(e) {\n if (isDestroyed) return;\n if (isChoiceDisplayed()) {\n // If choices are displayed, do nothing (wait for selection)\n return;\n }\n\n // If text is still typing, just skip (fast forward) the animation\n if (!isTextCompleted()) {\n triggerSkip.start();\n isTextCompleted.set(true);\n }\n else {\n const isFinished = currentTextIndex() === texts.length - 1;\n currentTextIndex.update((index) => {\n if (index < texts.length - 1) {\n return index + 1;\n }\n return index;\n });\n isChoiceDisplayed.set(false);\n isTextCompleted.set(false);\n if (isFinished && onFinish) {\n onFinish();\n } \n }\n },\n },\n });\n\n const onSelect = (index) => {\n onFinish(index);\n }\n \n effect(() => {\n if (choices().length != 0) {\n isChoiceDisplayed.set(true);\n }\n });\n</script>"],"names":["Selection"],"mappings":";;;;;AAYqB,SAAS,SAAS,CAAC,OAAO,EAAE;AACjD,QAAuB,QAAQ,CAAC,OAAO;AACvC,QAAQ,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO;AAClD,QAAQ,IAAI,QAAQ,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,KAAK,YAAY;AAC9D,IAAI,QAAQ,GAAG,MAAM,CAAC,MAAM,IAAI,SAAS,CAAC,EAAE;AAC5C,QAAQ,KAAK,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;AAC7D,YAAY,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC;AAC5B,YAAY,KAAK,IAA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import { useProps, useDefineProps, computed, h, Container, Rect } from 'canvasengine';
|
|
2
|
+
import { RpgClientEngine } from './index2.js';
|
|
3
|
+
import './index26.js';
|
|
4
|
+
import '@rpgjs/common';
|
|
5
|
+
import './index19.js';
|
|
6
|
+
import { inject } from './index6.js';
|
|
7
|
+
import 'rxjs';
|
|
8
|
+
import './index27.js';
|
|
9
|
+
import './index17.js';
|
|
10
|
+
import '@canvasengine/presets';
|
|
11
|
+
import './index18.js';
|
|
3
12
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
13
|
+
function component($$props) {
|
|
14
|
+
useProps($$props);
|
|
15
|
+
const defineProps = useDefineProps($$props);
|
|
16
|
+
var _a = defineProps(), width = _a.width, height = _a.height, children = _a.children, color = _a.color, top = _a.top, left = _a.left;
|
|
17
|
+
var engine = inject(RpgClientEngine);
|
|
18
|
+
var child = children[0];
|
|
19
|
+
var _color = computed(function () { var _a; return ((_a = engine.globalConfig.gui) === null || _a === void 0 ? void 0 : _a.windowColor) || (color === null || color === void 0 ? void 0 : color()) || "#1a1a2e"; });
|
|
20
|
+
let $this = h(Container, { positionType: 'absolute', top: top, left: left }, h(Container, { anchor: [0.5, 0.5] }, [h(Rect, { width, height, color: _color }), h(Container, { attach: child })]));
|
|
21
|
+
return $this
|
|
22
|
+
}
|
|
8
23
|
|
|
9
|
-
export {
|
|
24
|
+
export { component as default };
|
|
10
25
|
//# sourceMappingURL=index11.js.map
|
package/dist/index11.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index11.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index11.js","sources":["../src/components/gui/box.ce"],"sourcesContent":["<Container positionType=\"absolute\" top={top} left={left}>\n <Container\n anchor={[0.5, 0.5]}\n >\n <Rect width height color={_color} />\n <Container attach={child}></Container>\n </Container> \n</Container>\n\n<script>\n import { RpgClientEngine, inject } from \"../../index\";\n\n const { width, height, children, color, top, left } = defineProps();\n const engine = in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,CAAC,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;AACvM,QAAQ,OAAO;AACf,MAAM;;;;"}
|
package/dist/index12.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import component$1 from './index28.js';
|
|
2
|
+
import component from './index29.js';
|
|
2
3
|
|
|
3
|
-
const
|
|
4
|
-
|
|
4
|
+
const PrebuiltComponentAnimations = {
|
|
5
|
+
Hit: component$1,
|
|
6
|
+
Animation: component
|
|
5
7
|
};
|
|
6
8
|
|
|
7
|
-
export {
|
|
9
|
+
export { PrebuiltComponentAnimations };
|
|
8
10
|
//# sourceMappingURL=index12.js.map
|
package/dist/index12.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index12.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index12.js","sources":["../src/components/animations/index.ts"],"sourcesContent":["import Hit from \"./hit.ce\";\nimport Animation from \"./animation.ce\";\n\nexport const PrebuiltComponentAnimations = {\n Hit,\n Animation\n}"],"names":["Hit","Animation"],"mappings":";;;AAGO,MAAM,2BAAA,GAA8B;AAAA,OACvCA,WAAA;AAAA,aACAC;AACJ;;;;"}
|
package/dist/index13.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import { AnimationSpritesheetPreset } from './index30.js';
|
|
2
|
+
import { LPCSpritesheetPreset } from './index31.js';
|
|
3
|
+
import { RMSpritesheet } from './index32.js';
|
|
4
|
+
import { FacesetPreset } from './index33.js';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
let $this = h(Container, { sortableChildren: true }, [loop(events, (event, id) => h(component$1, { id: id, object: event, isMe: false })), loop(players, (player, id) => h(component$1, { id: id, object: player, isMe: true }))]);
|
|
13
|
-
return $this
|
|
14
|
-
}
|
|
6
|
+
const Presets = {
|
|
7
|
+
RMSpritesheet,
|
|
8
|
+
LPCSpritesheetPreset,
|
|
9
|
+
AnimationSpritesheetPreset,
|
|
10
|
+
FacesetPreset
|
|
11
|
+
};
|
|
15
12
|
|
|
16
|
-
export {
|
|
13
|
+
export { Presets };
|
|
17
14
|
//# sourceMappingURL=index13.js.map
|
package/dist/index13.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index13.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index13.js","sources":["../src/presets/index.ts"],"sourcesContent":["import { AnimationSpritesheetPreset } from \"./animation\";\nimport { LPCSpritesheetPreset } from \"./lpc\";\nimport { RMSpritesheet } from \"./rmspritesheet\";\nimport { FacesetPreset } from \"./faceset\";\n\nexport const Presets = {\n RMSpritesheet,\n LPCSpritesheetPreset,\n AnimationSpritesheetPreset,\n FacesetPreset\n}"],"names":[],"mappings":";;;;;AAKO,MAAM,OAAA,GAAU;AAAA,EACnB,aAAA;AAAA,EACA,oBAAA;AAAA,EACA,0BAAA;AAAA,EACA;AACJ;;;;"}
|
package/dist/index14.js
CHANGED
|
@@ -1,48 +1,16 @@
|
|
|
1
|
-
import { useProps, useDefineProps,
|
|
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 './
|
|
5
|
-
import { RpgGui } from './index9.js';
|
|
4
|
+
import component$1 from './index15.js';
|
|
6
5
|
|
|
7
6
|
function component($$props) {
|
|
8
7
|
useProps($$props);
|
|
9
|
-
useDefineProps($$props);
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
}
|
|
17
|
-
return t;
|
|
18
|
-
};
|
|
19
|
-
return __assign.apply(this, arguments);
|
|
20
|
-
};
|
|
21
|
-
var engine = inject(RpgClientEngine);
|
|
22
|
-
var guiService = inject(RpgGui);
|
|
23
|
-
var sceneData = engine.sceneMap.data;
|
|
24
|
-
var gui = guiService.gui;
|
|
25
|
-
var worldWidth = computed(function () { var _a; return (_a = sceneData()) === null || _a === void 0 ? void 0 : _a.width; });
|
|
26
|
-
var worldHeight = computed(function () { var _a; return (_a = sceneData()) === null || _a === void 0 ? void 0 : _a.height; });
|
|
27
|
-
effect(function () {
|
|
28
|
-
if (sceneData() && !sceneData().component) {
|
|
29
|
-
throw new Error("Warning ! You need to define a component for the scene. Use provideLoadMap() to define a component for the scene.");
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
var onGuiFinish = function (gui, data) {
|
|
33
|
-
guiService.guiClose(gui.name, data);
|
|
34
|
-
};
|
|
35
|
-
var onGuiInteraction = function (gui, name, data) {
|
|
36
|
-
guiService.guiInteraction(gui.name, name, data);
|
|
37
|
-
};
|
|
38
|
-
var clamp = {
|
|
39
|
-
direction: "all"
|
|
40
|
-
};
|
|
41
|
-
let $this = h(Canvas, { width: computed(() => engine.width()), height: computed(() => engine.height()) }, [h(Viewport, { worldWidth, worldHeight, clamp }, cond(sceneData, () => h(component$1))), loop(gui, gui => h(Container, { display: 'flex' }, cond(gui.display, () => h(gui.component, { ...gui.data(), onFinish: (data) => {
|
|
42
|
-
onGuiFinish(gui, data);
|
|
43
|
-
}, onInteraction: (name, data) => {
|
|
44
|
-
onGuiInteraction(gui, name, data);
|
|
45
|
-
} }))))]);
|
|
8
|
+
const defineProps = useDefineProps($$props);
|
|
9
|
+
var engine = inject(RpgClientEngine);
|
|
10
|
+
var children = defineProps().children;
|
|
11
|
+
var players = engine.sceneMap.players;
|
|
12
|
+
var events = engine.sceneMap.events;
|
|
13
|
+
let $this = h(Container, { sortableChildren: true }, [loop(events, (event, id) => h(component$1, { id: id, object: event })), loop(players, (player, id) => h(component$1, { id: id, object: player })), loop(children, child => h(child))]);
|
|
46
14
|
return $this
|
|
47
15
|
}
|
|
48
16
|
|
package/dist/index14.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index14.js","sources":["../src/components/scenes/
|
|
1
|
+
{"version":3,"file":"index14.js","sources":["../src/components/scenes/event-layer.ce"],"sourcesContent":["<Container sortableChildren={true}>\n @for ((event,id) of events) {\n <Character id={id} object={event} />\n }\n\n @for ((player,id) of players) {\n <Character id={id} object={player} />\n }\n\n @for (child of children) {\n <child />\n }\n</Container>\n\n<script>\n import { effect, signal } from 'canvasengine'\n import { inject } from \"../../core/inject\";\n import { RpgClientEngine } from \"../../RpgClientEngine\";\n import Character from \"../character.ce\";\n \n const engine = inject(RpgClientEngine);\n const { children } = defineProps()\n \n const players = engine.sceneMap.players\n const events = engine.sceneMap.events\n</script>"],"names":["Character"],"mappings":";;;;;AAQqB,SAAS,SAAS,CAAC,OAAO,EAAE;AACjD,QAAuB,QAAQ,CAAC,OAAO;AACvC,QAAQ,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO;AAClD,QAAQ,IAAI,MAAM,GAAG,MAAM,CAAC,eAAe,CAAC;AAC5C,IAAI,QAAQ,GAAG,WAAW,EAAE,CAAC,QAAQ;AACrC,IAAI,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO;AACrC,IAAI,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC7B,QAAQ,IAAI,KAAK,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,KAAK,CAAC,CAACA,WAAS,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,KAAK,CAAC,CAACA,WAAS,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AAC/O,QAAQ,OAAO;AACf,MAAM;;;;"}
|