@novely/core 0.31.0 → 0.31.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4 -7
- package/dist/index.global.js +5 -10
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +5 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -298,7 +298,9 @@ var createQueueProcessor = (queue, options) => {
|
|
|
298
298
|
const next = (i) => queue.slice(i + 1);
|
|
299
299
|
for (const [i, item] of queue.entries()) {
|
|
300
300
|
const [action, ...params] = item;
|
|
301
|
-
|
|
301
|
+
if (isUserRequiredAction(item) && !queue.slice(0, i + 1).some((action2) => isUserRequiredAction(action2))) {
|
|
302
|
+
keep.add(action);
|
|
303
|
+
}
|
|
302
304
|
if (options.skip.has(item) && item !== options.skipPreserve) {
|
|
303
305
|
continue;
|
|
304
306
|
}
|
|
@@ -957,11 +959,10 @@ var novely = ({
|
|
|
957
959
|
const [path] = stack.value = latest;
|
|
958
960
|
renderer.ui.showScreen("game");
|
|
959
961
|
const { queue, skip, skipPreserve } = getActionsFromPath(story, path, false);
|
|
960
|
-
const
|
|
962
|
+
const { run, keep: { keep, characters: characters2, audio } } = createQueueProcessor(queue, {
|
|
961
963
|
skip,
|
|
962
964
|
skipPreserve
|
|
963
965
|
});
|
|
964
|
-
const { keep, characters: characters2, audio } = processor.keep;
|
|
965
966
|
if (previous) {
|
|
966
967
|
const { queue: prevQueue } = getActionsFromPath(story, previous[0], false);
|
|
967
968
|
for (let i = prevQueue.length - 1; i > queue.length - 1; i--) {
|
|
@@ -981,7 +982,7 @@ var novely = ({
|
|
|
981
982
|
});
|
|
982
983
|
const lastQueueItem = queue.at(-1) || [];
|
|
983
984
|
const lastQueueItemRequiresUserAction = isSkippedDuringRestore(lastQueueItem[0]) || isUserRequiredAction(lastQueueItem);
|
|
984
|
-
await
|
|
985
|
+
await run((item) => {
|
|
985
986
|
if (!latest)
|
|
986
987
|
return;
|
|
987
988
|
if (lastQueueItem === item && lastQueueItemRequiresUserAction) {
|
|
@@ -1591,12 +1592,6 @@ var novely = ({
|
|
|
1591
1592
|
* ```
|
|
1592
1593
|
*/
|
|
1593
1594
|
typeEssentials,
|
|
1594
|
-
/**
|
|
1595
|
-
* @deprecated Renamed into `templateReplace`
|
|
1596
|
-
*/
|
|
1597
|
-
unwrap(content) {
|
|
1598
|
-
return templateReplace(content);
|
|
1599
|
-
},
|
|
1600
1595
|
/**
|
|
1601
1596
|
* Replaces content inside {{braces}} with using global data
|
|
1602
1597
|
* @example
|