@novely/core 0.42.0 → 0.43.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/dist/index.js CHANGED
@@ -2,7 +2,6 @@
2
2
  var SKIPPED_DURING_RESTORE = /* @__PURE__ */ new Set(["dialog", "choice", "input", "vibrate", "text"]);
3
3
  var BLOCK_EXIT_STATEMENTS = /* @__PURE__ */ new Set(["choice:exit", "condition:exit", "block:exit"]);
4
4
  var BLOCK_STATEMENTS = /* @__PURE__ */ new Set(["choice", "condition", "block"]);
5
- var VIRTUAL_ACTIONS = /* @__PURE__ */ new Set(["say", "choiceExtended"]);
6
5
  var AUDIO_ACTIONS = /* @__PURE__ */ new Set([
7
6
  "playMusic",
8
7
  "stopMusic",
@@ -1186,25 +1185,23 @@ var novely = ({
1186
1185
  return renderer.actions[action2];
1187
1186
  }
1188
1187
  return (...props) => {
1189
- if (VIRTUAL_ACTIONS.has(action2)) {
1190
- if (action2 === "say") {
1191
- action2 = "dialog";
1192
- const [character] = props;
1193
- if (DEV3 && !characters[character]) {
1194
- throw new Error(`Attempt to call Say action with unknown character "${character}"`);
1195
- }
1196
- } else if (action2 === "choiceExtended") {
1197
- action2 = "choice";
1198
- const choices = props[1];
1199
- const mappedChoices = choices.map((choice) => [
1200
- choice.title,
1201
- choice.children,
1202
- choice.active,
1203
- choice.visible,
1204
- choice.image
1205
- ]);
1206
- for (let i = 0; i < mappedChoices.length; i++) {
1207
- props[i + 1] = mappedChoices[i];
1188
+ if (action2 === "say") {
1189
+ action2 = "dialog";
1190
+ const [character] = props;
1191
+ if (DEV3 && !characters[character]) {
1192
+ throw new Error(`Attempt to call Say action with unknown character "${character}"`);
1193
+ }
1194
+ } else if (action2 === "choice") {
1195
+ if (props.slice(1).every((choice) => !Array.isArray(choice))) {
1196
+ for (let i = 1; i < props.length; i++) {
1197
+ const choice = props[i];
1198
+ props[i] = [
1199
+ choice.title,
1200
+ choice.children,
1201
+ choice.active,
1202
+ choice.visible,
1203
+ choice.image
1204
+ ];
1208
1205
  }
1209
1206
  }
1210
1207
  }