@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
@@ -1613,8 +1613,8 @@ var _GameStepManager = class _GameStepManager {
1613
1613
  static runCurrentStep(props, choiseMade) {
1614
1614
  return __async(this, null, function* () {
1615
1615
  if (_GameStepManager.currentLabelId) {
1616
- let lasteStepsLength = _GameStepManager.currentLabelStepIndex;
1617
- if (lasteStepsLength === null) {
1616
+ let lastStepsLength = _GameStepManager.currentLabelStepIndex;
1617
+ if (lastStepsLength === null) {
1618
1618
  console.error("[Pixi'VN] currentLabelStepIndex is null");
1619
1619
  return;
1620
1620
  }
@@ -1624,12 +1624,12 @@ var _GameStepManager = class _GameStepManager {
1624
1624
  return;
1625
1625
  }
1626
1626
  let n = currentLabel.steps.length;
1627
- if (n > lasteStepsLength) {
1628
- let nextStep = currentLabel.steps[lasteStepsLength];
1629
- let result = yield nextStep(props);
1630
- _GameStepManager.addStepHistory(nextStep, choiseMade);
1627
+ if (n > lastStepsLength) {
1628
+ let step = currentLabel.steps[lastStepsLength];
1629
+ let result = yield step(props);
1630
+ _GameStepManager.addStepHistory(step, choiseMade);
1631
1631
  return result;
1632
- } else if (n === lasteStepsLength) {
1632
+ } else if (n === lastStepsLength) {
1633
1633
  _GameStepManager.closeCurrentLabel();
1634
1634
  return yield _GameStepManager.runNextStep(props);
1635
1635
  } else {
@@ -1674,7 +1674,8 @@ var _GameStepManager = class _GameStepManager {
1674
1674
  }
1675
1675
  try {
1676
1676
  if (labelId === CLOSE_LABEL_ID) {
1677
- return _GameStepManager.runNextStep(props);
1677
+ let closeLabel = newCloseLabel(choiseMade);
1678
+ return _GameStepManager.closeChoiceMenu(closeLabel, props);
1678
1679
  }
1679
1680
  let tempLabel = getLabelById(labelId);
1680
1681
  if (!tempLabel) {
@@ -1713,18 +1714,20 @@ var _GameStepManager = class _GameStepManager {
1713
1714
  static jumpLabel(label, props) {
1714
1715
  return __async(this, null, function* () {
1715
1716
  _GameStepManager.closeAllLabels();
1717
+ let choiseMade = void 0;
1716
1718
  let labelId;
1717
1719
  if (typeof label === "string") {
1718
1720
  labelId = label;
1719
1721
  } else {
1720
1722
  labelId = label.id;
1721
1723
  if (typeof label.choiseIndex === "number") {
1722
- label.choiseIndex;
1724
+ choiseMade = label.choiseIndex;
1723
1725
  }
1724
1726
  }
1725
1727
  try {
1726
1728
  if (labelId === CLOSE_LABEL_ID) {
1727
- return _GameStepManager.runNextStep(props);
1729
+ let closeLabel = newCloseLabel(choiseMade);
1730
+ return _GameStepManager.closeChoiceMenu(closeLabel, props);
1728
1731
  }
1729
1732
  let tempLabel = getLabelById(labelId);
1730
1733
  if (!tempLabel) {
@@ -1735,7 +1738,7 @@ var _GameStepManager = class _GameStepManager {
1735
1738
  console.error("[Pixi'VN] Error jumping label", e);
1736
1739
  return;
1737
1740
  }
1738
- return yield _GameStepManager.runCurrentStep(props);
1741
+ return yield _GameStepManager.runCurrentStep(props, choiseMade);
1739
1742
  });
1740
1743
  }
1741
1744
  /**
@@ -1751,8 +1754,14 @@ var _GameStepManager = class _GameStepManager {
1751
1754
  * })
1752
1755
  * ```
1753
1756
  */
1754
- static closeChoiceMenu(props) {
1757
+ static closeChoiceMenu(label, props) {
1755
1758
  return __async(this, null, function* () {
1759
+ let choiseMade = void 0;
1760
+ if (typeof label.choiseIndex === "number") {
1761
+ choiseMade = label.choiseIndex;
1762
+ }
1763
+ _GameStepManager.addStepHistory(() => {
1764
+ }, choiseMade);
1756
1765
  return _GameStepManager.runNextStep(props);
1757
1766
  });
1758
1767
  }
@@ -2378,7 +2387,7 @@ function showWithDissolveTransition(tag, image, speed, priority) {
2378
2387
  }
2379
2388
 
2380
2389
  // src/constants.ts
2381
- var PIXIVN_VERSION = "0.5.7";
2390
+ var PIXIVN_VERSION = "0.5.9";
2382
2391
 
2383
2392
  // src/functions/SavesUtility.ts
2384
2393
  function getSaveData() {