@doodle-engine/react 0.0.7 → 0.0.9
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 +16 -0
- package/dist/GameProvider.d.ts +13 -3
- package/dist/GameProvider.d.ts.map +1 -1
- package/dist/GameShell.d.ts +11 -1
- package/dist/GameShell.d.ts.map +1 -1
- package/dist/components/LoadingScreen.d.ts +14 -0
- package/dist/components/LoadingScreen.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/react.cjs +4 -4
- package/dist/react.js +574 -559
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/react.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { VERSION as
|
|
3
|
-
import
|
|
1
|
+
import { enableDevTools as ie, Engine as ue } from "@doodle-engine/core";
|
|
2
|
+
import { VERSION as Fe } from "@doodle-engine/core";
|
|
3
|
+
import de, { createContext as me, useState as T, useEffect as L, useCallback as j, useContext as he, useRef as U } from "react";
|
|
4
4
|
var Z = { exports: {} }, z = {};
|
|
5
5
|
/**
|
|
6
6
|
* @license React
|
|
@@ -11,27 +11,27 @@ 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
|
|
15
|
-
function
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
function r(a,
|
|
20
|
-
var
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
for (var
|
|
24
|
-
|
|
25
|
-
} else
|
|
26
|
-
return
|
|
27
|
-
$$typeof:
|
|
14
|
+
var se;
|
|
15
|
+
function ve() {
|
|
16
|
+
if (se) return z;
|
|
17
|
+
se = 1;
|
|
18
|
+
var n = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
19
|
+
function r(a, o, c) {
|
|
20
|
+
var d = null;
|
|
21
|
+
if (c !== void 0 && (d = "" + c), o.key !== void 0 && (d = "" + o.key), "key" in o) {
|
|
22
|
+
c = {};
|
|
23
|
+
for (var m in o)
|
|
24
|
+
m !== "key" && (c[m] = o[m]);
|
|
25
|
+
} else c = o;
|
|
26
|
+
return o = c.ref, {
|
|
27
|
+
$$typeof: n,
|
|
28
28
|
type: a,
|
|
29
|
-
key:
|
|
30
|
-
ref:
|
|
31
|
-
props:
|
|
29
|
+
key: d,
|
|
30
|
+
ref: o !== void 0 ? o : null,
|
|
31
|
+
props: c
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
return z.Fragment =
|
|
34
|
+
return z.Fragment = t, z.jsx = r, z.jsxs = r, z;
|
|
35
35
|
}
|
|
36
36
|
var B = {};
|
|
37
37
|
/**
|
|
@@ -43,470 +43,477 @@ 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
|
|
47
|
-
function
|
|
48
|
-
return
|
|
49
|
-
function
|
|
50
|
-
if (
|
|
51
|
-
if (typeof
|
|
52
|
-
return
|
|
53
|
-
if (typeof
|
|
54
|
-
switch (
|
|
46
|
+
var ne;
|
|
47
|
+
function pe() {
|
|
48
|
+
return ne || (ne = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
49
|
+
function n(s) {
|
|
50
|
+
if (s == null) return null;
|
|
51
|
+
if (typeof s == "function")
|
|
52
|
+
return s.$$typeof === N ? null : s.displayName || s.name || null;
|
|
53
|
+
if (typeof s == "string") return s;
|
|
54
|
+
switch (s) {
|
|
55
55
|
case u:
|
|
56
56
|
return "Fragment";
|
|
57
|
-
case
|
|
57
|
+
case $:
|
|
58
58
|
return "Profiler";
|
|
59
|
-
case
|
|
59
|
+
case h:
|
|
60
60
|
return "StrictMode";
|
|
61
|
-
case
|
|
61
|
+
case W:
|
|
62
62
|
return "Suspense";
|
|
63
|
-
case
|
|
63
|
+
case R:
|
|
64
64
|
return "SuspenseList";
|
|
65
|
-
case
|
|
65
|
+
case p:
|
|
66
66
|
return "Activity";
|
|
67
67
|
}
|
|
68
|
-
if (typeof
|
|
69
|
-
switch (typeof
|
|
68
|
+
if (typeof s == "object")
|
|
69
|
+
switch (typeof s.tag == "number" && console.error(
|
|
70
70
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
71
|
-
),
|
|
72
|
-
case
|
|
71
|
+
), s.$$typeof) {
|
|
72
|
+
case S:
|
|
73
73
|
return "Portal";
|
|
74
|
-
case
|
|
75
|
-
return
|
|
76
|
-
case
|
|
77
|
-
return (
|
|
78
|
-
case
|
|
79
|
-
var
|
|
80
|
-
return
|
|
81
|
-
case
|
|
82
|
-
return
|
|
83
|
-
case
|
|
84
|
-
|
|
74
|
+
case q:
|
|
75
|
+
return s.displayName || "Context";
|
|
76
|
+
case M:
|
|
77
|
+
return (s._context.displayName || "Context") + ".Consumer";
|
|
78
|
+
case Y:
|
|
79
|
+
var i = s.render;
|
|
80
|
+
return s = s.displayName, s || (s = i.displayName || i.name || "", s = s !== "" ? "ForwardRef(" + s + ")" : "ForwardRef"), s;
|
|
81
|
+
case I:
|
|
82
|
+
return i = s.displayName || null, i !== null ? i : n(s.type) || "Memo";
|
|
83
|
+
case l:
|
|
84
|
+
i = s._payload, s = s._init;
|
|
85
85
|
try {
|
|
86
|
-
return
|
|
86
|
+
return n(s(i));
|
|
87
87
|
} catch {
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
return null;
|
|
91
91
|
}
|
|
92
|
-
function s
|
|
93
|
-
return "" +
|
|
92
|
+
function t(s) {
|
|
93
|
+
return "" + s;
|
|
94
94
|
}
|
|
95
|
-
function r(
|
|
95
|
+
function r(s) {
|
|
96
96
|
try {
|
|
97
|
-
s
|
|
98
|
-
var
|
|
97
|
+
t(s);
|
|
98
|
+
var i = !1;
|
|
99
99
|
} catch {
|
|
100
|
-
|
|
100
|
+
i = !0;
|
|
101
101
|
}
|
|
102
|
-
if (
|
|
103
|
-
|
|
104
|
-
var
|
|
105
|
-
return
|
|
106
|
-
|
|
102
|
+
if (i) {
|
|
103
|
+
i = console;
|
|
104
|
+
var f = i.error, k = typeof Symbol == "function" && Symbol.toStringTag && s[Symbol.toStringTag] || s.constructor.name || "Object";
|
|
105
|
+
return f.call(
|
|
106
|
+
i,
|
|
107
107
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
108
|
-
|
|
109
|
-
), s
|
|
108
|
+
k
|
|
109
|
+
), t(s);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
function a(
|
|
113
|
-
if (
|
|
114
|
-
if (typeof
|
|
112
|
+
function a(s) {
|
|
113
|
+
if (s === u) return "<>";
|
|
114
|
+
if (typeof s == "object" && s !== null && s.$$typeof === l)
|
|
115
115
|
return "<...>";
|
|
116
116
|
try {
|
|
117
|
-
var
|
|
118
|
-
return
|
|
117
|
+
var i = n(s);
|
|
118
|
+
return i ? "<" + i + ">" : "<...>";
|
|
119
119
|
} catch {
|
|
120
120
|
return "<...>";
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
function l() {
|
|
124
|
-
var n = O.A;
|
|
125
|
-
return n === null ? null : n.getOwner();
|
|
126
|
-
}
|
|
127
123
|
function o() {
|
|
124
|
+
var s = A.A;
|
|
125
|
+
return s === null ? null : s.getOwner();
|
|
126
|
+
}
|
|
127
|
+
function c() {
|
|
128
128
|
return Error("react-stack-top-frame");
|
|
129
129
|
}
|
|
130
|
-
function
|
|
131
|
-
if (
|
|
132
|
-
var
|
|
133
|
-
if (
|
|
130
|
+
function d(s) {
|
|
131
|
+
if (V.call(s, "key")) {
|
|
132
|
+
var i = Object.getOwnPropertyDescriptor(s, "key").get;
|
|
133
|
+
if (i && i.isReactWarning) return !1;
|
|
134
134
|
}
|
|
135
|
-
return
|
|
135
|
+
return s.key !== void 0;
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
function
|
|
137
|
+
function m(s, i) {
|
|
138
|
+
function f() {
|
|
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
|
+
i
|
|
142
142
|
));
|
|
143
143
|
}
|
|
144
|
-
|
|
145
|
-
get:
|
|
144
|
+
f.isReactWarning = !0, Object.defineProperty(s, "key", {
|
|
145
|
+
get: f,
|
|
146
146
|
configurable: !0
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
|
-
function
|
|
150
|
-
var
|
|
151
|
-
return
|
|
149
|
+
function v() {
|
|
150
|
+
var s = n(this.type);
|
|
151
|
+
return D[s] || (D[s] = !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
|
+
)), s = this.props.ref, s !== void 0 ? s : null;
|
|
154
154
|
}
|
|
155
|
-
function b(
|
|
156
|
-
var
|
|
157
|
-
return
|
|
155
|
+
function b(s, i, f, k, H, K) {
|
|
156
|
+
var y = f.ref;
|
|
157
|
+
return s = {
|
|
158
158
|
$$typeof: w,
|
|
159
|
-
type:
|
|
160
|
-
key:
|
|
161
|
-
props:
|
|
162
|
-
_owner:
|
|
163
|
-
}, (
|
|
159
|
+
type: s,
|
|
160
|
+
key: i,
|
|
161
|
+
props: f,
|
|
162
|
+
_owner: k
|
|
163
|
+
}, (y !== void 0 ? y : null) !== null ? Object.defineProperty(s, "ref", {
|
|
164
164
|
enumerable: !1,
|
|
165
|
-
get:
|
|
166
|
-
}) : Object.defineProperty(
|
|
165
|
+
get: v
|
|
166
|
+
}) : Object.defineProperty(s, "ref", { enumerable: !1, value: null }), s._store = {}, Object.defineProperty(s._store, "validated", {
|
|
167
167
|
configurable: !1,
|
|
168
168
|
enumerable: !1,
|
|
169
169
|
writable: !0,
|
|
170
170
|
value: 0
|
|
171
|
-
}), Object.defineProperty(
|
|
171
|
+
}), Object.defineProperty(s, "_debugInfo", {
|
|
172
172
|
configurable: !1,
|
|
173
173
|
enumerable: !1,
|
|
174
174
|
writable: !0,
|
|
175
175
|
value: null
|
|
176
|
-
}), Object.defineProperty(
|
|
176
|
+
}), Object.defineProperty(s, "_debugStack", {
|
|
177
177
|
configurable: !1,
|
|
178
178
|
enumerable: !1,
|
|
179
179
|
writable: !0,
|
|
180
180
|
value: H
|
|
181
|
-
}), Object.defineProperty(
|
|
181
|
+
}), Object.defineProperty(s, "_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(s.props), Object.freeze(s)), s;
|
|
187
187
|
}
|
|
188
|
-
function x(
|
|
189
|
-
var
|
|
190
|
-
if (
|
|
191
|
-
if (
|
|
192
|
-
if (
|
|
193
|
-
for (
|
|
194
|
-
|
|
195
|
-
Object.freeze && Object.freeze(
|
|
188
|
+
function x(s, i, f, k, H, K) {
|
|
189
|
+
var y = i.children;
|
|
190
|
+
if (y !== void 0)
|
|
191
|
+
if (k)
|
|
192
|
+
if (G(y)) {
|
|
193
|
+
for (k = 0; k < y.length; k++)
|
|
194
|
+
_(y[k]);
|
|
195
|
+
Object.freeze && Object.freeze(y);
|
|
196
196
|
} else
|
|
197
197
|
console.error(
|
|
198
198
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
199
199
|
);
|
|
200
|
-
else
|
|
201
|
-
if (
|
|
202
|
-
|
|
203
|
-
var
|
|
200
|
+
else _(y);
|
|
201
|
+
if (V.call(i, "key")) {
|
|
202
|
+
y = n(s);
|
|
203
|
+
var J = Object.keys(i).filter(function(ce) {
|
|
204
204
|
return ce !== "key";
|
|
205
205
|
});
|
|
206
|
-
|
|
206
|
+
k = 0 < J.length ? "{key: someKey, " + J.join(": ..., ") + ": ...}" : "{key: someKey}", g[y + k] || (J = 0 < J.length ? "{" + J.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
207
207
|
`A props object containing a "key" prop is being spread into JSX:
|
|
208
208
|
let props = %s;
|
|
209
209
|
<%s {...props} />
|
|
210
210
|
React keys must be passed directly to JSX without using spread:
|
|
211
211
|
let props = %s;
|
|
212
212
|
<%s key={someKey} {...props} />`,
|
|
213
|
-
S,
|
|
214
213
|
k,
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
214
|
+
y,
|
|
215
|
+
J,
|
|
216
|
+
y
|
|
217
|
+
), g[y + k] = !0);
|
|
218
218
|
}
|
|
219
|
-
if (
|
|
220
|
-
|
|
221
|
-
for (var ee in
|
|
222
|
-
ee !== "key" && (
|
|
223
|
-
} else
|
|
224
|
-
return
|
|
225
|
-
|
|
226
|
-
typeof
|
|
219
|
+
if (y = null, f !== void 0 && (r(f), y = "" + f), d(i) && (r(i.key), y = "" + i.key), "key" in i) {
|
|
220
|
+
f = {};
|
|
221
|
+
for (var ee in i)
|
|
222
|
+
ee !== "key" && (f[ee] = i[ee]);
|
|
223
|
+
} else f = i;
|
|
224
|
+
return y && m(
|
|
225
|
+
f,
|
|
226
|
+
typeof s == "function" ? s.displayName || s.name || "Unknown" : s
|
|
227
227
|
), b(
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
228
|
+
s,
|
|
229
|
+
y,
|
|
230
|
+
f,
|
|
231
|
+
o(),
|
|
232
232
|
H,
|
|
233
233
|
K
|
|
234
234
|
);
|
|
235
235
|
}
|
|
236
|
-
function
|
|
237
|
-
|
|
236
|
+
function _(s) {
|
|
237
|
+
C(s) ? s._store && (s._store.validated = 1) : typeof s == "object" && s !== null && s.$$typeof === l && (s._payload.status === "fulfilled" ? C(s._payload.value) && s._payload.value._store && (s._payload.value._store.validated = 1) : s._store && (s._store.validated = 1));
|
|
238
238
|
}
|
|
239
|
-
function
|
|
240
|
-
return typeof
|
|
239
|
+
function C(s) {
|
|
240
|
+
return typeof s == "object" && s !== null && s.$$typeof === w;
|
|
241
241
|
}
|
|
242
|
-
var E =
|
|
242
|
+
var E = de, w = Symbol.for("react.transitional.element"), S = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), h = Symbol.for("react.strict_mode"), $ = Symbol.for("react.profiler"), M = Symbol.for("react.consumer"), q = Symbol.for("react.context"), Y = Symbol.for("react.forward_ref"), W = Symbol.for("react.suspense"), R = Symbol.for("react.suspense_list"), I = Symbol.for("react.memo"), l = Symbol.for("react.lazy"), p = Symbol.for("react.activity"), N = Symbol.for("react.client.reference"), A = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, G = Array.isArray, O = 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(s) {
|
|
247
|
+
return s();
|
|
248
248
|
}
|
|
249
249
|
};
|
|
250
|
-
var P,
|
|
250
|
+
var P, D = {}, F = E.react_stack_bottom_frame.bind(
|
|
251
251
|
E,
|
|
252
|
-
|
|
253
|
-
)(),
|
|
254
|
-
B.Fragment = u, B.jsx = function(
|
|
255
|
-
var
|
|
252
|
+
c
|
|
253
|
+
)(), X = O(a(c)), g = {};
|
|
254
|
+
B.Fragment = u, B.jsx = function(s, i, f) {
|
|
255
|
+
var k = 1e4 > A.recentlyCreatedOwnerStacks++;
|
|
256
256
|
return x(
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
257
|
+
s,
|
|
258
|
+
i,
|
|
259
|
+
f,
|
|
260
260
|
!1,
|
|
261
|
-
|
|
262
|
-
|
|
261
|
+
k ? Error("react-stack-top-frame") : F,
|
|
262
|
+
k ? O(a(s)) : X
|
|
263
263
|
);
|
|
264
|
-
}, B.jsxs = function(
|
|
265
|
-
var
|
|
264
|
+
}, B.jsxs = function(s, i, f) {
|
|
265
|
+
var k = 1e4 > A.recentlyCreatedOwnerStacks++;
|
|
266
266
|
return x(
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
267
|
+
s,
|
|
268
|
+
i,
|
|
269
|
+
f,
|
|
270
270
|
!0,
|
|
271
|
-
|
|
272
|
-
|
|
271
|
+
k ? Error("react-stack-top-frame") : F,
|
|
272
|
+
k ? O(a(s)) : X
|
|
273
273
|
);
|
|
274
274
|
};
|
|
275
275
|
})()), B;
|
|
276
276
|
}
|
|
277
|
-
var
|
|
278
|
-
function
|
|
279
|
-
return
|
|
277
|
+
var te;
|
|
278
|
+
function fe() {
|
|
279
|
+
return te || (te = 1, process.env.NODE_ENV === "production" ? Z.exports = ve() : Z.exports = pe()), Z.exports;
|
|
280
280
|
}
|
|
281
|
-
var e =
|
|
282
|
-
const ae =
|
|
283
|
-
function
|
|
284
|
-
const [
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
281
|
+
var e = fe();
|
|
282
|
+
const ae = me(null);
|
|
283
|
+
function xe({ engine: n, initialSnapshot: t, children: r, devTools: a = !1 }) {
|
|
284
|
+
const [o, c] = T(t);
|
|
285
|
+
L(() => {
|
|
286
|
+
if (a)
|
|
287
|
+
return ie(n, () => c(n.getSnapshot())), () => {
|
|
288
|
+
delete window.doodle;
|
|
289
|
+
};
|
|
290
|
+
}, [n, a]);
|
|
291
|
+
const d = j(
|
|
292
|
+
(u) => {
|
|
293
|
+
const h = n.selectChoice(u);
|
|
294
|
+
c(h);
|
|
288
295
|
},
|
|
289
|
-
[
|
|
290
|
-
), m =
|
|
291
|
-
(
|
|
292
|
-
const
|
|
293
|
-
|
|
296
|
+
[n]
|
|
297
|
+
), m = j(
|
|
298
|
+
(u) => {
|
|
299
|
+
const h = n.talkTo(u);
|
|
300
|
+
c(h);
|
|
294
301
|
},
|
|
295
|
-
[
|
|
296
|
-
),
|
|
297
|
-
(
|
|
298
|
-
const
|
|
299
|
-
|
|
302
|
+
[n]
|
|
303
|
+
), v = j(
|
|
304
|
+
(u) => {
|
|
305
|
+
const h = n.takeItem(u);
|
|
306
|
+
c(h);
|
|
300
307
|
},
|
|
301
|
-
[
|
|
302
|
-
),
|
|
303
|
-
(
|
|
304
|
-
const
|
|
305
|
-
|
|
308
|
+
[n]
|
|
309
|
+
), b = j(
|
|
310
|
+
(u) => {
|
|
311
|
+
const h = n.travelTo(u);
|
|
312
|
+
c(h);
|
|
306
313
|
},
|
|
307
|
-
[
|
|
308
|
-
),
|
|
309
|
-
(
|
|
310
|
-
const
|
|
311
|
-
|
|
314
|
+
[n]
|
|
315
|
+
), x = j(
|
|
316
|
+
(u, h) => {
|
|
317
|
+
const $ = n.writeNote(u, h);
|
|
318
|
+
c($);
|
|
312
319
|
},
|
|
313
|
-
[
|
|
314
|
-
),
|
|
315
|
-
(
|
|
316
|
-
const
|
|
317
|
-
|
|
320
|
+
[n]
|
|
321
|
+
), _ = j(
|
|
322
|
+
(u) => {
|
|
323
|
+
const h = n.deleteNote(u);
|
|
324
|
+
c(h);
|
|
318
325
|
},
|
|
319
|
-
[
|
|
320
|
-
),
|
|
321
|
-
(
|
|
322
|
-
const
|
|
323
|
-
|
|
326
|
+
[n]
|
|
327
|
+
), C = j(
|
|
328
|
+
(u) => {
|
|
329
|
+
const h = n.setLocale(u);
|
|
330
|
+
c(h);
|
|
324
331
|
},
|
|
325
|
-
[
|
|
326
|
-
),
|
|
327
|
-
(
|
|
328
|
-
const
|
|
329
|
-
|
|
332
|
+
[n]
|
|
333
|
+
), E = j(() => n.saveGame(), [n]), w = j(
|
|
334
|
+
(u) => {
|
|
335
|
+
const h = n.loadGame(u);
|
|
336
|
+
c(h);
|
|
330
337
|
},
|
|
331
|
-
[
|
|
332
|
-
),
|
|
333
|
-
snapshot:
|
|
338
|
+
[n]
|
|
339
|
+
), S = {
|
|
340
|
+
snapshot: o,
|
|
334
341
|
actions: {
|
|
335
|
-
selectChoice:
|
|
342
|
+
selectChoice: d,
|
|
336
343
|
talkTo: m,
|
|
337
|
-
takeItem:
|
|
338
|
-
travelTo:
|
|
339
|
-
writeNote:
|
|
340
|
-
deleteNote:
|
|
341
|
-
setLocale:
|
|
342
|
-
saveGame:
|
|
343
|
-
loadGame:
|
|
344
|
+
takeItem: v,
|
|
345
|
+
travelTo: b,
|
|
346
|
+
writeNote: x,
|
|
347
|
+
deleteNote: _,
|
|
348
|
+
setLocale: C,
|
|
349
|
+
saveGame: E,
|
|
350
|
+
loadGame: w
|
|
344
351
|
}
|
|
345
352
|
};
|
|
346
|
-
return /* @__PURE__ */ e.jsx(ae.Provider, { value:
|
|
353
|
+
return /* @__PURE__ */ e.jsx(ae.Provider, { value: S, children: r });
|
|
347
354
|
}
|
|
348
355
|
function re() {
|
|
349
|
-
const
|
|
350
|
-
if (!
|
|
356
|
+
const n = he(ae);
|
|
357
|
+
if (!n)
|
|
351
358
|
throw new Error("useGame must be used within a GameProvider");
|
|
352
|
-
return
|
|
359
|
+
return n;
|
|
353
360
|
}
|
|
354
|
-
function le(
|
|
355
|
-
var
|
|
361
|
+
function le(n, t = {}) {
|
|
362
|
+
var I;
|
|
356
363
|
const {
|
|
357
364
|
audioBasePath: r = "/audio",
|
|
358
365
|
masterVolume: a = 1,
|
|
359
|
-
musicVolume:
|
|
360
|
-
soundVolume:
|
|
361
|
-
voiceVolume:
|
|
362
|
-
crossfadeDuration:
|
|
363
|
-
} =
|
|
364
|
-
|
|
365
|
-
const
|
|
366
|
-
|
|
367
|
-
const
|
|
368
|
-
return
|
|
369
|
-
|
|
366
|
+
musicVolume: o = 0.7,
|
|
367
|
+
soundVolume: c = 0.8,
|
|
368
|
+
voiceVolume: d = 1,
|
|
369
|
+
crossfadeDuration: m = 1e3
|
|
370
|
+
} = t, [v, b] = T(a), [x, _] = T(o), [C, E] = T(c), [w, S] = T(d), u = U(null), h = U(null), $ = U(null), M = U(null);
|
|
371
|
+
L(() => {
|
|
372
|
+
const l = new Audio();
|
|
373
|
+
l.loop = !0, u.current = l;
|
|
374
|
+
const p = new Audio();
|
|
375
|
+
return h.current = p, () => {
|
|
376
|
+
M.current && clearInterval(M.current), l.pause(), p.pause(), l.src = "", p.src = "";
|
|
370
377
|
};
|
|
371
|
-
}, []),
|
|
372
|
-
const
|
|
373
|
-
if (!
|
|
374
|
-
const
|
|
375
|
-
if (
|
|
376
|
-
if (
|
|
377
|
-
|
|
378
|
+
}, []), L(() => {
|
|
379
|
+
const l = u.current;
|
|
380
|
+
if (!l) return;
|
|
381
|
+
const p = n.music;
|
|
382
|
+
if (p !== $.current)
|
|
383
|
+
if ($.current = p, !p)
|
|
384
|
+
Y(l, m);
|
|
378
385
|
else {
|
|
379
|
-
const
|
|
380
|
-
|
|
386
|
+
const N = `${r}/music/${p}`;
|
|
387
|
+
q(l, N, m);
|
|
381
388
|
}
|
|
382
|
-
|
|
383
|
-
}, [
|
|
384
|
-
var
|
|
385
|
-
const
|
|
386
|
-
if (!
|
|
387
|
-
const
|
|
388
|
-
|
|
389
|
-
console.warn("Voice playback failed:",
|
|
389
|
+
l.volume = v * x;
|
|
390
|
+
}, [n.music, v, x, r, m]), L(() => {
|
|
391
|
+
var N;
|
|
392
|
+
const l = h.current;
|
|
393
|
+
if (!l) return;
|
|
394
|
+
const p = (N = n.dialogue) == null ? void 0 : N.voice;
|
|
395
|
+
p && (l.pause(), l.currentTime = 0, l.src = `${r}/voice/${p}`, l.volume = v * w, l.play().catch((A) => {
|
|
396
|
+
console.warn("Voice playback failed:", A);
|
|
390
397
|
}));
|
|
391
|
-
}, [(
|
|
392
|
-
|
|
393
|
-
const
|
|
394
|
-
|
|
395
|
-
console.warn("Sound playback failed:",
|
|
398
|
+
}, [(I = n.dialogue) == null ? void 0 : I.voice, v, w, r]), L(() => {
|
|
399
|
+
n.pendingSounds.length !== 0 && n.pendingSounds.forEach((l) => {
|
|
400
|
+
const p = new Audio(`${r}/sfx/${l}`);
|
|
401
|
+
p.volume = v * C, p.play().catch((N) => {
|
|
402
|
+
console.warn("Sound playback failed:", N);
|
|
396
403
|
});
|
|
397
404
|
});
|
|
398
|
-
}, [
|
|
399
|
-
const
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
}).catch((
|
|
404
|
-
console.warn("Music playback failed:",
|
|
405
|
+
}, [n.pendingSounds, v, C, r]);
|
|
406
|
+
const q = (l, p, N) => {
|
|
407
|
+
Y(l, N / 2).then(() => {
|
|
408
|
+
l.src = p, l.load(), l.volume = 0, l.play().then(() => {
|
|
409
|
+
W(l, N / 2, v * x);
|
|
410
|
+
}).catch((A) => {
|
|
411
|
+
console.warn("Music playback failed:", A);
|
|
405
412
|
});
|
|
406
413
|
});
|
|
407
|
-
},
|
|
408
|
-
const
|
|
414
|
+
}, Y = (l, p) => new Promise((N) => {
|
|
415
|
+
const A = l.volume, V = 20, G = p / V, O = A / V;
|
|
409
416
|
let P = 0;
|
|
410
|
-
const
|
|
411
|
-
P++,
|
|
412
|
-
},
|
|
413
|
-
|
|
414
|
-
}),
|
|
415
|
-
const
|
|
416
|
-
let
|
|
417
|
+
const D = setInterval(() => {
|
|
418
|
+
P++, l.volume = Math.max(0, A - O * P), P >= V && (clearInterval(D), l.pause(), l.currentTime = 0, N());
|
|
419
|
+
}, G);
|
|
420
|
+
M.current = D;
|
|
421
|
+
}), W = (l, p, N) => {
|
|
422
|
+
const V = p / 20, G = N / 20;
|
|
423
|
+
let O = 0;
|
|
417
424
|
const P = setInterval(() => {
|
|
418
|
-
|
|
419
|
-
},
|
|
420
|
-
|
|
425
|
+
O++, l.volume = Math.min(N, G * O), O >= 20 && clearInterval(P);
|
|
426
|
+
}, V);
|
|
427
|
+
M.current = P;
|
|
421
428
|
};
|
|
422
429
|
return {
|
|
423
430
|
setMasterVolume: b,
|
|
424
|
-
setMusicVolume:
|
|
431
|
+
setMusicVolume: _,
|
|
425
432
|
setSoundVolume: E,
|
|
426
|
-
setVoiceVolume:
|
|
433
|
+
setVoiceVolume: S,
|
|
427
434
|
stopAll: () => {
|
|
428
|
-
u.current && (u.current.pause(), u.current.currentTime = 0),
|
|
435
|
+
u.current && (u.current.pause(), u.current.currentTime = 0), h.current && (h.current.pause(), h.current.currentTime = 0);
|
|
429
436
|
}
|
|
430
437
|
};
|
|
431
438
|
}
|
|
432
|
-
const
|
|
439
|
+
const je = {
|
|
433
440
|
click: "click.ogg",
|
|
434
441
|
menuOpen: "menu_open.ogg",
|
|
435
442
|
menuClose: "menu_close.ogg"
|
|
436
443
|
};
|
|
437
|
-
function
|
|
444
|
+
function Ne(n = {}) {
|
|
438
445
|
const {
|
|
439
|
-
enabled:
|
|
446
|
+
enabled: t = !0,
|
|
440
447
|
basePath: r = "/audio/ui",
|
|
441
448
|
volume: a = 0.5,
|
|
442
|
-
sounds:
|
|
443
|
-
} =
|
|
444
|
-
(
|
|
445
|
-
if (!
|
|
446
|
-
const u = new Audio(`${r}/${
|
|
447
|
-
u.volume =
|
|
449
|
+
sounds: o = {}
|
|
450
|
+
} = n, [c, d] = T(t), [m, v] = T(a), b = U({ ...je, ...o }), x = j(
|
|
451
|
+
(S) => {
|
|
452
|
+
if (!c || !S) return;
|
|
453
|
+
const u = new Audio(`${r}/${S}`);
|
|
454
|
+
u.volume = m, u.play().catch(() => {
|
|
448
455
|
});
|
|
449
456
|
},
|
|
450
|
-
[
|
|
451
|
-
),
|
|
452
|
-
(
|
|
453
|
-
const u = b.current[
|
|
457
|
+
[c, m, r]
|
|
458
|
+
), _ = j(
|
|
459
|
+
(S) => {
|
|
460
|
+
const u = b.current[S];
|
|
454
461
|
u && x(u);
|
|
455
462
|
},
|
|
456
463
|
[x]
|
|
457
|
-
),
|
|
464
|
+
), C = j(() => x(b.current.click), [x]), E = j(() => x(b.current.menuOpen), [x]), w = j(() => x(b.current.menuClose), [x]);
|
|
458
465
|
return {
|
|
459
|
-
playClick:
|
|
466
|
+
playClick: C,
|
|
460
467
|
playMenuOpen: E,
|
|
461
468
|
playMenuClose: w,
|
|
462
|
-
playSound:
|
|
463
|
-
setEnabled:
|
|
464
|
-
setVolume:
|
|
465
|
-
enabled:
|
|
466
|
-
volume:
|
|
469
|
+
playSound: _,
|
|
470
|
+
setEnabled: d,
|
|
471
|
+
setVolume: v,
|
|
472
|
+
enabled: c,
|
|
473
|
+
volume: m
|
|
467
474
|
};
|
|
468
475
|
}
|
|
469
|
-
function
|
|
470
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `dialogue-box ${
|
|
471
|
-
|
|
476
|
+
function ge({ dialogue: n, className: t = "" }) {
|
|
477
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `dialogue-box ${t}`, children: [
|
|
478
|
+
n.portrait && /* @__PURE__ */ e.jsx("div", { className: "dialogue-portrait", children: /* @__PURE__ */ e.jsx("img", { src: n.portrait, alt: n.speakerName }) }),
|
|
472
479
|
/* @__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:
|
|
480
|
+
/* @__PURE__ */ e.jsx("div", { className: "dialogue-speaker", children: n.speakerName }),
|
|
481
|
+
/* @__PURE__ */ e.jsx("div", { className: "dialogue-text", children: n.text })
|
|
475
482
|
] })
|
|
476
483
|
] });
|
|
477
484
|
}
|
|
478
|
-
function
|
|
479
|
-
return
|
|
485
|
+
function be({ choices: n, onSelectChoice: t, className: r = "" }) {
|
|
486
|
+
return n.length === 0 ? null : /* @__PURE__ */ e.jsx("div", { className: `choice-list ${r}`, children: n.map((a) => /* @__PURE__ */ e.jsx(
|
|
480
487
|
"button",
|
|
481
488
|
{
|
|
482
489
|
className: "choice-button",
|
|
483
|
-
onClick: () =>
|
|
490
|
+
onClick: () => t(a.id),
|
|
484
491
|
children: a.text
|
|
485
492
|
},
|
|
486
493
|
a.id
|
|
487
494
|
)) });
|
|
488
495
|
}
|
|
489
|
-
function
|
|
490
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `location-view ${
|
|
491
|
-
|
|
496
|
+
function Se({ location: n, className: t = "" }) {
|
|
497
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `location-view ${t}`, children: [
|
|
498
|
+
n.banner && /* @__PURE__ */ e.jsx("div", { className: "location-banner", children: /* @__PURE__ */ e.jsx("img", { src: n.banner, alt: n.name }) }),
|
|
492
499
|
/* @__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:
|
|
500
|
+
/* @__PURE__ */ e.jsx("h1", { className: "location-name", children: n.name }),
|
|
501
|
+
/* @__PURE__ */ e.jsx("p", { className: "location-description", children: n.description })
|
|
495
502
|
] })
|
|
496
503
|
] });
|
|
497
504
|
}
|
|
498
|
-
function
|
|
499
|
-
characters:
|
|
500
|
-
onTalkTo:
|
|
505
|
+
function ke({
|
|
506
|
+
characters: n,
|
|
507
|
+
onTalkTo: t,
|
|
501
508
|
className: r = ""
|
|
502
509
|
}) {
|
|
503
|
-
return
|
|
510
|
+
return n.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: `character-list ${r}`, children: [
|
|
504
511
|
/* @__PURE__ */ e.jsx("h2", { children: "Characters" }),
|
|
505
|
-
/* @__PURE__ */ e.jsx("div", { className: "character-grid", children:
|
|
512
|
+
/* @__PURE__ */ e.jsx("div", { className: "character-grid", children: n.map((a) => /* @__PURE__ */ e.jsxs(
|
|
506
513
|
"button",
|
|
507
514
|
{
|
|
508
515
|
className: "character-card",
|
|
509
|
-
onClick: () =>
|
|
516
|
+
onClick: () => t(a.id),
|
|
510
517
|
children: [
|
|
511
518
|
a.portrait && /* @__PURE__ */ e.jsx(
|
|
512
519
|
"img",
|
|
@@ -523,23 +530,23 @@ function Se({
|
|
|
523
530
|
)) })
|
|
524
531
|
] });
|
|
525
532
|
}
|
|
526
|
-
function
|
|
527
|
-
const [r, a] =
|
|
528
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `inventory ${
|
|
533
|
+
function ye({ items: n, className: t = "" }) {
|
|
534
|
+
const [r, a] = T(null);
|
|
535
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `inventory ${t}`, children: [
|
|
529
536
|
/* @__PURE__ */ e.jsx("h2", { children: "Inventory" }),
|
|
530
|
-
|
|
537
|
+
n.length === 0 ? /* @__PURE__ */ e.jsx("p", { className: "inventory-empty", children: "No items" }) : /* @__PURE__ */ e.jsx("div", { className: "inventory-grid", children: n.map((o) => /* @__PURE__ */ e.jsxs(
|
|
531
538
|
"div",
|
|
532
539
|
{
|
|
533
540
|
className: "inventory-item",
|
|
534
|
-
onClick: () => a(
|
|
541
|
+
onClick: () => a(o),
|
|
535
542
|
children: [
|
|
536
|
-
|
|
537
|
-
/* @__PURE__ */ e.jsx("div", { className: "item-name", children:
|
|
543
|
+
o.icon && /* @__PURE__ */ e.jsx("img", { src: o.icon, alt: o.name, className: "item-icon" }),
|
|
544
|
+
/* @__PURE__ */ e.jsx("div", { className: "item-name", children: o.name })
|
|
538
545
|
]
|
|
539
546
|
},
|
|
540
|
-
|
|
547
|
+
o.id
|
|
541
548
|
)) }),
|
|
542
|
-
r && /* @__PURE__ */ e.jsx("div", { className: "item-modal-overlay", onClick: () => a(null), children: /* @__PURE__ */ e.jsxs("div", { className: "item-modal", onClick: (
|
|
549
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "item-modal-overlay", onClick: () => a(null), children: /* @__PURE__ */ e.jsxs("div", { className: "item-modal", onClick: (o) => o.stopPropagation(), children: [
|
|
543
550
|
r.image && /* @__PURE__ */ e.jsx("img", { src: r.image, alt: r.name, className: "item-modal-image" }),
|
|
544
551
|
/* @__PURE__ */ e.jsx("h3", { className: "item-modal-name", children: r.name }),
|
|
545
552
|
/* @__PURE__ */ e.jsx("p", { className: "item-modal-description", children: r.description }),
|
|
@@ -547,33 +554,33 @@ function ke({ items: t, className: s = "" }) {
|
|
|
547
554
|
] }) })
|
|
548
555
|
] });
|
|
549
556
|
}
|
|
550
|
-
function
|
|
557
|
+
function Ee({ quests: n, entries: t, className: r = "" }) {
|
|
551
558
|
return /* @__PURE__ */ e.jsxs("div", { className: `journal ${r}`, children: [
|
|
552
559
|
/* @__PURE__ */ e.jsx("h2", { children: "Journal" }),
|
|
553
|
-
|
|
560
|
+
n.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "journal-quests", children: [
|
|
554
561
|
/* @__PURE__ */ e.jsx("h3", { children: "Active Quests" }),
|
|
555
|
-
|
|
562
|
+
n.map((a) => /* @__PURE__ */ e.jsxs("div", { className: "quest-entry", children: [
|
|
556
563
|
/* @__PURE__ */ e.jsx("div", { className: "quest-name", children: a.name }),
|
|
557
564
|
/* @__PURE__ */ e.jsx("div", { className: "quest-description", children: a.description }),
|
|
558
565
|
/* @__PURE__ */ e.jsx("div", { className: "quest-stage", children: a.currentStageDescription })
|
|
559
566
|
] }, a.id))
|
|
560
567
|
] }),
|
|
561
|
-
|
|
568
|
+
t.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "journal-entries", children: [
|
|
562
569
|
/* @__PURE__ */ e.jsx("h3", { children: "Entries" }),
|
|
563
|
-
|
|
570
|
+
t.map((a) => /* @__PURE__ */ e.jsxs("div", { className: `journal-entry journal-category-${a.category}`, children: [
|
|
564
571
|
/* @__PURE__ */ e.jsx("div", { className: "entry-title", children: a.title }),
|
|
565
572
|
/* @__PURE__ */ e.jsx("div", { className: "entry-text", children: a.text })
|
|
566
573
|
] }, a.id))
|
|
567
574
|
] }),
|
|
568
|
-
|
|
575
|
+
n.length === 0 && t.length === 0 && /* @__PURE__ */ e.jsx("p", { className: "journal-empty", children: "No entries yet" })
|
|
569
576
|
] });
|
|
570
577
|
}
|
|
571
|
-
function
|
|
572
|
-
return
|
|
573
|
-
/* @__PURE__ */ e.jsx("h2", { children:
|
|
578
|
+
function we({ map: n, onTravelTo: t, className: r = "" }) {
|
|
579
|
+
return n ? /* @__PURE__ */ e.jsxs("div", { className: `map-view ${r}`, children: [
|
|
580
|
+
/* @__PURE__ */ e.jsx("h2", { children: n.name }),
|
|
574
581
|
/* @__PURE__ */ e.jsxs("div", { className: "map-container", style: { position: "relative" }, children: [
|
|
575
|
-
|
|
576
|
-
|
|
582
|
+
n.image && /* @__PURE__ */ e.jsx("img", { src: n.image, alt: n.name, className: "map-image" }),
|
|
583
|
+
n.locations.map((a) => /* @__PURE__ */ e.jsx(
|
|
577
584
|
"button",
|
|
578
585
|
{
|
|
579
586
|
className: `map-marker ${a.isCurrent ? "current" : ""}`,
|
|
@@ -582,7 +589,7 @@ function Ee({ map: t, onTravelTo: s, className: r = "" }) {
|
|
|
582
589
|
left: `${a.x}px`,
|
|
583
590
|
top: `${a.y}px`
|
|
584
591
|
},
|
|
585
|
-
onClick: () => !a.isCurrent &&
|
|
592
|
+
onClick: () => !a.isCurrent && t(a.id),
|
|
586
593
|
disabled: a.isCurrent,
|
|
587
594
|
title: a.name,
|
|
588
595
|
children: a.name
|
|
@@ -593,140 +600,140 @@ function Ee({ map: t, onTravelTo: s, className: r = "" }) {
|
|
|
593
600
|
] }) : null;
|
|
594
601
|
}
|
|
595
602
|
function Te({
|
|
596
|
-
notifications:
|
|
597
|
-
className:
|
|
603
|
+
notifications: n,
|
|
604
|
+
className: t = ""
|
|
598
605
|
}) {
|
|
599
|
-
return
|
|
606
|
+
return n.length === 0 ? null : /* @__PURE__ */ e.jsx("div", { className: `notification-area ${t}`, children: n.map((r, a) => /* @__PURE__ */ e.jsx("div", { className: "notification", children: r }, a)) });
|
|
600
607
|
}
|
|
601
|
-
function
|
|
602
|
-
onSave:
|
|
603
|
-
onLoad:
|
|
608
|
+
function _e({
|
|
609
|
+
onSave: n,
|
|
610
|
+
onLoad: t,
|
|
604
611
|
storageKey: r = "doodle-engine-save",
|
|
605
612
|
className: a = ""
|
|
606
613
|
}) {
|
|
607
|
-
const [
|
|
608
|
-
const b =
|
|
609
|
-
localStorage.setItem(r, JSON.stringify(b)),
|
|
610
|
-
},
|
|
614
|
+
const [o, c] = T(""), d = () => {
|
|
615
|
+
const b = n();
|
|
616
|
+
localStorage.setItem(r, JSON.stringify(b)), c("Saved!"), setTimeout(() => c(""), 2e3);
|
|
617
|
+
}, m = () => {
|
|
611
618
|
const b = localStorage.getItem(r);
|
|
612
619
|
if (!b) {
|
|
613
|
-
|
|
620
|
+
c("No save found"), setTimeout(() => c(""), 2e3);
|
|
614
621
|
return;
|
|
615
622
|
}
|
|
616
623
|
const x = JSON.parse(b);
|
|
617
|
-
|
|
618
|
-
},
|
|
624
|
+
t(x), c("Loaded!"), setTimeout(() => c(""), 2e3);
|
|
625
|
+
}, v = localStorage.getItem(r) !== null;
|
|
619
626
|
return /* @__PURE__ */ e.jsxs("div", { className: `save-load-panel ${a}`, children: [
|
|
620
|
-
/* @__PURE__ */ e.jsx("button", { className: "save-button", onClick:
|
|
621
|
-
/* @__PURE__ */ e.jsx("button", { className: "load-button", onClick:
|
|
622
|
-
|
|
627
|
+
/* @__PURE__ */ e.jsx("button", { className: "save-button", onClick: d, children: "Save" }),
|
|
628
|
+
/* @__PURE__ */ e.jsx("button", { className: "load-button", onClick: m, disabled: !v, children: "Load" }),
|
|
629
|
+
o && /* @__PURE__ */ e.jsx("span", { className: "save-load-message", children: o })
|
|
623
630
|
] });
|
|
624
631
|
}
|
|
625
|
-
function
|
|
626
|
-
const { snapshot:
|
|
627
|
-
le(
|
|
628
|
-
const a = Object.entries(
|
|
629
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `game-renderer ${
|
|
630
|
-
/* @__PURE__ */ e.jsx(Te, { notifications:
|
|
632
|
+
function Ce({ className: n = "" }) {
|
|
633
|
+
const { snapshot: t, actions: r } = re();
|
|
634
|
+
le(t);
|
|
635
|
+
const a = Object.entries(t.variables).filter(([o]) => !o.startsWith("_"));
|
|
636
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `game-renderer ${n}`, children: [
|
|
637
|
+
/* @__PURE__ */ e.jsx(Te, { notifications: t.notifications }),
|
|
631
638
|
/* @__PURE__ */ e.jsxs("div", { className: "game-main", children: [
|
|
632
|
-
/* @__PURE__ */ e.jsx(
|
|
633
|
-
|
|
634
|
-
/* @__PURE__ */ e.jsx(
|
|
635
|
-
/* @__PURE__ */ e.jsx(
|
|
639
|
+
/* @__PURE__ */ e.jsx(Se, { location: t.location }),
|
|
640
|
+
t.dialogue && /* @__PURE__ */ e.jsxs("div", { className: "dialogue-container", children: [
|
|
641
|
+
/* @__PURE__ */ e.jsx(ge, { dialogue: t.dialogue }),
|
|
642
|
+
/* @__PURE__ */ e.jsx(be, { choices: t.choices, onSelectChoice: r.selectChoice })
|
|
636
643
|
] }),
|
|
637
|
-
!
|
|
638
|
-
|
|
644
|
+
!t.dialogue && /* @__PURE__ */ e.jsx(
|
|
645
|
+
ke,
|
|
639
646
|
{
|
|
640
|
-
characters:
|
|
647
|
+
characters: t.charactersHere,
|
|
641
648
|
onTalkTo: r.talkTo
|
|
642
649
|
}
|
|
643
650
|
)
|
|
644
651
|
] }),
|
|
645
652
|
/* @__PURE__ */ e.jsxs("div", { className: "game-sidebar", children: [
|
|
646
|
-
/* @__PURE__ */ e.jsx(
|
|
653
|
+
/* @__PURE__ */ e.jsx(_e, { onSave: r.saveGame, onLoad: r.loadGame }),
|
|
647
654
|
a.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "resources", children: [
|
|
648
655
|
/* @__PURE__ */ e.jsx("h2", { children: "Resources" }),
|
|
649
|
-
/* @__PURE__ */ e.jsx("ul", { className: "resources-list", children: a.map(([
|
|
650
|
-
/* @__PURE__ */ e.jsx("span", { className: "resource-name", children:
|
|
651
|
-
/* @__PURE__ */ e.jsx("span", { className: "resource-value", children:
|
|
652
|
-
] },
|
|
656
|
+
/* @__PURE__ */ e.jsx("ul", { className: "resources-list", children: a.map(([o, c]) => /* @__PURE__ */ e.jsxs("li", { className: "resource-entry", children: [
|
|
657
|
+
/* @__PURE__ */ e.jsx("span", { className: "resource-name", children: o }),
|
|
658
|
+
/* @__PURE__ */ e.jsx("span", { className: "resource-value", children: c })
|
|
659
|
+
] }, o)) })
|
|
653
660
|
] }),
|
|
654
|
-
|
|
661
|
+
t.party.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "party", children: [
|
|
655
662
|
/* @__PURE__ */ e.jsx("h2", { children: "Party" }),
|
|
656
|
-
/* @__PURE__ */ e.jsx("ul", { className: "party-list", children:
|
|
663
|
+
/* @__PURE__ */ e.jsx("ul", { className: "party-list", children: t.party.map((o) => /* @__PURE__ */ e.jsx("li", { className: "party-member", children: /* @__PURE__ */ e.jsx("span", { className: "party-member-name", children: o.name }) }, o.id)) })
|
|
657
664
|
] }),
|
|
658
|
-
/* @__PURE__ */ e.jsx(
|
|
659
|
-
/* @__PURE__ */ e.jsx(
|
|
660
|
-
|
|
665
|
+
/* @__PURE__ */ e.jsx(ye, { items: t.inventory }),
|
|
666
|
+
/* @__PURE__ */ e.jsx(Ee, { quests: t.quests, entries: t.journal }),
|
|
667
|
+
t.map && /* @__PURE__ */ e.jsx(we, { map: t.map, onTravelTo: r.travelTo })
|
|
661
668
|
] })
|
|
662
669
|
] });
|
|
663
670
|
}
|
|
664
|
-
function
|
|
665
|
-
logoSrc:
|
|
666
|
-
title:
|
|
671
|
+
function Re({
|
|
672
|
+
logoSrc: n,
|
|
673
|
+
title: t,
|
|
667
674
|
onComplete: r,
|
|
668
675
|
duration: a = 2e3,
|
|
669
|
-
className:
|
|
676
|
+
className: o = ""
|
|
670
677
|
}) {
|
|
671
|
-
return
|
|
672
|
-
const
|
|
673
|
-
return () => clearTimeout(
|
|
674
|
-
}, [r, a]), /* @__PURE__ */ e.jsxs("div", { className: `splash-screen ${
|
|
675
|
-
|
|
676
|
-
|
|
678
|
+
return L(() => {
|
|
679
|
+
const c = setTimeout(r, a);
|
|
680
|
+
return () => clearTimeout(c);
|
|
681
|
+
}, [r, a]), /* @__PURE__ */ e.jsxs("div", { className: `splash-screen ${o}`, onClick: r, children: [
|
|
682
|
+
n && /* @__PURE__ */ e.jsx("img", { src: n, alt: t || "", className: "splash-logo" }),
|
|
683
|
+
t && /* @__PURE__ */ e.jsx("h1", { className: "splash-title", children: t }),
|
|
677
684
|
/* @__PURE__ */ e.jsx("div", { className: "splash-loading", children: "Loading..." })
|
|
678
685
|
] });
|
|
679
686
|
}
|
|
680
|
-
function
|
|
681
|
-
title:
|
|
682
|
-
subtitle:
|
|
687
|
+
function Ae({
|
|
688
|
+
title: n = "Doodle Engine",
|
|
689
|
+
subtitle: t,
|
|
683
690
|
logoSrc: r,
|
|
684
691
|
hasSaveData: a,
|
|
685
|
-
onNewGame:
|
|
686
|
-
onContinue:
|
|
687
|
-
onSettings:
|
|
688
|
-
className:
|
|
692
|
+
onNewGame: o,
|
|
693
|
+
onContinue: c,
|
|
694
|
+
onSettings: d,
|
|
695
|
+
className: m = ""
|
|
689
696
|
}) {
|
|
690
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `title-screen ${
|
|
691
|
-
r && /* @__PURE__ */ e.jsx("img", { src: r, alt:
|
|
692
|
-
/* @__PURE__ */ e.jsx("h1", { className: "title-heading", children:
|
|
693
|
-
|
|
697
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `title-screen ${m}`, children: [
|
|
698
|
+
r && /* @__PURE__ */ e.jsx("img", { src: r, alt: n, className: "title-logo" }),
|
|
699
|
+
/* @__PURE__ */ e.jsx("h1", { className: "title-heading", children: n }),
|
|
700
|
+
t && /* @__PURE__ */ e.jsx("p", { className: "title-subtitle", children: t }),
|
|
694
701
|
/* @__PURE__ */ e.jsxs("div", { className: "title-menu", children: [
|
|
695
|
-
/* @__PURE__ */ e.jsx("button", { className: "title-button", onClick:
|
|
696
|
-
a && /* @__PURE__ */ e.jsx("button", { className: "title-button", onClick:
|
|
697
|
-
/* @__PURE__ */ e.jsx("button", { className: "title-button", onClick:
|
|
702
|
+
/* @__PURE__ */ e.jsx("button", { className: "title-button", onClick: o, children: "New Game" }),
|
|
703
|
+
a && /* @__PURE__ */ e.jsx("button", { className: "title-button", onClick: c, children: "Continue" }),
|
|
704
|
+
/* @__PURE__ */ e.jsx("button", { className: "title-button", onClick: d, children: "Settings" })
|
|
698
705
|
] })
|
|
699
706
|
] });
|
|
700
707
|
}
|
|
701
|
-
function
|
|
702
|
-
onResume:
|
|
703
|
-
onSave:
|
|
708
|
+
function Oe({
|
|
709
|
+
onResume: n,
|
|
710
|
+
onSave: t,
|
|
704
711
|
onLoad: r,
|
|
705
712
|
onSettings: a,
|
|
706
|
-
onQuitToTitle:
|
|
707
|
-
className:
|
|
713
|
+
onQuitToTitle: o,
|
|
714
|
+
className: c = ""
|
|
708
715
|
}) {
|
|
709
|
-
return /* @__PURE__ */ e.jsx("div", { className: `pause-menu-overlay ${
|
|
716
|
+
return /* @__PURE__ */ e.jsx("div", { className: `pause-menu-overlay ${c}`, children: /* @__PURE__ */ e.jsxs("div", { className: "pause-menu", children: [
|
|
710
717
|
/* @__PURE__ */ e.jsx("h2", { className: "pause-title", children: "Paused" }),
|
|
711
718
|
/* @__PURE__ */ e.jsxs("div", { className: "pause-buttons", children: [
|
|
712
|
-
/* @__PURE__ */ e.jsx("button", { className: "pause-button", onClick:
|
|
713
|
-
/* @__PURE__ */ e.jsx("button", { className: "pause-button", onClick:
|
|
719
|
+
/* @__PURE__ */ e.jsx("button", { className: "pause-button", onClick: n, children: "Resume" }),
|
|
720
|
+
/* @__PURE__ */ e.jsx("button", { className: "pause-button", onClick: t, children: "Save" }),
|
|
714
721
|
/* @__PURE__ */ e.jsx("button", { className: "pause-button", onClick: r, children: "Load" }),
|
|
715
722
|
/* @__PURE__ */ e.jsx("button", { className: "pause-button", onClick: a, children: "Settings" }),
|
|
716
|
-
/* @__PURE__ */ e.jsx("button", { className: "pause-button pause-button-quit", onClick:
|
|
723
|
+
/* @__PURE__ */ e.jsx("button", { className: "pause-button pause-button-quit", onClick: o, children: "Quit to Title" })
|
|
717
724
|
] })
|
|
718
725
|
] }) });
|
|
719
726
|
}
|
|
720
727
|
function oe({
|
|
721
|
-
audioControls:
|
|
722
|
-
uiSoundControls:
|
|
728
|
+
audioControls: n,
|
|
729
|
+
uiSoundControls: t,
|
|
723
730
|
availableLocales: r,
|
|
724
731
|
currentLocale: a,
|
|
725
|
-
onLocaleChange:
|
|
726
|
-
onBack:
|
|
727
|
-
className:
|
|
732
|
+
onLocaleChange: o,
|
|
733
|
+
onBack: c,
|
|
734
|
+
className: d = ""
|
|
728
735
|
}) {
|
|
729
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `settings-panel ${
|
|
736
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `settings-panel ${d}`, children: [
|
|
730
737
|
/* @__PURE__ */ e.jsx("h2", { className: "settings-title", children: "Settings" }),
|
|
731
738
|
/* @__PURE__ */ e.jsxs("div", { className: "settings-section", children: [
|
|
732
739
|
/* @__PURE__ */ e.jsx("h3", { children: "Audio" }),
|
|
@@ -735,7 +742,7 @@ function oe({
|
|
|
735
742
|
{
|
|
736
743
|
label: "Master",
|
|
737
744
|
value: 1,
|
|
738
|
-
onChange:
|
|
745
|
+
onChange: n.setMasterVolume
|
|
739
746
|
}
|
|
740
747
|
),
|
|
741
748
|
/* @__PURE__ */ e.jsx(
|
|
@@ -743,7 +750,7 @@ function oe({
|
|
|
743
750
|
{
|
|
744
751
|
label: "Music",
|
|
745
752
|
value: 0.7,
|
|
746
|
-
onChange:
|
|
753
|
+
onChange: n.setMusicVolume
|
|
747
754
|
}
|
|
748
755
|
),
|
|
749
756
|
/* @__PURE__ */ e.jsx(
|
|
@@ -751,7 +758,7 @@ function oe({
|
|
|
751
758
|
{
|
|
752
759
|
label: "Sound Effects",
|
|
753
760
|
value: 0.8,
|
|
754
|
-
onChange:
|
|
761
|
+
onChange: n.setSoundVolume
|
|
755
762
|
}
|
|
756
763
|
),
|
|
757
764
|
/* @__PURE__ */ e.jsx(
|
|
@@ -759,40 +766,40 @@ function oe({
|
|
|
759
766
|
{
|
|
760
767
|
label: "Voice",
|
|
761
768
|
value: 1,
|
|
762
|
-
onChange:
|
|
769
|
+
onChange: n.setVoiceVolume
|
|
763
770
|
}
|
|
764
771
|
),
|
|
765
|
-
|
|
772
|
+
t && /* @__PURE__ */ e.jsx(
|
|
766
773
|
Q,
|
|
767
774
|
{
|
|
768
775
|
label: "UI Sounds",
|
|
769
|
-
value:
|
|
770
|
-
onChange:
|
|
776
|
+
value: t.volume,
|
|
777
|
+
onChange: t.setVolume
|
|
771
778
|
}
|
|
772
779
|
)
|
|
773
780
|
] }),
|
|
774
|
-
r && r.length > 1 &&
|
|
781
|
+
r && r.length > 1 && o && /* @__PURE__ */ e.jsxs("div", { className: "settings-section", children: [
|
|
775
782
|
/* @__PURE__ */ e.jsx("h3", { children: "Language" }),
|
|
776
783
|
/* @__PURE__ */ e.jsx(
|
|
777
784
|
"select",
|
|
778
785
|
{
|
|
779
786
|
className: "settings-locale-select",
|
|
780
787
|
value: a,
|
|
781
|
-
onChange: (
|
|
782
|
-
children: r.map((
|
|
788
|
+
onChange: (m) => o(m.target.value),
|
|
789
|
+
children: r.map((m) => /* @__PURE__ */ e.jsx("option", { value: m.code, children: m.label }, m.code))
|
|
783
790
|
}
|
|
784
791
|
)
|
|
785
792
|
] }),
|
|
786
|
-
/* @__PURE__ */ e.jsx("button", { className: "settings-back-button", onClick:
|
|
793
|
+
/* @__PURE__ */ e.jsx("button", { className: "settings-back-button", onClick: c, children: "Back" })
|
|
787
794
|
] });
|
|
788
795
|
}
|
|
789
796
|
function Q({
|
|
790
|
-
label:
|
|
791
|
-
value:
|
|
797
|
+
label: n,
|
|
798
|
+
value: t,
|
|
792
799
|
onChange: r
|
|
793
800
|
}) {
|
|
794
801
|
return /* @__PURE__ */ e.jsxs("div", { className: "volume-slider", children: [
|
|
795
|
-
/* @__PURE__ */ e.jsx("label", { className: "volume-label", children:
|
|
802
|
+
/* @__PURE__ */ e.jsx("label", { className: "volume-label", children: n }),
|
|
796
803
|
/* @__PURE__ */ e.jsx(
|
|
797
804
|
"input",
|
|
798
805
|
{
|
|
@@ -800,31 +807,31 @@ function Q({
|
|
|
800
807
|
min: "0",
|
|
801
808
|
max: "1",
|
|
802
809
|
step: "0.05",
|
|
803
|
-
defaultValue:
|
|
810
|
+
defaultValue: t,
|
|
804
811
|
onChange: (a) => r(parseFloat(a.target.value)),
|
|
805
812
|
className: "volume-input"
|
|
806
813
|
}
|
|
807
814
|
)
|
|
808
815
|
] });
|
|
809
816
|
}
|
|
810
|
-
function
|
|
811
|
-
src:
|
|
812
|
-
basePath:
|
|
817
|
+
function Pe({
|
|
818
|
+
src: n,
|
|
819
|
+
basePath: t = "/video",
|
|
813
820
|
onComplete: r,
|
|
814
821
|
className: a = ""
|
|
815
822
|
}) {
|
|
816
|
-
const
|
|
817
|
-
return
|
|
818
|
-
const
|
|
819
|
-
(
|
|
823
|
+
const o = U(null);
|
|
824
|
+
return L(() => {
|
|
825
|
+
const c = (d) => {
|
|
826
|
+
(d.key === "Escape" || d.key === " " || d.key === "Enter") && (d.preventDefault(), r());
|
|
820
827
|
};
|
|
821
|
-
return window.addEventListener("keydown",
|
|
828
|
+
return window.addEventListener("keydown", c), () => window.removeEventListener("keydown", c);
|
|
822
829
|
}, [r]), /* @__PURE__ */ e.jsxs("div", { className: `video-player-overlay ${a}`, children: [
|
|
823
830
|
/* @__PURE__ */ e.jsx(
|
|
824
831
|
"video",
|
|
825
832
|
{
|
|
826
|
-
ref:
|
|
827
|
-
src: `${
|
|
833
|
+
ref: o,
|
|
834
|
+
src: `${t}/${n}`,
|
|
828
835
|
autoPlay: !0,
|
|
829
836
|
onEnded: r,
|
|
830
837
|
className: "video-player-video"
|
|
@@ -840,29 +847,30 @@ function Oe({
|
|
|
840
847
|
)
|
|
841
848
|
] });
|
|
842
849
|
}
|
|
843
|
-
function
|
|
844
|
-
registry:
|
|
845
|
-
config:
|
|
850
|
+
function Ie({
|
|
851
|
+
registry: n,
|
|
852
|
+
config: t,
|
|
846
853
|
title: r = "Doodle Engine",
|
|
847
854
|
subtitle: a,
|
|
848
|
-
logoSrc:
|
|
849
|
-
splashDuration:
|
|
850
|
-
uiSounds:
|
|
851
|
-
audioOptions:
|
|
852
|
-
storageKey:
|
|
855
|
+
logoSrc: o,
|
|
856
|
+
splashDuration: c = 2e3,
|
|
857
|
+
uiSounds: d,
|
|
858
|
+
audioOptions: m,
|
|
859
|
+
storageKey: v = "doodle-engine-save",
|
|
853
860
|
availableLocales: b,
|
|
854
861
|
videoBasePath: x = "/video",
|
|
855
|
-
className:
|
|
862
|
+
className: _ = "",
|
|
863
|
+
devTools: C = !1
|
|
856
864
|
}) {
|
|
857
|
-
const [
|
|
858
|
-
|
|
859
|
-
),
|
|
865
|
+
const [E, w] = T(c > 0 ? "splash" : "title"), [S, u] = T(!1), [h, $] = T(!1), [M, q] = T("title"), [Y, W] = T(null), [R, I] = T(null), l = Ne(
|
|
866
|
+
d === !1 ? { enabled: !1 } : d
|
|
867
|
+
), p = localStorage.getItem(v) !== null, N = j(() => {
|
|
860
868
|
const g = {
|
|
861
|
-
currentLocation:
|
|
862
|
-
currentTime: { ...
|
|
863
|
-
flags: { ...
|
|
864
|
-
variables: { ...
|
|
865
|
-
inventory: [...
|
|
869
|
+
currentLocation: t.startLocation,
|
|
870
|
+
currentTime: { ...t.startTime },
|
|
871
|
+
flags: { ...t.startFlags },
|
|
872
|
+
variables: { ...t.startVariables },
|
|
873
|
+
inventory: [...t.startInventory],
|
|
866
874
|
questProgress: {},
|
|
867
875
|
unlockedJournalEntries: [],
|
|
868
876
|
playerNotes: [],
|
|
@@ -875,42 +883,42 @@ function Me({
|
|
|
875
883
|
pendingVideo: null,
|
|
876
884
|
currentLocale: "en"
|
|
877
885
|
};
|
|
878
|
-
return new
|
|
879
|
-
}, [
|
|
880
|
-
|
|
881
|
-
const g =
|
|
882
|
-
|
|
883
|
-
}, [
|
|
884
|
-
|
|
885
|
-
const g = localStorage.getItem(
|
|
886
|
+
return new ue(n, g);
|
|
887
|
+
}, [n, t]), A = j(() => {
|
|
888
|
+
l.playClick();
|
|
889
|
+
const g = N(), s = g.newGame(t);
|
|
890
|
+
I({ engine: g, snapshot: s }), w("playing");
|
|
891
|
+
}, [N, t, l]), V = j(() => {
|
|
892
|
+
l.playClick();
|
|
893
|
+
const g = localStorage.getItem(v);
|
|
886
894
|
if (!g) return;
|
|
887
|
-
const
|
|
888
|
-
|
|
889
|
-
}, [
|
|
890
|
-
if (!
|
|
891
|
-
|
|
892
|
-
const g =
|
|
893
|
-
localStorage.setItem(
|
|
894
|
-
}, [
|
|
895
|
-
const g = localStorage.getItem(
|
|
896
|
-
if (!g || !
|
|
897
|
-
|
|
898
|
-
const
|
|
899
|
-
|
|
900
|
-
}, [
|
|
901
|
-
|
|
902
|
-
}, [
|
|
903
|
-
|
|
904
|
-
}, [
|
|
905
|
-
|
|
906
|
-
}, [
|
|
907
|
-
|
|
908
|
-
if (
|
|
909
|
-
const g = (
|
|
910
|
-
|
|
895
|
+
const s = JSON.parse(g), i = N(), f = i.loadGame(s);
|
|
896
|
+
I({ engine: i, snapshot: f }), w("playing");
|
|
897
|
+
}, [N, v, l]), G = j(() => {
|
|
898
|
+
if (!R) return;
|
|
899
|
+
l.playClick();
|
|
900
|
+
const g = R.engine.saveGame();
|
|
901
|
+
localStorage.setItem(v, JSON.stringify(g)), u(!1);
|
|
902
|
+
}, [R, v, l]), O = j(() => {
|
|
903
|
+
const g = localStorage.getItem(v);
|
|
904
|
+
if (!g || !R) return;
|
|
905
|
+
l.playClick();
|
|
906
|
+
const s = JSON.parse(g), i = R.engine.loadGame(s);
|
|
907
|
+
I({ engine: R.engine, snapshot: i }), u(!1);
|
|
908
|
+
}, [R, v, l]), P = j(() => {
|
|
909
|
+
l.playClick(), u(!1), $(!1), I(null), w("title");
|
|
910
|
+
}, [l]), D = j((g) => {
|
|
911
|
+
l.playMenuOpen(), q(g), $(!0), g === "pause" && u(!1);
|
|
912
|
+
}, [l]), F = j(() => {
|
|
913
|
+
l.playMenuClose(), $(!1), M === "pause" && u(!0);
|
|
914
|
+
}, [M, l]);
|
|
915
|
+
L(() => {
|
|
916
|
+
if (E !== "playing") return;
|
|
917
|
+
const g = (s) => {
|
|
918
|
+
s.key === "Escape" && (s.preventDefault(), h ? F() : (S ? l.playMenuClose() : l.playMenuOpen(), u((i) => !i)));
|
|
911
919
|
};
|
|
912
920
|
return window.addEventListener("keydown", g), () => window.removeEventListener("keydown", g);
|
|
913
|
-
}, [
|
|
921
|
+
}, [E, S, h, F, l]);
|
|
914
922
|
const X = {
|
|
915
923
|
setMasterVolume: () => {
|
|
916
924
|
},
|
|
@@ -923,141 +931,148 @@ function Me({
|
|
|
923
931
|
stopAll: () => {
|
|
924
932
|
}
|
|
925
933
|
};
|
|
926
|
-
return
|
|
927
|
-
|
|
934
|
+
return E === "splash" ? /* @__PURE__ */ e.jsx("div", { className: `game-shell ${_}`, children: /* @__PURE__ */ e.jsx(
|
|
935
|
+
Re,
|
|
928
936
|
{
|
|
929
|
-
logoSrc:
|
|
937
|
+
logoSrc: o,
|
|
930
938
|
title: r,
|
|
931
|
-
onComplete: () =>
|
|
932
|
-
duration:
|
|
939
|
+
onComplete: () => w("title"),
|
|
940
|
+
duration: c
|
|
933
941
|
}
|
|
934
|
-
) }) :
|
|
942
|
+
) }) : E === "title" ? /* @__PURE__ */ e.jsx("div", { className: `game-shell ${_}`, children: h ? /* @__PURE__ */ e.jsx(
|
|
935
943
|
oe,
|
|
936
944
|
{
|
|
937
945
|
audioControls: X,
|
|
938
|
-
uiSoundControls:
|
|
946
|
+
uiSoundControls: d !== !1 ? l : void 0,
|
|
939
947
|
availableLocales: b,
|
|
940
|
-
onBack:
|
|
948
|
+
onBack: F
|
|
941
949
|
}
|
|
942
950
|
) : /* @__PURE__ */ e.jsx(
|
|
943
|
-
|
|
951
|
+
Ae,
|
|
944
952
|
{
|
|
945
953
|
title: r,
|
|
946
954
|
subtitle: a,
|
|
947
|
-
logoSrc:
|
|
948
|
-
hasSaveData:
|
|
949
|
-
onNewGame:
|
|
950
|
-
onContinue:
|
|
951
|
-
onSettings: () =>
|
|
955
|
+
logoSrc: o,
|
|
956
|
+
hasSaveData: p,
|
|
957
|
+
onNewGame: A,
|
|
958
|
+
onContinue: V,
|
|
959
|
+
onSettings: () => D("title")
|
|
952
960
|
}
|
|
953
|
-
) }) :
|
|
954
|
-
|
|
961
|
+
) }) : R ? /* @__PURE__ */ e.jsx("div", { className: `game-shell ${_}`, children: /* @__PURE__ */ e.jsx(xe, { engine: R.engine, initialSnapshot: R.snapshot, devTools: C, children: /* @__PURE__ */ e.jsx(
|
|
962
|
+
$e,
|
|
955
963
|
{
|
|
956
|
-
audioOptions:
|
|
957
|
-
uiSoundControls:
|
|
958
|
-
showPauseMenu:
|
|
959
|
-
showSettings:
|
|
964
|
+
audioOptions: m,
|
|
965
|
+
uiSoundControls: d !== !1 ? l : void 0,
|
|
966
|
+
showPauseMenu: S,
|
|
967
|
+
showSettings: h,
|
|
960
968
|
availableLocales: b,
|
|
961
969
|
videoBasePath: x,
|
|
962
|
-
pendingVideo:
|
|
963
|
-
setPendingVideo:
|
|
970
|
+
pendingVideo: Y,
|
|
971
|
+
setPendingVideo: W,
|
|
964
972
|
onPause: () => {
|
|
965
|
-
|
|
973
|
+
l.playMenuOpen(), u(!0);
|
|
966
974
|
},
|
|
967
975
|
onResume: () => {
|
|
968
|
-
|
|
976
|
+
l.playMenuClose(), u(!1);
|
|
969
977
|
},
|
|
970
|
-
onSave:
|
|
971
|
-
onLoad:
|
|
972
|
-
onSettings: () =>
|
|
973
|
-
onQuitToTitle:
|
|
974
|
-
onCloseSettings:
|
|
978
|
+
onSave: G,
|
|
979
|
+
onLoad: O,
|
|
980
|
+
onSettings: () => D("pause"),
|
|
981
|
+
onQuitToTitle: P,
|
|
982
|
+
onCloseSettings: F
|
|
975
983
|
}
|
|
976
984
|
) }) }) : null;
|
|
977
985
|
}
|
|
978
|
-
function
|
|
979
|
-
audioOptions:
|
|
980
|
-
uiSoundControls:
|
|
986
|
+
function $e({
|
|
987
|
+
audioOptions: n,
|
|
988
|
+
uiSoundControls: t,
|
|
981
989
|
showPauseMenu: r,
|
|
982
990
|
showSettings: a,
|
|
983
|
-
availableLocales:
|
|
984
|
-
videoBasePath:
|
|
985
|
-
pendingVideo:
|
|
986
|
-
setPendingVideo:
|
|
987
|
-
onPause:
|
|
991
|
+
availableLocales: o,
|
|
992
|
+
videoBasePath: c,
|
|
993
|
+
pendingVideo: d,
|
|
994
|
+
setPendingVideo: m,
|
|
995
|
+
onPause: v,
|
|
988
996
|
onResume: b,
|
|
989
997
|
onSave: x,
|
|
990
|
-
onLoad:
|
|
991
|
-
onSettings:
|
|
998
|
+
onLoad: _,
|
|
999
|
+
onSettings: C,
|
|
992
1000
|
onQuitToTitle: E,
|
|
993
1001
|
onCloseSettings: w
|
|
994
1002
|
}) {
|
|
995
|
-
const { snapshot:
|
|
996
|
-
return
|
|
997
|
-
|
|
998
|
-
}, [
|
|
999
|
-
|
|
1000
|
-
|
|
1003
|
+
const { snapshot: S, actions: u } = re(), h = le(S, n);
|
|
1004
|
+
return L(() => {
|
|
1005
|
+
S.pendingVideo && m(S.pendingVideo);
|
|
1006
|
+
}, [S.pendingVideo, m]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1007
|
+
d && /* @__PURE__ */ e.jsx(
|
|
1008
|
+
Pe,
|
|
1001
1009
|
{
|
|
1002
|
-
src:
|
|
1003
|
-
basePath:
|
|
1004
|
-
onComplete: () =>
|
|
1010
|
+
src: d,
|
|
1011
|
+
basePath: c,
|
|
1012
|
+
onComplete: () => m(null)
|
|
1005
1013
|
}
|
|
1006
1014
|
),
|
|
1007
|
-
/* @__PURE__ */ e.jsx(
|
|
1008
|
-
!r && !a && !
|
|
1015
|
+
/* @__PURE__ */ e.jsx(Ce, {}),
|
|
1016
|
+
!r && !a && !d && /* @__PURE__ */ e.jsx(
|
|
1009
1017
|
"button",
|
|
1010
1018
|
{
|
|
1011
1019
|
className: "game-shell-menu-button",
|
|
1012
|
-
onClick:
|
|
1020
|
+
onClick: v,
|
|
1013
1021
|
"aria-label": "Menu",
|
|
1014
1022
|
children: "Menu"
|
|
1015
1023
|
}
|
|
1016
1024
|
),
|
|
1017
1025
|
r && /* @__PURE__ */ e.jsx(
|
|
1018
|
-
|
|
1026
|
+
Oe,
|
|
1019
1027
|
{
|
|
1020
1028
|
onResume: b,
|
|
1021
1029
|
onSave: x,
|
|
1022
|
-
onLoad:
|
|
1023
|
-
onSettings:
|
|
1030
|
+
onLoad: _,
|
|
1031
|
+
onSettings: C,
|
|
1024
1032
|
onQuitToTitle: E
|
|
1025
1033
|
}
|
|
1026
1034
|
),
|
|
1027
1035
|
a && /* @__PURE__ */ e.jsx(
|
|
1028
1036
|
oe,
|
|
1029
1037
|
{
|
|
1030
|
-
audioControls:
|
|
1031
|
-
uiSoundControls:
|
|
1032
|
-
availableLocales:
|
|
1033
|
-
currentLocale: (
|
|
1038
|
+
audioControls: h,
|
|
1039
|
+
uiSoundControls: t,
|
|
1040
|
+
availableLocales: o,
|
|
1041
|
+
currentLocale: (S.time, void 0),
|
|
1034
1042
|
onLocaleChange: u.setLocale,
|
|
1035
1043
|
onBack: w
|
|
1036
1044
|
}
|
|
1037
1045
|
)
|
|
1038
1046
|
] });
|
|
1039
1047
|
}
|
|
1048
|
+
function Le({ message: n = "Loading...", className: t = "" }) {
|
|
1049
|
+
return /* @__PURE__ */ e.jsx("div", { className: `loading-screen ${t}`, children: /* @__PURE__ */ e.jsxs("div", { className: "loading-screen-content", children: [
|
|
1050
|
+
/* @__PURE__ */ e.jsx("div", { className: "loading-screen-spinner" }),
|
|
1051
|
+
/* @__PURE__ */ e.jsx("p", { className: "loading-screen-message", children: n })
|
|
1052
|
+
] }) });
|
|
1053
|
+
}
|
|
1040
1054
|
export {
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1055
|
+
ke as CharacterList,
|
|
1056
|
+
be as ChoiceList,
|
|
1057
|
+
ge as DialogueBox,
|
|
1044
1058
|
ae as GameContext,
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1059
|
+
xe as GameProvider,
|
|
1060
|
+
Ce as GameRenderer,
|
|
1061
|
+
Ie as GameShell,
|
|
1062
|
+
ye as Inventory,
|
|
1063
|
+
Ee as Journal,
|
|
1064
|
+
Le as LoadingScreen,
|
|
1065
|
+
Se as LocationView,
|
|
1066
|
+
we as MapView,
|
|
1052
1067
|
Te as NotificationArea,
|
|
1053
|
-
|
|
1054
|
-
|
|
1068
|
+
Oe as PauseMenu,
|
|
1069
|
+
_e as SaveLoadPanel,
|
|
1055
1070
|
oe as SettingsPanel,
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1071
|
+
Re as SplashScreen,
|
|
1072
|
+
Ae as TitleScreen,
|
|
1073
|
+
Fe as VERSION,
|
|
1074
|
+
Pe as VideoPlayer,
|
|
1060
1075
|
le as useAudioManager,
|
|
1061
1076
|
re as useGame,
|
|
1062
|
-
|
|
1077
|
+
Ne as useUISounds
|
|
1063
1078
|
};
|