@drincs/pixi-vn 0.5.7 → 0.5.9

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.
Files changed (61) hide show
  1. package/dist/classes/CharacterBaseModel.js.map +1 -1
  2. package/dist/classes/CharacterBaseModel.mjs.map +1 -1
  3. package/dist/classes/ChoiceMenuOption.js.map +1 -1
  4. package/dist/classes/ChoiceMenuOption.mjs.map +1 -1
  5. package/dist/classes/StoredClassModel.js.map +1 -1
  6. package/dist/classes/StoredClassModel.mjs.map +1 -1
  7. package/dist/classes/index.js.map +1 -1
  8. package/dist/classes/index.mjs.map +1 -1
  9. package/dist/classes/ticker/TickerFadeAlpha.js.map +1 -1
  10. package/dist/classes/ticker/TickerFadeAlpha.mjs.map +1 -1
  11. package/dist/classes/ticker/TickerMove.js.map +1 -1
  12. package/dist/classes/ticker/TickerMove.mjs.map +1 -1
  13. package/dist/classes/ticker/TickerRotate.js.map +1 -1
  14. package/dist/classes/ticker/TickerRotate.mjs.map +1 -1
  15. package/dist/classes/ticker/index.js.map +1 -1
  16. package/dist/classes/ticker/index.mjs.map +1 -1
  17. package/dist/constants.d.mts +1 -1
  18. package/dist/constants.d.ts +1 -1
  19. package/dist/constants.js +1 -1
  20. package/dist/constants.js.map +1 -1
  21. package/dist/constants.mjs +1 -1
  22. package/dist/constants.mjs.map +1 -1
  23. package/dist/decorators/LabelDecorator.js.map +1 -1
  24. package/dist/decorators/LabelDecorator.mjs.map +1 -1
  25. package/dist/decorators/index.js.map +1 -1
  26. package/dist/decorators/index.mjs.map +1 -1
  27. package/dist/functions/DialogueUtility.d.mts +4 -2
  28. package/dist/functions/DialogueUtility.d.ts +4 -2
  29. package/dist/functions/DialogueUtility.js +21 -12
  30. package/dist/functions/DialogueUtility.js.map +1 -1
  31. package/dist/functions/DialogueUtility.mjs +21 -12
  32. package/dist/functions/DialogueUtility.mjs.map +1 -1
  33. package/dist/functions/FlagsUtility.js.map +1 -1
  34. package/dist/functions/FlagsUtility.mjs.map +1 -1
  35. package/dist/functions/GameUtility.js.map +1 -1
  36. package/dist/functions/GameUtility.mjs.map +1 -1
  37. package/dist/functions/ImageUtility.js.map +1 -1
  38. package/dist/functions/ImageUtility.mjs.map +1 -1
  39. package/dist/functions/SavesUtility.js +92 -13
  40. package/dist/functions/SavesUtility.js.map +1 -1
  41. package/dist/functions/SavesUtility.mjs +92 -13
  42. package/dist/functions/SavesUtility.mjs.map +1 -1
  43. package/dist/functions/index.js +22 -13
  44. package/dist/functions/index.js.map +1 -1
  45. package/dist/functions/index.mjs +22 -13
  46. package/dist/functions/index.mjs.map +1 -1
  47. package/dist/index.js +22 -13
  48. package/dist/index.js.map +1 -1
  49. package/dist/index.mjs +22 -13
  50. package/dist/index.mjs.map +1 -1
  51. package/dist/managers/StepManager.d.mts +1 -1
  52. package/dist/managers/StepManager.d.ts +1 -1
  53. package/dist/managers/StepManager.js +91 -12
  54. package/dist/managers/StepManager.js.map +1 -1
  55. package/dist/managers/StepManager.mjs +91 -12
  56. package/dist/managers/StepManager.mjs.map +1 -1
  57. package/dist/managers/index.js +91 -12
  58. package/dist/managers/index.js.map +1 -1
  59. package/dist/managers/index.mjs +91 -12
  60. package/dist/managers/index.mjs.map +1 -1
  61. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1164,7 +1164,7 @@ function showWithDissolveTransition(tag, image, speed, priority) {
1164
1164
  }
1165
1165
 
1166
1166
  // src/constants.ts
1167
- var PIXIVN_VERSION = "0.5.7";
1167
+ var PIXIVN_VERSION = "0.5.9";
1168
1168
 
1169
1169
  // src/functions/SavesUtility.ts
1170
1170
  function getSaveData() {
@@ -2142,8 +2142,8 @@ var _GameStepManager = class _GameStepManager {
2142
2142
  static runCurrentStep(props, choiseMade) {
2143
2143
  return __async(this, null, function* () {
2144
2144
  if (_GameStepManager.currentLabelId) {
2145
- let lasteStepsLength = _GameStepManager.currentLabelStepIndex;
2146
- if (lasteStepsLength === null) {
2145
+ let lastStepsLength = _GameStepManager.currentLabelStepIndex;
2146
+ if (lastStepsLength === null) {
2147
2147
  console.error("[Pixi'VN] currentLabelStepIndex is null");
2148
2148
  return;
2149
2149
  }
@@ -2153,12 +2153,12 @@ var _GameStepManager = class _GameStepManager {
2153
2153
  return;
2154
2154
  }
2155
2155
  let n = currentLabel.steps.length;
2156
- if (n > lasteStepsLength) {
2157
- let nextStep = currentLabel.steps[lasteStepsLength];
2158
- let result = yield nextStep(props);
2159
- _GameStepManager.addStepHistory(nextStep, choiseMade);
2156
+ if (n > lastStepsLength) {
2157
+ let step = currentLabel.steps[lastStepsLength];
2158
+ let result = yield step(props);
2159
+ _GameStepManager.addStepHistory(step, choiseMade);
2160
2160
  return result;
2161
- } else if (n === lasteStepsLength) {
2161
+ } else if (n === lastStepsLength) {
2162
2162
  _GameStepManager.closeCurrentLabel();
2163
2163
  return yield _GameStepManager.runNextStep(props);
2164
2164
  } else {
@@ -2203,7 +2203,8 @@ var _GameStepManager = class _GameStepManager {
2203
2203
  }
2204
2204
  try {
2205
2205
  if (labelId === CLOSE_LABEL_ID) {
2206
- return _GameStepManager.runNextStep(props);
2206
+ let closeLabel = newCloseLabel(choiseMade);
2207
+ return _GameStepManager.closeChoiceMenu(closeLabel, props);
2207
2208
  }
2208
2209
  let tempLabel = getLabelById(labelId);
2209
2210
  if (!tempLabel) {
@@ -2242,18 +2243,20 @@ var _GameStepManager = class _GameStepManager {
2242
2243
  static jumpLabel(label, props) {
2243
2244
  return __async(this, null, function* () {
2244
2245
  _GameStepManager.closeAllLabels();
2246
+ let choiseMade = void 0;
2245
2247
  let labelId;
2246
2248
  if (typeof label === "string") {
2247
2249
  labelId = label;
2248
2250
  } else {
2249
2251
  labelId = label.id;
2250
2252
  if (typeof label.choiseIndex === "number") {
2251
- label.choiseIndex;
2253
+ choiseMade = label.choiseIndex;
2252
2254
  }
2253
2255
  }
2254
2256
  try {
2255
2257
  if (labelId === CLOSE_LABEL_ID) {
2256
- return _GameStepManager.runNextStep(props);
2258
+ let closeLabel = newCloseLabel(choiseMade);
2259
+ return _GameStepManager.closeChoiceMenu(closeLabel, props);
2257
2260
  }
2258
2261
  let tempLabel = getLabelById(labelId);
2259
2262
  if (!tempLabel) {
@@ -2264,7 +2267,7 @@ var _GameStepManager = class _GameStepManager {
2264
2267
  console.error("[Pixi'VN] Error jumping label", e);
2265
2268
  return;
2266
2269
  }
2267
- return yield _GameStepManager.runCurrentStep(props);
2270
+ return yield _GameStepManager.runCurrentStep(props, choiseMade);
2268
2271
  });
2269
2272
  }
2270
2273
  /**
@@ -2280,8 +2283,14 @@ var _GameStepManager = class _GameStepManager {
2280
2283
  * })
2281
2284
  * ```
2282
2285
  */
2283
- static closeChoiceMenu(props) {
2286
+ static closeChoiceMenu(label, props) {
2284
2287
  return __async(this, null, function* () {
2288
+ let choiseMade = void 0;
2289
+ if (typeof label.choiseIndex === "number") {
2290
+ choiseMade = label.choiseIndex;
2291
+ }
2292
+ _GameStepManager.addStepHistory(() => {
2293
+ }, choiseMade);
2285
2294
  return _GameStepManager.runNextStep(props);
2286
2295
  });
2287
2296
  }