@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
@@ -1708,6 +1708,24 @@ var _GameStepManager = class _GameStepManager {
1708
1708
  return yield _GameStepManager.runCurrentStep(props);
1709
1709
  });
1710
1710
  }
1711
+ /**
1712
+ * When the player is in a choice menu, can use this function to exit to the choice menu.
1713
+ * @param props The props to pass to the step.
1714
+ * @returns StepLabelResultType or undefined.
1715
+ * @example
1716
+ * ```typescript
1717
+ * GameStepManager.exitToChoiceMenu(yourParams).then((result) => {
1718
+ * if (result) {
1719
+ * // your code
1720
+ * }
1721
+ * })
1722
+ * ```
1723
+ */
1724
+ static exitToChoiceMenu(props) {
1725
+ return __async(this, null, function* () {
1726
+ return _GameStepManager.runNextStep(props);
1727
+ });
1728
+ }
1711
1729
  /* After Update Methods */
1712
1730
  // /**
1713
1731
  // * After the update or code edit, some steps or labels may no longer match.
@@ -1900,6 +1918,9 @@ _GameStepManager._openedLabels = [];
1900
1918
  _GameStepManager._originalStepData = void 0;
1901
1919
  var GameStepManager = _GameStepManager;
1902
1920
 
1921
+ // src/types/CloseType.ts
1922
+ var Close = "close";
1923
+
1903
1924
  // src/classes/ChoiceMenuOption.ts
1904
1925
  var ChoiceMenuOptionClose = class {
1905
1926
  /**
@@ -1910,6 +1931,14 @@ var ChoiceMenuOptionClose = class {
1910
1931
  * Label to be opened when the option is selected
1911
1932
  */
1912
1933
  this.label = new CloseLabel();
1934
+ /**
1935
+ * Type of the label to be opened
1936
+ */
1937
+ this.type = Close;
1938
+ /**
1939
+ * Properties to be passed to the label
1940
+ */
1941
+ this.props = {};
1913
1942
  this.text = text;
1914
1943
  }
1915
1944
  };
@@ -1960,9 +1989,6 @@ var DialogueBaseModel2 = class {
1960
1989
  }
1961
1990
  };
1962
1991
 
1963
- // src/types/CloseType.ts
1964
- var Close = "close";
1965
-
1966
1992
  // src/functions/DialogueUtility.ts
1967
1993
  function setDialogue(props) {
1968
1994
  let text = "";
@@ -2018,7 +2044,9 @@ function getChoiceMenuOptions() {
2018
2044
  itemLabel.choiseIndex = index;
2019
2045
  options.push({
2020
2046
  text: option.text,
2021
- label: itemLabel
2047
+ label: itemLabel,
2048
+ type: Close,
2049
+ props: {}
2022
2050
  });
2023
2051
  return;
2024
2052
  }
@@ -2043,28 +2071,30 @@ function getDialogueHistory() {
2043
2071
  GameStepManager.stepsHistory.forEach((step) => {
2044
2072
  let dialoge = step.dialoge;
2045
2073
  let requiredChoices = step.choices;
2046
- if (list.length > 0 && list[list.length - 1].choices && !list[list.length - 1].choiceMade && step.currentLabel) {
2074
+ if (list.length > 0 && list[list.length - 1].choices && !list[list.length - 1].playerMadeChoice && step.currentLabel) {
2047
2075
  let oldChoices = list[list.length - 1].choices;
2048
2076
  if (oldChoices) {
2049
- let choiceMade = void 0;
2077
+ let choiceMade = false;
2050
2078
  if (step.choiceIndexMade !== void 0 && oldChoices.length > step.choiceIndexMade) {
2051
- choiceMade = oldChoices[step.choiceIndexMade];
2052
- } else {
2053
- choiceMade = oldChoices.find((choice) => {
2054
- if (choice.type === Close) {
2055
- return false;
2056
- }
2057
- return choice.label === step.currentLabel;
2058
- });
2079
+ oldChoices[step.choiceIndexMade].isMadeChoice = true;
2080
+ choiceMade = true;
2059
2081
  }
2060
- list[list.length - 1].choiceMade = choiceMade;
2082
+ list[list.length - 1].playerMadeChoice = choiceMade;
2083
+ list[list.length - 1].choices = oldChoices;
2061
2084
  }
2062
2085
  }
2063
2086
  if (dialoge || requiredChoices) {
2087
+ let choices = requiredChoices == null ? void 0 : requiredChoices.map((choice) => {
2088
+ return {
2089
+ text: choice.text,
2090
+ type: choice.type,
2091
+ isMadeChoice: false
2092
+ };
2093
+ });
2064
2094
  list.push({
2065
2095
  dialoge,
2066
- choiceMade: void 0,
2067
- choices: requiredChoices,
2096
+ playerMadeChoice: false,
2097
+ choices,
2068
2098
  stepIndex: step.index
2069
2099
  });
2070
2100
  }
@@ -2320,7 +2350,7 @@ function showWithDissolveTransition(tag, image, speed, priority) {
2320
2350
  }
2321
2351
 
2322
2352
  // src/constants.ts
2323
- var PIXIVN_VERSION = "0.5.0";
2353
+ var PIXIVN_VERSION = "0.5.2";
2324
2354
 
2325
2355
  // src/functions/SavesUtility.ts
2326
2356
  function getSaveData() {