@drincs/pixi-vn 0.5.2 → 0.5.4

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 (142) hide show
  1. package/dist/classes/CharacterBaseModel.js +110 -112
  2. package/dist/classes/CharacterBaseModel.js.map +1 -1
  3. package/dist/classes/CharacterBaseModel.mjs +110 -112
  4. package/dist/classes/CharacterBaseModel.mjs.map +1 -1
  5. package/dist/classes/ChoiceMenuOption.d.mts +19 -7
  6. package/dist/classes/ChoiceMenuOption.d.ts +19 -7
  7. package/dist/classes/ChoiceMenuOption.js +1386 -7
  8. package/dist/classes/ChoiceMenuOption.js.map +1 -1
  9. package/dist/classes/ChoiceMenuOption.mjs +1386 -7
  10. package/dist/classes/ChoiceMenuOption.mjs.map +1 -1
  11. package/dist/classes/CloseLabel.d.mts +8 -3
  12. package/dist/classes/CloseLabel.d.ts +8 -3
  13. package/dist/classes/CloseLabel.js +44 -2
  14. package/dist/classes/CloseLabel.js.map +1 -1
  15. package/dist/classes/CloseLabel.mjs +41 -2
  16. package/dist/classes/CloseLabel.mjs.map +1 -1
  17. package/dist/classes/Label.d.mts +47 -21
  18. package/dist/classes/Label.d.ts +47 -21
  19. package/dist/classes/Label.js +36 -1
  20. package/dist/classes/Label.js.map +1 -1
  21. package/dist/classes/Label.mjs +36 -1
  22. package/dist/classes/Label.mjs.map +1 -1
  23. package/dist/classes/StoredClassModel.js +55 -57
  24. package/dist/classes/StoredClassModel.js.map +1 -1
  25. package/dist/classes/StoredClassModel.mjs +55 -57
  26. package/dist/classes/StoredClassModel.mjs.map +1 -1
  27. package/dist/classes/index.d.mts +2 -2
  28. package/dist/classes/index.d.ts +2 -2
  29. package/dist/classes/index.js +125 -73
  30. package/dist/classes/index.js.map +1 -1
  31. package/dist/classes/index.mjs +125 -73
  32. package/dist/classes/index.mjs.map +1 -1
  33. package/dist/classes/ticker/TickerFadeAlpha.js +27 -27
  34. package/dist/classes/ticker/TickerFadeAlpha.js.map +1 -1
  35. package/dist/classes/ticker/TickerFadeAlpha.mjs +27 -27
  36. package/dist/classes/ticker/TickerFadeAlpha.mjs.map +1 -1
  37. package/dist/classes/ticker/TickerMove.js +57 -55
  38. package/dist/classes/ticker/TickerMove.js.map +1 -1
  39. package/dist/classes/ticker/TickerMove.mjs +57 -55
  40. package/dist/classes/ticker/TickerMove.mjs.map +1 -1
  41. package/dist/classes/ticker/TickerRotate.js +57 -55
  42. package/dist/classes/ticker/TickerRotate.js.map +1 -1
  43. package/dist/classes/ticker/TickerRotate.mjs +57 -55
  44. package/dist/classes/ticker/TickerRotate.mjs.map +1 -1
  45. package/dist/classes/ticker/index.js +17 -17
  46. package/dist/classes/ticker/index.js.map +1 -1
  47. package/dist/classes/ticker/index.mjs +17 -17
  48. package/dist/classes/ticker/index.mjs.map +1 -1
  49. package/dist/constants.d.mts +1 -1
  50. package/dist/constants.d.ts +1 -1
  51. package/dist/constants.js +1 -1
  52. package/dist/constants.js.map +1 -1
  53. package/dist/constants.mjs +1 -1
  54. package/dist/constants.mjs.map +1 -1
  55. package/dist/decorators/LabelDecorator.d.mts +13 -20
  56. package/dist/decorators/LabelDecorator.d.ts +13 -20
  57. package/dist/decorators/LabelDecorator.js +1388 -28
  58. package/dist/decorators/LabelDecorator.js.map +1 -1
  59. package/dist/decorators/LabelDecorator.mjs +1388 -25
  60. package/dist/decorators/LabelDecorator.mjs.map +1 -1
  61. package/dist/decorators/index.d.mts +4 -4
  62. package/dist/decorators/index.d.ts +4 -4
  63. package/dist/decorators/index.js +1385 -13
  64. package/dist/decorators/index.js.map +1 -1
  65. package/dist/decorators/index.mjs +1384 -13
  66. package/dist/decorators/index.mjs.map +1 -1
  67. package/dist/functions/DialogueUtility.d.mts +7 -7
  68. package/dist/functions/DialogueUtility.d.ts +7 -7
  69. package/dist/functions/DialogueUtility.js +97 -67
  70. package/dist/functions/DialogueUtility.js.map +1 -1
  71. package/dist/functions/DialogueUtility.mjs +97 -67
  72. package/dist/functions/DialogueUtility.mjs.map +1 -1
  73. package/dist/functions/FlagsUtility.js +55 -57
  74. package/dist/functions/FlagsUtility.js.map +1 -1
  75. package/dist/functions/FlagsUtility.mjs +55 -57
  76. package/dist/functions/FlagsUtility.mjs.map +1 -1
  77. package/dist/functions/GameUtility.js +55 -57
  78. package/dist/functions/GameUtility.js.map +1 -1
  79. package/dist/functions/GameUtility.mjs +55 -57
  80. package/dist/functions/GameUtility.mjs.map +1 -1
  81. package/dist/functions/ImageUtility.js +17 -17
  82. package/dist/functions/ImageUtility.js.map +1 -1
  83. package/dist/functions/ImageUtility.mjs +17 -17
  84. package/dist/functions/ImageUtility.mjs.map +1 -1
  85. package/dist/functions/SavesUtility.d.mts +2 -2
  86. package/dist/functions/SavesUtility.d.ts +2 -2
  87. package/dist/functions/SavesUtility.js +115 -143
  88. package/dist/functions/SavesUtility.js.map +1 -1
  89. package/dist/functions/SavesUtility.mjs +115 -143
  90. package/dist/functions/SavesUtility.mjs.map +1 -1
  91. package/dist/functions/StepLabelUtility.d.mts +0 -1
  92. package/dist/functions/StepLabelUtility.d.ts +0 -1
  93. package/dist/functions/index.d.mts +4 -4
  94. package/dist/functions/index.d.ts +4 -4
  95. package/dist/functions/index.js +98 -68
  96. package/dist/functions/index.js.map +1 -1
  97. package/dist/functions/index.mjs +98 -68
  98. package/dist/functions/index.mjs.map +1 -1
  99. package/dist/index.d.mts +3 -3
  100. package/dist/index.d.ts +3 -3
  101. package/dist/index.js +361 -327
  102. package/dist/index.js.map +1 -1
  103. package/dist/index.mjs +360 -327
  104. package/dist/index.mjs.map +1 -1
  105. package/dist/interface/{IDialogueHistory.d.mts → DialogueHistory.d.mts} +5 -5
  106. package/dist/interface/{IDialogueHistory.d.ts → DialogueHistory.d.ts} +5 -5
  107. package/dist/interface/{IDialogueHistory.js → DialogueHistory.js} +1 -1
  108. package/dist/interface/DialogueHistory.mjs +3 -0
  109. package/dist/interface/IHistoryStep.d.mts +2 -2
  110. package/dist/interface/IHistoryStep.d.ts +2 -2
  111. package/dist/interface/ISaveData.d.mts +2 -2
  112. package/dist/interface/ISaveData.d.ts +2 -2
  113. package/dist/interface/export/ExportedStep.d.mts +2 -2
  114. package/dist/interface/export/ExportedStep.d.ts +2 -2
  115. package/dist/interface/export/index.d.mts +2 -2
  116. package/dist/interface/export/index.d.ts +2 -2
  117. package/dist/interface/index.d.mts +6 -6
  118. package/dist/interface/index.d.ts +6 -6
  119. package/dist/managers/StepManager.d.mts +12 -12
  120. package/dist/managers/StepManager.d.ts +12 -12
  121. package/dist/managers/StepManager.js +55 -81
  122. package/dist/managers/StepManager.js.map +1 -1
  123. package/dist/managers/StepManager.mjs +55 -81
  124. package/dist/managers/StepManager.mjs.map +1 -1
  125. package/dist/managers/WindowManager.d.mts +1 -1
  126. package/dist/managers/WindowManager.d.ts +1 -1
  127. package/dist/managers/index.d.mts +2 -2
  128. package/dist/managers/index.d.ts +2 -2
  129. package/dist/managers/index.js +114 -142
  130. package/dist/managers/index.js.map +1 -1
  131. package/dist/managers/index.mjs +114 -142
  132. package/dist/managers/index.mjs.map +1 -1
  133. package/dist/types/ChoiceMenuOptionsType.d.mts +3 -3
  134. package/dist/types/ChoiceMenuOptionsType.d.ts +3 -3
  135. package/dist/types/StepLabelType.d.mts +2 -3
  136. package/dist/types/StepLabelType.d.ts +2 -3
  137. package/dist/types/index.d.mts +1 -1
  138. package/dist/types/index.d.ts +1 -1
  139. package/package.json +2 -2
  140. package/dist/interface/IDialogueHistory.mjs +0 -3
  141. /package/dist/interface/{IDialogueHistory.js.map → DialogueHistory.js.map} +0 -0
  142. /package/dist/interface/{IDialogueHistory.mjs.map → DialogueHistory.mjs.map} +0 -0
@@ -53,107 +53,14 @@ var __async = (__this, __arguments, generator) => {
53
53
  };
54
54
 
55
55
  // src/constants.ts
56
- var PIXIVN_VERSION = "0.5.2";
57
-
58
- // src/types/PauseType.ts
59
- var PauseValueType = "pause";
60
-
61
- // src/types/RepeatType.ts
62
- var Repeat = "repeat";
56
+ var PIXIVN_VERSION = "0.5.4";
63
57
  function getStepSha1(step) {
64
58
  let sha1String = sha1(step.toString().toLocaleLowerCase());
65
59
  return sha1String.toString();
66
60
  }
67
- function checkIfStepsIsEqual(step1, step2) {
68
- return step1 === step2;
69
- }
70
-
71
- // src/classes/Label.ts
72
- var Label = class {
73
- /**
74
- * Get the steps of the label.
75
- * This class should be extended and the steps method should be overridden.
76
- * Every time you update this list will also be updated when the other game versions load.
77
- */
78
- get steps() {
79
- throw new Error("[Pixi'VN] The method Label.steps must be overridden");
80
- }
81
- /**
82
- * Get the corresponding steps number
83
- * @param externalSteps
84
- * @returns Numer of corresponding steps, for example, if externalSteps is [ABC, DEF, GHI] and the steps of the label is [ABC, GHT], the result will be 1
85
- */
86
- getCorrespondingStepsNumber(externalSteps) {
87
- if (externalSteps.length === 0) {
88
- return 0;
89
- }
90
- let res = 0;
91
- externalSteps.forEach((step, index) => {
92
- if (checkIfStepsIsEqual(step, this.steps[index])) {
93
- res = index;
94
- }
95
- });
96
- return res;
97
- }
98
- };
99
61
 
100
62
  // src/classes/CloseLabel.ts
101
- var CloseLabel = class extends Label {
102
- };
103
-
104
- // src/decorators/LabelDecorator.ts
105
- var registeredLabels = {};
106
- function getLabelInstanceByClassName(labelName) {
107
- try {
108
- let labelType = registeredLabels[labelName];
109
- if (!labelType) {
110
- console.error(`[Pixi'VN] Label ${labelName} not found`);
111
- return;
112
- }
113
- let label = new labelType();
114
- let step = label.steps;
115
- if (step.length = 0) {
116
- console.warn(`[Pixi'VN] Label ${labelName} has no steps`);
117
- }
118
- return label;
119
- } catch (e) {
120
- console.error(`[Pixi'VN] Error while getting Label ${labelName}`, e);
121
- return;
122
- }
123
- }
124
-
125
- // src/functions/DialogueUtility.ts
126
- function getDialogue() {
127
- return GameStorageManager.getVariable(GameStorageManager.keysSystem.CURRENT_DIALOGUE_MEMORY_KEY);
128
- }
129
-
130
- // src/decorators/CanvasElementDecorator.ts
131
- var registeredCanvasElement = {};
132
- function getCanvasElementInstanceByClassName(canvasName) {
133
- try {
134
- let eventType = registeredCanvasElement[canvasName];
135
- if (!eventType) {
136
- if (canvasName === "CanvasContainer") {
137
- eventType = CanvasContainer;
138
- } else if (canvasName === "CanvasImage") {
139
- eventType = CanvasImage;
140
- } else if (canvasName === "CanvasSprite") {
141
- eventType = CanvasSprite;
142
- } else if (canvasName === "CanvasText") {
143
- eventType = CanvasText;
144
- }
145
- }
146
- if (!eventType) {
147
- console.error(`[Pixi'VN] CanvasElement ${canvasName} not found`);
148
- return;
149
- }
150
- let canvasElement = new eventType();
151
- return canvasElement;
152
- } catch (e) {
153
- console.error(`[Pixi'VN] Error while getting CanvasElement ${canvasName}`, e);
154
- return;
155
- }
156
- }
63
+ var CLOSE_LABEL_ID = "__close-label-id__";
157
64
 
158
65
  // src/functions/CanvasUtility.ts
159
66
  function getTextureMemory(texture) {
@@ -590,29 +497,33 @@ function setMemoryText(element, memory) {
590
497
  }
591
498
  }
592
499
 
593
- // src/classes/ticker/TickerBase.ts
594
- var TickerBase = class {
595
- /**
596
- * @param args The arguments that you want to pass to the ticker.
597
- * @param duration The duration of the ticker. If is undefined, the ticker will be called every frame.
598
- * @param priority The priority of the ticker. If is undefined, the priority will be UPDATE_PRIORITY.NORMAL.
599
- */
600
- constructor(args, duration, priority) {
601
- this.args = args;
602
- this.duration = duration;
603
- this.priority = priority;
604
- }
605
- /**
606
- * The method that will be called every frame.
607
- * This method should be overridden and you can use GameWindowManager.addCanvasElement() to get the canvas element of the canvas, and edit them.
608
- * @param t The ticker that is calling this method
609
- * @param args The arguments that you passed when you added the ticker
610
- * @param tags The tags of the canvas elements that are connected to this ticker
611
- */
612
- fn(_t, _args, _tags) {
613
- throw new Error("[Pixi'VN] The method TickerBase.fn() must be overridden");
500
+ // src/decorators/CanvasElementDecorator.ts
501
+ var registeredCanvasElement = {};
502
+ function getCanvasElementInstanceByClassName(canvasName) {
503
+ try {
504
+ let eventType = registeredCanvasElement[canvasName];
505
+ if (!eventType) {
506
+ if (canvasName === "CanvasContainer") {
507
+ eventType = CanvasContainer;
508
+ } else if (canvasName === "CanvasImage") {
509
+ eventType = CanvasImage;
510
+ } else if (canvasName === "CanvasSprite") {
511
+ eventType = CanvasSprite;
512
+ } else if (canvasName === "CanvasText") {
513
+ eventType = CanvasText;
514
+ }
515
+ }
516
+ if (!eventType) {
517
+ console.error(`[Pixi'VN] CanvasElement ${canvasName} not found`);
518
+ return;
519
+ }
520
+ let canvasElement = new eventType();
521
+ return canvasElement;
522
+ } catch (e) {
523
+ console.error(`[Pixi'VN] Error while getting CanvasElement ${canvasName}`, e);
524
+ return;
614
525
  }
615
- };
526
+ }
616
527
 
617
528
  // src/decorators/TickerDecorator.ts
618
529
  var registeredTickers = {};
@@ -641,7 +552,51 @@ function geTickerInstanceByClassName(tickerName, args, duration, priority) {
641
552
  }
642
553
  }
643
554
 
644
- // src/classes/ticker/TickerFadeAlpha.ts
555
+ // src/types/PauseType.ts
556
+ var PauseValueType = "pause";
557
+
558
+ // src/types/RepeatType.ts
559
+ var Repeat = "repeat";
560
+
561
+ // src/decorators/LabelDecorator.ts
562
+ var registeredLabels = {};
563
+ function getLabelById(id) {
564
+ let label = registeredLabels[id];
565
+ if (!label) {
566
+ console.error(`[Pixi'VN] Label ${id} not found`);
567
+ return;
568
+ }
569
+ return label;
570
+ }
571
+
572
+ // src/functions/DialogueUtility.ts
573
+ function getDialogue() {
574
+ return GameStorageManager.getVariable(GameStorageManager.keysSystem.CURRENT_DIALOGUE_MEMORY_KEY);
575
+ }
576
+
577
+ // src/classes/ticker/TickerBase.ts
578
+ var TickerBase = class {
579
+ /**
580
+ * @param args The arguments that you want to pass to the ticker.
581
+ * @param duration The duration of the ticker. If is undefined, the ticker will be called every frame.
582
+ * @param priority The priority of the ticker. If is undefined, the priority will be UPDATE_PRIORITY.NORMAL.
583
+ */
584
+ constructor(args, duration, priority) {
585
+ this.args = args;
586
+ this.duration = duration;
587
+ this.priority = priority;
588
+ }
589
+ /**
590
+ * The method that will be called every frame.
591
+ * This method should be overridden and you can use GameWindowManager.addCanvasElement() to get the canvas element of the canvas, and edit them.
592
+ * @param t The ticker that is calling this method
593
+ * @param args The arguments that you passed when you added the ticker
594
+ * @param tags The tags of the canvas elements that are connected to this ticker
595
+ */
596
+ fn(_t, _args, _tags) {
597
+ throw new Error("[Pixi'VN] The method TickerBase.fn() must be overridden");
598
+ }
599
+ };
645
600
  var TickerFadeAlpha = class extends TickerBase {
646
601
  /**
647
602
  * The method that will be called every frame to fade the alpha of the canvas element of the canvas.
@@ -1555,7 +1510,7 @@ var _GameStepManager = class _GameStepManager {
1555
1510
  */
1556
1511
  static get currentLabel() {
1557
1512
  if (_GameStepManager.currentLabelId) {
1558
- return getLabelInstanceByClassName(_GameStepManager.currentLabelId);
1513
+ return getLabelById(_GameStepManager.currentLabelId);
1559
1514
  }
1560
1515
  }
1561
1516
  static get currentLabelStepIndex() {
@@ -1576,7 +1531,7 @@ var _GameStepManager = class _GameStepManager {
1576
1531
  return true;
1577
1532
  } else {
1578
1533
  this.openedLabels.forEach((item) => {
1579
- let label = getLabelInstanceByClassName(item.label);
1534
+ let label = getLabelById(item.label);
1580
1535
  if (label && label.steps.length > item.currentStepIndex) {
1581
1536
  return false;
1582
1537
  }
@@ -1669,9 +1624,9 @@ var _GameStepManager = class _GameStepManager {
1669
1624
  * @param label The label to add to the history.
1670
1625
  */
1671
1626
  static pushNewLabel(label) {
1672
- let currentLabel = getLabelInstanceByClassName(label);
1627
+ let currentLabel = getLabelById(label);
1673
1628
  if (!currentLabel) {
1674
- throw new Error("[Pixi'VN] Label not found");
1629
+ throw new Error(`[Pixi'VN] Label ${label} not found`);
1675
1630
  }
1676
1631
  _GameStepManager._openedLabels.push({
1677
1632
  label,
@@ -1688,7 +1643,7 @@ var _GameStepManager = class _GameStepManager {
1688
1643
  return;
1689
1644
  }
1690
1645
  if (!_GameStepManager.currentLabel) {
1691
- console.error("[Pixi'VN] Label not found");
1646
+ console.error("[Pixi'VN] currentLabel not found");
1692
1647
  return;
1693
1648
  }
1694
1649
  _GameStepManager._openedLabels.pop();
@@ -1760,7 +1715,7 @@ var _GameStepManager = class _GameStepManager {
1760
1715
  }
1761
1716
  let currentLabel = _GameStepManager.currentLabel;
1762
1717
  if (!currentLabel) {
1763
- console.error("[Pixi'VN] Label not found");
1718
+ console.error("[Pixi'VN] currentLabel not found");
1764
1719
  return;
1765
1720
  }
1766
1721
  let n = currentLabel.steps.length;
@@ -1781,12 +1736,12 @@ var _GameStepManager = class _GameStepManager {
1781
1736
  /**
1782
1737
  * Execute the label and add it to the history.
1783
1738
  * Is a call function in Ren'Py.
1784
- * @param label The label to execute.
1739
+ * @param label The label to execute or the id of the label
1785
1740
  * @param props The props to pass to the label.
1786
1741
  * @returns StepLabelResultType or undefined.
1787
1742
  * @example
1788
1743
  * ```typescript
1789
- * GameStepManager.callLabel(StartLabel, yourParams).then((result) => {
1744
+ * GameStepManager.callLabel(startLabel, yourParams).then((result) => {
1790
1745
  * if (result) {
1791
1746
  * // your code
1792
1747
  * }
@@ -1795,7 +1750,7 @@ var _GameStepManager = class _GameStepManager {
1795
1750
  * @example
1796
1751
  * ```typescript
1797
1752
  * // if you use it in a step label you should return the result.
1798
- * return GameStepManager.callLabel(StartLabel).then((result) => {
1753
+ * return GameStepManager.callLabel(startLabel).then((result) => {
1799
1754
  * return result
1800
1755
  * })
1801
1756
  * ```
@@ -1803,16 +1758,24 @@ var _GameStepManager = class _GameStepManager {
1803
1758
  static callLabel(label, props) {
1804
1759
  return __async(this, null, function* () {
1805
1760
  let choiseMade = void 0;
1761
+ let labelId;
1762
+ if (typeof label === "string") {
1763
+ labelId = label;
1764
+ } else {
1765
+ labelId = label.id;
1766
+ if (typeof label.choiseIndex === "number") {
1767
+ choiseMade = label.choiseIndex;
1768
+ }
1769
+ }
1806
1770
  try {
1807
- if (label instanceof CloseLabel) {
1771
+ if (labelId === CLOSE_LABEL_ID) {
1808
1772
  return _GameStepManager.runNextStep(props);
1809
1773
  }
1810
- if (label instanceof Label) {
1811
- choiseMade = label.choiseIndex;
1812
- label = label.constructor;
1774
+ let tempLabel = getLabelById(labelId);
1775
+ if (!tempLabel) {
1776
+ throw new Error(`[Pixi'VN] Label ${labelId} not found`);
1813
1777
  }
1814
- let labelName = label.name;
1815
- _GameStepManager.pushNewLabel(labelName);
1778
+ _GameStepManager.pushNewLabel(tempLabel.id);
1816
1779
  } catch (e) {
1817
1780
  console.error("[Pixi'VN] Error calling label", e);
1818
1781
  return;
@@ -1824,11 +1787,11 @@ var _GameStepManager = class _GameStepManager {
1824
1787
  * Execute the label, close all labels and add them to the history.
1825
1788
  * Is a jump function in Ren'Py.
1826
1789
  * @param label The label to execute.
1827
- * @param props The props to pass to the label.
1790
+ * @param props The props to pass to the label or the id of the label
1828
1791
  * @returns StepLabelResultType or undefined.
1829
1792
  * @example
1830
1793
  * ```typescript
1831
- * GameStepManager.jumpLabel(StartLabel, yourParams).then((result) => {
1794
+ * GameStepManager.jumpLabel(startLabel, yourParams).then((result) => {
1832
1795
  * if (result) {
1833
1796
  * // your code
1834
1797
  * }
@@ -1837,7 +1800,7 @@ var _GameStepManager = class _GameStepManager {
1837
1800
  * @example
1838
1801
  * ```typescript
1839
1802
  * // if you use it in a step label you should return the result.
1840
- * return GameStepManager.jumpLabel(StartLabel).then((result) => {
1803
+ * return GameStepManager.jumpLabel(startLabel).then((result) => {
1841
1804
  * return result
1842
1805
  * })
1843
1806
  * ```
@@ -1845,15 +1808,24 @@ var _GameStepManager = class _GameStepManager {
1845
1808
  static jumpLabel(label, props) {
1846
1809
  return __async(this, null, function* () {
1847
1810
  _GameStepManager.closeAllLabels();
1811
+ let labelId;
1812
+ if (typeof label === "string") {
1813
+ labelId = label;
1814
+ } else {
1815
+ labelId = label.id;
1816
+ if (typeof label.choiseIndex === "number") {
1817
+ label.choiseIndex;
1818
+ }
1819
+ }
1848
1820
  try {
1849
- if (label instanceof CloseLabel) {
1821
+ if (labelId === CLOSE_LABEL_ID) {
1850
1822
  return _GameStepManager.runNextStep(props);
1851
1823
  }
1852
- if (label instanceof Label) {
1853
- label = label.constructor;
1824
+ let tempLabel = getLabelById(labelId);
1825
+ if (!tempLabel) {
1826
+ throw new Error(`[Pixi'VN] Label ${labelId} not found`);
1854
1827
  }
1855
- let labelName = label.name;
1856
- _GameStepManager.pushNewLabel(labelName);
1828
+ _GameStepManager.pushNewLabel(tempLabel.id);
1857
1829
  } catch (e) {
1858
1830
  console.error("[Pixi'VN] Error jumping label", e);
1859
1831
  return;
@@ -1867,14 +1839,14 @@ var _GameStepManager = class _GameStepManager {
1867
1839
  * @returns StepLabelResultType or undefined.
1868
1840
  * @example
1869
1841
  * ```typescript
1870
- * GameStepManager.exitToChoiceMenu(yourParams).then((result) => {
1842
+ * GameStepManager.closeChoiceMenu(yourParams).then((result) => {
1871
1843
  * if (result) {
1872
1844
  * // your code
1873
1845
  * }
1874
1846
  * })
1875
1847
  * ```
1876
1848
  */
1877
- static exitToChoiceMenu(props) {
1849
+ static closeChoiceMenu(props) {
1878
1850
  return __async(this, null, function* () {
1879
1851
  return _GameStepManager.runNextStep(props);
1880
1852
  });