pixi-reels 2.2.0 → 2.3.0
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 +46 -0
- package/dist/board/HoldAndWinBoard.d.ts.map +1 -1
- package/dist/config/types.d.ts +52 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/core/Reel.d.ts.map +1 -1
- package/dist/core/ReelSet.d.ts +55 -6
- package/dist/core/ReelSet.d.ts.map +1 -1
- package/dist/core/ReelSetBuilder.d.ts +19 -3
- package/dist/core/ReelSetBuilder.d.ts.map +1 -1
- package/dist/debug-BmbbKZrS.cjs +4 -0
- package/dist/debug-BmbbKZrS.cjs.map +1 -0
- package/dist/{debug-BVIT3Sjs.js → debug-BwsaPR3I.js} +382 -244
- package/dist/debug-BwsaPR3I.js.map +1 -0
- package/dist/events/ReelEvents.d.ts +18 -2
- package/dist/events/ReelEvents.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +53 -53
- package/dist/index.js.map +1 -1
- package/dist/spin/SpinController.d.ts +165 -13
- package/dist/spin/SpinController.d.ts.map +1 -1
- package/dist/testing/testHarness.d.ts +5 -0
- package/dist/testing/testHarness.d.ts.map +1 -1
- package/dist/testing.cjs +1 -1
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.js +2 -2
- package/dist/testing.js.map +1 -1
- package/dist/utils/notify.d.ts +44 -0
- package/dist/utils/notify.d.ts.map +1 -0
- package/package.json +2 -2
- package/dist/debug-AjBRiekN.cjs +0 -4
- package/dist/debug-AjBRiekN.cjs.map +0 -1
- package/dist/debug-BVIT3Sjs.js.map +0 -1
|
@@ -899,7 +899,7 @@ var A = class {
|
|
|
899
899
|
return;
|
|
900
900
|
}
|
|
901
901
|
if (n.symbolId === t) {
|
|
902
|
-
n.view.alpha = 1, n.view.scale.set(1, 1), n.view.rotation = 0, n.view.filters = null, n.view.zIndex = this._computeSymbolZIndex(t, e);
|
|
902
|
+
n.stopAnimation(), n.view.alpha = 1, n.view.scale.set(1, 1), n.view.rotation = 0, n.view.filters = null, n.view.zIndex = this._computeSymbolZIndex(t, e);
|
|
903
903
|
let r = this._parentForSymbolId(t, e);
|
|
904
904
|
n.view.parent !== r && r.addChild(n.view), this._placeSymbolView(n, i, this._effectiveUnmask(t, e)), this._spinPresentationActive && n.onReelSpinStart(!0), this._anticipationActive && n.onReelAnticipationStart();
|
|
905
905
|
return;
|
|
@@ -964,7 +964,7 @@ var A = class {
|
|
|
964
964
|
}
|
|
965
965
|
for (let n of t.rects) e.rect(n.x, n.y, n.width, n.height).fill({ color: 16777215 });
|
|
966
966
|
}
|
|
967
|
-
},
|
|
967
|
+
}, ie = class {
|
|
968
968
|
version = 2;
|
|
969
969
|
build(e) {
|
|
970
970
|
let t = new r();
|
|
@@ -977,7 +977,7 @@ var A = class {
|
|
|
977
977
|
let n = t.axis.toScreen(t.bleed ?? 0, 0);
|
|
978
978
|
e.rect(-n.x, -n.y, t.width + n.x * 2, t.height + n.y * 2).fill({ color: 16777215 });
|
|
979
979
|
}
|
|
980
|
-
},
|
|
980
|
+
}, ae = class extends n {
|
|
981
981
|
maskedContainer;
|
|
982
982
|
unmaskedContainer;
|
|
983
983
|
spotlightContainer;
|
|
@@ -1042,7 +1042,7 @@ var A = class {
|
|
|
1042
1042
|
destroy() {
|
|
1043
1043
|
this._isDestroyed || (this._isDestroyed = !0, super.destroy({ children: !0 }));
|
|
1044
1044
|
}
|
|
1045
|
-
},
|
|
1045
|
+
}, F = class {
|
|
1046
1046
|
_reel;
|
|
1047
1047
|
_speed;
|
|
1048
1048
|
_resolve = null;
|
|
@@ -1075,7 +1075,7 @@ var A = class {
|
|
|
1075
1075
|
this._resolve = null, e();
|
|
1076
1076
|
}
|
|
1077
1077
|
}
|
|
1078
|
-
},
|
|
1078
|
+
}, I = class extends F {
|
|
1079
1079
|
name = "start";
|
|
1080
1080
|
skippable = !0;
|
|
1081
1081
|
_tween = null;
|
|
@@ -1109,7 +1109,7 @@ var A = class {
|
|
|
1109
1109
|
_kill() {
|
|
1110
1110
|
this._delayedCall &&= (this._delayedCall.kill(), null), this._tween &&= (this._tween.kill(), null);
|
|
1111
1111
|
}
|
|
1112
|
-
},
|
|
1112
|
+
}, oe = class extends F {
|
|
1113
1113
|
name = "spin";
|
|
1114
1114
|
skippable = !1;
|
|
1115
1115
|
_elapsed = 0;
|
|
@@ -1125,7 +1125,7 @@ var A = class {
|
|
|
1125
1125
|
this._readyToStop = !0, this._elapsed >= this._minTime && this._complete();
|
|
1126
1126
|
}
|
|
1127
1127
|
onSkip() {}
|
|
1128
|
-
},
|
|
1128
|
+
}, L = class extends F {
|
|
1129
1129
|
name = "stop";
|
|
1130
1130
|
skippable = !0;
|
|
1131
1131
|
_config = null;
|
|
@@ -1183,7 +1183,7 @@ var A = class {
|
|
|
1183
1183
|
_killTweens() {
|
|
1184
1184
|
this._delayTween &&= (this._delayTween.kill(), null), this._bounceTween &&= (this._bounceTween.kill(), null);
|
|
1185
1185
|
}
|
|
1186
|
-
},
|
|
1186
|
+
}, R = class extends F {
|
|
1187
1187
|
name = "anticipation";
|
|
1188
1188
|
skippable = !0;
|
|
1189
1189
|
_tween = null;
|
|
@@ -1209,10 +1209,10 @@ var A = class {
|
|
|
1209
1209
|
_kill() {
|
|
1210
1210
|
this._tween &&= (this._tween.kill(), null);
|
|
1211
1211
|
}
|
|
1212
|
-
},
|
|
1212
|
+
}, z = class {
|
|
1213
1213
|
_registry = /* @__PURE__ */ new Map();
|
|
1214
1214
|
constructor() {
|
|
1215
|
-
this._registry.set("start", (e, t) => new
|
|
1215
|
+
this._registry.set("start", (e, t) => new I(e, t)), this._registry.set("spin", (e, t) => new oe(e, t)), this._registry.set("stop", (e, t) => new L(e, t)), this._registry.set("anticipation", (e, t) => new R(e, t));
|
|
1216
1216
|
}
|
|
1217
1217
|
register(e, t) {
|
|
1218
1218
|
this._registry.set(e, (e, n) => new t(e, n));
|
|
@@ -1228,7 +1228,47 @@ var A = class {
|
|
|
1228
1228
|
has(e) {
|
|
1229
1229
|
return this._registry.has(e);
|
|
1230
1230
|
}
|
|
1231
|
-
},
|
|
1231
|
+
}, se = {
|
|
1232
|
+
silent: 0,
|
|
1233
|
+
error: 1,
|
|
1234
|
+
warn: 2,
|
|
1235
|
+
info: 3
|
|
1236
|
+
}, ce = "info";
|
|
1237
|
+
function le(e) {
|
|
1238
|
+
ce = e;
|
|
1239
|
+
}
|
|
1240
|
+
function ue() {
|
|
1241
|
+
return ce;
|
|
1242
|
+
}
|
|
1243
|
+
var de = /* @__PURE__ */ new Set(), fe = typeof document < "u", pe = "background:#1f1d1b;color:#fef08a;padding:2px 6px;border-radius:3px 0 0 3px;font-weight:700", me = {
|
|
1244
|
+
error: "background:#7f1d1d;color:#fee2e2;padding:2px 6px;border-radius:0 3px 3px 0",
|
|
1245
|
+
warn: "background:#78350f;color:#fef3c7;padding:2px 6px;border-radius:0 3px 3px 0",
|
|
1246
|
+
info: "background:#334155;color:#e2e8f0;padding:2px 6px;border-radius:0 3px 3px 0"
|
|
1247
|
+
}, he = "background:transparent;color:inherit;font-weight:400";
|
|
1248
|
+
function B(e, t, n, r, i) {
|
|
1249
|
+
if (se[ce] < se[e]) return;
|
|
1250
|
+
if (i?.once) {
|
|
1251
|
+
if (de.has(t)) return;
|
|
1252
|
+
de.add(t);
|
|
1253
|
+
}
|
|
1254
|
+
let a = console[e];
|
|
1255
|
+
fe ? a(`%cpixi-reels%c${t}%c ${n}`, pe, me[e], he, ...r) : a(`[pixi-reels] ${e}(${t}) ${n}`, ...r);
|
|
1256
|
+
}
|
|
1257
|
+
function V(e, t, ...n) {
|
|
1258
|
+
B("error", e, t, n);
|
|
1259
|
+
}
|
|
1260
|
+
function ge(e, t, ...n) {
|
|
1261
|
+
B("warn", e, t, n);
|
|
1262
|
+
}
|
|
1263
|
+
function _e(e, t, ...n) {
|
|
1264
|
+
B("warn", e, t, n, { once: !0 });
|
|
1265
|
+
}
|
|
1266
|
+
function ve(e, t, ...n) {
|
|
1267
|
+
B("info", e, t, n);
|
|
1268
|
+
}
|
|
1269
|
+
//#endregion
|
|
1270
|
+
//#region src/spin/SpinController.ts
|
|
1271
|
+
var ye = class {
|
|
1232
1272
|
_reels;
|
|
1233
1273
|
_speedManager;
|
|
1234
1274
|
_frameBuilder;
|
|
@@ -1246,12 +1286,18 @@ var A = class {
|
|
|
1246
1286
|
_anticipationStagger = 0;
|
|
1247
1287
|
_anticipationSlowdown = null;
|
|
1248
1288
|
_anticipationDuration = null;
|
|
1289
|
+
_anticipationProtect = !1;
|
|
1290
|
+
_protectSpent = !1;
|
|
1249
1291
|
_teasingReels = /* @__PURE__ */ new Set();
|
|
1250
1292
|
_reelLandedResolvers = /* @__PURE__ */ new Map();
|
|
1251
1293
|
_reelLandedPromises = /* @__PURE__ */ new Map();
|
|
1252
1294
|
_stopDelayOverride = null;
|
|
1253
1295
|
_activePhases = /* @__PURE__ */ new Map();
|
|
1254
1296
|
_landedReels = /* @__PURE__ */ new Set();
|
|
1297
|
+
_slammedReels = /* @__PURE__ */ new Set();
|
|
1298
|
+
_activeSpinSpeed = null;
|
|
1299
|
+
_allStartedEmitted = !1;
|
|
1300
|
+
_minimumSpinTimeOverride = null;
|
|
1255
1301
|
_heldReels = /* @__PURE__ */ new Set();
|
|
1256
1302
|
_wasSkipped = !1;
|
|
1257
1303
|
_skipPending = !1;
|
|
@@ -1298,9 +1344,9 @@ var A = class {
|
|
|
1298
1344
|
let e = this._skipPreviousSpeedName;
|
|
1299
1345
|
this._skipPreviousSpeedName = null, this._skipBoostedToName = null, !this._manualSpeedSinceBoost && this._speedManager.activeName !== e && this._speedManager.set(e);
|
|
1300
1346
|
}
|
|
1301
|
-
this._manualSpeedSinceBoost = !1, this._skipStage = 0, this._autoSlamRefills = !1, this._isSpinning = !0, this._wasSkipped = !1, this._skipPending = !1, this._pendingAbortError = null, this._spinStartTime = performance.now(), this._resultSymbols = null, this._anticipationReels = [], this._anticipationStagger = 0, this._anticipationSlowdown = null, this._anticipationDuration = null, this._teasingReels.clear(), this._reelLandedResolvers.clear(), this._reelLandedPromises.clear(), this._landedReels.clear(), this._activePhases.clear(), this._heldReels = this._normalizeHoldReels(e?.holdReels), this._spinGeneration++;
|
|
1347
|
+
this._manualSpeedSinceBoost = !1, this._skipStage = 0, this._autoSlamRefills = !1, this._isSpinning = !0, this._wasSkipped = !1, this._skipPending = !1, this._pendingAbortError = null, this._spinStartTime = performance.now(), this._resultSymbols = null, this._anticipationReels = [], this._anticipationStagger = 0, this._anticipationSlowdown = null, this._anticipationDuration = null, this._anticipationProtect = !1, this._protectSpent = !1, this._teasingReels.clear(), this._reelLandedResolvers.clear(), this._reelLandedPromises.clear(), this._landedReels.clear(), this._slammedReels.clear(), this._allStartedEmitted = !1, this._activePhases.clear(), this._heldReels = this._normalizeHoldReels(e?.holdReels), this._spinGeneration++;
|
|
1302
1348
|
let n = this._spinGeneration, r = this._speedManager.active;
|
|
1303
|
-
this._events.emit("spin:start");
|
|
1349
|
+
this._activeSpinSpeed = r, this._events.emit("spin:start");
|
|
1304
1350
|
let i = new Promise((e, t) => {
|
|
1305
1351
|
this._currentSpinResolve = e, this._currentSpinReject = t;
|
|
1306
1352
|
});
|
|
@@ -1312,7 +1358,7 @@ var A = class {
|
|
|
1312
1358
|
}
|
|
1313
1359
|
_runReelTask(e, t, n, r) {
|
|
1314
1360
|
e.catch((e) => {
|
|
1315
|
-
r === this._spinGeneration && (
|
|
1361
|
+
r === this._spinGeneration && (V("phase-chain-threw", `reel ${n} (${t}) phase chain threw. slamming to recover:`, e), this._slam());
|
|
1316
1362
|
});
|
|
1317
1363
|
}
|
|
1318
1364
|
_normalizeHoldReels(e) {
|
|
@@ -1325,7 +1371,7 @@ var A = class {
|
|
|
1325
1371
|
this._isSpinning && (this._coordinateBigSymbols(e, (e) => {
|
|
1326
1372
|
let t = this._hooks.peekTargetShape();
|
|
1327
1373
|
return t ? t[e] : this._reels[e].visibleCells;
|
|
1328
|
-
}), this._resultSymbols = e, this._tryBeginStopSequence(), this._skipPending && (this._skipPending = !1, this.
|
|
1374
|
+
}), this._resultSymbols = e, this._tryBeginStopSequence(), this._skipPending && (this._skipPending = !1, this._pressSkip(!1)));
|
|
1329
1375
|
}
|
|
1330
1376
|
async refill(e) {
|
|
1331
1377
|
if (this._isSpinning) throw Error("Cannot refill while a spin or refill is in progress.");
|
|
@@ -1341,9 +1387,9 @@ var A = class {
|
|
|
1341
1387
|
let e = this._reels[t.reel].visibleCells;
|
|
1342
1388
|
if (!Number.isInteger(t.cell) || t.cell < 0 || t.cell >= e) throw RangeError(`refill: winner.cell ${t.cell} out of range [0, ${e}) for reel ${t.reel}.`);
|
|
1343
1389
|
}
|
|
1344
|
-
this._isSpinning = !0, this._wasSkipped = !1, this._skipPending = !1, this._pendingAbortError = null, this._spinStartTime = performance.now(), this._resultSymbols = null, this._anticipationReels = [], this._anticipationStagger = 0, this._anticipationSlowdown = null, this._anticipationDuration = null, this._teasingReels.clear(), this._reelLandedResolvers.clear(), this._reelLandedPromises.clear(), this._landedReels.clear(), this._activePhases.clear(), this._heldReels = /* @__PURE__ */ new Set(), this._spinGeneration++, this._currentSpinMode = "cascade";
|
|
1390
|
+
this._isSpinning = !0, this._wasSkipped = !1, this._skipPending = !1, this._pendingAbortError = null, this._spinStartTime = performance.now(), this._resultSymbols = null, this._anticipationReels = [], this._anticipationStagger = 0, this._anticipationSlowdown = null, this._anticipationDuration = null, this._anticipationProtect = !1, this._protectSpent = !1, this._teasingReels.clear(), this._reelLandedResolvers.clear(), this._reelLandedPromises.clear(), this._landedReels.clear(), this._slammedReels.clear(), this._allStartedEmitted = !1, this._activePhases.clear(), this._heldReels = /* @__PURE__ */ new Set(), this._spinGeneration++, this._currentSpinMode = "cascade";
|
|
1345
1391
|
let n = this._spinGeneration, r = this._speedManager.active;
|
|
1346
|
-
this._resultSymbols = t;
|
|
1392
|
+
this._activeSpinSpeed = r, this._resultSymbols = t;
|
|
1347
1393
|
let i = this._coordinateBigSymbols(t, (e) => this._reels[e].visibleCells), a = [];
|
|
1348
1394
|
for (let e = 0; e < this._reels.length; e++) {
|
|
1349
1395
|
let t = this._reels[e];
|
|
@@ -1364,7 +1410,7 @@ var A = class {
|
|
|
1364
1410
|
if ((e.mode ?? "combined") === "gravity-then-drop") {
|
|
1365
1411
|
let t = e.gravityHoldMs ?? 250;
|
|
1366
1412
|
this._refillTwoStage(r, n, o, t, e.gravityHold, e.onGravityComplete).catch((e) => {
|
|
1367
|
-
n === this._spinGeneration && (this._events.emit("cascade:gravity:error", { error: e }),
|
|
1413
|
+
n === this._spinGeneration && (this._events.emit("cascade:gravity:error", { error: e }), V("refill-threw", "two-stage refill threw (likely from a user-supplied gravityHold/onGravityComplete). slamming to recover:", e), this._slam());
|
|
1368
1414
|
});
|
|
1369
1415
|
} else for (let e = 0; e < this._reels.length; e++) {
|
|
1370
1416
|
let t = o.get(e) ?? [];
|
|
@@ -1373,7 +1419,7 @@ var A = class {
|
|
|
1373
1419
|
return s;
|
|
1374
1420
|
}
|
|
1375
1421
|
async _refillReel(e, t, n, r) {
|
|
1376
|
-
if (
|
|
1422
|
+
if (this._isStale(e, n)) return;
|
|
1377
1423
|
let i = this._reels[e], a = this._frameFor(e), o = this._stopDelayFor(e, t), s = this._phaseFactory.create("cascade:place", i, t);
|
|
1378
1424
|
if (this._activePhases.set(e, s), await s.run({
|
|
1379
1425
|
targetFrame: a,
|
|
@@ -1381,17 +1427,17 @@ var A = class {
|
|
|
1381
1427
|
initial: !1,
|
|
1382
1428
|
delay: o,
|
|
1383
1429
|
events: this._events
|
|
1384
|
-
}),
|
|
1430
|
+
}), this._isStale(e, n)) return;
|
|
1385
1431
|
let c = this._phaseFactory.create("cascade:dropIn", i, t);
|
|
1386
1432
|
this._activePhases.set(e, c), await c.run({
|
|
1387
1433
|
winnerCells: r,
|
|
1388
1434
|
initial: !1,
|
|
1389
1435
|
events: this._events
|
|
1390
|
-
}),
|
|
1436
|
+
}), !this._isStale(e, n) && this._markLanded(e);
|
|
1391
1437
|
}
|
|
1392
1438
|
async _refillTwoStage(e, t, n, r, i, a) {
|
|
1393
1439
|
let o = this._reels.map(async (r, i) => {
|
|
1394
|
-
if (
|
|
1440
|
+
if (this._isStale(i, t)) return;
|
|
1395
1441
|
let a = this._reels[i], o = this._frameFor(i), s = n.get(i) ?? [], c = this._phaseFactory.create("cascade:place", a, e);
|
|
1396
1442
|
if (this._activePhases.set(i, c), await c.run({
|
|
1397
1443
|
targetFrame: o,
|
|
@@ -1399,7 +1445,7 @@ var A = class {
|
|
|
1399
1445
|
initial: !1,
|
|
1400
1446
|
delay: 0,
|
|
1401
1447
|
events: this._events
|
|
1402
|
-
}),
|
|
1448
|
+
}), this._isStale(i, t)) return;
|
|
1403
1449
|
let l = this._phaseFactory.create("cascade:dropIn", a, e);
|
|
1404
1450
|
this._activePhases.set(i, l), await l.run({
|
|
1405
1451
|
winnerCells: s,
|
|
@@ -1413,28 +1459,39 @@ var A = class {
|
|
|
1413
1459
|
if (r > 0 && s.push(new Promise((e) => setTimeout(e, r))), i && s.push(typeof i == "function" ? i() : i), !(s.length > 0 && (await Promise.all(s), t !== this._spinGeneration)) && !(a && (await a(), t !== this._spinGeneration))) for (let r = 0; r < this._reels.length; r++) this._runReelTask(this._refillReelDropInOnly(r, e, t, n.get(r) ?? []), "refill", r, t);
|
|
1414
1460
|
}
|
|
1415
1461
|
async _refillReelDropInOnly(e, t, n, r) {
|
|
1416
|
-
if (
|
|
1462
|
+
if (this._isStale(e, n)) return;
|
|
1417
1463
|
let i = this._reels[e], a = this._stopDelayFor(e, t);
|
|
1418
|
-
if (a > 0 && (await new Promise((e) => setTimeout(e, a)),
|
|
1464
|
+
if (a > 0 && (await new Promise((e) => setTimeout(e, a)), this._isStale(e, n))) return;
|
|
1419
1465
|
let o = this._phaseFactory.create("cascade:dropIn", i, t);
|
|
1420
1466
|
this._activePhases.set(e, o), await o.run({
|
|
1421
1467
|
winnerCells: r,
|
|
1422
1468
|
initial: !1,
|
|
1423
1469
|
role: "new",
|
|
1424
1470
|
events: this._events
|
|
1425
|
-
}),
|
|
1471
|
+
}), !this._isStale(e, n) && this._markLanded(e);
|
|
1426
1472
|
}
|
|
1427
1473
|
setAnticipation(e, t = 0) {
|
|
1428
1474
|
let n = typeof t == "object" && !Array.isArray(t) ? t : { stagger: t }, r = n.stagger ?? 0;
|
|
1429
|
-
|
|
1475
|
+
this._anticipationReels = e.filter((e) => !this._heldReels.has(e)), this._anticipationStagger = r, this._anticipationSlowdown = n.slowdown ?? null, this._anticipationDuration = n.duration ?? null;
|
|
1476
|
+
let i = n.protect ?? !1;
|
|
1477
|
+
if (this._anticipationProtect = i === !0 ? "once" : i, this._protectSpent = !1, this._teasingReels.clear(), this._reelLandedResolvers.clear(), this._reelLandedPromises.clear(), r === "sequential") for (let e of this._anticipationReels) this._reelLandedPromises.set(e, new Promise((t) => this._reelLandedResolvers.set(e, t)));
|
|
1430
1478
|
}
|
|
1431
1479
|
setStopDelays(e) {
|
|
1432
1480
|
this._stopDelayOverride = e ? [...e] : null;
|
|
1433
1481
|
}
|
|
1482
|
+
setMinimumSpinTime(e) {
|
|
1483
|
+
this._minimumSpinTimeOverride = Array.isArray(e) ? [...e] : e;
|
|
1484
|
+
}
|
|
1485
|
+
_minimumSpinTimeFor(e) {
|
|
1486
|
+
let t = this._minimumSpinTimeOverride;
|
|
1487
|
+
if (t === null) return;
|
|
1488
|
+
let n = Array.isArray(t) ? t[e] : t;
|
|
1489
|
+
if (!(typeof n != "number" || !Number.isFinite(n) || n < 0)) return n;
|
|
1490
|
+
}
|
|
1434
1491
|
requestSkip() {
|
|
1435
1492
|
if (this._isSpinning) {
|
|
1436
1493
|
if (this._resultSymbols) {
|
|
1437
|
-
this.
|
|
1494
|
+
this._pressSkip(!1);
|
|
1438
1495
|
return;
|
|
1439
1496
|
}
|
|
1440
1497
|
this._skipPending = !0;
|
|
@@ -1443,41 +1500,111 @@ var A = class {
|
|
|
1443
1500
|
skip() {
|
|
1444
1501
|
if (this._isSpinning) {
|
|
1445
1502
|
if (!this._resultSymbols) throw Error("skip() called before setResult(). there is nothing to land on yet (standard mode would land on random buffer fill; cascade mode would land invisible). Use reelSet.requestSkip() to queue the slam until setResult() arrives, or wait for setResult() before calling skip().");
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1503
|
+
this._pressSkip(!0);
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
_pressSkip(e) {
|
|
1507
|
+
let t = this._nextSlamGroup();
|
|
1508
|
+
if (t !== null) {
|
|
1509
|
+
this._slam(t);
|
|
1510
|
+
let n = this._teaseStillRunning();
|
|
1511
|
+
if (this._anticipationProtect === "once" && (this._protectSpent = !0), n) {
|
|
1512
|
+
this._skipStage === 0 && (this._skipStage = 1);
|
|
1513
|
+
return;
|
|
1456
1514
|
}
|
|
1457
|
-
this.
|
|
1515
|
+
this._applyRoundSideEffects(e), this._skipStage = 2;
|
|
1516
|
+
return;
|
|
1458
1517
|
}
|
|
1518
|
+
this._applyRoundSideEffects(e), this._slam(), this._skipStage = 2;
|
|
1459
1519
|
}
|
|
1460
|
-
|
|
1461
|
-
|
|
1520
|
+
_nextSlamGroup() {
|
|
1521
|
+
let e = this._protectedTeaseReels();
|
|
1522
|
+
if (e.size === 0) return null;
|
|
1523
|
+
let t = [];
|
|
1524
|
+
for (let n = 0; n < this._reels.length; n++) e.has(n) || this._landedReels.has(n) || this._heldReels.has(n) || t.push(n);
|
|
1525
|
+
if (t.length > 0 || this._anticipationProtect !== "stepwise") return t;
|
|
1526
|
+
let n = this._anticipationReels.find((t) => e.has(t));
|
|
1527
|
+
return n === void 0 ? t : [n];
|
|
1528
|
+
}
|
|
1529
|
+
_teaseStillRunning() {
|
|
1530
|
+
for (let e of this._anticipationReels) if (!this._landedReels.has(e) && !this._heldReels.has(e)) return !0;
|
|
1531
|
+
return !1;
|
|
1462
1532
|
}
|
|
1463
|
-
|
|
1533
|
+
_applyRoundSideEffects(e) {
|
|
1534
|
+
if (e && this._skipStage !== 2) if (this._currentSpinMode === "cascade") this._autoSlamRefills = !0;
|
|
1535
|
+
else {
|
|
1536
|
+
let e = this._findFastestSpeedName();
|
|
1537
|
+
if (e !== null && e !== this._speedManager.activeName) {
|
|
1538
|
+
let { previous: t, current: n } = this._speedManager.set(e);
|
|
1539
|
+
this._skipPreviousSpeedName = t.name, this._skipBoostedToName = n.name, this._events.emit("skip:boosted", {
|
|
1540
|
+
previous: t,
|
|
1541
|
+
current: n
|
|
1542
|
+
});
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
_protectedTeaseReels() {
|
|
1547
|
+
let e = /* @__PURE__ */ new Set();
|
|
1548
|
+
if (this._anticipationProtect === !1 || this._anticipationProtect === "once" && this._protectSpent) return e;
|
|
1549
|
+
let t = this._activeSpinSpeed ?? this._speedManager.active;
|
|
1550
|
+
if ((this._anticipationDuration ?? t.anticipationDelay) <= 0) return e;
|
|
1551
|
+
for (let t of this._anticipationReels) this._landedReels.has(t) || this._heldReels.has(t) || e.add(t);
|
|
1552
|
+
return e;
|
|
1553
|
+
}
|
|
1554
|
+
slamStop(e) {
|
|
1464
1555
|
if (this._isSpinning) {
|
|
1465
|
-
|
|
1556
|
+
if (e?.reels && e?.except) throw Error("slamStop: pass either 'reels' or 'except', not both.");
|
|
1557
|
+
if (this._resultSymbols || ge("slam-before-result", "slamStop() was called before setResult(), so the reels will land on whatever the strip is currently showing (random fill in standard mode, the invisible fall-out residue in cascade mode) rather than on a result. Use requestSkip() to queue the slam until setResult() arrives, or skipSpin(), which throws in this window instead of landing on nothing."), e?.reels) {
|
|
1558
|
+
this._slam(e.reels) || (this._skipStage = 2);
|
|
1559
|
+
return;
|
|
1560
|
+
}
|
|
1561
|
+
if (e?.except) {
|
|
1562
|
+
let t = new Set(e.except), n = [];
|
|
1563
|
+
for (let e = 0; e < this._reels.length; e++) t.has(e) || n.push(e);
|
|
1564
|
+
this._slam(n) || (this._skipStage = 2);
|
|
1565
|
+
return;
|
|
1566
|
+
}
|
|
1567
|
+
this._slam(), this._skipStage = 2;
|
|
1568
|
+
}
|
|
1569
|
+
}
|
|
1570
|
+
_isStale(e, t) {
|
|
1571
|
+
return t !== this._spinGeneration || this._slammedReels.has(e);
|
|
1572
|
+
}
|
|
1573
|
+
_slam(e) {
|
|
1574
|
+
if (!this._isSpinning) return !1;
|
|
1575
|
+
let t = /* @__PURE__ */ new Set();
|
|
1576
|
+
if (e) {
|
|
1577
|
+
for (let n of e) !Number.isInteger(n) || n < 0 || n >= this._reels.length || this._landedReels.has(n) || this._heldReels.has(n) || t.add(n);
|
|
1578
|
+
if (t.size === 0) return !0;
|
|
1579
|
+
} else for (let e = 0; e < this._reels.length; e++) this._landedReels.has(e) || this._heldReels.has(e) || t.add(e);
|
|
1580
|
+
let n = 0;
|
|
1581
|
+
for (let e = 0; e < this._reels.length; e++) !this._landedReels.has(e) && !this._heldReels.has(e) && n++;
|
|
1582
|
+
let r = t.size < n;
|
|
1583
|
+
if (this._wasSkipped = !0, this._events.emit("skip:requested", {
|
|
1584
|
+
reels: [...t],
|
|
1585
|
+
partial: r
|
|
1586
|
+
}), r) for (let e of t) {
|
|
1587
|
+
let t = this._activePhases.get(e);
|
|
1588
|
+
t && (t.forceComplete(), this._activePhases.delete(e)), this._slammedReels.add(e);
|
|
1589
|
+
}
|
|
1590
|
+
else {
|
|
1466
1591
|
for (let [, e] of this._activePhases) e.forceComplete();
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
} else for (let e = 0; e < this._reels.length; e++) {
|
|
1475
|
-
if (this._landedReels.has(e) || this._heldReels.has(e)) continue;
|
|
1476
|
-
let t = this._reels[e];
|
|
1477
|
-
t.speed = 0, t.isStopping = !1, t.snapToGrid(), t.notifySpinEnd(), t.notifyLanded(), this._markLanded(e);
|
|
1592
|
+
this._activePhases.clear(), this._spinGeneration++;
|
|
1593
|
+
}
|
|
1594
|
+
if (this._resultSymbols) {
|
|
1595
|
+
let e = this._hooks.peekTargetShape(), n = this._coordinateBigSymbols(this._resultSymbols, (t) => e ? e[t] : this._reels[t].visibleCells);
|
|
1596
|
+
for (let r of t) {
|
|
1597
|
+
let t = this._reels[r];
|
|
1598
|
+
t.speed = 0, t.isStopping = !1, this._hooks.isMultiWaysSlot && e && this._applyReshape(r, e[r]), t.placeSymbols(n[r]), t.notifySpinEnd(), t.notifyLanded(), this._markLanded(r);
|
|
1478
1599
|
}
|
|
1479
|
-
|
|
1600
|
+
} else for (let e of t) {
|
|
1601
|
+
let t = this._reels[e];
|
|
1602
|
+
t.speed = 0, t.isStopping = !1, t.snapToGrid(), t.notifySpinEnd(), t.notifyLanded(), this._markLanded(e);
|
|
1480
1603
|
}
|
|
1604
|
+
return this._events.emit("skip:completed", {
|
|
1605
|
+
reels: [...t],
|
|
1606
|
+
partial: r
|
|
1607
|
+
}), r && (this._announceAllStartedIfReady(), this._tryBeginStopSequence()), r;
|
|
1481
1608
|
}
|
|
1482
1609
|
notifyManualSpeedChange() {
|
|
1483
1610
|
this._manualSpeedSinceBoost = !0;
|
|
@@ -1511,9 +1638,9 @@ var A = class {
|
|
|
1511
1638
|
}), n.reshape(t, r, n.bufferStart, n.bufferEnd), this._hooks.refreshPinOverlaysForReel(e), this._events.emit("adjust:complete", { reelIndex: e }), !0);
|
|
1512
1639
|
}
|
|
1513
1640
|
async _startReel(e, t, n) {
|
|
1514
|
-
if (
|
|
1641
|
+
if (this._isStale(e, n)) return;
|
|
1515
1642
|
let r = this._reels[e], i = this._currentSpinMode === "cascade", a = this._hooks.isMultiWaysSlot && this._phaseFactory.has("adjust"), o = i && a && this._hooks.peekTargetShape() !== null;
|
|
1516
|
-
if (o && (await this._runAdjustForReel(r, e, t, n),
|
|
1643
|
+
if (o && (await this._runAdjustForReel(r, e, t, n), this._isStale(e, n))) return;
|
|
1517
1644
|
if (i) {
|
|
1518
1645
|
let n = this._phaseFactory.create("cascade:fall", r, t);
|
|
1519
1646
|
this._activePhases.set(e, n), await n.run({
|
|
@@ -1528,54 +1655,52 @@ var A = class {
|
|
|
1528
1655
|
delay: e * t.spinDelay
|
|
1529
1656
|
});
|
|
1530
1657
|
}
|
|
1531
|
-
if (
|
|
1658
|
+
if (this._isStale(e, n)) return;
|
|
1532
1659
|
let s = this._phaseFactory.create("spin", r, t);
|
|
1533
1660
|
this._activePhases.set(e, s);
|
|
1534
|
-
let c = s.run({
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
if (!t || t.name !== "spin") {
|
|
1539
|
-
l = !1;
|
|
1540
|
-
break;
|
|
1541
|
-
}
|
|
1542
|
-
}
|
|
1543
|
-
if (l && (this._events.emit("spin:allStarted"), this._tryBeginStopSequence()), await c, n !== this._spinGeneration || a && !o && (await this._runAdjustForReel(r, e, t, n), n !== this._spinGeneration)) return;
|
|
1544
|
-
let u = this._stopDelayFor(e, t), d = this._frameFor(e), f = this._anticipationDuration ?? t.anticipationDelay, p = !1;
|
|
1545
|
-
if (this._anticipationReels.includes(e) && f > 0) {
|
|
1661
|
+
let c = s.run({ minimumSpinTime: this._minimumSpinTimeFor(e) });
|
|
1662
|
+
if (this._announceAllStartedIfReady() && this._tryBeginStopSequence(), await c, this._isStale(e, n) || a && !o && (await this._runAdjustForReel(r, e, t, n), this._isStale(e, n))) return;
|
|
1663
|
+
let l = this._stopDelayFor(e, t), u = this._frameFor(e), d = this._anticipationDuration ?? t.anticipationDelay, f = !1;
|
|
1664
|
+
if (this._anticipationReels.includes(e) && d > 0) {
|
|
1546
1665
|
if (!await this._awaitAnticipationOffset(e, n)) return;
|
|
1547
|
-
let
|
|
1666
|
+
let a = this._anticipationReels.indexOf(e);
|
|
1548
1667
|
this._teasingReels.add(e), r.notifyAnticipationStart(), this._events.emit("anticipation:reel", {
|
|
1549
1668
|
reelIndex: e,
|
|
1550
|
-
order:
|
|
1669
|
+
order: a,
|
|
1551
1670
|
total: this._anticipationReels.length
|
|
1552
1671
|
}), this._events.emit("spin:stopping", e);
|
|
1553
|
-
let
|
|
1554
|
-
|
|
1555
|
-
|
|
1672
|
+
let o = this._phaseFactory.create("anticipation", r, t);
|
|
1673
|
+
this._activePhases.set(e, o);
|
|
1674
|
+
let s = this._anticipationConfigFor(e, t);
|
|
1675
|
+
if (await o.run(i ? {
|
|
1676
|
+
...s,
|
|
1677
|
+
speedMultiplier: 0
|
|
1678
|
+
} : s), this._isStale(e, n)) return;
|
|
1679
|
+
f = !0;
|
|
1556
1680
|
} else this._events.emit("spin:stopping", e);
|
|
1557
1681
|
if (i) {
|
|
1682
|
+
f && (r.speed = 0, r.snapToGrid());
|
|
1558
1683
|
let i = this._phaseFactory.create("cascade:place", r, t);
|
|
1559
1684
|
if (this._activePhases.set(e, i), await i.run({
|
|
1560
|
-
targetFrame:
|
|
1685
|
+
targetFrame: u,
|
|
1561
1686
|
winnerCells: [],
|
|
1562
1687
|
initial: !0,
|
|
1563
|
-
delay:
|
|
1688
|
+
delay: l,
|
|
1564
1689
|
events: this._events
|
|
1565
|
-
}),
|
|
1690
|
+
}), this._isStale(e, n)) return;
|
|
1566
1691
|
let a = this._phaseFactory.create("cascade:dropIn", r, t);
|
|
1567
1692
|
if (this._activePhases.set(e, a), await a.run({
|
|
1568
1693
|
winnerCells: [],
|
|
1569
1694
|
initial: !0,
|
|
1570
1695
|
events: this._events
|
|
1571
|
-
}),
|
|
1696
|
+
}), this._isStale(e, n)) return;
|
|
1572
1697
|
} else {
|
|
1573
1698
|
let i = this._phaseFactory.create("stop", r, t);
|
|
1574
1699
|
if (this._activePhases.set(e, i), await i.run({
|
|
1575
|
-
targetFrame:
|
|
1576
|
-
delay:
|
|
1577
|
-
preserveSpeed:
|
|
1578
|
-
}),
|
|
1700
|
+
targetFrame: u,
|
|
1701
|
+
delay: l,
|
|
1702
|
+
preserveSpeed: f
|
|
1703
|
+
}), this._isStale(e, n)) return;
|
|
1579
1704
|
}
|
|
1580
1705
|
this._markLanded(e);
|
|
1581
1706
|
}
|
|
@@ -1590,11 +1715,11 @@ var A = class {
|
|
|
1590
1715
|
if (n <= 0) return !0;
|
|
1591
1716
|
let r = this._anticipationStagger;
|
|
1592
1717
|
if (r === "sequential") {
|
|
1593
|
-
let
|
|
1594
|
-
return !(
|
|
1718
|
+
let r = this._reelLandedPromises.get(this._anticipationReels[n - 1]);
|
|
1719
|
+
return !(r && (await r, this._isStale(e, t)));
|
|
1595
1720
|
}
|
|
1596
1721
|
let i = Array.isArray(r) ? r[n] ?? 0 : n * r;
|
|
1597
|
-
return !(i > 0 && (await new Promise((e) => setTimeout(e, i)),
|
|
1722
|
+
return !(i > 0 && (await new Promise((e) => setTimeout(e, i)), this._isStale(e, t)));
|
|
1598
1723
|
}
|
|
1599
1724
|
_anticipationConfigFor(e, t) {
|
|
1600
1725
|
let n = this._anticipationSlowdown, r = this._anticipationDuration;
|
|
@@ -1609,10 +1734,19 @@ var A = class {
|
|
|
1609
1734
|
_frameFor(e) {
|
|
1610
1735
|
return this._cachedFrames ? this._cachedFrames[e] : [];
|
|
1611
1736
|
}
|
|
1737
|
+
_announceAllStartedIfReady() {
|
|
1738
|
+
if (this._allStartedEmitted) return !1;
|
|
1739
|
+
for (let e = 0; e < this._reels.length; e++) {
|
|
1740
|
+
if (this._heldReels.has(e) || this._landedReels.has(e)) continue;
|
|
1741
|
+
let t = this._activePhases.get(e);
|
|
1742
|
+
if (!t || t.name !== "spin") return !1;
|
|
1743
|
+
}
|
|
1744
|
+
return this._allStartedEmitted = !0, this._events.emit("spin:allStarted"), !0;
|
|
1745
|
+
}
|
|
1612
1746
|
_tryBeginStopSequence() {
|
|
1613
1747
|
if (!this._resultSymbols) return;
|
|
1614
1748
|
for (let e = 0; e < this._reels.length; e++) {
|
|
1615
|
-
if (this._heldReels.has(e)) continue;
|
|
1749
|
+
if (this._heldReels.has(e) || this._landedReels.has(e)) continue;
|
|
1616
1750
|
let t = this._activePhases.get(e);
|
|
1617
1751
|
if (!t || t.name !== "spin") return;
|
|
1618
1752
|
}
|
|
@@ -1627,7 +1761,7 @@ var A = class {
|
|
|
1627
1761
|
}
|
|
1628
1762
|
this._cachedFrames = r;
|
|
1629
1763
|
for (let e = 0; e < this._reels.length; e++) {
|
|
1630
|
-
if (this._heldReels.has(e)) continue;
|
|
1764
|
+
if (this._heldReels.has(e) || this._landedReels.has(e)) continue;
|
|
1631
1765
|
let t = this._activePhases.get(e);
|
|
1632
1766
|
t?.resolve && t.resolve();
|
|
1633
1767
|
}
|
|
@@ -1718,7 +1852,7 @@ var A = class {
|
|
|
1718
1852
|
for (let e of this._reels) e.update(t);
|
|
1719
1853
|
for (let e of this._activePhases.values()) e.isActive && e.update(t);
|
|
1720
1854
|
}
|
|
1721
|
-
},
|
|
1855
|
+
}, be = class {
|
|
1722
1856
|
_profiles = /* @__PURE__ */ new Map();
|
|
1723
1857
|
_activeName;
|
|
1724
1858
|
_active;
|
|
@@ -1752,7 +1886,7 @@ var A = class {
|
|
|
1752
1886
|
get profileNames() {
|
|
1753
1887
|
return [...this._profiles.keys()];
|
|
1754
1888
|
}
|
|
1755
|
-
},
|
|
1889
|
+
}, xe = class {
|
|
1756
1890
|
_reels;
|
|
1757
1891
|
_viewport;
|
|
1758
1892
|
_promoted = [];
|
|
@@ -1851,12 +1985,12 @@ var A = class {
|
|
|
1851
1985
|
};
|
|
1852
1986
|
//#endregion
|
|
1853
1987
|
//#region src/pins/CellPin.ts
|
|
1854
|
-
function
|
|
1988
|
+
function H(e, t) {
|
|
1855
1989
|
return `${e}:${t}`;
|
|
1856
1990
|
}
|
|
1857
1991
|
//#endregion
|
|
1858
1992
|
//#region src/config/v1Renames.ts
|
|
1859
|
-
var
|
|
1993
|
+
var Se = "run npx pixi-reels-codemod v1-to-v2", Ce = {
|
|
1860
1994
|
visibleRows: "visibleCells",
|
|
1861
1995
|
visibleRowsPerReel: "visibleCellsPerReel",
|
|
1862
1996
|
reelPixelHeights: "reelExtents"
|
|
@@ -1886,7 +2020,7 @@ var le = "run npx pixi-reels-codemod v1-to-v2", H = {
|
|
|
1886
2020
|
bufferAbove: "bufferStart",
|
|
1887
2021
|
bufferBelow: "bufferEnd"
|
|
1888
2022
|
}
|
|
1889
|
-
},
|
|
2023
|
+
}, we = {
|
|
1890
2024
|
"reelAnchor()": {
|
|
1891
2025
|
top: "start",
|
|
1892
2026
|
bottom: "end"
|
|
@@ -1900,22 +2034,22 @@ var le = "run npx pixi-reels-codemod v1-to-v2", H = {
|
|
|
1900
2034
|
up: "reverse"
|
|
1901
2035
|
}
|
|
1902
2036
|
};
|
|
1903
|
-
function
|
|
1904
|
-
return `${e}: '${t}' was renamed to '${n}' in v2; ${
|
|
2037
|
+
function W(e, t, n) {
|
|
2038
|
+
return `${e}: '${t}' was renamed to '${n}' in v2; ${Se}.`;
|
|
1905
2039
|
}
|
|
1906
|
-
function
|
|
2040
|
+
function G(e, t, n) {
|
|
1907
2041
|
if (!(!e || typeof e != "object")) {
|
|
1908
|
-
for (let [r, i] of Object.entries(t)) if (r in e) throw Error(
|
|
2042
|
+
for (let [r, i] of Object.entries(t)) if (r in e) throw Error(W(n, r, i));
|
|
1909
2043
|
}
|
|
1910
2044
|
}
|
|
1911
|
-
function
|
|
2045
|
+
function K(e, t, n) {
|
|
1912
2046
|
if (typeof e != "string") return;
|
|
1913
2047
|
let r = t[e];
|
|
1914
|
-
if (r !== void 0) throw Error(
|
|
2048
|
+
if (r !== void 0) throw Error(W(n, e, r));
|
|
1915
2049
|
}
|
|
1916
2050
|
//#endregion
|
|
1917
2051
|
//#region src/core/ReelSet.ts
|
|
1918
|
-
var
|
|
2052
|
+
var Te = class e extends n {
|
|
1919
2053
|
static PIN_OVERLAY_Z_INDEX = 1e4;
|
|
1920
2054
|
_events = new c();
|
|
1921
2055
|
_reels;
|
|
@@ -1954,7 +2088,7 @@ var ue = class e extends n {
|
|
|
1954
2088
|
get middleware() {
|
|
1955
2089
|
return t.middleware;
|
|
1956
2090
|
}
|
|
1957
|
-
}, this._speedManager = new
|
|
2091
|
+
}, this._speedManager = new be(e.config.speeds, e.config.initialSpeed), this._spinController = new ye(e.reels, this._speedManager, e.frameBuilder, e.phaseFactory, this._events, e.config.ticker, e.spinningMode, e.defaultSpinMode, {
|
|
1958
2092
|
isMultiWaysSlot: this._isMultiWaysSlot,
|
|
1959
2093
|
symbolsData: this._symbolsData,
|
|
1960
2094
|
peekTargetShape: () => this.peekTargetShape(),
|
|
@@ -1964,7 +2098,7 @@ var ue = class e extends n {
|
|
|
1964
2098
|
migratePinsForReel: (e, t) => this._migratePinsForReel(e, t),
|
|
1965
2099
|
refreshPinOverlaysForReel: (e) => this.refreshPinOverlaysForReel(e),
|
|
1966
2100
|
buildPinOverlayTweens: (e, t) => this._buildPinOverlayTweens(e, t)
|
|
1967
|
-
}), this._spotlight = new
|
|
2101
|
+
}), this._spotlight = new xe(e.reels, e.viewport, this._events), this.addChild(this._viewport), this._events.on("spin:allLanded", () => this._onSpinLanded()), this._events.on("spin:start", () => this._onSpinStart());
|
|
1968
2102
|
}
|
|
1969
2103
|
get events() {
|
|
1970
2104
|
return this._events;
|
|
@@ -2023,7 +2157,7 @@ var ue = class e extends n {
|
|
|
2023
2157
|
signal: a
|
|
2024
2158
|
});
|
|
2025
2159
|
})), r = [];
|
|
2026
|
-
for (let n = 0; n < t.length; n++) t[n].status === "rejected" && (r.push(e[n]),
|
|
2160
|
+
for (let n = 0; n < t.length; n++) t[n].status === "rejected" && (r.push(e[n]), ge("destroy-rejected", `destroySymbols: cell (${e[n].reel}, ${e[n].cell}) playDestroy rejected:`, t[n].reason));
|
|
2027
2161
|
this._events.emit("cascade:destroy:end", r.length > 0 ? {
|
|
2028
2162
|
cells: e,
|
|
2029
2163
|
failed: r
|
|
@@ -2117,15 +2251,18 @@ var ue = class e extends n {
|
|
|
2117
2251
|
requestSkip() {
|
|
2118
2252
|
this._spinController.requestSkip();
|
|
2119
2253
|
}
|
|
2120
|
-
slamStop() {
|
|
2121
|
-
this._spinController.slamStop();
|
|
2254
|
+
slamStop(e) {
|
|
2255
|
+
this._spinController.slamStop(e);
|
|
2256
|
+
}
|
|
2257
|
+
setMinimumSpinTime(e) {
|
|
2258
|
+
this._spinController.setMinimumSpinTime(e);
|
|
2122
2259
|
}
|
|
2123
2260
|
get skipStage() {
|
|
2124
2261
|
return this._spinController.skipStage;
|
|
2125
2262
|
}
|
|
2126
2263
|
setSymbolAt(e, t, n) {
|
|
2127
2264
|
if (e < 0 || e >= this._reels.length) throw RangeError(`setSymbolAt: reel ${e} out of range [0, ${this._reels.length})`);
|
|
2128
|
-
if (this._pins.has(
|
|
2265
|
+
if (this._pins.has(H(e, t))) throw Error(`setSymbolAt: cell (${e}, ${t}) has an active pin. Call unpin(reel, cell) first if you intend to overwrite it.`);
|
|
2129
2266
|
this._reels[e].setSymbolAt(t, n);
|
|
2130
2267
|
}
|
|
2131
2268
|
async nudge(e, t) {
|
|
@@ -2162,7 +2299,7 @@ var ue = class e extends n {
|
|
|
2162
2299
|
_assertGrid(e, t) {
|
|
2163
2300
|
O(e, t);
|
|
2164
2301
|
let n = U["initialFrame() / setResult() column"];
|
|
2165
|
-
for (let r = 0; r < e.length; r++)
|
|
2302
|
+
for (let r = 0; r < e.length; r++) G(e[r], n, `${t} column ${r}`);
|
|
2166
2303
|
te(e, this._reels.map((e) => e.bufferStart), this._reels.map((e) => e.bufferEnd), t);
|
|
2167
2304
|
}
|
|
2168
2305
|
_assertNoNudgeInFlight(e) {
|
|
@@ -2344,22 +2481,22 @@ var ue = class e extends n {
|
|
|
2344
2481
|
symbolId: n,
|
|
2345
2482
|
turns: r?.turns ?? "permanent",
|
|
2346
2483
|
payload: r?.payload
|
|
2347
|
-
}, o =
|
|
2484
|
+
}, o = H(e, t);
|
|
2348
2485
|
return this._pins.has(o) && this._destroyPinOverlay(o), this._pins.set(o, a), this._spinController.isSpinning ? this._ensurePinOverlay(a) : this._applyPinVisually(e, t, n), this._events.emit("pin:placed", a), a;
|
|
2349
2486
|
}
|
|
2350
2487
|
unpin(e, t) {
|
|
2351
|
-
let n =
|
|
2488
|
+
let n = H(e, t), r = this._pins.get(n);
|
|
2352
2489
|
r && (this._pins.delete(n), this._destroyPinOverlay(n), this._events.emit("pin:expired", r, "explicit"));
|
|
2353
2490
|
}
|
|
2354
2491
|
get pins() {
|
|
2355
2492
|
return this._pins;
|
|
2356
2493
|
}
|
|
2357
2494
|
getPin(e, t) {
|
|
2358
|
-
return this._pins.get(
|
|
2495
|
+
return this._pins.get(H(e, t));
|
|
2359
2496
|
}
|
|
2360
2497
|
async movePin(e, t, n) {
|
|
2361
2498
|
if (this._spinController.isSpinning) throw Error("movePin(): cannot move pin while spinning");
|
|
2362
|
-
let r =
|
|
2499
|
+
let r = H(e.reel, e.cell), i = this._pins.get(r);
|
|
2363
2500
|
if (!i) throw Error(`movePin(): no pin at (${e.reel}, ${e.cell})`);
|
|
2364
2501
|
if (t.reel < 0 || t.reel >= this._reels.length) throw Error(`movePin(): to reel ${t.reel} out of range [0, ${this._reels.length})`);
|
|
2365
2502
|
let a = this._reels[t.reel];
|
|
@@ -2371,7 +2508,7 @@ var ue = class e extends n {
|
|
|
2371
2508
|
});
|
|
2372
2509
|
return;
|
|
2373
2510
|
}
|
|
2374
|
-
let o =
|
|
2511
|
+
let o = H(t.reel, t.cell);
|
|
2375
2512
|
if (this._pins.has(o)) throw Error(`movePin(): a pin already exists at (${t.reel}, ${t.cell})`);
|
|
2376
2513
|
this._pins.delete(r);
|
|
2377
2514
|
let s = {
|
|
@@ -2388,7 +2525,7 @@ var ue = class e extends n {
|
|
|
2388
2525
|
try {
|
|
2389
2526
|
n?.onFlightCreated?.(p);
|
|
2390
2527
|
} catch (e) {
|
|
2391
|
-
|
|
2528
|
+
V("pin-hook-threw", "movePin onFlightCreated hook threw. continuing the flight to avoid leaking the flight symbol:", e);
|
|
2392
2529
|
}
|
|
2393
2530
|
let m = (n?.duration ?? 400) / 1e3, h = n?.easing ?? "power2.inOut";
|
|
2394
2531
|
await new Promise((e) => {
|
|
@@ -2403,7 +2540,7 @@ var ue = class e extends n {
|
|
|
2403
2540
|
try {
|
|
2404
2541
|
n?.onFlightCompleted?.(p);
|
|
2405
2542
|
} catch (e) {
|
|
2406
|
-
|
|
2543
|
+
V("pin-hook-threw", "movePin onFlightCompleted hook threw. continuing cleanup:", e);
|
|
2407
2544
|
}
|
|
2408
2545
|
let g = a.getVisibleSymbols();
|
|
2409
2546
|
g[t.cell] = i.symbolId, a.placeSymbols({ visible: g }), this._viewport.unmaskedContainer.removeChild(p.view), this._symbolFactory.release(p), this._events.emit("pin:moved", s, {
|
|
@@ -2456,13 +2593,13 @@ var ue = class e extends n {
|
|
|
2456
2593
|
});
|
|
2457
2594
|
}
|
|
2458
2595
|
for (let { pin: t, fromCell: r, target: o, clamped: s, nextOriginCell: c } of a) {
|
|
2459
|
-
let a =
|
|
2596
|
+
let a = H(t.reel, r);
|
|
2460
2597
|
if (i.has(o)) {
|
|
2461
2598
|
this._pins.delete(a), this._destroyPinOverlay(a), this._events.emit("pin:expired", t, "collision");
|
|
2462
2599
|
continue;
|
|
2463
2600
|
}
|
|
2464
2601
|
i.add(o);
|
|
2465
|
-
let l =
|
|
2602
|
+
let l = H(t.reel, o);
|
|
2466
2603
|
this._pins.delete(a);
|
|
2467
2604
|
let u = {
|
|
2468
2605
|
...t,
|
|
@@ -2499,18 +2636,18 @@ var ue = class e extends n {
|
|
|
2499
2636
|
if (this._destroyAllPinOverlays(), this._pins.size === 0) return;
|
|
2500
2637
|
let e = [];
|
|
2501
2638
|
for (let t of this._pins.values()) typeof t.turns == "number" && (--t.turns, t.turns <= 0 && e.push(t));
|
|
2502
|
-
for (let t of e) this._pins.delete(
|
|
2639
|
+
for (let t of e) this._pins.delete(H(t.reel, t.cell)), this._events.emit("pin:expired", t, "turns");
|
|
2503
2640
|
}
|
|
2504
2641
|
_onSpinStart() {
|
|
2505
2642
|
if (this._resultSetForCurrentSpin = !1, this._pins.size > 0) {
|
|
2506
2643
|
let e = [];
|
|
2507
2644
|
for (let t of this._pins.values()) t.turns === "eval" && e.push(t);
|
|
2508
|
-
for (let t of e) this._pins.delete(
|
|
2645
|
+
for (let t of e) this._pins.delete(H(t.reel, t.cell)), this._events.emit("pin:expired", t, "eval");
|
|
2509
2646
|
}
|
|
2510
2647
|
for (let e of this._pins.values()) this._ensurePinOverlay(e);
|
|
2511
2648
|
}
|
|
2512
2649
|
_ensurePinOverlay(t) {
|
|
2513
|
-
let n =
|
|
2650
|
+
let n = H(t.reel, t.cell);
|
|
2514
2651
|
if (this._pinOverlays.has(n)) return;
|
|
2515
2652
|
let r = this._reels[t.reel], i = this._symbolFactory.acquire(t.symbolId);
|
|
2516
2653
|
i.resize(r.symbolWidth, r.symbolHeight), r.axis.setCross(i.view, r.axis.getCross(r.container)), r.axis.setMain(i.view, this._pinOverlayCellMain(r, t.cell, r.motion.slotPitch)), i.view.zIndex = e.PIN_OVERLAY_Z_INDEX, this._viewport.unmaskedContainer.addChild(i.view), this._pinOverlays.set(n, {
|
|
@@ -2553,7 +2690,7 @@ var ue = class e extends n {
|
|
|
2553
2690
|
let e = [...this._pinOverlays.keys()];
|
|
2554
2691
|
for (let t of e) this._destroyPinOverlay(t);
|
|
2555
2692
|
}
|
|
2556
|
-
},
|
|
2693
|
+
}, q = {
|
|
2557
2694
|
bufferSymbols: 1,
|
|
2558
2695
|
symbolGap: {
|
|
2559
2696
|
x: 0,
|
|
@@ -2562,7 +2699,7 @@ var ue = class e extends n {
|
|
|
2562
2699
|
initialSpeed: "normal",
|
|
2563
2700
|
maxPoolPerKey: 20,
|
|
2564
2701
|
zIndexStep: 100
|
|
2565
|
-
},
|
|
2702
|
+
}, Ee = {
|
|
2566
2703
|
NORMAL: {
|
|
2567
2704
|
name: "normal",
|
|
2568
2705
|
spinDelay: 100,
|
|
@@ -2602,7 +2739,7 @@ var ue = class e extends n {
|
|
|
2602
2739
|
accelerationDuration: 50,
|
|
2603
2740
|
minimumSpinTime: 100
|
|
2604
2741
|
}
|
|
2605
|
-
},
|
|
2742
|
+
}, De = class {
|
|
2606
2743
|
_entries = /* @__PURE__ */ new Map();
|
|
2607
2744
|
register(e, t, n) {
|
|
2608
2745
|
if (this._entries.has(e)) throw Error(`Symbol '${e}' is already registered.`);
|
|
@@ -2626,7 +2763,7 @@ var ue = class e extends n {
|
|
|
2626
2763
|
get size() {
|
|
2627
2764
|
return this._entries.size;
|
|
2628
2765
|
}
|
|
2629
|
-
},
|
|
2766
|
+
}, Oe = class {
|
|
2630
2767
|
_pools = /* @__PURE__ */ new Map();
|
|
2631
2768
|
_pooled = /* @__PURE__ */ new Set();
|
|
2632
2769
|
_isDestroyed = !1;
|
|
@@ -2669,11 +2806,11 @@ var ue = class e extends n {
|
|
|
2669
2806
|
destroy() {
|
|
2670
2807
|
this._isDestroyed ||= (this.clear(), !0);
|
|
2671
2808
|
}
|
|
2672
|
-
},
|
|
2809
|
+
}, ke = class {
|
|
2673
2810
|
_pool;
|
|
2674
2811
|
_capacityPerKey;
|
|
2675
2812
|
constructor(t, n = 20, r = e, i = "y") {
|
|
2676
|
-
this._registry = t, this._capacityPerKey = n, this._pool = new
|
|
2813
|
+
this._registry = t, this._capacityPerKey = n, this._pool = new Oe((e) => {
|
|
2677
2814
|
let t = this._registry.create(e);
|
|
2678
2815
|
return t.bindGsap(r), t.bindMainAxis(i), t;
|
|
2679
2816
|
}, (e) => e.reset(), (e) => e.destroy(), n);
|
|
@@ -2692,7 +2829,7 @@ var ue = class e extends n {
|
|
|
2692
2829
|
destroy() {
|
|
2693
2830
|
this._pool.destroy();
|
|
2694
2831
|
}
|
|
2695
|
-
},
|
|
2832
|
+
}, Ae = "*", je = class {
|
|
2696
2833
|
_symbols;
|
|
2697
2834
|
_baseWeights = {};
|
|
2698
2835
|
_pools = /* @__PURE__ */ new Map();
|
|
@@ -2752,7 +2889,7 @@ var ue = class e extends n {
|
|
|
2752
2889
|
}, { slots: e });
|
|
2753
2890
|
}
|
|
2754
2891
|
_key(e, t) {
|
|
2755
|
-
return `${e}:${t ??
|
|
2892
|
+
return `${e}:${t ?? Ae}`;
|
|
2756
2893
|
}
|
|
2757
2894
|
_readBaseWeights(e) {
|
|
2758
2895
|
this._baseWeights = {};
|
|
@@ -2801,7 +2938,7 @@ var ue = class e extends n {
|
|
|
2801
2938
|
let e = /* @__PURE__ */ new Set();
|
|
2802
2939
|
for (let t of this._pools.keys()) {
|
|
2803
2940
|
let n = t.slice(t.indexOf(":") + 1);
|
|
2804
|
-
n !==
|
|
2941
|
+
n !== Ae && e.add(Number(n));
|
|
2805
2942
|
}
|
|
2806
2943
|
let t = [
|
|
2807
2944
|
"spinning",
|
|
@@ -2830,11 +2967,11 @@ var ue = class e extends n {
|
|
|
2830
2967
|
for (let t of this._symbols) e += Math.max(0, this._baseWeights[t]);
|
|
2831
2968
|
if (e <= 0) throw Error("RandomSymbolProvider requires at least one symbol with weight > 0; all registered symbols have weight 0, so the spinning strip cannot be filled.");
|
|
2832
2969
|
}
|
|
2833
|
-
},
|
|
2970
|
+
}, Me = class {
|
|
2834
2971
|
_middlewares = [];
|
|
2835
2972
|
_sorted = !1;
|
|
2836
2973
|
constructor(e) {
|
|
2837
|
-
this._randomProvider = e, this.use(new
|
|
2974
|
+
this._randomProvider = e, this.use(new Ne(e)), this.use(new Pe());
|
|
2838
2975
|
}
|
|
2839
2976
|
use(e) {
|
|
2840
2977
|
return this._middlewares.push(e), this._sorted = !1, this;
|
|
@@ -2867,7 +3004,7 @@ var ue = class e extends n {
|
|
|
2867
3004
|
get middleware() {
|
|
2868
3005
|
return this._middlewares;
|
|
2869
3006
|
}
|
|
2870
|
-
},
|
|
3007
|
+
}, Ne = class {
|
|
2871
3008
|
name = "random-fill";
|
|
2872
3009
|
priority = 0;
|
|
2873
3010
|
constructor(e) {
|
|
@@ -2880,7 +3017,7 @@ var ue = class e extends n {
|
|
|
2880
3017
|
}
|
|
2881
3018
|
t();
|
|
2882
3019
|
}
|
|
2883
|
-
},
|
|
3020
|
+
}, Pe = class {
|
|
2884
3021
|
name = "target-placement";
|
|
2885
3022
|
priority = 10;
|
|
2886
3023
|
process(e, t) {
|
|
@@ -2896,16 +3033,16 @@ var ue = class e extends n {
|
|
|
2896
3033
|
};
|
|
2897
3034
|
//#endregion
|
|
2898
3035
|
//#region src/cascade/TumbleConfig.ts
|
|
2899
|
-
function
|
|
3036
|
+
function Fe(e, t) {
|
|
2900
3037
|
return e === "auto" ? t : e;
|
|
2901
3038
|
}
|
|
2902
|
-
function
|
|
3039
|
+
function Ie(e) {
|
|
2903
3040
|
return e === "forward" ? 1 : -1;
|
|
2904
3041
|
}
|
|
2905
|
-
function
|
|
3042
|
+
function Le(e, t) {
|
|
2906
3043
|
return e === "auto" ? t === "forward" ? "endFirst" : "startFirst" : e;
|
|
2907
3044
|
}
|
|
2908
|
-
function
|
|
3045
|
+
function Re(e) {
|
|
2909
3046
|
return {
|
|
2910
3047
|
gravity: e?.gravity ?? "auto",
|
|
2911
3048
|
fall: {
|
|
@@ -2923,7 +3060,7 @@ function Ce(e) {
|
|
|
2923
3060
|
}
|
|
2924
3061
|
};
|
|
2925
3062
|
}
|
|
2926
|
-
function
|
|
3063
|
+
function ze(e, t) {
|
|
2927
3064
|
return t ? {
|
|
2928
3065
|
duration: t.duration ?? e.duration,
|
|
2929
3066
|
ease: t.ease ?? e.ease,
|
|
@@ -2931,7 +3068,7 @@ function we(e, t) {
|
|
|
2931
3068
|
cellOrder: t.cellOrder ?? e.cellOrder
|
|
2932
3069
|
} : e;
|
|
2933
3070
|
}
|
|
2934
|
-
function
|
|
3071
|
+
function Be(e, t) {
|
|
2935
3072
|
return t ? {
|
|
2936
3073
|
duration: t.duration ?? e.duration,
|
|
2937
3074
|
ease: t.ease ?? e.ease,
|
|
@@ -2942,7 +3079,7 @@ function Te(e, t) {
|
|
|
2942
3079
|
}
|
|
2943
3080
|
//#endregion
|
|
2944
3081
|
//#region src/spin/phases/CascadeFallPhase.ts
|
|
2945
|
-
var
|
|
3082
|
+
var Ve = class extends F {
|
|
2946
3083
|
name = "cascade:fall";
|
|
2947
3084
|
skippable = !0;
|
|
2948
3085
|
_baseFall;
|
|
@@ -2959,13 +3096,13 @@ var Ee = class extends I {
|
|
|
2959
3096
|
}
|
|
2960
3097
|
onEnter(e) {
|
|
2961
3098
|
let t = this._reel;
|
|
2962
|
-
t.spinningMode = e.spinningMode, t.speed = 0, t.notifySpinStart(), this._fall =
|
|
3099
|
+
t.spinningMode = e.spinningMode, t.speed = 0, t.notifySpinStart(), this._fall = ze(this._baseFall, this._speed.tumble?.fall), this._events = e.events, this._startEmitted = !1, this._skipAbort = new AbortController();
|
|
2963
3100
|
let n = (e.delay ?? 0) / 1e3;
|
|
2964
3101
|
n > 0 ? this._delayedCall = this._reel.gsap.delayedCall(n, () => this._beginFall(e.events)) : this._beginFall(e.events);
|
|
2965
3102
|
}
|
|
2966
3103
|
_beginFall(e) {
|
|
2967
3104
|
this._delayedCall = null;
|
|
2968
|
-
let t = this._reel, n = t.axis, r = t.motion.slotPitch, i = t.visibleCells, a = t.reelIndex, o =
|
|
3105
|
+
let t = this._reel, n = t.axis, r = t.motion.slotPitch, i = t.visibleCells, a = t.reelIndex, o = Fe(this._gravity, n.direction), s = Ie(o), c = (i + (s > 0 ? t.bufferEnd : t.bufferStart) + 1) * r, l = this._fall.duration / 1e3, u = this._fall.cellStagger / 1e3, d = [], f = [], p = [];
|
|
2969
3106
|
for (let e = 0; e < i; e++) {
|
|
2970
3107
|
let r = t.getSymbolAt(e);
|
|
2971
3108
|
d.push(r), f.push(r.view), p.push(n.getMain(r.view));
|
|
@@ -2981,7 +3118,7 @@ var Ee = class extends I {
|
|
|
2981
3118
|
this._fallingViews = [], e.emit("cascade:fall:end", { reelIndex: a }), this._startEmitted = !1, this._events = null, this._skipAbort = null, this._complete();
|
|
2982
3119
|
} });
|
|
2983
3120
|
this._timeline = m;
|
|
2984
|
-
let h =
|
|
3121
|
+
let h = Le(this._fall.cellOrder, o) === "endFirst";
|
|
2985
3122
|
for (let t = 0; t < i; t++) {
|
|
2986
3123
|
let r = f[t], o = d[t], g = p[t], _ = (h ? i - 1 - t : t) * u;
|
|
2987
3124
|
m.call(() => {
|
|
@@ -3015,7 +3152,7 @@ var Ee = class extends I {
|
|
|
3015
3152
|
};
|
|
3016
3153
|
//#endregion
|
|
3017
3154
|
//#region src/cascade/tumbleAlgorithm.ts
|
|
3018
|
-
function
|
|
3155
|
+
function He(e, t, n = {}) {
|
|
3019
3156
|
let r = n.initial ?? !1, i = n.gravity ?? "forward", a = r ? e : t.length, o = r ? /* @__PURE__ */ new Set() : new Set(t), s = [];
|
|
3020
3157
|
for (let t = 0; t < e; t++) o.has(t) || s.push(t);
|
|
3021
3158
|
let c = e - a, l = [];
|
|
@@ -3032,7 +3169,7 @@ function De(e, t, n = {}) {
|
|
|
3032
3169
|
}
|
|
3033
3170
|
//#endregion
|
|
3034
3171
|
//#region src/spin/phases/CascadePlacePhase.ts
|
|
3035
|
-
var
|
|
3172
|
+
var Ue = class extends F {
|
|
3036
3173
|
name = "cascade:place";
|
|
3037
3174
|
skippable = !0;
|
|
3038
3175
|
_config = null;
|
|
@@ -3053,9 +3190,9 @@ var Oe = class extends I {
|
|
|
3053
3190
|
if (this._delayedCall = null, !this._config) return;
|
|
3054
3191
|
let e = this._reel, { targetFrame: t, events: n } = this._config;
|
|
3055
3192
|
e.beginMotion(), e.placeStrip(this._placement(t)), e.snapToGrid(), e.notifySpinEnd();
|
|
3056
|
-
let r =
|
|
3193
|
+
let r = He(e.visibleCells, this._config.winnerCells, {
|
|
3057
3194
|
initial: this._config.initial,
|
|
3058
|
-
gravity:
|
|
3195
|
+
gravity: Fe(this._gravity, e.axis.direction)
|
|
3059
3196
|
}), i = [], a = /* @__PURE__ */ new Set();
|
|
3060
3197
|
for (let t of r) {
|
|
3061
3198
|
let n = e.getAnchorCell(t.cell);
|
|
@@ -3082,7 +3219,7 @@ var Oe = class extends I {
|
|
|
3082
3219
|
}
|
|
3083
3220
|
}
|
|
3084
3221
|
}
|
|
3085
|
-
},
|
|
3222
|
+
}, We = class extends F {
|
|
3086
3223
|
name = "cascade:dropIn";
|
|
3087
3224
|
skippable = !0;
|
|
3088
3225
|
_baseDrop;
|
|
@@ -3098,10 +3235,10 @@ var Oe = class extends I {
|
|
|
3098
3235
|
}
|
|
3099
3236
|
onEnter(e) {
|
|
3100
3237
|
let t = this._reel, n = t.axis, r = t.visibleCells, i = t.motion.slotPitch, a = e.events, o = t.reelIndex, s = e.role ?? "all";
|
|
3101
|
-
t.beginMotion(), this._drop =
|
|
3238
|
+
t.beginMotion(), this._drop = Be(this._baseDrop, this._speed.tumble?.dropIn), this._skipAbort = new AbortController();
|
|
3102
3239
|
let c = s === "gravity" ? "cascade:gravity:start" : "cascade:dropIn:start", l = s === "gravity" ? "cascade:gravity:symbol" : "cascade:dropIn:symbol", u = s === "gravity" ? "cascade:gravity:end" : "cascade:dropIn:end";
|
|
3103
3240
|
this._events = a, this._endEvent = u, a.emit(c, { reelIndex: o });
|
|
3104
|
-
let d =
|
|
3241
|
+
let d = Fe(this._gravity, n.direction), f = Ie(d), p = He(r, e.winnerCells, {
|
|
3105
3242
|
initial: e.initial,
|
|
3106
3243
|
gravity: d
|
|
3107
3244
|
}), m = [], h = /* @__PURE__ */ new Set();
|
|
@@ -3151,7 +3288,7 @@ var Oe = class extends I {
|
|
|
3151
3288
|
}
|
|
3152
3289
|
let y = this._reel.gsap.timeline({ onComplete: g });
|
|
3153
3290
|
this._timeline = y;
|
|
3154
|
-
let b =
|
|
3291
|
+
let b = Le(this._drop.cellOrder, d) === "endFirst";
|
|
3155
3292
|
for (let e = 0; e < m.length; e++) {
|
|
3156
3293
|
let t = m[e], r = (b ? m.length - 1 - e : e) * v;
|
|
3157
3294
|
y.call(() => {
|
|
@@ -3186,7 +3323,7 @@ var Oe = class extends I {
|
|
|
3186
3323
|
}
|
|
3187
3324
|
this._skipAbort && !this._skipAbort.signal.aborted && this._skipAbort.abort(), this._skipAbort = null, this._events &&= (this._events.emit(this._endEvent, { reelIndex: this._reel.reelIndex }), null);
|
|
3188
3325
|
}
|
|
3189
|
-
},
|
|
3326
|
+
}, Ge = class extends F {
|
|
3190
3327
|
name = "adjust";
|
|
3191
3328
|
skippable = !0;
|
|
3192
3329
|
_durationMs;
|
|
@@ -3239,23 +3376,24 @@ var Oe = class extends I {
|
|
|
3239
3376
|
n.symbol.resize(e.x, e.y), t.setCross(n.symbol.view, n.cross), t.setMain(n.symbol.view, n.toMain), n.symbol.view.scale.set(1, 1);
|
|
3240
3377
|
}
|
|
3241
3378
|
}
|
|
3242
|
-
},
|
|
3379
|
+
}, Ke = class {
|
|
3243
3380
|
_reelCount;
|
|
3244
3381
|
_visibleCells;
|
|
3245
3382
|
_symbolWidth;
|
|
3246
3383
|
_symbolHeight;
|
|
3247
|
-
_symbolGap = { ...
|
|
3248
|
-
_bufferStart =
|
|
3249
|
-
_bufferEnd =
|
|
3250
|
-
_symbolRegistry = new
|
|
3384
|
+
_symbolGap = { ...q.symbolGap };
|
|
3385
|
+
_bufferStart = q.bufferSymbols;
|
|
3386
|
+
_bufferEnd = q.bufferSymbols;
|
|
3387
|
+
_symbolRegistry = new De();
|
|
3251
3388
|
_weights = {};
|
|
3252
3389
|
_symbolPools = [];
|
|
3253
3390
|
_speeds = /* @__PURE__ */ new Map();
|
|
3254
|
-
_initialSpeed =
|
|
3391
|
+
_initialSpeed = q.initialSpeed;
|
|
3255
3392
|
_offset = { mode: "none" };
|
|
3256
3393
|
_ticker;
|
|
3257
3394
|
_spinningMode = new A();
|
|
3258
|
-
_phaseFactory = new
|
|
3395
|
+
_phaseFactory = new z();
|
|
3396
|
+
_phaseConfigurators = [];
|
|
3259
3397
|
_middlewares = [];
|
|
3260
3398
|
_initialFrame;
|
|
3261
3399
|
_symbolDataOverrides = {};
|
|
@@ -3284,13 +3422,13 @@ var Oe = class extends I {
|
|
|
3284
3422
|
_rng = Math.random;
|
|
3285
3423
|
_poolCapacity;
|
|
3286
3424
|
visibleRows(e) {
|
|
3287
|
-
throw Error(
|
|
3425
|
+
throw Error(W("ReelSetBuilder", "visibleRows", Ce.visibleRows));
|
|
3288
3426
|
}
|
|
3289
3427
|
visibleRowsPerReel(e) {
|
|
3290
|
-
throw Error(
|
|
3428
|
+
throw Error(W("ReelSetBuilder", "visibleRowsPerReel", Ce.visibleRowsPerReel));
|
|
3291
3429
|
}
|
|
3292
3430
|
reelPixelHeights(e) {
|
|
3293
|
-
throw Error(
|
|
3431
|
+
throw Error(W("ReelSetBuilder", "reelPixelHeights", Ce.reelPixelHeights));
|
|
3294
3432
|
}
|
|
3295
3433
|
reels(e) {
|
|
3296
3434
|
return this._reelCount = e, this;
|
|
@@ -3305,7 +3443,7 @@ var Oe = class extends I {
|
|
|
3305
3443
|
return this._reelExtents = [...e], this;
|
|
3306
3444
|
}
|
|
3307
3445
|
reelAnchor(e) {
|
|
3308
|
-
return
|
|
3446
|
+
return K(e, we["reelAnchor()"], "reelAnchor()"), this._reelAnchor = e, this;
|
|
3309
3447
|
}
|
|
3310
3448
|
cellStacking(e) {
|
|
3311
3449
|
return this._cellStacking = e, this;
|
|
@@ -3349,7 +3487,7 @@ var Oe = class extends I {
|
|
|
3349
3487
|
return this._maskStrategy = e, this._maskStrategyExplicit = !0, this;
|
|
3350
3488
|
}
|
|
3351
3489
|
multiways(e) {
|
|
3352
|
-
return
|
|
3490
|
+
return G(e, U["multiways()"], "multiways()"), this._multiways = { ...e }, this;
|
|
3353
3491
|
}
|
|
3354
3492
|
pinMigrationDuration(e) {
|
|
3355
3493
|
return this._pinMigrationDuration = e, this;
|
|
@@ -3367,14 +3505,13 @@ var Oe = class extends I {
|
|
|
3367
3505
|
}, this;
|
|
3368
3506
|
}
|
|
3369
3507
|
bufferSymbols(e) {
|
|
3370
|
-
if (
|
|
3508
|
+
if (G(e, U["bufferSymbols()"], "bufferSymbols()"), typeof e == "object") return this._bufferStart = this._clampBufferMin1(e.start, "bufferSymbols({ start })"), this._bufferEnd = Number.isFinite(e.end) && e.end >= 0 ? e.end : 0, this;
|
|
3371
3509
|
let t = this._clampBufferMin1(e, `bufferSymbols(${e})`);
|
|
3372
3510
|
return this._bufferStart = t, this._bufferEnd = t, this;
|
|
3373
3511
|
}
|
|
3374
|
-
_clampBufferMin1(e,
|
|
3375
|
-
return !Number.isFinite(e) || e < 1 ? (
|
|
3512
|
+
_clampBufferMin1(e, t) {
|
|
3513
|
+
return !Number.isFinite(e) || e < 1 ? (_e("buffer-clamped", `${t} is below the minimum of 1; clamping to 1. The motion layer needs at least one buffer cell above (and, outside tumble-only sets, below) the visible window for wrap detection.`), 1) : e;
|
|
3376
3514
|
}
|
|
3377
|
-
static _bufferWarnedThisProcess = !1;
|
|
3378
3515
|
symbols(e) {
|
|
3379
3516
|
return e(this._symbolRegistry), this;
|
|
3380
3517
|
}
|
|
@@ -3388,7 +3525,7 @@ var Oe = class extends I {
|
|
|
3388
3525
|
}), this;
|
|
3389
3526
|
}
|
|
3390
3527
|
symbolData(e) {
|
|
3391
|
-
for (let [t, n] of Object.entries(e ?? {}))
|
|
3528
|
+
for (let [t, n] of Object.entries(e ?? {})) G(n?.size, U["symbolData() size"], `symbolData('${t}').size`);
|
|
3392
3529
|
return this._symbolDataOverrides = {
|
|
3393
3530
|
...this._symbolDataOverrides,
|
|
3394
3531
|
...e
|
|
@@ -3401,7 +3538,7 @@ var Oe = class extends I {
|
|
|
3401
3538
|
return this._initialSpeed = e, this;
|
|
3402
3539
|
}
|
|
3403
3540
|
offsetConfig(e) {
|
|
3404
|
-
return
|
|
3541
|
+
return G(e, U["offset() trapezoid"], "offsetConfig()"), this._offset = e, this;
|
|
3405
3542
|
}
|
|
3406
3543
|
ticker(e) {
|
|
3407
3544
|
return this._ticker = e, this;
|
|
@@ -3422,16 +3559,16 @@ var Oe = class extends I {
|
|
|
3422
3559
|
return this._middlewares.push(e), this;
|
|
3423
3560
|
}
|
|
3424
3561
|
phases(e) {
|
|
3425
|
-
return
|
|
3562
|
+
return this._phaseConfigurators.push(e), this;
|
|
3426
3563
|
}
|
|
3427
3564
|
tumble(e) {
|
|
3428
3565
|
let t = U["tumble() fall/dropIn"];
|
|
3429
|
-
return
|
|
3566
|
+
return G(e?.fall, t, "tumble({ fall })"), G(e?.dropIn, t, "tumble({ dropIn })"), K(e?.fall?.cellOrder, we["tumble() cellOrder"], "tumble({ fall: { cellOrder } })"), K(e?.dropIn?.cellOrder, we["tumble() cellOrder"], "tumble({ dropIn: { cellOrder } })"), this._tumbleConfig = Re(e), this._defaultSpinMode = "cascade", this;
|
|
3430
3567
|
}
|
|
3431
3568
|
initialFrame(e) {
|
|
3432
3569
|
O(e, "initialFrame()");
|
|
3433
3570
|
let t = U["initialFrame() / setResult() column"];
|
|
3434
|
-
for (let n = 0; n < (e?.length ?? 0); n++)
|
|
3571
|
+
for (let n = 0; n < (e?.length ?? 0); n++) G(e[n], t, `initialFrame() column ${n}`);
|
|
3435
3572
|
return this._initialFrame = e, this;
|
|
3436
3573
|
}
|
|
3437
3574
|
build() {
|
|
@@ -3459,7 +3596,7 @@ var Oe = class extends I {
|
|
|
3459
3596
|
let n = h[t];
|
|
3460
3597
|
return (e - (n - 1) * f) / n;
|
|
3461
3598
|
}), x = l, S = o ? Array(e).fill(x) : b;
|
|
3462
|
-
this._speeds.size === 0 && this._speeds.set("normal",
|
|
3599
|
+
this._speeds.size === 0 && this._speeds.set("normal", Ee.NORMAL);
|
|
3463
3600
|
let C = {}, ee = this._symbolRegistry.symbolIds;
|
|
3464
3601
|
for (let e of ee) {
|
|
3465
3602
|
let t = this._symbolDataOverrides[e] ?? {};
|
|
@@ -3489,31 +3626,32 @@ var Oe = class extends I {
|
|
|
3489
3626
|
initialSpeed: this._initialSpeed,
|
|
3490
3627
|
offset: this._offset,
|
|
3491
3628
|
ticker: a
|
|
3492
|
-
}, T = h.reduce((e, t) => e + t + r + i, 0), E = this._poolCapacity ?? Math.max(20, T), D = new
|
|
3629
|
+
}, T = h.reduce((e, t) => e + t + r + i, 0), E = this._poolCapacity ?? Math.max(20, T), D = new ke(this._symbolRegistry, E, this._gsap, c.mainProp), O = new je(C, this._rng);
|
|
3493
3630
|
for (let { pool: e, scope: t } of this._symbolPools) O.set(e, t);
|
|
3494
|
-
let k = new
|
|
3631
|
+
let k = new Me(O);
|
|
3495
3632
|
for (let e of this._middlewares) k.use(e);
|
|
3496
3633
|
if (this._tumbleConfig) {
|
|
3497
3634
|
let e = this._tumbleConfig.fall, t = this._tumbleConfig.dropIn, n = this._tumbleConfig.gravity;
|
|
3498
|
-
this._phaseFactory.registerFactory("cascade:fall", (t, r) => new
|
|
3635
|
+
this._phaseFactory.registerFactory("cascade:fall", (t, r) => new Ve(t, r, e, n)), this._phaseFactory.registerFactory("cascade:place", (e, t) => new Ue(e, t, n)), this._phaseFactory.registerFactory("cascade:dropIn", (e, r) => new We(e, r, t, n));
|
|
3499
3636
|
}
|
|
3500
3637
|
if (o) {
|
|
3501
3638
|
let e = this._pinMigrationDuration, t = this._pinMigrationEase;
|
|
3502
|
-
this._phaseFactory.registerFactory("adjust", (n, r) => new
|
|
3639
|
+
this._phaseFactory.registerFactory("adjust", (n, r) => new Ge(n, r, {
|
|
3503
3640
|
durationMs: typeof e == "function" ? e(n.reelIndex) : e,
|
|
3504
3641
|
ease: t
|
|
3505
3642
|
}));
|
|
3506
3643
|
}
|
|
3644
|
+
for (let e of this._phaseConfigurators) e(this._phaseFactory);
|
|
3507
3645
|
let A = e * (d + p) - p, ne = c.toScreen(A, v), j = ne.x, M = ne.y, N = Object.values(C).some((e) => e.size && (e.size.reels > 1 || e.size.cells > 1)), P = Object.values(C).some((e) => e.unmask);
|
|
3508
|
-
!this._maskStrategyExplicit && (N || P) && p > 0 && (this._maskStrategy = new
|
|
3509
|
-
let
|
|
3510
|
-
!this._maskStrategyExplicit &&
|
|
3511
|
-
let
|
|
3646
|
+
!this._maskStrategyExplicit && (N || P) && p > 0 && (this._maskStrategy = new ie(), ve("mask-auto-shared", `auto-selected SharedRectMaskStrategy because ${N ? "big symbols are registered" : "one or more symbols use `unmask: true`"} and the cross-axis gap (symbolGap.${s ? "x" : "y"}) is > 0. Pass .maskStrategy(...) explicitly to override.`));
|
|
3647
|
+
let F = this._curveFocus !== "reel" && (this._curve !== void 0 || this._curvePerReel !== void 0);
|
|
3648
|
+
!this._maskStrategyExplicit && F && (this._maskStrategy = new ie(), ve("mask-auto-shared", `auto-selected SharedRectMaskStrategy because curveFocus('${this._curveFocus}') leans cells across their own reel column. Pass .maskStrategy(...) explicitly to override.`)), this._curveMode === "warp" && this._curve !== void 0 && P && ve("warp-skips-unmask", "curveMode('warp') does not bend symbols with `unmask: true`. They are lifted into `viewport.unmaskedContainer`, outside the reel texture, so they render FLAT above a curved board. The same applies to the win spotlight and pin overlays. Use curveMode('symbol') if those have to follow the drum.");
|
|
3649
|
+
let I = m[this._curveFocus], oe = A / 2, L = new ae(j, M, void 0, this._maskStrategy, c, this._curveMode === "warp" ? this._curveBleed : 0);
|
|
3512
3650
|
if (this._initialFrame) {
|
|
3513
3651
|
let t = Array(e).fill(r), n = Array(e).fill(i);
|
|
3514
3652
|
te(this._initialFrame, t, n, "initialFrame");
|
|
3515
3653
|
}
|
|
3516
|
-
let
|
|
3654
|
+
let R = [], z = [];
|
|
3517
3655
|
for (let t = 0; t < e; t++) {
|
|
3518
3656
|
let e = h[t], n = c.toScreen(d, S[t]), o = k.build(t, e, r, i, this._initialFrame?.[t]), s = new re({
|
|
3519
3657
|
reelIndex: t,
|
|
@@ -3534,24 +3672,24 @@ var Oe = class extends I {
|
|
|
3534
3672
|
curveRenderer: this._curveMode === "warp" ? this._renderer : void 0,
|
|
3535
3673
|
curveTicker: this._curveMode === "warp" ? a : void 0,
|
|
3536
3674
|
curveBleed: this._curveBleed,
|
|
3537
|
-
curveFocus:
|
|
3675
|
+
curveFocus: I === 0 ? void 0 : d / 2 + I * (oe - t * (d + p) - d / 2),
|
|
3538
3676
|
cellStacking: this._cellStacking,
|
|
3539
3677
|
reelStacking: this._reelStacking,
|
|
3540
3678
|
gsap: this._gsap
|
|
3541
|
-
}, D, O,
|
|
3542
|
-
|
|
3679
|
+
}, D, O, L);
|
|
3680
|
+
R.push(s);
|
|
3543
3681
|
let l = c.toScreen(t * (d + p), y[t]), f = c.toScreen(d, _[t]);
|
|
3544
|
-
|
|
3682
|
+
z.push({
|
|
3545
3683
|
x: l.x,
|
|
3546
3684
|
y: l.y,
|
|
3547
3685
|
width: f.x,
|
|
3548
3686
|
height: f.y
|
|
3549
3687
|
});
|
|
3550
3688
|
}
|
|
3551
|
-
return
|
|
3689
|
+
return L.updateMaskSize(j, M, z), new Te({
|
|
3552
3690
|
config: w,
|
|
3553
|
-
reels:
|
|
3554
|
-
viewport:
|
|
3691
|
+
reels: R,
|
|
3692
|
+
viewport: L,
|
|
3555
3693
|
symbolFactory: D,
|
|
3556
3694
|
frameBuilder: k,
|
|
3557
3695
|
phaseFactory: this._phaseFactory,
|
|
@@ -3588,7 +3726,7 @@ var Oe = class extends I {
|
|
|
3588
3726
|
}
|
|
3589
3727
|
if (this._visibleCells !== void 0 && this._visibleCells <= 0 && e.push("visibleCells() must be called with a positive number."), (this._symbolWidth === void 0 || this._symbolHeight === void 0) && e.push("symbolSize() must be called with width and height."), this._symbolRegistry.size === 0 && e.push("symbols() must register at least one symbol."), this._ticker || e.push("ticker() must be called with a PixiJS Ticker."), this._speeds.size > 0 && !this._speeds.has(this._initialSpeed) && e.push(`initialSpeed '${this._initialSpeed}' does not match any registered speed profile. Available: ${[...this._speeds.keys()].join(", ")}`), e.length > 0) throw Error(`ReelSetBuilder validation failed:\n - ${e.join("\n - ")}`);
|
|
3590
3728
|
}
|
|
3591
|
-
},
|
|
3729
|
+
}, qe = [
|
|
3592
3730
|
"mask",
|
|
3593
3731
|
"cells",
|
|
3594
3732
|
"buffers",
|
|
@@ -3599,7 +3737,7 @@ var Oe = class extends I {
|
|
|
3599
3737
|
"blocks",
|
|
3600
3738
|
"pins",
|
|
3601
3739
|
"hud"
|
|
3602
|
-
],
|
|
3740
|
+
], J = {
|
|
3603
3741
|
mask: 16726832,
|
|
3604
3742
|
cells: 3321318,
|
|
3605
3743
|
buffers: 16749824,
|
|
@@ -3610,14 +3748,14 @@ var Oe = class extends I {
|
|
|
3610
3748
|
blocks: 16763904,
|
|
3611
3749
|
pins: 11490014,
|
|
3612
3750
|
hud: 16777215
|
|
3613
|
-
},
|
|
3614
|
-
function
|
|
3615
|
-
return e === void 0 || e === "all" ? new Set(
|
|
3751
|
+
}, Je = "pixi-reels:debugOverlay", Ye = 3458905, Xe = 3458905, Ze = 10, Qe = 11, Y = 4, $e = 0, et = .7, tt = .62;
|
|
3752
|
+
function nt(e) {
|
|
3753
|
+
return e === void 0 || e === "all" ? new Set(qe) : new Set(e);
|
|
3616
3754
|
}
|
|
3617
|
-
function
|
|
3618
|
-
return new
|
|
3755
|
+
function rt(e, t = {}) {
|
|
3756
|
+
return new it(e, t);
|
|
3619
3757
|
}
|
|
3620
|
-
var
|
|
3758
|
+
var it = class {
|
|
3621
3759
|
_root = new n();
|
|
3622
3760
|
_graphics = /* @__PURE__ */ new Map();
|
|
3623
3761
|
_cellLabels = [];
|
|
@@ -3629,7 +3767,7 @@ var Ue = class {
|
|
|
3629
3767
|
_reelDetach = [];
|
|
3630
3768
|
_onStatic = () => this._redrawStatic();
|
|
3631
3769
|
constructor(e, t) {
|
|
3632
|
-
if (this._reelSet = e, this._active =
|
|
3770
|
+
if (this._reelSet = e, this._active = nt(t.layers), this._phase = e.reels.map(() => "idle"), this._root.zIndex = 1e6, this._root.eventMode = "none", this._root.label = Je, e.addChild(this._root), e.reels.forEach((e, t) => {
|
|
3633
3771
|
let n = (e) => {
|
|
3634
3772
|
this._phase[t] = e;
|
|
3635
3773
|
}, r = (e) => {
|
|
@@ -3649,7 +3787,7 @@ var Ue = class {
|
|
|
3649
3787
|
}
|
|
3650
3788
|
setLayers(e) {
|
|
3651
3789
|
if (!this._isDestroyed) {
|
|
3652
|
-
this._active =
|
|
3790
|
+
this._active = nt(e);
|
|
3653
3791
|
for (let [e, t] of this._graphics) this._active.has(e) ? t.visible = !0 : (t.clear(), t.visible = !1);
|
|
3654
3792
|
this._active.has("cells") || this._hideTextsFrom(this._cellLabels, 0), this._active.has("hud") || this._hideTextsFrom(this._hudTexts, 0), this.redraw();
|
|
3655
3793
|
}
|
|
@@ -3694,7 +3832,7 @@ var Ue = class {
|
|
|
3694
3832
|
}
|
|
3695
3833
|
_layer(e) {
|
|
3696
3834
|
let t = this._graphics.get(e);
|
|
3697
|
-
return t || (t = new r(), t.label = `${
|
|
3835
|
+
return t || (t = new r(), t.label = `${Je}:${e}`, this._graphics.set(e, t), this._root.addChild(t)), t.visible = !0, t.clear(), t;
|
|
3698
3836
|
}
|
|
3699
3837
|
_text(e, t, n, r) {
|
|
3700
3838
|
let i = e[t];
|
|
@@ -3713,11 +3851,11 @@ var Ue = class {
|
|
|
3713
3851
|
_drawMask() {
|
|
3714
3852
|
let e = this._layer("mask"), t = this._reelSet.viewport, n = t.x, r = t.y;
|
|
3715
3853
|
e.rect(n, r, t.maskWidth, t.maskHeight).stroke({
|
|
3716
|
-
color:
|
|
3854
|
+
color: J.mask,
|
|
3717
3855
|
width: 2
|
|
3718
3856
|
});
|
|
3719
3857
|
for (let i of t.maskRects) e.rect(n + i.x, r + i.y, i.width, i.height).stroke({
|
|
3720
|
-
color:
|
|
3858
|
+
color: Ye,
|
|
3721
3859
|
width: 2
|
|
3722
3860
|
});
|
|
3723
3861
|
}
|
|
@@ -3727,13 +3865,13 @@ var Ue = class {
|
|
|
3727
3865
|
for (let i = 0; i < n.visibleCells; i++) {
|
|
3728
3866
|
let n = this._reelSet.getCellBounds(r, i), a = this._reelSet.getCellQuad(r, i);
|
|
3729
3867
|
a ? e.poly(a).stroke({
|
|
3730
|
-
color:
|
|
3868
|
+
color: J.cells,
|
|
3731
3869
|
width: 1
|
|
3732
3870
|
}) : e.rect(n.x, n.y, n.width, n.height).stroke({
|
|
3733
|
-
color:
|
|
3871
|
+
color: J.cells,
|
|
3734
3872
|
width: 1
|
|
3735
3873
|
});
|
|
3736
|
-
let o = this._text(this._cellLabels, t++,
|
|
3874
|
+
let o = this._text(this._cellLabels, t++, J.cells, 10);
|
|
3737
3875
|
o.text = `${r},${i}`, o.x = (a ? a[0].x : n.x) + 3, o.y = (a ? a[0].y : n.y) + 3;
|
|
3738
3876
|
}
|
|
3739
3877
|
}), this._hideTextsFrom(this._cellLabels, t);
|
|
@@ -3744,7 +3882,7 @@ var Ue = class {
|
|
|
3744
3882
|
let n = t.motion.slotPitch, r = (n) => {
|
|
3745
3883
|
let r = t.curve, i = r ? r.mapMain(n) : n, a = r ? r.mapMain(n + t.cellMain) : n + t.cellMain, o = r ? t.cellCross * r.scaleAt(n + t.cellMain / 2) : t.cellCross, s = this._reelRect(t, (t.cellCross - o) / 2, i, o, a - i);
|
|
3746
3884
|
e.rect(s.x, s.y, s.width, s.height).stroke({
|
|
3747
|
-
color:
|
|
3885
|
+
color: J.buffers,
|
|
3748
3886
|
width: 1,
|
|
3749
3887
|
alpha: .45
|
|
3750
3888
|
});
|
|
@@ -3785,14 +3923,14 @@ var Ue = class {
|
|
|
3785
3923
|
for (let t of this._reelSet.reels) {
|
|
3786
3924
|
let n = t.visibleCells * t.motion.slotPitch, r = t.cellCross / 2, { fromMain: i, toMain: a } = this._arrowMains(t), o = t.axis.polarity > 0, s = this._reelPoint(t, r, i), c = this._reelPoint(t, r, a);
|
|
3787
3925
|
e.moveTo(s.x, s.y).lineTo(c.x, c.y).stroke({
|
|
3788
|
-
color:
|
|
3926
|
+
color: J.axis,
|
|
3789
3927
|
width: 3
|
|
3790
3928
|
});
|
|
3791
3929
|
let l = Math.min(n * .12, t.cellCross * .4) || 8, u = a - (o ? l : -l);
|
|
3792
3930
|
for (let n of [-1, 1]) {
|
|
3793
3931
|
let i = this._reelPoint(t, r + n * l * .6, u);
|
|
3794
3932
|
e.moveTo(c.x, c.y).lineTo(i.x, i.y).stroke({
|
|
3795
|
-
color:
|
|
3933
|
+
color: J.axis,
|
|
3796
3934
|
width: 3
|
|
3797
3935
|
});
|
|
3798
3936
|
}
|
|
@@ -3803,7 +3941,7 @@ var Ue = class {
|
|
|
3803
3941
|
for (let t of this._reelSet.reels) {
|
|
3804
3942
|
let n = t.motion.slotPitch, r = this._reelRect(t, 0, this._feedMain(t), t.cellCross, n * .18);
|
|
3805
3943
|
e.rect(r.x, r.y, r.width, r.height).fill({
|
|
3806
|
-
color:
|
|
3944
|
+
color: J.feed,
|
|
3807
3945
|
alpha: .55
|
|
3808
3946
|
});
|
|
3809
3947
|
}
|
|
@@ -3815,7 +3953,7 @@ var Ue = class {
|
|
|
3815
3953
|
for (let n of r) {
|
|
3816
3954
|
let r = this._reelPoint(t, 0, n), i = this._reelPoint(t, t.cellCross, n);
|
|
3817
3955
|
e.moveTo(r.x, r.y).lineTo(i.x, i.y).stroke({
|
|
3818
|
-
color:
|
|
3956
|
+
color: J.thresholds,
|
|
3819
3957
|
width: 2,
|
|
3820
3958
|
alpha: .9
|
|
3821
3959
|
});
|
|
@@ -3834,7 +3972,7 @@ var Ue = class {
|
|
|
3834
3972
|
y: r.y + r.height
|
|
3835
3973
|
});
|
|
3836
3974
|
e.rect(i.x, i.y, a.x - i.x, a.y - i.y).stroke({
|
|
3837
|
-
color:
|
|
3975
|
+
color: J.bounds,
|
|
3838
3976
|
width: 1
|
|
3839
3977
|
});
|
|
3840
3978
|
}
|
|
@@ -3848,7 +3986,7 @@ var Ue = class {
|
|
|
3848
3986
|
if (t.size.reels <= 1 && t.size.cells <= 1 || t.anchor.reel !== n || t.anchor.cell !== r) continue;
|
|
3849
3987
|
let i = this._reelSet.getBlockBounds(n, r);
|
|
3850
3988
|
e.rect(i.x, i.y, i.width, i.height).stroke({
|
|
3851
|
-
color:
|
|
3989
|
+
color: J.blocks,
|
|
3852
3990
|
width: 3
|
|
3853
3991
|
});
|
|
3854
3992
|
}
|
|
@@ -3861,10 +3999,10 @@ var Ue = class {
|
|
|
3861
3999
|
if (!this._reelSet.getPin(n, r)) continue;
|
|
3862
4000
|
let t = this._reelSet.getCellBounds(n, r);
|
|
3863
4001
|
e.rect(t.x, t.y, t.width, t.height).stroke({
|
|
3864
|
-
color:
|
|
4002
|
+
color: J.pins,
|
|
3865
4003
|
width: 3
|
|
3866
4004
|
}), e.moveTo(t.x, t.y).lineTo(t.x + t.width, t.y + t.height).moveTo(t.x + t.width, t.y).lineTo(t.x, t.y + t.height).stroke({
|
|
3867
|
-
color:
|
|
4005
|
+
color: Xe,
|
|
3868
4006
|
width: 1,
|
|
3869
4007
|
alpha: .8
|
|
3870
4008
|
});
|
|
@@ -3872,21 +4010,21 @@ var Ue = class {
|
|
|
3872
4010
|
});
|
|
3873
4011
|
}
|
|
3874
4012
|
_drawHud() {
|
|
3875
|
-
let e = this._layer("hud"), t = this._reelSet.viewport, n = t.x +
|
|
4013
|
+
let e = this._layer("hud"), t = this._reelSet.viewport, n = t.x + Y, r = t.y + Y, i = 0, a = 0;
|
|
3876
4014
|
this._reelSet.reels.forEach((e, t) => {
|
|
3877
|
-
let o = this._text(this._hudTexts, i,
|
|
4015
|
+
let o = this._text(this._hudTexts, i, J.hud, Ze);
|
|
3878
4016
|
o.resolution !== 1 && (o.resolution = 1);
|
|
3879
4017
|
let s = e.axis;
|
|
3880
|
-
o.text = `r${t} ${s.orientation === "vertical" ? "V" : "H"}${s.direction === "forward" ? "F" : "R"} feed=${s.feedEdge} spd=${e.speed.toFixed(1)} ${this._phase[t]} cells=${e.visibleCells}`, o.x = n, o.y = r + i *
|
|
3881
|
-
}), this._hideTextsFrom(this._hudTexts, i), i > 0 && e.rect(n -
|
|
3882
|
-
color:
|
|
3883
|
-
alpha:
|
|
4018
|
+
o.text = `r${t} ${s.orientation === "vertical" ? "V" : "H"}${s.direction === "forward" ? "F" : "R"} feed=${s.feedEdge} spd=${e.speed.toFixed(1)} ${this._phase[t]} cells=${e.visibleCells}`, o.x = n, o.y = r + i * Qe, a = Math.max(a, o.text.length), i++;
|
|
4019
|
+
}), this._hideTextsFrom(this._hudTexts, i), i > 0 && e.rect(n - Y, r - Y, a * Ze * tt + Y * 2, i * Qe + Y * 2).fill({
|
|
4020
|
+
color: $e,
|
|
4021
|
+
alpha: et
|
|
3884
4022
|
});
|
|
3885
4023
|
}
|
|
3886
4024
|
};
|
|
3887
4025
|
//#endregion
|
|
3888
4026
|
//#region src/debug/debug.ts
|
|
3889
|
-
function
|
|
4027
|
+
function X(e) {
|
|
3890
4028
|
let t = e.reels, n = t.map((e, t) => ({
|
|
3891
4029
|
index: t,
|
|
3892
4030
|
speed: e.speed,
|
|
@@ -3912,8 +4050,8 @@ function Z(e) {
|
|
|
3912
4050
|
grid: r
|
|
3913
4051
|
};
|
|
3914
4052
|
}
|
|
3915
|
-
function
|
|
3916
|
-
let { grid: t, visibleCells: n } =
|
|
4053
|
+
function Z(e) {
|
|
4054
|
+
let { grid: t, visibleCells: n } = X(e);
|
|
3917
4055
|
if (t.length === 0) return "(empty grid)";
|
|
3918
4056
|
let r = Math.max(...n), i = (e) => e.slice(0, 8).padEnd(8), a = " ".repeat(8), o = (e, n, r) => e + t.map(() => "─".repeat(8)).join(n) + r, s = [];
|
|
3919
4057
|
s.push(o("┌", "┬", "┐"));
|
|
@@ -3923,39 +4061,39 @@ function We(e) {
|
|
|
3923
4061
|
}
|
|
3924
4062
|
return s.push(o("└", "┴", "┘")), s.join("\n");
|
|
3925
4063
|
}
|
|
3926
|
-
var
|
|
3927
|
-
function
|
|
3928
|
-
$(e), n.maxFrames !== void 0 && n.maxFrames > 0 && (
|
|
4064
|
+
var at = 1e3, Q = [], ot = at, st = /* @__PURE__ */ new WeakMap();
|
|
4065
|
+
function ct(e, t = "default", n = {}) {
|
|
4066
|
+
$(e), n.maxFrames !== void 0 && n.maxFrames > 0 && (ot = n.maxFrames);
|
|
3929
4067
|
let r = (n) => {
|
|
3930
4068
|
Q.push({
|
|
3931
4069
|
tag: t,
|
|
3932
4070
|
trigger: n,
|
|
3933
|
-
snapshot:
|
|
3934
|
-
}), Q.length >
|
|
4071
|
+
snapshot: X(e)
|
|
4072
|
+
}), Q.length > ot && Q.splice(0, Q.length - ot);
|
|
3935
4073
|
}, i = () => r("spin:start"), a = () => r("spin:reelLanded"), o = () => r("spin:allLanded"), s = () => r("spin:complete"), c = () => $(e);
|
|
3936
|
-
e.events.on("spin:start", i), e.events.on("spin:reelLanded", a), e.events.on("spin:allLanded", o), e.events.on("spin:complete", s), e.events.on("destroyed", c),
|
|
4074
|
+
e.events.on("spin:start", i), e.events.on("spin:reelLanded", a), e.events.on("spin:allLanded", o), e.events.on("spin:complete", s), e.events.on("destroyed", c), st.set(e, () => {
|
|
3937
4075
|
e.events.off("spin:start", i), e.events.off("spin:reelLanded", a), e.events.off("spin:allLanded", o), e.events.off("spin:complete", s), e.events.off("destroyed", c);
|
|
3938
4076
|
});
|
|
3939
4077
|
}
|
|
3940
4078
|
function $(e) {
|
|
3941
|
-
let t =
|
|
3942
|
-
t && (t(),
|
|
4079
|
+
let t = st.get(e);
|
|
4080
|
+
t && (t(), st.delete(e));
|
|
3943
4081
|
}
|
|
3944
|
-
function
|
|
4082
|
+
function lt(e) {
|
|
3945
4083
|
return e === void 0 ? Q.slice() : Q.filter((t) => t.tag === e);
|
|
3946
4084
|
}
|
|
3947
|
-
function
|
|
4085
|
+
function ut() {
|
|
3948
4086
|
Q.length = 0;
|
|
3949
4087
|
}
|
|
3950
|
-
function
|
|
4088
|
+
function dt(e, t) {
|
|
3951
4089
|
if (typeof window > "u") return;
|
|
3952
4090
|
let n = null, i = {
|
|
3953
4091
|
reelSet: e,
|
|
3954
|
-
snapshot: () =>
|
|
3955
|
-
grid: () =>
|
|
4092
|
+
snapshot: () => X(e),
|
|
4093
|
+
grid: () => Z(e),
|
|
3956
4094
|
log: () => {
|
|
3957
|
-
let t =
|
|
3958
|
-
return console.log(`[pixi-reels debug] spinning=${t.isSpinning} speed=${t.currentSpeed}`), console.log(
|
|
4095
|
+
let t = X(e);
|
|
4096
|
+
return console.log(`[pixi-reels debug] spinning=${t.isSpinning} speed=${t.currentSpeed}`), console.log(Z(e)), t;
|
|
3959
4097
|
},
|
|
3960
4098
|
trace: () => {
|
|
3961
4099
|
for (let t of [
|
|
@@ -3983,10 +4121,10 @@ function Ze(e, t) {
|
|
|
3983
4121
|
});
|
|
3984
4122
|
console.log("[pixi-reels debug] tracing enabled for all events");
|
|
3985
4123
|
},
|
|
3986
|
-
startRecording: (t = "default", n) =>
|
|
4124
|
+
startRecording: (t = "default", n) => ct(e, t, n),
|
|
3987
4125
|
stopRecording: () => $(e),
|
|
3988
|
-
getFrames: (e) =>
|
|
3989
|
-
clearFrames: () =>
|
|
4126
|
+
getFrames: (e) => lt(e),
|
|
4127
|
+
clearFrames: () => ut(),
|
|
3990
4128
|
showMask: (t) => {
|
|
3991
4129
|
if (t) {
|
|
3992
4130
|
if (n) return;
|
|
@@ -4002,11 +4140,11 @@ function Ze(e, t) {
|
|
|
4002
4140
|
e.viewport.unmaskedContainer.addChild(t), n = t;
|
|
4003
4141
|
} else n &&= (e.viewport.unmaskedContainer.removeChild(n), n.destroy(), null);
|
|
4004
4142
|
},
|
|
4005
|
-
overlay: (t) =>
|
|
4143
|
+
overlay: (t) => rt(e, t)
|
|
4006
4144
|
}, a = window, o = a.__PIXI_REELS_DEBUG_INSTANCES ??= {}, s = t ?? `reelset_${Object.keys(o).length}`;
|
|
4007
4145
|
o[s] = i, a.__PIXI_REELS_DEBUG = i, console.log(`[pixi-reels] Debug mode enabled (key "${s}"). Use __PIXI_REELS_DEBUG.log() or __PIXI_REELS_DEBUG_INSTANCES["${s}"].`);
|
|
4008
4146
|
}
|
|
4009
4147
|
//#endregion
|
|
4010
|
-
export {
|
|
4148
|
+
export { R as A, A as B, H as C, ge as D, ue as E, N as F, C as G, E as H, P as I, b as J, x as K, ae as L, oe as M, I as N, le as O, F as P, c as Q, ie as R, Te as S, be as T, w as U, D as V, T as W, d as X, v as Y, u as Z, Me as _, lt as a, Ee as b, Je as c, Ge as d, We as f, Re as g, Ve as h, dt as i, L as j, z as k, rt as l, He as m, Z as n, ct as o, Ue as p, m as q, X as r, $ as s, ut as t, Ke as u, Oe as v, xe as w, q as x, De as y, re as z };
|
|
4011
4149
|
|
|
4012
|
-
//# sourceMappingURL=debug-
|
|
4150
|
+
//# sourceMappingURL=debug-BwsaPR3I.js.map
|