@novely/core 0.36.0-beta.0 → 0.36.0-beta.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.global.js +10 -5
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +10 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -988,6 +988,11 @@ var novely = ({
|
|
|
988
988
|
await Promise.allSettled(list);
|
|
989
989
|
ASSETS_TO_PRELOAD.clear();
|
|
990
990
|
};
|
|
991
|
+
const assetsToPreloadAdd = (asset) => {
|
|
992
|
+
if (!PRELOADED_ASSETS.has(asset)) {
|
|
993
|
+
ASSETS_TO_PRELOAD.add(asset);
|
|
994
|
+
}
|
|
995
|
+
};
|
|
991
996
|
const scriptBase = async (part) => {
|
|
992
997
|
Object.assign(story, flattenStory(part));
|
|
993
998
|
let loadingIsShown = false;
|
|
@@ -1018,27 +1023,27 @@ var novely = ({
|
|
|
1018
1023
|
const checkAndAddToPreloadingList = (action2, props) => {
|
|
1019
1024
|
if (action2 === "showBackground") {
|
|
1020
1025
|
if (isImageAsset(props[0])) {
|
|
1021
|
-
|
|
1026
|
+
assetsToPreloadAdd(props[0]);
|
|
1022
1027
|
}
|
|
1023
1028
|
if (props[0] && typeof props[0] === "object") {
|
|
1024
1029
|
for (const value of Object.values(props[0])) {
|
|
1025
1030
|
if (!isImageAsset(value))
|
|
1026
1031
|
continue;
|
|
1027
|
-
|
|
1032
|
+
assetsToPreloadAdd(value);
|
|
1028
1033
|
}
|
|
1029
1034
|
}
|
|
1030
1035
|
}
|
|
1031
1036
|
if (isAudioAction(action2) && isString(props[0])) {
|
|
1032
|
-
|
|
1037
|
+
assetsToPreloadAdd(props[0]);
|
|
1033
1038
|
}
|
|
1034
1039
|
if (action2 === "showCharacter" && isString(props[0]) && isString(props[1])) {
|
|
1035
1040
|
const images = characters[props[0]].emotions[props[1]];
|
|
1036
1041
|
if (Array.isArray(images)) {
|
|
1037
1042
|
for (const asset of images) {
|
|
1038
|
-
|
|
1043
|
+
assetsToPreloadAdd(asset);
|
|
1039
1044
|
}
|
|
1040
1045
|
} else {
|
|
1041
|
-
|
|
1046
|
+
assetsToPreloadAdd(images);
|
|
1042
1047
|
}
|
|
1043
1048
|
}
|
|
1044
1049
|
};
|