@novely/core 0.47.0 → 0.47.2
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.global.js +31 -9
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +31 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.global.js
CHANGED
|
@@ -834,7 +834,7 @@ var Novely = (() => {
|
|
|
834
834
|
const characters = /* @__PURE__ */ new Set();
|
|
835
835
|
const audio2 = {
|
|
836
836
|
music: /* @__PURE__ */ new Set(),
|
|
837
|
-
|
|
837
|
+
sounds: /* @__PURE__ */ new Set()
|
|
838
838
|
};
|
|
839
839
|
const next = (i) => queue.slice(i + 1);
|
|
840
840
|
for (const [i, item] of queue.entries()) {
|
|
@@ -863,23 +863,35 @@ var Novely = (() => {
|
|
|
863
863
|
}
|
|
864
864
|
}
|
|
865
865
|
processedQueue.push(item);
|
|
866
|
-
} else if (action === "
|
|
866
|
+
} else if (action === "playSound") {
|
|
867
|
+
const closing = getOppositeAction(action);
|
|
868
|
+
const skip = next(i).some((item2) => {
|
|
869
|
+
if (isUserRequiredAction(item2) || isSkippedDuringRestore(item2[0])) {
|
|
870
|
+
return true;
|
|
871
|
+
}
|
|
872
|
+
const [_action, target] = item2;
|
|
873
|
+
if (target !== params[0]) {
|
|
874
|
+
return false;
|
|
875
|
+
}
|
|
876
|
+
return _action === closing || _action === action;
|
|
877
|
+
});
|
|
878
|
+
if (skip) continue;
|
|
879
|
+
audio2.sounds.add(unwrapAsset(params[0]));
|
|
880
|
+
processedQueue.push(item);
|
|
881
|
+
} else if (action === "showCharacter" || action === "playMusic" || action === "voice") {
|
|
867
882
|
const closing = getOppositeAction(action);
|
|
868
883
|
const skip = next(i).some(([_action, target]) => {
|
|
869
884
|
if (target !== params[0] && action !== "voice") {
|
|
870
885
|
return false;
|
|
871
886
|
}
|
|
872
|
-
const
|
|
873
|
-
|
|
874
|
-
return musicGonnaBePaused || soundGonnaBePaused || _action === closing || _action === action;
|
|
887
|
+
const musicWillBePaused = action === "playMusic" && _action === "pauseMusic";
|
|
888
|
+
return musicWillBePaused || _action === closing || _action === action;
|
|
875
889
|
});
|
|
876
890
|
if (skip) continue;
|
|
877
891
|
if (action === "showCharacter") {
|
|
878
892
|
characters.add(params[0]);
|
|
879
893
|
} else if (action === "playMusic") {
|
|
880
894
|
audio2.music.add(unwrapAsset(params[0]));
|
|
881
|
-
} else if (action === "playSound") {
|
|
882
|
-
audio2.sound.add(unwrapAsset(params[0]));
|
|
883
895
|
}
|
|
884
896
|
processedQueue.push(item);
|
|
885
897
|
} else if (action === "showBackground" || action === "preload") {
|
|
@@ -2727,18 +2739,28 @@ var Novely = (() => {
|
|
|
2727
2739
|
return assetPrivate(variants);
|
|
2728
2740
|
};
|
|
2729
2741
|
asset.image = (source) => {
|
|
2730
|
-
|
|
2742
|
+
if (assetPrivate.cache.has(source)) {
|
|
2743
|
+
return assetPrivate.cache.get(source);
|
|
2744
|
+
}
|
|
2745
|
+
const asset2 = {
|
|
2731
2746
|
type: "image",
|
|
2732
2747
|
source,
|
|
2733
2748
|
id: generateRandomId()
|
|
2734
2749
|
};
|
|
2750
|
+
assetPrivate.cache.set(source, asset2);
|
|
2751
|
+
return asset2;
|
|
2735
2752
|
};
|
|
2736
2753
|
asset.audio = (source) => {
|
|
2737
|
-
|
|
2754
|
+
if (assetPrivate.cache.has(source)) {
|
|
2755
|
+
return assetPrivate.cache.get(source);
|
|
2756
|
+
}
|
|
2757
|
+
const asset2 = {
|
|
2738
2758
|
type: "audio",
|
|
2739
2759
|
source,
|
|
2740
2760
|
id: generateRandomId()
|
|
2741
2761
|
};
|
|
2762
|
+
assetPrivate.cache.set(source, asset2);
|
|
2763
|
+
return asset2;
|
|
2742
2764
|
};
|
|
2743
2765
|
return __toCommonJS(src_exports);
|
|
2744
2766
|
})();
|