@doodle-engine/react 0.0.7 → 0.0.8
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 +8 -0
- package/dist/GameProvider.d.ts.map +1 -1
- package/dist/react.cjs +2 -2
- package/dist/react.js +206 -203
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/react.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Engine as ie } from "@doodle-engine/core";
|
|
2
2
|
import { VERSION as De } from "@doodle-engine/core";
|
|
3
|
-
import ue, { createContext as de, useState as C, useCallback as N, useContext as me, useRef as q
|
|
3
|
+
import ue, { createContext as de, useState as C, useEffect as L, useCallback as N, useContext as me, useRef as q } from "react";
|
|
4
4
|
var Z = { exports: {} }, z = {};
|
|
5
5
|
/**
|
|
6
6
|
* @license React
|
|
@@ -11,11 +11,11 @@ var Z = { exports: {} }, z = {};
|
|
|
11
11
|
* This source code is licensed under the MIT license found in the
|
|
12
12
|
* LICENSE file in the root directory of this source tree.
|
|
13
13
|
*/
|
|
14
|
-
var
|
|
14
|
+
var te;
|
|
15
15
|
function he() {
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
var
|
|
16
|
+
if (te) return z;
|
|
17
|
+
te = 1;
|
|
18
|
+
var n = Symbol.for("react.transitional.element"), s = Symbol.for("react.fragment");
|
|
19
19
|
function r(a, l, o) {
|
|
20
20
|
var m = null;
|
|
21
21
|
if (o !== void 0 && (m = "" + o), l.key !== void 0 && (m = "" + l.key), "key" in l) {
|
|
@@ -24,7 +24,7 @@ function he() {
|
|
|
24
24
|
h !== "key" && (o[h] = l[h]);
|
|
25
25
|
} else o = l;
|
|
26
26
|
return l = o.ref, {
|
|
27
|
-
$$typeof:
|
|
27
|
+
$$typeof: n,
|
|
28
28
|
type: a,
|
|
29
29
|
key: m,
|
|
30
30
|
ref: l !== void 0 ? l : null,
|
|
@@ -43,15 +43,15 @@ var B = {};
|
|
|
43
43
|
* This source code is licensed under the MIT license found in the
|
|
44
44
|
* LICENSE file in the root directory of this source tree.
|
|
45
45
|
*/
|
|
46
|
-
var
|
|
46
|
+
var ne;
|
|
47
47
|
function ve() {
|
|
48
|
-
return
|
|
49
|
-
function t
|
|
50
|
-
if (
|
|
51
|
-
if (typeof
|
|
52
|
-
return
|
|
53
|
-
if (typeof
|
|
54
|
-
switch (
|
|
48
|
+
return ne || (ne = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
49
|
+
function n(t) {
|
|
50
|
+
if (t == null) return null;
|
|
51
|
+
if (typeof t == "function")
|
|
52
|
+
return t.$$typeof === y ? null : t.displayName || t.name || null;
|
|
53
|
+
if (typeof t == "string") return t;
|
|
54
|
+
switch (t) {
|
|
55
55
|
case u:
|
|
56
56
|
return "Fragment";
|
|
57
57
|
case G:
|
|
@@ -65,127 +65,127 @@ function ve() {
|
|
|
65
65
|
case v:
|
|
66
66
|
return "Activity";
|
|
67
67
|
}
|
|
68
|
-
if (typeof
|
|
69
|
-
switch (typeof
|
|
68
|
+
if (typeof t == "object")
|
|
69
|
+
switch (typeof t.tag == "number" && console.error(
|
|
70
70
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
71
|
-
),
|
|
71
|
+
), t.$$typeof) {
|
|
72
72
|
case i:
|
|
73
73
|
return "Portal";
|
|
74
74
|
case W:
|
|
75
|
-
return
|
|
76
|
-
case
|
|
77
|
-
return (
|
|
75
|
+
return t.displayName || "Context";
|
|
76
|
+
case D:
|
|
77
|
+
return (t._context.displayName || "Context") + ".Consumer";
|
|
78
78
|
case J:
|
|
79
|
-
var c =
|
|
80
|
-
return
|
|
79
|
+
var c = t.render;
|
|
80
|
+
return t = t.displayName, t || (t = c.displayName || c.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
|
|
81
81
|
case p:
|
|
82
|
-
return c =
|
|
82
|
+
return c = t.displayName || null, c !== null ? c : n(t.type) || "Memo";
|
|
83
83
|
case d:
|
|
84
|
-
c =
|
|
84
|
+
c = t._payload, t = t._init;
|
|
85
85
|
try {
|
|
86
|
-
return t(
|
|
86
|
+
return n(t(c));
|
|
87
87
|
} catch {
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
return null;
|
|
91
91
|
}
|
|
92
|
-
function s(
|
|
93
|
-
return "" +
|
|
92
|
+
function s(t) {
|
|
93
|
+
return "" + t;
|
|
94
94
|
}
|
|
95
|
-
function r(
|
|
95
|
+
function r(t) {
|
|
96
96
|
try {
|
|
97
|
-
s(
|
|
97
|
+
s(t);
|
|
98
98
|
var c = !1;
|
|
99
99
|
} catch {
|
|
100
100
|
c = !0;
|
|
101
101
|
}
|
|
102
102
|
if (c) {
|
|
103
103
|
c = console;
|
|
104
|
-
var j = c.error, S = typeof Symbol == "function" && Symbol.toStringTag &&
|
|
104
|
+
var j = c.error, S = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
105
105
|
return j.call(
|
|
106
106
|
c,
|
|
107
107
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
108
108
|
S
|
|
109
|
-
), s(
|
|
109
|
+
), s(t);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
function a(
|
|
113
|
-
if (
|
|
114
|
-
if (typeof
|
|
112
|
+
function a(t) {
|
|
113
|
+
if (t === u) return "<>";
|
|
114
|
+
if (typeof t == "object" && t !== null && t.$$typeof === d)
|
|
115
115
|
return "<...>";
|
|
116
116
|
try {
|
|
117
|
-
var c = t
|
|
117
|
+
var c = n(t);
|
|
118
118
|
return c ? "<" + c + ">" : "<...>";
|
|
119
119
|
} catch {
|
|
120
120
|
return "<...>";
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
function l() {
|
|
124
|
-
var
|
|
125
|
-
return
|
|
124
|
+
var t = O.A;
|
|
125
|
+
return t === null ? null : t.getOwner();
|
|
126
126
|
}
|
|
127
127
|
function o() {
|
|
128
128
|
return Error("react-stack-top-frame");
|
|
129
129
|
}
|
|
130
|
-
function m(
|
|
131
|
-
if (M.call(
|
|
132
|
-
var c = Object.getOwnPropertyDescriptor(
|
|
130
|
+
function m(t) {
|
|
131
|
+
if (M.call(t, "key")) {
|
|
132
|
+
var c = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
133
133
|
if (c && c.isReactWarning) return !1;
|
|
134
134
|
}
|
|
135
|
-
return
|
|
135
|
+
return t.key !== void 0;
|
|
136
136
|
}
|
|
137
|
-
function h(
|
|
137
|
+
function h(t, c) {
|
|
138
138
|
function j() {
|
|
139
139
|
P || (P = !0, console.error(
|
|
140
140
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
141
141
|
c
|
|
142
142
|
));
|
|
143
143
|
}
|
|
144
|
-
j.isReactWarning = !0, Object.defineProperty(
|
|
144
|
+
j.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
145
145
|
get: j,
|
|
146
146
|
configurable: !0
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
149
|
function f() {
|
|
150
|
-
var
|
|
151
|
-
return I[
|
|
150
|
+
var t = n(this.type);
|
|
151
|
+
return I[t] || (I[t] = !0, console.error(
|
|
152
152
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
153
|
-
)),
|
|
153
|
+
)), t = this.props.ref, t !== void 0 ? t : null;
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function g(t, c, j, S, H, K) {
|
|
156
156
|
var k = j.ref;
|
|
157
|
-
return
|
|
157
|
+
return t = {
|
|
158
158
|
$$typeof: w,
|
|
159
|
-
type:
|
|
159
|
+
type: t,
|
|
160
160
|
key: c,
|
|
161
161
|
props: j,
|
|
162
162
|
_owner: S
|
|
163
|
-
}, (k !== void 0 ? k : null) !== null ? Object.defineProperty(
|
|
163
|
+
}, (k !== void 0 ? k : null) !== null ? Object.defineProperty(t, "ref", {
|
|
164
164
|
enumerable: !1,
|
|
165
165
|
get: f
|
|
166
|
-
}) : Object.defineProperty(
|
|
166
|
+
}) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
|
|
167
167
|
configurable: !1,
|
|
168
168
|
enumerable: !1,
|
|
169
169
|
writable: !0,
|
|
170
170
|
value: 0
|
|
171
|
-
}), Object.defineProperty(
|
|
171
|
+
}), Object.defineProperty(t, "_debugInfo", {
|
|
172
172
|
configurable: !1,
|
|
173
173
|
enumerable: !1,
|
|
174
174
|
writable: !0,
|
|
175
175
|
value: null
|
|
176
|
-
}), Object.defineProperty(
|
|
176
|
+
}), Object.defineProperty(t, "_debugStack", {
|
|
177
177
|
configurable: !1,
|
|
178
178
|
enumerable: !1,
|
|
179
179
|
writable: !0,
|
|
180
180
|
value: H
|
|
181
|
-
}), Object.defineProperty(
|
|
181
|
+
}), Object.defineProperty(t, "_debugTask", {
|
|
182
182
|
configurable: !1,
|
|
183
183
|
enumerable: !1,
|
|
184
184
|
writable: !0,
|
|
185
185
|
value: K
|
|
186
|
-
}), Object.freeze && (Object.freeze(
|
|
186
|
+
}), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
|
|
187
187
|
}
|
|
188
|
-
function x(
|
|
188
|
+
function x(t, c, j, S, H, K) {
|
|
189
189
|
var k = c.children;
|
|
190
190
|
if (k !== void 0)
|
|
191
191
|
if (S)
|
|
@@ -199,7 +199,7 @@ function ve() {
|
|
|
199
199
|
);
|
|
200
200
|
else R(k);
|
|
201
201
|
if (M.call(c, "key")) {
|
|
202
|
-
k = t
|
|
202
|
+
k = n(t);
|
|
203
203
|
var U = Object.keys(c).filter(function(ce) {
|
|
204
204
|
return ce !== "key";
|
|
205
205
|
});
|
|
@@ -223,9 +223,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
223
223
|
} else j = c;
|
|
224
224
|
return k && h(
|
|
225
225
|
j,
|
|
226
|
-
typeof
|
|
227
|
-
),
|
|
228
|
-
|
|
226
|
+
typeof t == "function" ? t.displayName || t.name || "Unknown" : t
|
|
227
|
+
), g(
|
|
228
|
+
t,
|
|
229
229
|
k,
|
|
230
230
|
j,
|
|
231
231
|
l(),
|
|
@@ -233,43 +233,43 @@ React keys must be passed directly to JSX without using spread:
|
|
|
233
233
|
K
|
|
234
234
|
);
|
|
235
235
|
}
|
|
236
|
-
function R(
|
|
237
|
-
T(
|
|
236
|
+
function R(t) {
|
|
237
|
+
T(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === d && (t._payload.status === "fulfilled" ? T(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
|
|
238
238
|
}
|
|
239
|
-
function T(
|
|
240
|
-
return typeof
|
|
239
|
+
function T(t) {
|
|
240
|
+
return typeof t == "object" && t !== null && t.$$typeof === w;
|
|
241
241
|
}
|
|
242
|
-
var E = ue, w = Symbol.for("react.transitional.element"), i = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), G = Symbol.for("react.profiler"),
|
|
242
|
+
var E = ue, w = Symbol.for("react.transitional.element"), i = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), G = Symbol.for("react.profiler"), D = Symbol.for("react.consumer"), W = Symbol.for("react.context"), J = Symbol.for("react.forward_ref"), A = Symbol.for("react.suspense"), F = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), d = Symbol.for("react.lazy"), v = Symbol.for("react.activity"), y = Symbol.for("react.client.reference"), O = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, M = Object.prototype.hasOwnProperty, Y = Array.isArray, $ = console.createTask ? console.createTask : function() {
|
|
243
243
|
return null;
|
|
244
244
|
};
|
|
245
245
|
E = {
|
|
246
|
-
react_stack_bottom_frame: function(
|
|
247
|
-
return
|
|
246
|
+
react_stack_bottom_frame: function(t) {
|
|
247
|
+
return t();
|
|
248
248
|
}
|
|
249
249
|
};
|
|
250
250
|
var P, I = {}, X = E.react_stack_bottom_frame.bind(
|
|
251
251
|
E,
|
|
252
252
|
o
|
|
253
|
-
)(),
|
|
254
|
-
B.Fragment = u, B.jsx = function(
|
|
253
|
+
)(), b = $(a(o)), V = {};
|
|
254
|
+
B.Fragment = u, B.jsx = function(t, c, j) {
|
|
255
255
|
var S = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
256
256
|
return x(
|
|
257
|
-
|
|
257
|
+
t,
|
|
258
258
|
c,
|
|
259
259
|
j,
|
|
260
260
|
!1,
|
|
261
261
|
S ? Error("react-stack-top-frame") : X,
|
|
262
|
-
S ? $(a(
|
|
262
|
+
S ? $(a(t)) : b
|
|
263
263
|
);
|
|
264
|
-
}, B.jsxs = function(
|
|
264
|
+
}, B.jsxs = function(t, c, j) {
|
|
265
265
|
var S = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
266
266
|
return x(
|
|
267
|
-
|
|
267
|
+
t,
|
|
268
268
|
c,
|
|
269
269
|
j,
|
|
270
270
|
!0,
|
|
271
271
|
S ? Error("react-stack-top-frame") : X,
|
|
272
|
-
S ? $(a(
|
|
272
|
+
S ? $(a(t)) : b
|
|
273
273
|
);
|
|
274
274
|
};
|
|
275
275
|
})()), B;
|
|
@@ -280,55 +280,58 @@ function pe() {
|
|
|
280
280
|
}
|
|
281
281
|
var e = pe();
|
|
282
282
|
const ae = de(null);
|
|
283
|
-
function fe({ engine:
|
|
284
|
-
const [a, l] = C(s)
|
|
283
|
+
function fe({ engine: n, initialSnapshot: s, children: r }) {
|
|
284
|
+
const [a, l] = C(s);
|
|
285
|
+
L(() => {
|
|
286
|
+
}, [n]);
|
|
287
|
+
const o = N(
|
|
285
288
|
(i) => {
|
|
286
|
-
const u =
|
|
289
|
+
const u = n.selectChoice(i);
|
|
287
290
|
l(u);
|
|
288
291
|
},
|
|
289
|
-
[
|
|
292
|
+
[n]
|
|
290
293
|
), m = N(
|
|
291
294
|
(i) => {
|
|
292
|
-
const u =
|
|
295
|
+
const u = n.talkTo(i);
|
|
293
296
|
l(u);
|
|
294
297
|
},
|
|
295
|
-
[
|
|
298
|
+
[n]
|
|
296
299
|
), h = N(
|
|
297
300
|
(i) => {
|
|
298
|
-
const u =
|
|
301
|
+
const u = n.takeItem(i);
|
|
299
302
|
l(u);
|
|
300
303
|
},
|
|
301
|
-
[
|
|
304
|
+
[n]
|
|
302
305
|
), f = N(
|
|
303
306
|
(i) => {
|
|
304
|
-
const u =
|
|
307
|
+
const u = n.travelTo(i);
|
|
305
308
|
l(u);
|
|
306
309
|
},
|
|
307
|
-
[
|
|
308
|
-
),
|
|
310
|
+
[n]
|
|
311
|
+
), g = N(
|
|
309
312
|
(i, u) => {
|
|
310
|
-
const _ =
|
|
313
|
+
const _ = n.writeNote(i, u);
|
|
311
314
|
l(_);
|
|
312
315
|
},
|
|
313
|
-
[
|
|
316
|
+
[n]
|
|
314
317
|
), x = N(
|
|
315
318
|
(i) => {
|
|
316
|
-
const u =
|
|
319
|
+
const u = n.deleteNote(i);
|
|
317
320
|
l(u);
|
|
318
321
|
},
|
|
319
|
-
[
|
|
322
|
+
[n]
|
|
320
323
|
), R = N(
|
|
321
324
|
(i) => {
|
|
322
|
-
const u =
|
|
325
|
+
const u = n.setLocale(i);
|
|
323
326
|
l(u);
|
|
324
327
|
},
|
|
325
|
-
[
|
|
326
|
-
), T = N(() =>
|
|
328
|
+
[n]
|
|
329
|
+
), T = N(() => n.saveGame(), [n]), E = N(
|
|
327
330
|
(i) => {
|
|
328
|
-
const u =
|
|
331
|
+
const u = n.loadGame(i);
|
|
329
332
|
l(u);
|
|
330
333
|
},
|
|
331
|
-
[
|
|
334
|
+
[n]
|
|
332
335
|
), w = {
|
|
333
336
|
snapshot: a,
|
|
334
337
|
actions: {
|
|
@@ -336,7 +339,7 @@ function fe({ engine: t, initialSnapshot: s, children: r }) {
|
|
|
336
339
|
talkTo: m,
|
|
337
340
|
takeItem: h,
|
|
338
341
|
travelTo: f,
|
|
339
|
-
writeNote:
|
|
342
|
+
writeNote: g,
|
|
340
343
|
deleteNote: x,
|
|
341
344
|
setLocale: R,
|
|
342
345
|
saveGame: T,
|
|
@@ -346,12 +349,12 @@ function fe({ engine: t, initialSnapshot: s, children: r }) {
|
|
|
346
349
|
return /* @__PURE__ */ e.jsx(ae.Provider, { value: w, children: r });
|
|
347
350
|
}
|
|
348
351
|
function re() {
|
|
349
|
-
const
|
|
350
|
-
if (!
|
|
352
|
+
const n = me(ae);
|
|
353
|
+
if (!n)
|
|
351
354
|
throw new Error("useGame must be used within a GameProvider");
|
|
352
|
-
return
|
|
355
|
+
return n;
|
|
353
356
|
}
|
|
354
|
-
function le(
|
|
357
|
+
function le(n, s = {}) {
|
|
355
358
|
var p;
|
|
356
359
|
const {
|
|
357
360
|
audioBasePath: r = "/audio",
|
|
@@ -360,18 +363,18 @@ function le(t, s = {}) {
|
|
|
360
363
|
soundVolume: o = 0.8,
|
|
361
364
|
voiceVolume: m = 1,
|
|
362
365
|
crossfadeDuration: h = 1e3
|
|
363
|
-
} = s, [f,
|
|
364
|
-
|
|
366
|
+
} = s, [f, g] = C(a), [x, R] = C(l), [T, E] = C(o), [w, i] = C(m), u = q(null), _ = q(null), G = q(null), D = q(null);
|
|
367
|
+
L(() => {
|
|
365
368
|
const d = new Audio();
|
|
366
369
|
d.loop = !0, u.current = d;
|
|
367
370
|
const v = new Audio();
|
|
368
371
|
return _.current = v, () => {
|
|
369
|
-
|
|
372
|
+
D.current && clearInterval(D.current), d.pause(), v.pause(), d.src = "", v.src = "";
|
|
370
373
|
};
|
|
371
|
-
}, []),
|
|
374
|
+
}, []), L(() => {
|
|
372
375
|
const d = u.current;
|
|
373
376
|
if (!d) return;
|
|
374
|
-
const v =
|
|
377
|
+
const v = n.music;
|
|
375
378
|
if (v !== G.current)
|
|
376
379
|
if (G.current = v, !v)
|
|
377
380
|
J(d, h);
|
|
@@ -380,22 +383,22 @@ function le(t, s = {}) {
|
|
|
380
383
|
W(d, y, h);
|
|
381
384
|
}
|
|
382
385
|
d.volume = f * x;
|
|
383
|
-
}, [
|
|
386
|
+
}, [n.music, f, x, r, h]), L(() => {
|
|
384
387
|
var y;
|
|
385
388
|
const d = _.current;
|
|
386
389
|
if (!d) return;
|
|
387
|
-
const v = (y =
|
|
390
|
+
const v = (y = n.dialogue) == null ? void 0 : y.voice;
|
|
388
391
|
v && (d.pause(), d.currentTime = 0, d.src = `${r}/voice/${v}`, d.volume = f * w, d.play().catch((O) => {
|
|
389
392
|
console.warn("Voice playback failed:", O);
|
|
390
393
|
}));
|
|
391
|
-
}, [(p =
|
|
392
|
-
|
|
394
|
+
}, [(p = n.dialogue) == null ? void 0 : p.voice, f, w, r]), L(() => {
|
|
395
|
+
n.pendingSounds.length !== 0 && n.pendingSounds.forEach((d) => {
|
|
393
396
|
const v = new Audio(`${r}/sfx/${d}`);
|
|
394
397
|
v.volume = f * T, v.play().catch((y) => {
|
|
395
398
|
console.warn("Sound playback failed:", y);
|
|
396
399
|
});
|
|
397
400
|
});
|
|
398
|
-
}, [
|
|
401
|
+
}, [n.pendingSounds, f, T, r]);
|
|
399
402
|
const W = (d, v, y) => {
|
|
400
403
|
J(d, y / 2).then(() => {
|
|
401
404
|
d.src = v, d.load(), d.volume = 0, d.play().then(() => {
|
|
@@ -410,17 +413,17 @@ function le(t, s = {}) {
|
|
|
410
413
|
const I = setInterval(() => {
|
|
411
414
|
P++, d.volume = Math.max(0, O - $ * P), P >= M && (clearInterval(I), d.pause(), d.currentTime = 0, y());
|
|
412
415
|
}, Y);
|
|
413
|
-
|
|
416
|
+
D.current = I;
|
|
414
417
|
}), A = (d, v, y) => {
|
|
415
418
|
const M = v / 20, Y = y / 20;
|
|
416
419
|
let $ = 0;
|
|
417
420
|
const P = setInterval(() => {
|
|
418
421
|
$++, d.volume = Math.min(y, Y * $), $ >= 20 && clearInterval(P);
|
|
419
422
|
}, M);
|
|
420
|
-
|
|
423
|
+
D.current = P;
|
|
421
424
|
};
|
|
422
425
|
return {
|
|
423
|
-
setMasterVolume:
|
|
426
|
+
setMasterVolume: g,
|
|
424
427
|
setMusicVolume: R,
|
|
425
428
|
setSoundVolume: E,
|
|
426
429
|
setVoiceVolume: i,
|
|
@@ -434,13 +437,13 @@ const xe = {
|
|
|
434
437
|
menuOpen: "menu_open.ogg",
|
|
435
438
|
menuClose: "menu_close.ogg"
|
|
436
439
|
};
|
|
437
|
-
function je(
|
|
440
|
+
function je(n = {}) {
|
|
438
441
|
const {
|
|
439
442
|
enabled: s = !0,
|
|
440
443
|
basePath: r = "/audio/ui",
|
|
441
444
|
volume: a = 0.5,
|
|
442
445
|
sounds: l = {}
|
|
443
|
-
} =
|
|
446
|
+
} = n, [o, m] = C(s), [h, f] = C(a), g = q({ ...xe, ...l }), x = N(
|
|
444
447
|
(i) => {
|
|
445
448
|
if (!o || !i) return;
|
|
446
449
|
const u = new Audio(`${r}/${i}`);
|
|
@@ -450,11 +453,11 @@ function je(t = {}) {
|
|
|
450
453
|
[o, h, r]
|
|
451
454
|
), R = N(
|
|
452
455
|
(i) => {
|
|
453
|
-
const u =
|
|
456
|
+
const u = g.current[i];
|
|
454
457
|
u && x(u);
|
|
455
458
|
},
|
|
456
459
|
[x]
|
|
457
|
-
), T = N(() => x(
|
|
460
|
+
), T = N(() => x(g.current.click), [x]), E = N(() => x(g.current.menuOpen), [x]), w = N(() => x(g.current.menuClose), [x]);
|
|
458
461
|
return {
|
|
459
462
|
playClick: T,
|
|
460
463
|
playMenuOpen: E,
|
|
@@ -466,17 +469,17 @@ function je(t = {}) {
|
|
|
466
469
|
volume: h
|
|
467
470
|
};
|
|
468
471
|
}
|
|
469
|
-
function Ne({ dialogue:
|
|
472
|
+
function Ne({ dialogue: n, className: s = "" }) {
|
|
470
473
|
return /* @__PURE__ */ e.jsxs("div", { className: `dialogue-box ${s}`, children: [
|
|
471
|
-
|
|
474
|
+
n.portrait && /* @__PURE__ */ e.jsx("div", { className: "dialogue-portrait", children: /* @__PURE__ */ e.jsx("img", { src: n.portrait, alt: n.speakerName }) }),
|
|
472
475
|
/* @__PURE__ */ e.jsxs("div", { className: "dialogue-content", children: [
|
|
473
|
-
/* @__PURE__ */ e.jsx("div", { className: "dialogue-speaker", children:
|
|
474
|
-
/* @__PURE__ */ e.jsx("div", { className: "dialogue-text", children:
|
|
476
|
+
/* @__PURE__ */ e.jsx("div", { className: "dialogue-speaker", children: n.speakerName }),
|
|
477
|
+
/* @__PURE__ */ e.jsx("div", { className: "dialogue-text", children: n.text })
|
|
475
478
|
] })
|
|
476
479
|
] });
|
|
477
480
|
}
|
|
478
|
-
function
|
|
479
|
-
return
|
|
481
|
+
function be({ choices: n, onSelectChoice: s, className: r = "" }) {
|
|
482
|
+
return n.length === 0 ? null : /* @__PURE__ */ e.jsx("div", { className: `choice-list ${r}`, children: n.map((a) => /* @__PURE__ */ e.jsx(
|
|
480
483
|
"button",
|
|
481
484
|
{
|
|
482
485
|
className: "choice-button",
|
|
@@ -486,23 +489,23 @@ function ge({ choices: t, onSelectChoice: s, className: r = "" }) {
|
|
|
486
489
|
a.id
|
|
487
490
|
)) });
|
|
488
491
|
}
|
|
489
|
-
function
|
|
492
|
+
function ge({ location: n, className: s = "" }) {
|
|
490
493
|
return /* @__PURE__ */ e.jsxs("div", { className: `location-view ${s}`, children: [
|
|
491
|
-
|
|
494
|
+
n.banner && /* @__PURE__ */ e.jsx("div", { className: "location-banner", children: /* @__PURE__ */ e.jsx("img", { src: n.banner, alt: n.name }) }),
|
|
492
495
|
/* @__PURE__ */ e.jsxs("div", { className: "location-content", children: [
|
|
493
|
-
/* @__PURE__ */ e.jsx("h1", { className: "location-name", children:
|
|
494
|
-
/* @__PURE__ */ e.jsx("p", { className: "location-description", children:
|
|
496
|
+
/* @__PURE__ */ e.jsx("h1", { className: "location-name", children: n.name }),
|
|
497
|
+
/* @__PURE__ */ e.jsx("p", { className: "location-description", children: n.description })
|
|
495
498
|
] })
|
|
496
499
|
] });
|
|
497
500
|
}
|
|
498
501
|
function Se({
|
|
499
|
-
characters:
|
|
502
|
+
characters: n,
|
|
500
503
|
onTalkTo: s,
|
|
501
504
|
className: r = ""
|
|
502
505
|
}) {
|
|
503
|
-
return
|
|
506
|
+
return n.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: `character-list ${r}`, children: [
|
|
504
507
|
/* @__PURE__ */ e.jsx("h2", { children: "Characters" }),
|
|
505
|
-
/* @__PURE__ */ e.jsx("div", { className: "character-grid", children:
|
|
508
|
+
/* @__PURE__ */ e.jsx("div", { className: "character-grid", children: n.map((a) => /* @__PURE__ */ e.jsxs(
|
|
506
509
|
"button",
|
|
507
510
|
{
|
|
508
511
|
className: "character-card",
|
|
@@ -523,11 +526,11 @@ function Se({
|
|
|
523
526
|
)) })
|
|
524
527
|
] });
|
|
525
528
|
}
|
|
526
|
-
function ke({ items:
|
|
529
|
+
function ke({ items: n, className: s = "" }) {
|
|
527
530
|
const [r, a] = C(null);
|
|
528
531
|
return /* @__PURE__ */ e.jsxs("div", { className: `inventory ${s}`, children: [
|
|
529
532
|
/* @__PURE__ */ e.jsx("h2", { children: "Inventory" }),
|
|
530
|
-
|
|
533
|
+
n.length === 0 ? /* @__PURE__ */ e.jsx("p", { className: "inventory-empty", children: "No items" }) : /* @__PURE__ */ e.jsx("div", { className: "inventory-grid", children: n.map((l) => /* @__PURE__ */ e.jsxs(
|
|
531
534
|
"div",
|
|
532
535
|
{
|
|
533
536
|
className: "inventory-item",
|
|
@@ -547,12 +550,12 @@ function ke({ items: t, className: s = "" }) {
|
|
|
547
550
|
] }) })
|
|
548
551
|
] });
|
|
549
552
|
}
|
|
550
|
-
function ye({ quests:
|
|
553
|
+
function ye({ quests: n, entries: s, className: r = "" }) {
|
|
551
554
|
return /* @__PURE__ */ e.jsxs("div", { className: `journal ${r}`, children: [
|
|
552
555
|
/* @__PURE__ */ e.jsx("h2", { children: "Journal" }),
|
|
553
|
-
|
|
556
|
+
n.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "journal-quests", children: [
|
|
554
557
|
/* @__PURE__ */ e.jsx("h3", { children: "Active Quests" }),
|
|
555
|
-
|
|
558
|
+
n.map((a) => /* @__PURE__ */ e.jsxs("div", { className: "quest-entry", children: [
|
|
556
559
|
/* @__PURE__ */ e.jsx("div", { className: "quest-name", children: a.name }),
|
|
557
560
|
/* @__PURE__ */ e.jsx("div", { className: "quest-description", children: a.description }),
|
|
558
561
|
/* @__PURE__ */ e.jsx("div", { className: "quest-stage", children: a.currentStageDescription })
|
|
@@ -565,15 +568,15 @@ function ye({ quests: t, entries: s, className: r = "" }) {
|
|
|
565
568
|
/* @__PURE__ */ e.jsx("div", { className: "entry-text", children: a.text })
|
|
566
569
|
] }, a.id))
|
|
567
570
|
] }),
|
|
568
|
-
|
|
571
|
+
n.length === 0 && s.length === 0 && /* @__PURE__ */ e.jsx("p", { className: "journal-empty", children: "No entries yet" })
|
|
569
572
|
] });
|
|
570
573
|
}
|
|
571
|
-
function Ee({ map:
|
|
572
|
-
return
|
|
573
|
-
/* @__PURE__ */ e.jsx("h2", { children:
|
|
574
|
+
function Ee({ map: n, onTravelTo: s, className: r = "" }) {
|
|
575
|
+
return n ? /* @__PURE__ */ e.jsxs("div", { className: `map-view ${r}`, children: [
|
|
576
|
+
/* @__PURE__ */ e.jsx("h2", { children: n.name }),
|
|
574
577
|
/* @__PURE__ */ e.jsxs("div", { className: "map-container", style: { position: "relative" }, children: [
|
|
575
|
-
|
|
576
|
-
|
|
578
|
+
n.image && /* @__PURE__ */ e.jsx("img", { src: n.image, alt: n.name, className: "map-image" }),
|
|
579
|
+
n.locations.map((a) => /* @__PURE__ */ e.jsx(
|
|
577
580
|
"button",
|
|
578
581
|
{
|
|
579
582
|
className: `map-marker ${a.isCurrent ? "current" : ""}`,
|
|
@@ -593,27 +596,27 @@ function Ee({ map: t, onTravelTo: s, className: r = "" }) {
|
|
|
593
596
|
] }) : null;
|
|
594
597
|
}
|
|
595
598
|
function Te({
|
|
596
|
-
notifications:
|
|
599
|
+
notifications: n,
|
|
597
600
|
className: s = ""
|
|
598
601
|
}) {
|
|
599
|
-
return
|
|
602
|
+
return n.length === 0 ? null : /* @__PURE__ */ e.jsx("div", { className: `notification-area ${s}`, children: n.map((r, a) => /* @__PURE__ */ e.jsx("div", { className: "notification", children: r }, a)) });
|
|
600
603
|
}
|
|
601
604
|
function we({
|
|
602
|
-
onSave:
|
|
605
|
+
onSave: n,
|
|
603
606
|
onLoad: s,
|
|
604
607
|
storageKey: r = "doodle-engine-save",
|
|
605
608
|
className: a = ""
|
|
606
609
|
}) {
|
|
607
610
|
const [l, o] = C(""), m = () => {
|
|
608
|
-
const
|
|
609
|
-
localStorage.setItem(r, JSON.stringify(
|
|
611
|
+
const g = n();
|
|
612
|
+
localStorage.setItem(r, JSON.stringify(g)), o("Saved!"), setTimeout(() => o(""), 2e3);
|
|
610
613
|
}, h = () => {
|
|
611
|
-
const
|
|
612
|
-
if (!
|
|
614
|
+
const g = localStorage.getItem(r);
|
|
615
|
+
if (!g) {
|
|
613
616
|
o("No save found"), setTimeout(() => o(""), 2e3);
|
|
614
617
|
return;
|
|
615
618
|
}
|
|
616
|
-
const x = JSON.parse(
|
|
619
|
+
const x = JSON.parse(g);
|
|
617
620
|
s(x), o("Loaded!"), setTimeout(() => o(""), 2e3);
|
|
618
621
|
}, f = localStorage.getItem(r) !== null;
|
|
619
622
|
return /* @__PURE__ */ e.jsxs("div", { className: `save-load-panel ${a}`, children: [
|
|
@@ -622,17 +625,17 @@ function we({
|
|
|
622
625
|
l && /* @__PURE__ */ e.jsx("span", { className: "save-load-message", children: l })
|
|
623
626
|
] });
|
|
624
627
|
}
|
|
625
|
-
function _e({ className:
|
|
628
|
+
function _e({ className: n = "" }) {
|
|
626
629
|
const { snapshot: s, actions: r } = re();
|
|
627
630
|
le(s);
|
|
628
631
|
const a = Object.entries(s.variables).filter(([l]) => !l.startsWith("_"));
|
|
629
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `game-renderer ${
|
|
632
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `game-renderer ${n}`, children: [
|
|
630
633
|
/* @__PURE__ */ e.jsx(Te, { notifications: s.notifications }),
|
|
631
634
|
/* @__PURE__ */ e.jsxs("div", { className: "game-main", children: [
|
|
632
|
-
/* @__PURE__ */ e.jsx(
|
|
635
|
+
/* @__PURE__ */ e.jsx(ge, { location: s.location }),
|
|
633
636
|
s.dialogue && /* @__PURE__ */ e.jsxs("div", { className: "dialogue-container", children: [
|
|
634
637
|
/* @__PURE__ */ e.jsx(Ne, { dialogue: s.dialogue }),
|
|
635
|
-
/* @__PURE__ */ e.jsx(
|
|
638
|
+
/* @__PURE__ */ e.jsx(be, { choices: s.choices, onSelectChoice: r.selectChoice })
|
|
636
639
|
] }),
|
|
637
640
|
!s.dialogue && /* @__PURE__ */ e.jsx(
|
|
638
641
|
Se,
|
|
@@ -662,23 +665,23 @@ function _e({ className: t = "" }) {
|
|
|
662
665
|
] });
|
|
663
666
|
}
|
|
664
667
|
function Ce({
|
|
665
|
-
logoSrc:
|
|
668
|
+
logoSrc: n,
|
|
666
669
|
title: s,
|
|
667
670
|
onComplete: r,
|
|
668
671
|
duration: a = 2e3,
|
|
669
672
|
className: l = ""
|
|
670
673
|
}) {
|
|
671
|
-
return
|
|
674
|
+
return L(() => {
|
|
672
675
|
const o = setTimeout(r, a);
|
|
673
676
|
return () => clearTimeout(o);
|
|
674
677
|
}, [r, a]), /* @__PURE__ */ e.jsxs("div", { className: `splash-screen ${l}`, onClick: r, children: [
|
|
675
|
-
|
|
678
|
+
n && /* @__PURE__ */ e.jsx("img", { src: n, alt: s || "", className: "splash-logo" }),
|
|
676
679
|
s && /* @__PURE__ */ e.jsx("h1", { className: "splash-title", children: s }),
|
|
677
680
|
/* @__PURE__ */ e.jsx("div", { className: "splash-loading", children: "Loading..." })
|
|
678
681
|
] });
|
|
679
682
|
}
|
|
680
683
|
function Re({
|
|
681
|
-
title:
|
|
684
|
+
title: n = "Doodle Engine",
|
|
682
685
|
subtitle: s,
|
|
683
686
|
logoSrc: r,
|
|
684
687
|
hasSaveData: a,
|
|
@@ -688,8 +691,8 @@ function Re({
|
|
|
688
691
|
className: h = ""
|
|
689
692
|
}) {
|
|
690
693
|
return /* @__PURE__ */ e.jsxs("div", { className: `title-screen ${h}`, children: [
|
|
691
|
-
r && /* @__PURE__ */ e.jsx("img", { src: r, alt:
|
|
692
|
-
/* @__PURE__ */ e.jsx("h1", { className: "title-heading", children:
|
|
694
|
+
r && /* @__PURE__ */ e.jsx("img", { src: r, alt: n, className: "title-logo" }),
|
|
695
|
+
/* @__PURE__ */ e.jsx("h1", { className: "title-heading", children: n }),
|
|
693
696
|
s && /* @__PURE__ */ e.jsx("p", { className: "title-subtitle", children: s }),
|
|
694
697
|
/* @__PURE__ */ e.jsxs("div", { className: "title-menu", children: [
|
|
695
698
|
/* @__PURE__ */ e.jsx("button", { className: "title-button", onClick: l, children: "New Game" }),
|
|
@@ -699,7 +702,7 @@ function Re({
|
|
|
699
702
|
] });
|
|
700
703
|
}
|
|
701
704
|
function Ae({
|
|
702
|
-
onResume:
|
|
705
|
+
onResume: n,
|
|
703
706
|
onSave: s,
|
|
704
707
|
onLoad: r,
|
|
705
708
|
onSettings: a,
|
|
@@ -709,7 +712,7 @@ function Ae({
|
|
|
709
712
|
return /* @__PURE__ */ e.jsx("div", { className: `pause-menu-overlay ${o}`, children: /* @__PURE__ */ e.jsxs("div", { className: "pause-menu", children: [
|
|
710
713
|
/* @__PURE__ */ e.jsx("h2", { className: "pause-title", children: "Paused" }),
|
|
711
714
|
/* @__PURE__ */ e.jsxs("div", { className: "pause-buttons", children: [
|
|
712
|
-
/* @__PURE__ */ e.jsx("button", { className: "pause-button", onClick:
|
|
715
|
+
/* @__PURE__ */ e.jsx("button", { className: "pause-button", onClick: n, children: "Resume" }),
|
|
713
716
|
/* @__PURE__ */ e.jsx("button", { className: "pause-button", onClick: s, children: "Save" }),
|
|
714
717
|
/* @__PURE__ */ e.jsx("button", { className: "pause-button", onClick: r, children: "Load" }),
|
|
715
718
|
/* @__PURE__ */ e.jsx("button", { className: "pause-button", onClick: a, children: "Settings" }),
|
|
@@ -718,7 +721,7 @@ function Ae({
|
|
|
718
721
|
] }) });
|
|
719
722
|
}
|
|
720
723
|
function oe({
|
|
721
|
-
audioControls:
|
|
724
|
+
audioControls: n,
|
|
722
725
|
uiSoundControls: s,
|
|
723
726
|
availableLocales: r,
|
|
724
727
|
currentLocale: a,
|
|
@@ -735,7 +738,7 @@ function oe({
|
|
|
735
738
|
{
|
|
736
739
|
label: "Master",
|
|
737
740
|
value: 1,
|
|
738
|
-
onChange:
|
|
741
|
+
onChange: n.setMasterVolume
|
|
739
742
|
}
|
|
740
743
|
),
|
|
741
744
|
/* @__PURE__ */ e.jsx(
|
|
@@ -743,7 +746,7 @@ function oe({
|
|
|
743
746
|
{
|
|
744
747
|
label: "Music",
|
|
745
748
|
value: 0.7,
|
|
746
|
-
onChange:
|
|
749
|
+
onChange: n.setMusicVolume
|
|
747
750
|
}
|
|
748
751
|
),
|
|
749
752
|
/* @__PURE__ */ e.jsx(
|
|
@@ -751,7 +754,7 @@ function oe({
|
|
|
751
754
|
{
|
|
752
755
|
label: "Sound Effects",
|
|
753
756
|
value: 0.8,
|
|
754
|
-
onChange:
|
|
757
|
+
onChange: n.setSoundVolume
|
|
755
758
|
}
|
|
756
759
|
),
|
|
757
760
|
/* @__PURE__ */ e.jsx(
|
|
@@ -759,7 +762,7 @@ function oe({
|
|
|
759
762
|
{
|
|
760
763
|
label: "Voice",
|
|
761
764
|
value: 1,
|
|
762
|
-
onChange:
|
|
765
|
+
onChange: n.setVoiceVolume
|
|
763
766
|
}
|
|
764
767
|
),
|
|
765
768
|
s && /* @__PURE__ */ e.jsx(
|
|
@@ -787,12 +790,12 @@ function oe({
|
|
|
787
790
|
] });
|
|
788
791
|
}
|
|
789
792
|
function Q({
|
|
790
|
-
label:
|
|
793
|
+
label: n,
|
|
791
794
|
value: s,
|
|
792
795
|
onChange: r
|
|
793
796
|
}) {
|
|
794
797
|
return /* @__PURE__ */ e.jsxs("div", { className: "volume-slider", children: [
|
|
795
|
-
/* @__PURE__ */ e.jsx("label", { className: "volume-label", children:
|
|
798
|
+
/* @__PURE__ */ e.jsx("label", { className: "volume-label", children: n }),
|
|
796
799
|
/* @__PURE__ */ e.jsx(
|
|
797
800
|
"input",
|
|
798
801
|
{
|
|
@@ -808,13 +811,13 @@ function Q({
|
|
|
808
811
|
] });
|
|
809
812
|
}
|
|
810
813
|
function Oe({
|
|
811
|
-
src:
|
|
814
|
+
src: n,
|
|
812
815
|
basePath: s = "/video",
|
|
813
816
|
onComplete: r,
|
|
814
817
|
className: a = ""
|
|
815
818
|
}) {
|
|
816
819
|
const l = q(null);
|
|
817
|
-
return
|
|
820
|
+
return L(() => {
|
|
818
821
|
const o = (m) => {
|
|
819
822
|
(m.key === "Escape" || m.key === " " || m.key === "Enter") && (m.preventDefault(), r());
|
|
820
823
|
};
|
|
@@ -824,7 +827,7 @@ function Oe({
|
|
|
824
827
|
"video",
|
|
825
828
|
{
|
|
826
829
|
ref: l,
|
|
827
|
-
src: `${s}/${
|
|
830
|
+
src: `${s}/${n}`,
|
|
828
831
|
autoPlay: !0,
|
|
829
832
|
onEnded: r,
|
|
830
833
|
className: "video-player-video"
|
|
@@ -841,7 +844,7 @@ function Oe({
|
|
|
841
844
|
] });
|
|
842
845
|
}
|
|
843
846
|
function Me({
|
|
844
|
-
registry:
|
|
847
|
+
registry: n,
|
|
845
848
|
config: s,
|
|
846
849
|
title: r = "Doodle Engine",
|
|
847
850
|
subtitle: a,
|
|
@@ -850,14 +853,14 @@ function Me({
|
|
|
850
853
|
uiSounds: m,
|
|
851
854
|
audioOptions: h,
|
|
852
855
|
storageKey: f = "doodle-engine-save",
|
|
853
|
-
availableLocales:
|
|
856
|
+
availableLocales: g,
|
|
854
857
|
videoBasePath: x = "/video",
|
|
855
858
|
className: R = ""
|
|
856
859
|
}) {
|
|
857
|
-
const [T, E] = C(o > 0 ? "splash" : "title"), [w, i] = C(!1), [u, _] = C(!1), [G,
|
|
860
|
+
const [T, E] = C(o > 0 ? "splash" : "title"), [w, i] = C(!1), [u, _] = C(!1), [G, D] = C("title"), [W, J] = C(null), [A, F] = C(null), p = je(
|
|
858
861
|
m === !1 ? { enabled: !1 } : m
|
|
859
862
|
), d = localStorage.getItem(f) !== null, v = N(() => {
|
|
860
|
-
const
|
|
863
|
+
const b = {
|
|
861
864
|
currentLocation: s.startLocation,
|
|
862
865
|
currentTime: { ...s.startTime },
|
|
863
866
|
flags: { ...s.startFlags },
|
|
@@ -875,41 +878,41 @@ function Me({
|
|
|
875
878
|
pendingVideo: null,
|
|
876
879
|
currentLocale: "en"
|
|
877
880
|
};
|
|
878
|
-
return new ie(
|
|
879
|
-
}, [
|
|
881
|
+
return new ie(n, b);
|
|
882
|
+
}, [n, s]), y = N(() => {
|
|
880
883
|
p.playClick();
|
|
881
|
-
const
|
|
882
|
-
F({ engine:
|
|
884
|
+
const b = v(), V = b.newGame(s);
|
|
885
|
+
F({ engine: b, snapshot: V }), E("playing");
|
|
883
886
|
}, [v, s, p]), O = N(() => {
|
|
884
887
|
p.playClick();
|
|
885
|
-
const
|
|
886
|
-
if (!
|
|
887
|
-
const V = JSON.parse(
|
|
888
|
-
F({ engine:
|
|
888
|
+
const b = localStorage.getItem(f);
|
|
889
|
+
if (!b) return;
|
|
890
|
+
const V = JSON.parse(b), t = v(), c = t.loadGame(V);
|
|
891
|
+
F({ engine: t, snapshot: c }), E("playing");
|
|
889
892
|
}, [v, f, p]), M = N(() => {
|
|
890
893
|
if (!A) return;
|
|
891
894
|
p.playClick();
|
|
892
|
-
const
|
|
893
|
-
localStorage.setItem(f, JSON.stringify(
|
|
895
|
+
const b = A.engine.saveGame();
|
|
896
|
+
localStorage.setItem(f, JSON.stringify(b)), i(!1);
|
|
894
897
|
}, [A, f, p]), Y = N(() => {
|
|
895
|
-
const
|
|
896
|
-
if (!
|
|
898
|
+
const b = localStorage.getItem(f);
|
|
899
|
+
if (!b || !A) return;
|
|
897
900
|
p.playClick();
|
|
898
|
-
const V = JSON.parse(
|
|
899
|
-
F({ engine: A.engine, snapshot:
|
|
901
|
+
const V = JSON.parse(b), t = A.engine.loadGame(V);
|
|
902
|
+
F({ engine: A.engine, snapshot: t }), i(!1);
|
|
900
903
|
}, [A, f, p]), $ = N(() => {
|
|
901
904
|
p.playClick(), i(!1), _(!1), F(null), E("title");
|
|
902
|
-
}, [p]), P = N((
|
|
903
|
-
p.playMenuOpen(),
|
|
905
|
+
}, [p]), P = N((b) => {
|
|
906
|
+
p.playMenuOpen(), D(b), _(!0), b === "pause" && i(!1);
|
|
904
907
|
}, [p]), I = N(() => {
|
|
905
908
|
p.playMenuClose(), _(!1), G === "pause" && i(!0);
|
|
906
909
|
}, [G, p]);
|
|
907
|
-
|
|
910
|
+
L(() => {
|
|
908
911
|
if (T !== "playing") return;
|
|
909
|
-
const
|
|
910
|
-
V.key === "Escape" && (V.preventDefault(), u ? I() : (w ? p.playMenuClose() : p.playMenuOpen(), i((
|
|
912
|
+
const b = (V) => {
|
|
913
|
+
V.key === "Escape" && (V.preventDefault(), u ? I() : (w ? p.playMenuClose() : p.playMenuOpen(), i((t) => !t)));
|
|
911
914
|
};
|
|
912
|
-
return window.addEventListener("keydown",
|
|
915
|
+
return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
|
|
913
916
|
}, [T, w, u, I, p]);
|
|
914
917
|
const X = {
|
|
915
918
|
setMasterVolume: () => {
|
|
@@ -936,7 +939,7 @@ function Me({
|
|
|
936
939
|
{
|
|
937
940
|
audioControls: X,
|
|
938
941
|
uiSoundControls: m !== !1 ? p : void 0,
|
|
939
|
-
availableLocales:
|
|
942
|
+
availableLocales: g,
|
|
940
943
|
onBack: I
|
|
941
944
|
}
|
|
942
945
|
) : /* @__PURE__ */ e.jsx(
|
|
@@ -957,7 +960,7 @@ function Me({
|
|
|
957
960
|
uiSoundControls: m !== !1 ? p : void 0,
|
|
958
961
|
showPauseMenu: w,
|
|
959
962
|
showSettings: u,
|
|
960
|
-
availableLocales:
|
|
963
|
+
availableLocales: g,
|
|
961
964
|
videoBasePath: x,
|
|
962
965
|
pendingVideo: W,
|
|
963
966
|
setPendingVideo: J,
|
|
@@ -976,7 +979,7 @@ function Me({
|
|
|
976
979
|
) }) }) : null;
|
|
977
980
|
}
|
|
978
981
|
function Pe({
|
|
979
|
-
audioOptions:
|
|
982
|
+
audioOptions: n,
|
|
980
983
|
uiSoundControls: s,
|
|
981
984
|
showPauseMenu: r,
|
|
982
985
|
showSettings: a,
|
|
@@ -985,15 +988,15 @@ function Pe({
|
|
|
985
988
|
pendingVideo: m,
|
|
986
989
|
setPendingVideo: h,
|
|
987
990
|
onPause: f,
|
|
988
|
-
onResume:
|
|
991
|
+
onResume: g,
|
|
989
992
|
onSave: x,
|
|
990
993
|
onLoad: R,
|
|
991
994
|
onSettings: T,
|
|
992
995
|
onQuitToTitle: E,
|
|
993
996
|
onCloseSettings: w
|
|
994
997
|
}) {
|
|
995
|
-
const { snapshot: i, actions: u } = re(), _ = le(i,
|
|
996
|
-
return
|
|
998
|
+
const { snapshot: i, actions: u } = re(), _ = le(i, n);
|
|
999
|
+
return L(() => {
|
|
997
1000
|
i.pendingVideo && h(i.pendingVideo);
|
|
998
1001
|
}, [i.pendingVideo, h]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
999
1002
|
m && /* @__PURE__ */ e.jsx(
|
|
@@ -1017,7 +1020,7 @@ function Pe({
|
|
|
1017
1020
|
r && /* @__PURE__ */ e.jsx(
|
|
1018
1021
|
Ae,
|
|
1019
1022
|
{
|
|
1020
|
-
onResume:
|
|
1023
|
+
onResume: g,
|
|
1021
1024
|
onSave: x,
|
|
1022
1025
|
onLoad: R,
|
|
1023
1026
|
onSettings: T,
|
|
@@ -1039,7 +1042,7 @@ function Pe({
|
|
|
1039
1042
|
}
|
|
1040
1043
|
export {
|
|
1041
1044
|
Se as CharacterList,
|
|
1042
|
-
|
|
1045
|
+
be as ChoiceList,
|
|
1043
1046
|
Ne as DialogueBox,
|
|
1044
1047
|
ae as GameContext,
|
|
1045
1048
|
fe as GameProvider,
|
|
@@ -1047,7 +1050,7 @@ export {
|
|
|
1047
1050
|
Me as GameShell,
|
|
1048
1051
|
ke as Inventory,
|
|
1049
1052
|
ye as Journal,
|
|
1050
|
-
|
|
1053
|
+
ge as LocationView,
|
|
1051
1054
|
Ee as MapView,
|
|
1052
1055
|
Te as NotificationArea,
|
|
1053
1056
|
Ae as PauseMenu,
|