@drincs/pixi-vn 0.5.0 → 0.5.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.
Files changed (67) hide show
  1. package/dist/classes/CharacterBaseModel.js +6 -6
  2. package/dist/classes/CharacterBaseModel.js.map +1 -1
  3. package/dist/classes/CharacterBaseModel.mjs +6 -6
  4. package/dist/classes/CharacterBaseModel.mjs.map +1 -1
  5. package/dist/classes/ChoiceMenuOption.d.mts +17 -4
  6. package/dist/classes/ChoiceMenuOption.d.ts +17 -4
  7. package/dist/classes/ChoiceMenuOption.js +10 -1
  8. package/dist/classes/ChoiceMenuOption.js.map +1 -1
  9. package/dist/classes/ChoiceMenuOption.mjs +10 -1
  10. package/dist/classes/ChoiceMenuOption.mjs.map +1 -1
  11. package/dist/classes/StoredClassModel.js.map +1 -1
  12. package/dist/classes/StoredClassModel.mjs.map +1 -1
  13. package/dist/classes/index.js +6 -6
  14. package/dist/classes/index.js.map +1 -1
  15. package/dist/classes/index.mjs +6 -6
  16. package/dist/classes/index.mjs.map +1 -1
  17. package/dist/classes/ticker/TickerFadeAlpha.js.map +1 -1
  18. package/dist/classes/ticker/TickerFadeAlpha.mjs.map +1 -1
  19. package/dist/classes/ticker/TickerMove.js.map +1 -1
  20. package/dist/classes/ticker/TickerMove.mjs.map +1 -1
  21. package/dist/classes/ticker/TickerRotate.js.map +1 -1
  22. package/dist/classes/ticker/TickerRotate.mjs.map +1 -1
  23. package/dist/classes/ticker/index.js.map +1 -1
  24. package/dist/classes/ticker/index.mjs.map +1 -1
  25. package/dist/constants.d.mts +1 -1
  26. package/dist/constants.d.ts +1 -1
  27. package/dist/constants.js +1 -1
  28. package/dist/constants.js.map +1 -1
  29. package/dist/constants.mjs +1 -1
  30. package/dist/constants.mjs.map +1 -1
  31. package/dist/functions/DialogueUtility.js +47 -17
  32. package/dist/functions/DialogueUtility.js.map +1 -1
  33. package/dist/functions/DialogueUtility.mjs +47 -17
  34. package/dist/functions/DialogueUtility.mjs.map +1 -1
  35. package/dist/functions/FlagsUtility.js.map +1 -1
  36. package/dist/functions/FlagsUtility.mjs.map +1 -1
  37. package/dist/functions/GameUtility.js.map +1 -1
  38. package/dist/functions/GameUtility.mjs.map +1 -1
  39. package/dist/functions/ImageUtility.js.map +1 -1
  40. package/dist/functions/ImageUtility.mjs.map +1 -1
  41. package/dist/functions/SavesUtility.js +25 -7
  42. package/dist/functions/SavesUtility.js.map +1 -1
  43. package/dist/functions/SavesUtility.mjs +25 -7
  44. package/dist/functions/SavesUtility.mjs.map +1 -1
  45. package/dist/functions/index.js +48 -18
  46. package/dist/functions/index.js.map +1 -1
  47. package/dist/functions/index.mjs +48 -18
  48. package/dist/functions/index.mjs.map +1 -1
  49. package/dist/index.js +60 -30
  50. package/dist/index.js.map +1 -1
  51. package/dist/index.mjs +60 -30
  52. package/dist/index.mjs.map +1 -1
  53. package/dist/interface/IDialogueHistory.d.mts +4 -4
  54. package/dist/interface/IDialogueHistory.d.ts +4 -4
  55. package/dist/interface/IHistoryStep.d.mts +2 -2
  56. package/dist/interface/IHistoryStep.d.ts +2 -2
  57. package/dist/managers/StepManager.d.mts +14 -0
  58. package/dist/managers/StepManager.d.ts +14 -0
  59. package/dist/managers/StepManager.js +18 -0
  60. package/dist/managers/StepManager.js.map +1 -1
  61. package/dist/managers/StepManager.mjs +18 -0
  62. package/dist/managers/StepManager.mjs.map +1 -1
  63. package/dist/managers/index.js +24 -6
  64. package/dist/managers/index.js.map +1 -1
  65. package/dist/managers/index.mjs +24 -6
  66. package/dist/managers/index.mjs.map +1 -1
  67. package/package.json +1 -1
@@ -1702,6 +1702,24 @@ var _GameStepManager = class _GameStepManager {
1702
1702
  return yield _GameStepManager.runCurrentStep(props);
1703
1703
  });
1704
1704
  }
1705
+ /**
1706
+ * When the player is in a choice menu, can use this function to exit to the choice menu.
1707
+ * @param props The props to pass to the step.
1708
+ * @returns StepLabelResultType or undefined.
1709
+ * @example
1710
+ * ```typescript
1711
+ * GameStepManager.exitToChoiceMenu(yourParams).then((result) => {
1712
+ * if (result) {
1713
+ * // your code
1714
+ * }
1715
+ * })
1716
+ * ```
1717
+ */
1718
+ static exitToChoiceMenu(props) {
1719
+ return __async(this, null, function* () {
1720
+ return _GameStepManager.runNextStep(props);
1721
+ });
1722
+ }
1705
1723
  /* After Update Methods */
1706
1724
  // /**
1707
1725
  // * After the update or code edit, some steps or labels may no longer match.
@@ -1894,6 +1912,9 @@ _GameStepManager._openedLabels = [];
1894
1912
  _GameStepManager._originalStepData = void 0;
1895
1913
  var GameStepManager = _GameStepManager;
1896
1914
 
1915
+ // src/types/CloseType.ts
1916
+ var Close = "close";
1917
+
1897
1918
  // src/classes/ChoiceMenuOption.ts
1898
1919
  var ChoiceMenuOptionClose = class {
1899
1920
  /**
@@ -1904,6 +1925,14 @@ var ChoiceMenuOptionClose = class {
1904
1925
  * Label to be opened when the option is selected
1905
1926
  */
1906
1927
  this.label = new CloseLabel();
1928
+ /**
1929
+ * Type of the label to be opened
1930
+ */
1931
+ this.type = Close;
1932
+ /**
1933
+ * Properties to be passed to the label
1934
+ */
1935
+ this.props = {};
1907
1936
  this.text = text;
1908
1937
  }
1909
1938
  };
@@ -1954,9 +1983,6 @@ var DialogueBaseModel2 = class {
1954
1983
  }
1955
1984
  };
1956
1985
 
1957
- // src/types/CloseType.ts
1958
- var Close = "close";
1959
-
1960
1986
  // src/functions/DialogueUtility.ts
1961
1987
  function setDialogue(props) {
1962
1988
  let text = "";
@@ -2012,7 +2038,9 @@ function getChoiceMenuOptions() {
2012
2038
  itemLabel.choiseIndex = index;
2013
2039
  options.push({
2014
2040
  text: option.text,
2015
- label: itemLabel
2041
+ label: itemLabel,
2042
+ type: Close,
2043
+ props: {}
2016
2044
  });
2017
2045
  return;
2018
2046
  }
@@ -2037,28 +2065,30 @@ function getDialogueHistory() {
2037
2065
  GameStepManager.stepsHistory.forEach((step) => {
2038
2066
  let dialoge = step.dialoge;
2039
2067
  let requiredChoices = step.choices;
2040
- if (list.length > 0 && list[list.length - 1].choices && !list[list.length - 1].choiceMade && step.currentLabel) {
2068
+ if (list.length > 0 && list[list.length - 1].choices && !list[list.length - 1].playerMadeChoice && step.currentLabel) {
2041
2069
  let oldChoices = list[list.length - 1].choices;
2042
2070
  if (oldChoices) {
2043
- let choiceMade = void 0;
2071
+ let choiceMade = false;
2044
2072
  if (step.choiceIndexMade !== void 0 && oldChoices.length > step.choiceIndexMade) {
2045
- choiceMade = oldChoices[step.choiceIndexMade];
2046
- } else {
2047
- choiceMade = oldChoices.find((choice) => {
2048
- if (choice.type === Close) {
2049
- return false;
2050
- }
2051
- return choice.label === step.currentLabel;
2052
- });
2073
+ oldChoices[step.choiceIndexMade].isMadeChoice = true;
2074
+ choiceMade = true;
2053
2075
  }
2054
- list[list.length - 1].choiceMade = choiceMade;
2076
+ list[list.length - 1].playerMadeChoice = choiceMade;
2077
+ list[list.length - 1].choices = oldChoices;
2055
2078
  }
2056
2079
  }
2057
2080
  if (dialoge || requiredChoices) {
2081
+ let choices = requiredChoices == null ? void 0 : requiredChoices.map((choice) => {
2082
+ return {
2083
+ text: choice.text,
2084
+ type: choice.type,
2085
+ isMadeChoice: false
2086
+ };
2087
+ });
2058
2088
  list.push({
2059
2089
  dialoge,
2060
- choiceMade: void 0,
2061
- choices: requiredChoices,
2090
+ playerMadeChoice: false,
2091
+ choices,
2062
2092
  stepIndex: step.index
2063
2093
  });
2064
2094
  }
@@ -2314,7 +2344,7 @@ function showWithDissolveTransition(tag, image, speed, priority) {
2314
2344
  }
2315
2345
 
2316
2346
  // src/constants.ts
2317
- var PIXIVN_VERSION = "0.5.0";
2347
+ var PIXIVN_VERSION = "0.5.2";
2318
2348
 
2319
2349
  // src/functions/SavesUtility.ts
2320
2350
  function getSaveData() {