@rpgjs/client 5.0.0-alpha.2 → 5.0.0-alpha.3
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/CHANGELOG.md +9 -0
- package/dist/index13.js +1 -1
- package/dist/index20.js +1 -1
- package/dist/index22.js +1 -1
- package/dist/index29.js +1 -1
- package/dist/index30.js +1 -1
- package/dist/index35.js +85 -310
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +32 -62
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +17 -58
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +17 -17
- package/dist/index38.js.map +1 -1
- package/package.json +1 -1
- package/dist/index39.js +0 -20
- package/dist/index39.js.map +0 -1
package/CHANGELOG.md
ADDED
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 './index35.js';
|
|
5
5
|
|
|
6
6
|
function component($$props) {
|
|
7
7
|
useProps($$props);
|
package/dist/index20.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { dset } from './index33.js';
|
|
2
2
|
import z from './index34.js';
|
|
3
3
|
import { syncClass, generateShortUUID as generateShortUUID$1, createStatesSnapshot, id, sync, persist, load, getByPath, DELETE_TOKEN } from './index17.js';
|
|
4
|
-
import { signal } from './
|
|
4
|
+
import { signal } from './index27.js';
|
|
5
5
|
|
|
6
6
|
var __defProp = Object.defineProperty;
|
|
7
7
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
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 './index36.js';
|
|
3
3
|
import { inject } from './index6.js';
|
|
4
4
|
import { RpgClientEngine } from './index2.js';
|
|
5
5
|
|
package/dist/index29.js
CHANGED
package/dist/index30.js
CHANGED
package/dist/index35.js
CHANGED
|
@@ -1,316 +1,91 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useProps, useDefineProps, computed, signal, h, Container, loop, Sprite } from 'canvasengine';
|
|
2
|
+
import { Particle } from '@canvasengine/presets';
|
|
3
|
+
import { RpgClientEngine } from './index2.js';
|
|
4
|
+
import { inject } from './index6.js';
|
|
5
|
+
import { Direction } from '@rpgjs/common';
|
|
2
6
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
7
|
+
function component($$props) {
|
|
8
|
+
useProps($$props);
|
|
9
|
+
const defineProps = useDefineProps($$props);
|
|
10
|
+
var _a = defineProps(), object = _a.object; _a.id; var isMe = _a.isMe;
|
|
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(); };
|
|
31
|
+
var keyboardControls = client.globalConfig.keyboardControls;
|
|
32
|
+
var controls = signal({
|
|
33
|
+
down: {
|
|
34
|
+
repeat: true,
|
|
35
|
+
bind: keyboardControls.down,
|
|
36
|
+
keyDown: function () {
|
|
37
|
+
if (canControls())
|
|
38
|
+
client.processInput({ input: Direction.Down });
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
up: {
|
|
42
|
+
repeat: true,
|
|
43
|
+
bind: keyboardControls.up,
|
|
44
|
+
keyDown: function () {
|
|
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 });
|
|
55
|
+
},
|
|
56
|
+
},
|
|
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: {
|
|
66
|
+
bind: keyboardControls.action,
|
|
67
|
+
keyDown: function () {
|
|
68
|
+
if (canControls()) {
|
|
69
|
+
client.processAction({ action: 'action' });
|
|
70
|
+
// particleName.set('hit')
|
|
71
|
+
// emitParticleTrigger.start()
|
|
72
|
+
// object.flash('red')
|
|
65
73
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
type: changeType,
|
|
71
|
-
index,
|
|
72
|
-
items: itemsToEmit
|
|
73
|
-
});
|
|
74
|
-
} else {
|
|
75
|
-
this.next({
|
|
76
|
-
type: changeType,
|
|
77
|
-
index,
|
|
78
|
-
items: args
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return result;
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
return Reflect.get(target, prop, receiver);
|
|
86
|
-
}, "get"),
|
|
87
|
-
set: /* @__PURE__ */ __name((target, prop, value) => {
|
|
88
|
-
const index = !isNaN(Number(prop)) ? Number(prop) : void 0;
|
|
89
|
-
target[prop] = value;
|
|
90
|
-
this.next({
|
|
91
|
-
type: "update",
|
|
92
|
-
index,
|
|
93
|
-
items: [
|
|
94
|
-
value
|
|
95
|
-
]
|
|
96
|
-
});
|
|
97
|
-
return true;
|
|
98
|
-
}, "set")
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
get items() {
|
|
102
|
-
return this._items;
|
|
103
|
-
}
|
|
104
|
-
set items(newItems) {
|
|
105
|
-
this.createProxy(newItems);
|
|
106
|
-
this.next({
|
|
107
|
-
type: "reset",
|
|
108
|
-
items: newItems
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
var ObjectSubject = class extends BehaviorSubject {
|
|
113
|
-
static {
|
|
114
|
-
__name(this, "ObjectSubject");
|
|
115
|
-
}
|
|
116
|
-
_obj;
|
|
117
|
-
constructor(obj = {}) {
|
|
118
|
-
super({
|
|
119
|
-
type: "init",
|
|
120
|
-
value: obj
|
|
121
|
-
});
|
|
122
|
-
this.createProxy(obj);
|
|
123
|
-
}
|
|
124
|
-
createProxy(obj) {
|
|
125
|
-
this._obj = new Proxy(obj, {
|
|
126
|
-
get: /* @__PURE__ */ __name((target, prop, receiver) => {
|
|
127
|
-
return Reflect.get(target, prop, receiver);
|
|
128
|
-
}, "get"),
|
|
129
|
-
set: /* @__PURE__ */ __name((target, prop, value, receiver) => {
|
|
130
|
-
const key = prop;
|
|
131
|
-
const changeType = key in target ? "update" : "add";
|
|
132
|
-
target[key] = value;
|
|
133
|
-
this.next({
|
|
134
|
-
type: changeType,
|
|
135
|
-
key,
|
|
136
|
-
value
|
|
137
|
-
});
|
|
138
|
-
return true;
|
|
139
|
-
}, "set"),
|
|
140
|
-
deleteProperty: /* @__PURE__ */ __name((target, prop) => {
|
|
141
|
-
const key = prop;
|
|
142
|
-
if (key in target) {
|
|
143
|
-
const value = target[key];
|
|
144
|
-
delete target[key];
|
|
145
|
-
this.next({
|
|
146
|
-
type: "remove",
|
|
147
|
-
key,
|
|
148
|
-
value
|
|
149
|
-
});
|
|
150
|
-
return true;
|
|
151
|
-
}
|
|
152
|
-
return false;
|
|
153
|
-
}, "deleteProperty")
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
get obj() {
|
|
157
|
-
return this._obj;
|
|
158
|
-
}
|
|
159
|
-
set obj(newObj) {
|
|
160
|
-
this.createProxy(newObj);
|
|
161
|
-
this.next({
|
|
162
|
-
type: "reset",
|
|
163
|
-
value: newObj
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
var getGlobalReactiveStore = /* @__PURE__ */ __name(() => {
|
|
168
|
-
const globalKey = "__REACTIVE_STORE__";
|
|
169
|
-
if (typeof globalThis !== "undefined") {
|
|
170
|
-
if (!globalThis[globalKey]) {
|
|
171
|
-
globalThis[globalKey] = {
|
|
172
|
-
currentDependencyTracker: null,
|
|
173
|
-
currentSubscriptionsTracker: null
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
return globalThis[globalKey];
|
|
177
|
-
}
|
|
178
|
-
let globalObj;
|
|
179
|
-
if (typeof window !== "undefined") {
|
|
180
|
-
globalObj = window;
|
|
181
|
-
} else if (typeof process !== "undefined" && process.versions && process.versions.node) {
|
|
182
|
-
globalObj = Function("return this")();
|
|
183
|
-
} else if (typeof self !== "undefined") {
|
|
184
|
-
globalObj = self;
|
|
185
|
-
} else {
|
|
186
|
-
console.warn("Unable to find global object, using local instance");
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
var sheet = function (graphicId) {
|
|
187
78
|
return {
|
|
188
|
-
|
|
189
|
-
|
|
79
|
+
definition: spritesheets.get(graphicId),
|
|
80
|
+
playing: animationName,
|
|
81
|
+
params: {
|
|
82
|
+
direction: direction
|
|
83
|
+
},
|
|
190
84
|
};
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
currentSubscriptionsTracker: null
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
return globalObj[globalKey];
|
|
199
|
-
}, "getGlobalReactiveStore");
|
|
200
|
-
var reactiveStore = getGlobalReactiveStore();
|
|
201
|
-
var trackDependency = /* @__PURE__ */ __name((signal2) => {
|
|
202
|
-
if (reactiveStore.currentDependencyTracker) {
|
|
203
|
-
reactiveStore.currentDependencyTracker(signal2);
|
|
204
|
-
}
|
|
205
|
-
}, "trackDependency");
|
|
206
|
-
function signal(defaultValue) {
|
|
207
|
-
let subject;
|
|
208
|
-
if (Array.isArray(defaultValue)) {
|
|
209
|
-
subject = new ArraySubject(defaultValue);
|
|
210
|
-
} else if (typeof defaultValue === "object" && defaultValue !== null) {
|
|
211
|
-
subject = new ObjectSubject(defaultValue);
|
|
212
|
-
} else {
|
|
213
|
-
subject = new BehaviorSubject(defaultValue);
|
|
214
|
-
}
|
|
215
|
-
const getValue = /* @__PURE__ */ __name(() => {
|
|
216
|
-
if (subject instanceof ArraySubject) {
|
|
217
|
-
return subject.items;
|
|
218
|
-
} else if (subject instanceof ObjectSubject) {
|
|
219
|
-
return subject.obj;
|
|
220
|
-
}
|
|
221
|
-
return subject.value;
|
|
222
|
-
}, "getValue");
|
|
223
|
-
const fn = /* @__PURE__ */ __name(function() {
|
|
224
|
-
trackDependency(fn);
|
|
225
|
-
return getValue();
|
|
226
|
-
}, "fn");
|
|
227
|
-
fn.set = (value) => {
|
|
228
|
-
if (subject instanceof ArraySubject) {
|
|
229
|
-
subject.items = value;
|
|
230
|
-
} else if (subject instanceof ObjectSubject) {
|
|
231
|
-
subject.obj = value;
|
|
232
|
-
} else {
|
|
233
|
-
subject.next(value);
|
|
234
|
-
}
|
|
235
|
-
};
|
|
236
|
-
fn._isFrozen = false;
|
|
237
|
-
fn.freeze = () => {
|
|
238
|
-
fn._isFrozen = true;
|
|
239
|
-
};
|
|
240
|
-
fn.unfreeze = () => {
|
|
241
|
-
fn._isFrozen = false;
|
|
242
|
-
if (subject instanceof ArraySubject) {
|
|
243
|
-
subject.next({
|
|
244
|
-
type: "init",
|
|
245
|
-
items: subject.items
|
|
246
|
-
});
|
|
247
|
-
} else if (subject instanceof ObjectSubject) {
|
|
248
|
-
subject.next({
|
|
249
|
-
type: "init",
|
|
250
|
-
value: subject.obj
|
|
251
|
-
});
|
|
252
|
-
} else {
|
|
253
|
-
subject.next(subject.value);
|
|
254
|
-
}
|
|
255
|
-
};
|
|
256
|
-
fn.mutate = (mutateFn) => {
|
|
257
|
-
const value = getValue();
|
|
258
|
-
mutateFn(value);
|
|
259
|
-
};
|
|
260
|
-
fn.update = (updateFn) => {
|
|
261
|
-
const updatedValue = updateFn(getValue());
|
|
262
|
-
fn.set(updatedValue);
|
|
263
|
-
};
|
|
264
|
-
fn.observable = subject.asObservable().pipe(filter(() => !fn._isFrozen));
|
|
265
|
-
fn._subject = subject;
|
|
266
|
-
return fn;
|
|
267
|
-
}
|
|
268
|
-
__name(signal, "signal");
|
|
269
|
-
function isSignal(value) {
|
|
270
|
-
return !!(value && value.observable);
|
|
271
|
-
}
|
|
272
|
-
__name(isSignal, "isSignal");
|
|
273
|
-
function isComputed(value) {
|
|
274
|
-
return isSignal(value) && !!value.dependencies;
|
|
275
|
-
}
|
|
276
|
-
__name(isComputed, "isComputed");
|
|
277
|
-
function computed(computeFunction, disposableFn) {
|
|
278
|
-
const dependencies = /* @__PURE__ */ new Set();
|
|
279
|
-
let init = true;
|
|
280
|
-
let lastComputedValue;
|
|
281
|
-
const previousTracker = reactiveStore.currentDependencyTracker;
|
|
282
|
-
reactiveStore.currentDependencyTracker = (signal2) => {
|
|
283
|
-
dependencies.add(signal2);
|
|
284
|
-
};
|
|
285
|
-
lastComputedValue = computeFunction();
|
|
286
|
-
if (computeFunction["isEffect"]) {
|
|
287
|
-
disposableFn = lastComputedValue;
|
|
288
|
-
}
|
|
289
|
-
reactiveStore.currentDependencyTracker = previousTracker;
|
|
290
|
-
const computedObservable = combineLatest([
|
|
291
|
-
...dependencies
|
|
292
|
-
].map((signal2) => signal2.observable)).pipe(filter(() => !init), map(() => computeFunction()), finalize(() => disposableFn?.()));
|
|
293
|
-
const fn = /* @__PURE__ */ __name(function() {
|
|
294
|
-
trackDependency(fn);
|
|
295
|
-
return lastComputedValue;
|
|
296
|
-
}, "fn");
|
|
297
|
-
fn.observable = computedObservable;
|
|
298
|
-
fn.subscription = computedObservable.subscribe((value) => {
|
|
299
|
-
lastComputedValue = value;
|
|
300
|
-
});
|
|
301
|
-
fn.dependencies = dependencies;
|
|
302
|
-
reactiveStore.currentSubscriptionsTracker?.(fn.subscription);
|
|
303
|
-
init = false;
|
|
304
|
-
return fn;
|
|
305
|
-
}
|
|
306
|
-
__name(computed, "computed");
|
|
307
|
-
|
|
308
|
-
// src/effect.ts
|
|
309
|
-
function effect(fn) {
|
|
310
|
-
fn["isEffect"] = true;
|
|
311
|
-
return computed(fn);
|
|
312
|
-
}
|
|
313
|
-
__name(effect, "effect");
|
|
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 }))]);
|
|
87
|
+
return $this
|
|
88
|
+
}
|
|
314
89
|
|
|
315
|
-
export {
|
|
90
|
+
export { component as default };
|
|
316
91
|
//# sourceMappingURL=index35.js.map
|
package/dist/index35.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index35.js","sources":["../../../node_modules/.pnpm/@signe+reactive@2.3.1/node_modules/@signe/reactive/dist/index.js"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/ArraySubject.ts\nimport { BehaviorSubject } from \"rxjs\";\nvar ArraySubject = class extends BehaviorSubject {\n static {\n __name(this, \"ArraySubject\");\n }\n _items = [];\n constructor(items = []) {\n super({\n type: \"init\",\n items\n });\n this.createProxy(items);\n }\n createProxy(items) {\n this._items = new Proxy(items, {\n get: /* @__PURE__ */ __name((target, prop, receiver) => {\n const origMethod = target[prop];\n if (typeof origMethod === \"function\") {\n return (...args) => {\n let changeType = \"update\";\n let index = void 0;\n let isMutateFn = false;\n let itemsToEmit = [];\n let changeSplice = true;\n switch (prop) {\n case \"push\":\n index = target.length;\n changeType = \"add\";\n isMutateFn = true;\n break;\n case \"pop\":\n index = target.length - 1;\n changeType = \"remove\";\n isMutateFn = true;\n break;\n case \"unshift\":\n index = 0;\n changeType = \"add\";\n isMutateFn = true;\n break;\n case \"shift\":\n index = 0;\n changeType = \"remove\";\n isMutateFn = true;\n break;\n case \"splice\":\n index = args[0];\n const deleteCount = args[1];\n const newItems = args.slice(2);\n itemsToEmit = newItems;\n if (deleteCount > 0 && newItems.length === 0) {\n changeType = \"remove\";\n } else if (deleteCount === 0 && newItems.length > 0) {\n changeType = \"add\";\n } else if (deleteCount === 0 && newItems.length === 0) {\n changeSplice = false;\n } else {\n changeType = \"update\";\n }\n isMutateFn = true;\n break;\n }\n const result = origMethod.apply(target, args);\n if (isMutateFn && changeSplice) {\n if (prop === \"splice\") {\n this.next({\n type: changeType,\n index,\n items: itemsToEmit\n });\n } else {\n this.next({\n type: changeType,\n index,\n items: args\n });\n }\n }\n return result;\n };\n }\n return Reflect.get(target, prop, receiver);\n }, \"get\"),\n set: /* @__PURE__ */ __name((target, prop, value) => {\n const index = !isNaN(Number(prop)) ? Number(prop) : void 0;\n target[prop] = value;\n this.next({\n type: \"update\",\n index,\n items: [\n value\n ]\n });\n return true;\n }, \"set\")\n });\n }\n get items() {\n return this._items;\n }\n set items(newItems) {\n this.createProxy(newItems);\n this.next({\n type: \"reset\",\n items: newItems\n });\n }\n};\nvar isArraySubject = /* @__PURE__ */ __name((value) => {\n return \"_items\" in value;\n}, \"isArraySubject\");\n\n// src/ObjectSubject.ts\nimport { BehaviorSubject as BehaviorSubject2 } from \"rxjs\";\nvar ObjectSubject = class extends BehaviorSubject2 {\n static {\n __name(this, \"ObjectSubject\");\n }\n _obj;\n constructor(obj = {}) {\n super({\n type: \"init\",\n value: obj\n });\n this.createProxy(obj);\n }\n createProxy(obj) {\n this._obj = new Proxy(obj, {\n get: /* @__PURE__ */ __name((target, prop, receiver) => {\n return Reflect.get(target, prop, receiver);\n }, \"get\"),\n set: /* @__PURE__ */ __name((target, prop, value, receiver) => {\n const key = prop;\n const changeType = key in target ? \"update\" : \"add\";\n target[key] = value;\n this.next({\n type: changeType,\n key,\n value\n });\n return true;\n }, \"set\"),\n deleteProperty: /* @__PURE__ */ __name((target, prop) => {\n const key = prop;\n if (key in target) {\n const value = target[key];\n delete target[key];\n this.next({\n type: \"remove\",\n key,\n value\n });\n return true;\n }\n return false;\n }, \"deleteProperty\")\n });\n }\n get obj() {\n return this._obj;\n }\n set obj(newObj) {\n this.createProxy(newObj);\n this.next({\n type: \"reset\",\n value: newObj\n });\n }\n};\nvar isObjectSubject = /* @__PURE__ */ __name((value) => {\n return \"_obj\" in value;\n}, \"isObjectSubject\");\n\n// src/signal.ts\nimport { BehaviorSubject as BehaviorSubject3, combineLatest, filter, finalize, map } from \"rxjs\";\nvar getGlobalReactiveStore = /* @__PURE__ */ __name(() => {\n const globalKey = \"__REACTIVE_STORE__\";\n if (typeof globalThis !== \"undefined\") {\n if (!globalThis[globalKey]) {\n globalThis[globalKey] = {\n currentDependencyTracker: null,\n currentSubscriptionsTracker: null\n };\n }\n return globalThis[globalKey];\n }\n let globalObj;\n if (typeof window !== \"undefined\") {\n globalObj = window;\n } else if (typeof process !== \"undefined\" && process.versions && process.versions.node) {\n globalObj = Function(\"return this\")();\n } else if (typeof self !== \"undefined\") {\n globalObj = self;\n } else {\n console.warn(\"Unable to find global object, using local instance\");\n return {\n currentDependencyTracker: null,\n currentSubscriptionsTracker: null\n };\n }\n if (!globalObj[globalKey]) {\n globalObj[globalKey] = {\n currentDependencyTracker: null,\n currentSubscriptionsTracker: null\n };\n }\n return globalObj[globalKey];\n}, \"getGlobalReactiveStore\");\nvar reactiveStore = getGlobalReactiveStore();\nvar trackDependency = /* @__PURE__ */ __name((signal2) => {\n if (reactiveStore.currentDependencyTracker) {\n reactiveStore.currentDependencyTracker(signal2);\n }\n}, \"trackDependency\");\nfunction signal(defaultValue) {\n let subject;\n if (Array.isArray(defaultValue)) {\n subject = new ArraySubject(defaultValue);\n } else if (typeof defaultValue === \"object\" && defaultValue !== null) {\n subject = new ObjectSubject(defaultValue);\n } else {\n subject = new BehaviorSubject3(defaultValue);\n }\n const getValue = /* @__PURE__ */ __name(() => {\n if (subject instanceof ArraySubject) {\n return subject.items;\n } else if (subject instanceof ObjectSubject) {\n return subject.obj;\n }\n return subject.value;\n }, \"getValue\");\n const fn = /* @__PURE__ */ __name(function() {\n trackDependency(fn);\n return getValue();\n }, \"fn\");\n fn.set = (value) => {\n if (subject instanceof ArraySubject) {\n subject.items = value;\n } else if (subject instanceof ObjectSubject) {\n subject.obj = value;\n } else {\n subject.next(value);\n }\n };\n fn._isFrozen = false;\n fn.freeze = () => {\n fn._isFrozen = true;\n };\n fn.unfreeze = () => {\n fn._isFrozen = false;\n if (subject instanceof ArraySubject) {\n subject.next({\n type: \"init\",\n items: subject.items\n });\n } else if (subject instanceof ObjectSubject) {\n subject.next({\n type: \"init\",\n value: subject.obj\n });\n } else {\n subject.next(subject.value);\n }\n };\n fn.mutate = (mutateFn) => {\n const value = getValue();\n mutateFn(value);\n };\n fn.update = (updateFn) => {\n const updatedValue = updateFn(getValue());\n fn.set(updatedValue);\n };\n fn.observable = subject.asObservable().pipe(filter(() => !fn._isFrozen));\n fn._subject = subject;\n return fn;\n}\n__name(signal, \"signal\");\nfunction isSignal(value) {\n return !!(value && value.observable);\n}\n__name(isSignal, \"isSignal\");\nfunction isComputed(value) {\n return isSignal(value) && !!value.dependencies;\n}\n__name(isComputed, \"isComputed\");\nfunction computed(computeFunction, disposableFn) {\n const dependencies = /* @__PURE__ */ new Set();\n let init = true;\n let lastComputedValue;\n const previousTracker = reactiveStore.currentDependencyTracker;\n reactiveStore.currentDependencyTracker = (signal2) => {\n dependencies.add(signal2);\n };\n lastComputedValue = computeFunction();\n if (computeFunction[\"isEffect\"]) {\n disposableFn = lastComputedValue;\n }\n reactiveStore.currentDependencyTracker = previousTracker;\n const computedObservable = combineLatest([\n ...dependencies\n ].map((signal2) => signal2.observable)).pipe(filter(() => !init), map(() => computeFunction()), finalize(() => disposableFn?.()));\n const fn = /* @__PURE__ */ __name(function() {\n trackDependency(fn);\n return lastComputedValue;\n }, \"fn\");\n fn.observable = computedObservable;\n fn.subscription = computedObservable.subscribe((value) => {\n lastComputedValue = value;\n });\n fn.dependencies = dependencies;\n reactiveStore.currentSubscriptionsTracker?.(fn.subscription);\n init = false;\n return fn;\n}\n__name(computed, \"computed\");\n\n// src/effect.ts\nfunction effect(fn) {\n fn[\"isEffect\"] = true;\n return computed(fn);\n}\n__name(effect, \"effect\");\nexport {\n ArraySubject,\n ObjectSubject,\n computed,\n effect,\n isArraySubject,\n isComputed,\n isObjectSubject,\n isSignal,\n signal\n};\n//# sourceMappingURL=index.js.map"],"names":["BehaviorSubject2","BehaviorSubject3"],"mappings":";;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc;AACrC,IAAI,MAAM,GAAG,CAAC,MAAM,EAAE,KAAK,KAAK,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;AAIrF,IAAC,YAAY,GAAG,cAAc,eAAe,CAAC;AACjD,EAAE;AACF,IAAI,MAAM,CAAC,IAAI,EAAE,cAAc,CAAC;AAChC;AACA,EAAE,MAAM,GAAG,EAAE;AACb,EAAE,WAAW,CAAC,KAAK,GAAG,EAAE,EAAE;AAC1B,IAAI,KAAK,CAAC;AACV,MAAM,IAAI,EAAE,MAAM;AAClB,MAAM;AACN,KAAK,CAAC;AACN,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAC3B;AACA,EAAE,WAAW,CAAC,KAAK,EAAE;AACrB,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI,KAAK,CAAC,KAAK,EAAE;AACnC,MAAM,GAAG,kBAAkB,MAAM,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,KAAK;AAC9D,QAAQ,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC;AACvC,QAAQ,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE;AAC9C,UAAU,OAAO,CAAC,GAAG,IAAI,KAAK;AAC9B,YAAY,IAAI,UAAU,GAAG,QAAQ;AACrC,YAAY,IAAI,KAAK,GAAG,MAAM;AAC9B,YAAY,IAAI,UAAU,GAAG,KAAK;AAClC,YAAY,IAAI,WAAW,GAAG,EAAE;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B;AACA,SAAS,MAAM,CAAC,EAAE,EAAE;AACpB,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,IAAI;AACvB,EAAE,OAAO,QAAQ,CAAC,EAAE,CAAC;AACrB;AACA,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index35.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,C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AAI,CAAC,QAAQ,EAAE,SAAS,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACtR,QAAQ,OAAO;AACf;;;;"}
|
package/dist/index36.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 './index38.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/index36.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index36.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index36.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,IAA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,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,CAAC,CAACA,WAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAC1L,QAAQ,OAAO;AACf;;;;"}
|
package/dist/index37.js
CHANGED
|
@@ -1,61 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { RpgClientEngine } from './index2.js';
|
|
4
|
-
import { inject } from './index6.js';
|
|
1
|
+
import { RpgCommonPlayer } from '@rpgjs/common';
|
|
2
|
+
import { trigger, signal } from 'canvasengine';
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
}
|
|
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
|
+
}
|
|
59
18
|
|
|
60
|
-
export {
|
|
19
|
+
export { RpgClientObject };
|
|
61
20
|
//# 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/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/dist/index38.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { trigger, signal } from 'canvasengine';
|
|
1
|
+
import { useProps, useDefineProps, animatedSignal, h, Container, Rect, Text } from 'canvasengine';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
3
|
+
function component($$props) {
|
|
4
|
+
useProps($$props);
|
|
5
|
+
const defineProps = useDefineProps($$props);
|
|
6
|
+
var _a = defineProps(), text = _a.text, isSelected = _a.isSelected;
|
|
7
|
+
var alpha = animatedSignal(1, {
|
|
8
|
+
repeatType: "reverse",
|
|
9
|
+
duration: 500,
|
|
10
|
+
repeat: Infinity,
|
|
11
|
+
});
|
|
12
|
+
alpha.set(0.5);
|
|
13
|
+
var height = 40;
|
|
14
|
+
var width = 256;
|
|
15
|
+
let $this = h(Container, null, [h(Rect, { width, height, color: '#595971', alpha, visible: isSelected }), h(Container, { flexDirection: 'row', alignItems: 'center', justifyContent: 'center' }, h(Text, { text, color: '#fff', fontSize: 18, margin: 10 }))]);
|
|
16
|
+
return $this
|
|
17
|
+
}
|
|
18
18
|
|
|
19
|
-
export {
|
|
19
|
+
export { component as default };
|
|
20
20
|
//# sourceMappingURL=index38.js.map
|
package/dist/index38.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index38.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index38.js","sources":["../src/components/gui/dialogbox/itemMenu.ce"],"sourcesContent":["<Container>\n <Rect width height color=\"#595971\" alpha visible={isSelected} />\n <Container flexDirection=\"row\" alignItems=\"center\" justifyContent=\"center\">\n <Text text color=\"#fff\" fontSize={18} margin={10} />\n </Container>\n</Container>\n\n<script>\nimport { animatedSignal } from \"canvasengine\";\n\nconst { text, isSelected } = defineProps();\n\nconst alpha = animatedSignal(1, {\n repeatType: \"reverse\",\n duration: 500,\n repeat: Infinity,\n});\n\nalpha.set(0.5);\n\nconst height = 40;\nconst width = 256;\n</script>"],"names":[],"mappings":";;AAQqB,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,IAAI,GAAG,EAAE,CAAC,IAAI,EAAE,UAAU,GAAG,EAAE,CAAC,UAAU;AAC1E,IAAI,KAAK,GAAG,cAAc,CAAC,CAAC,EAAE;AAC9B,IAAI,UAAU,EAAE,SAAS;AACzB,IAAI,QAAQ,EAAE,GAAG;AACjB,IAAI,MAAM,EAAE,QAAQ;AACpB,CAAC,CAAC;AACF,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;AACd,IAAI,MAAM,GAAG,EAAE;AACf,IAAI,KAAK,GAAG,GAAG;AACf,QAAQ,IAAI,KAAK,GAAG,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC,SAAS,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;AACrQ,QAAQ,OAAO;AACf;;;;"}
|
package/package.json
CHANGED
package/dist/index39.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { useProps, useDefineProps, animatedSignal, h, Container, Rect, Text } from 'canvasengine';
|
|
2
|
-
|
|
3
|
-
function component($$props) {
|
|
4
|
-
useProps($$props);
|
|
5
|
-
const defineProps = useDefineProps($$props);
|
|
6
|
-
var _a = defineProps(), text = _a.text, isSelected = _a.isSelected;
|
|
7
|
-
var alpha = animatedSignal(1, {
|
|
8
|
-
repeatType: "reverse",
|
|
9
|
-
duration: 500,
|
|
10
|
-
repeat: Infinity,
|
|
11
|
-
});
|
|
12
|
-
alpha.set(0.5);
|
|
13
|
-
var height = 40;
|
|
14
|
-
var width = 256;
|
|
15
|
-
let $this = h(Container, null, [h(Rect, { width, height, color: '#595971', alpha, visible: isSelected }), h(Container, { flexDirection: 'row', alignItems: 'center', justifyContent: 'center' }, h(Text, { text, color: '#fff', fontSize: 18, margin: 10 }))]);
|
|
16
|
-
return $this
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export { component as default };
|
|
20
|
-
//# sourceMappingURL=index39.js.map
|
package/dist/index39.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index39.js","sources":["../src/components/gui/dialogbox/itemMenu.ce"],"sourcesContent":["<Container>\n <Rect width height color=\"#595971\" alpha visible={isSelected} />\n <Container flexDirection=\"row\" alignItems=\"center\" justifyContent=\"center\">\n <Text text color=\"#fff\" fontSize={18} margin={10} />\n </Container>\n</Container>\n\n<script>\nimport { animatedSignal } from \"canvasengine\";\n\nconst { text, isSelected } = defineProps();\n\nconst alpha = animatedSignal(1, {\n repeatType: \"reverse\",\n duration: 500,\n repeat: Infinity,\n});\n\nalpha.set(0.5);\n\nconst height = 40;\nconst width = 256;\n</script>"],"names":[],"mappings":";;AAQqB,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,IAAI,GAAG,EAAE,CAAC,IAAI,EAAE,UAAU,GAAG,EAAE,CAAC,UAAU;AAC1E,IAAI,KAAK,GAAG,cAAc,CAAC,CAAC,EAAE;AAC9B,IAAI,UAAU,EAAE,SAAS;AACzB,IAAI,QAAQ,EAAE,GAAG;AACjB,IAAI,MAAM,EAAE,QAAQ;AACpB,CAAC,CAAC;AACF,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;AACd,IAAI,MAAM,GAAG,EAAE;AACf,IAAI,KAAK,GAAG,GAAG;AACf,QAAQ,IAAI,KAAK,GAAG,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC,SAAS,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;AACrQ,QAAQ,OAAO;AACf;;;;"}
|